perf(subgraph): remove dead tx-input ABI parsing in handlePiecesAdded
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- backend
Research direction
Start in subgraph/src/pdp-verifier.ts at handlePiecesAdded, especially lines 1032-1099, and inspect the loop that builds Roots from event.params.pieceCids and event.params.pieceIds. Confirm whether readUint256 at lines 1431-1446 is used elsewhere, then remove only the dead transaction-input parsing and helper. Run the existing test suite and verify piece counts and sizes remain unchanged for the fixtures.
Written by the indexing model from the issue text.
Description
Problem
handlePiecesAdded manually ABI-decodes the full transaction input (subgraph/src/pdp-verifier.ts:1032-1099): setId, tuple-array offset, length, and a per-piece struct offset via readUint256 (32-byte slice + reverse per word).
None of the decoded values are used for entity data — piece CID bytes come from event.params.pieceCids (pdp-verifier.ts:1103) and piece IDs from event.params.pieceIds. The decoded values only feed warning logs and a bounds check whose continue can wrongly skip creating a Root that the event params fully describe.
This is CPU burned per piece on the hottest backfill path, plus a correctness smell.
Proposal
- Delete the parsing block (
pdp-verifier.ts:1032-1099, keeping the loop body that builds Roots from event params) and the now-unusedreadUint256helper (pdp-verifier.ts:1431-1446).
Acceptance criteria
-
handlePiecesAddedbuilds Roots purely from event params; no tx-input access -
readUint256removed (or confirmed still used elsewhere) - Tests pass; piece counts/sizes unchanged for existing test fixtures
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 7
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FilOzone/pdp-explorer
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
FilOzone/pdp-explorer#160 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
FilOzone/pdp-explorer#138 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
FilOzone/pdp-explorer#177 ·
-
Release v1.1.0 Openrelease
Difficulty 4/5 3-5 days Newbie friendliness 25/100
FilOzone/pdp-explorer#171 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
FilOzone/pdp-explorer#140 ·
All issues in FilOzone/pdp-explorer
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100