-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: last_indexed_block reset to Zero after reaching the seed blocks #300
Comments
@shardAstronaut This is weird, it might have been fixed already. Can you try using a more recent version of Checkpoint? |
@bonustrack I upgraded the package to beta.36 and I still have the same issue. On the logs I get this error |
@shardAstronaut Is your code available on GitHub to check? |
…xed_block reset to Zero after reaching the seed blocks checkpoint-labs#300) When indexing contracts with a big number of events the array.push method will throw an error. When you use spread operator all items of the source array are stored in the stack as arguments list, so having a large number of items (~ > 100K) will cause the this stack size exceed. The most simple work-around is to manually push all items one by one.
@bonustrack [1719415002170] DEBUG: handling transaction done
component: "checkpoint"
txIndex: 141
[1719415002170] DEBUG: handling transaction
component: "checkpoint"
txIndex: 142
[1719415002170] INFO: found contract event
component: "checkpoint"
contract: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
event: "Transfer"
handlerFn: "liquity_eth_Transfer"
[1719415002171] DEBUG: handling transaction done
component: "checkpoint"
txIndex: 142
[1719415002171] DEBUG: handling transaction
component: "checkpoint"
txIndex: 143
[1719415002171] INFO: found contract event
component: "checkpoint"
contract: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
event: "Transfer"
handlerFn: "liquity_eth_Transfer"
[1719415002171] INFO: found contract event
component: "checkpoint"
contract: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
event: "Transfer"
handlerFn: "liquity_eth_Transfer"
[1719415002173] DEBUG: handling transaction done
component: "checkpoint"
txIndex: 143
[1719415002173] DEBUG: handling block done
component: "checkpoint"
blockNumber: 250990
[1719415002176] DEBUG: next checkpoint blocks
component: "checkpoints_store"
result: []
block: 250991
contracts: [
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
]
toBlock 251991
toBlock 251991
events 0
addressEvents 336273
----------------Before-------------------
/home/astro/Desktop/checkpoint-template/node_modules/@snapshot-labs/checkpoint/dist/src/providers/starknet/provider.js:257
events.push(...addressEvents);
^
RangeError: Maximum call stack size exceeded
at StarknetProvider.getCheckpointsRange (/home/astro/Desktop/checkpoint-template/node_modules/@snapshot-labs/checkpoint/dist/src/providers/starknet/provider.js:257:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Checkpoint.preload (/home/astro/Desktop/checkpoint-template/node_modules/@snapshot-labs/checkpoint/dist/src/checkpoint.js:274:33)
at async Checkpoint.next (/home/astro/Desktop/checkpoint-template/node_modules/@snapshot-labs/checkpoint/dist/src/checkpoint.js:295:40)
at async Checkpoint.start (/home/astro/Desktop/checkpoint-template/node_modules/@snapshot-labs/checkpoint/dist/src/checkpoint.js:160:16)
at async run (/home/astro/Desktop/checkpoint-template/src/index.ts:26:3) The issue is with the array.push method that stores the data in stack which throws |
…xed_block reset to Zero after reaching the seed blocks checkpoint-labs#300) When indexing contracts with a big number of events the array.push method will throw an error. When you use spread operator all items of the source array are stored in the stack as arguments list, so having a large number of items (~ > 100K) will cause the this stack size exceed. The most simple work-around is to manually push all items one by one.
@shardAstronaut just to confirm, this issue ( |
Description
I'm indexing ETH contract on Starknet, the indexer index all the blocks but just after reaching last seed block the
last_indexed_block
is set to ZERO and the data is deleted.The text was updated successfully, but these errors were encountered: