getActivePieceCount fails with out-of-gas for large datasets
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- solidity
- Domain
- blockchain
Research direction
Start by locating the Solidity implementation of getActivePieceCount(uint256 setId) and compare it with the paginated getActivePieces behavior. Reproduce the small and large calls with cast and the provided RPC endpoint. Done means the count call completes for the 54,568-piece dataset without out-of-gas and remains consistent with the active pieces returned through pagination.
Written by the indexing model from the issue text.
Description
Problem
getActivePieceCount(uint256 setId) has O(n) complexity where n = nextPieceId[setId]. For datasets with tens of thousands of pieces, this exceeds the gas limit for eth_call requests.
Reproduction
On mainnet verifier (0xBADd0B92C1c71d02E7d520f64c0876538fa2557F):
# Works - small dataset
cast call 0xBADd0B92C1c71d02E7d520f64c0876538fa2557F "getActivePieceCount(uint256)(uint256)" 1 --rpc-url https://api.node.glif.io/rpc/v1
# Returns: 2
# Fails - large dataset (54,568 pieces)
cast call 0xBADd0B92C1c71d02E7d520f64c0876538fa2557F "getActivePieceCount(uint256)(uint256)" 89 --rpc-url https://api.node.glif.io/rpc/v1
# Error: out of gas
Note: getActivePieces with pagination works fine for the same dataset.
- Dominant language
- Solidity
- Stars
- 20
- Forks
- 19
- Avg merge
- 20h 6m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Release process improvement ideas/observations from pdp v3.5.0May be free again @BigLep claimed this 104 days ago, and no pull request is open. Open
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
Similar issues
-
agent-ready good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Soneso/stellar-agent-wallet#994 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Trac-Systems/main_settlement_bus#1057 ·
Maintainers usually reply within 1 day
-
utxo_ledger (reference): failed apply_transaction leaks already-created outputs (supply inflation)Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 10 days
-
test(verify): cover invalid bits, the mainnet and testnet limits, and the strong thresholdPossibly taken @omarelshamy25x claimed this 1 day ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
devdavidejesus/btc-toolkit#99 · 1 comment ·
Maintainers usually reply within 1 day
-
tezosx: alias materialization sends the EVM public key in the caller's spellingPossibly taken @dvkam claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day