Repository navigation
PLT-8299: graph-node fork: make the Celo reorg_threshold=0 special case switchable, so post-L2 Celo stops scanning eth_getLogs every block - #7
Conversation
…g threshold override switchable (PLT-8299) Polling block streams on Celo chain ids get a reorg threshold of 0, so every block is scanned with eth_getLogs. The premises (instant finality, events visible only in eth_getLogs) come from the Celo L1. The new flag defaults to true, keeping that behaviour; false gives Celo the chain's normal reorg threshold. The decision moves into polling_reorg_threshold, tested for both flag values, and the env parsing is tested for its default and for false. Other chains are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zerion-hive-worker[bot] <318250561+zerion-hive-worker[bot]@users.noreply.github.com>
|
Reviewer: reviewer-PLT-8299 @ 05ed496 Review: PLT-8299Acceptance Criteria
Half-Celo path checkI ran Code Quality
Verification
Verdict: APPROVEScopeScoped to 05ed496 (patch-id Notes (non-blocking):
|
PLT-8299: graph-node fork: make the Celo reorg_threshold=0 special case switchable, so post-L2 Celo stops scanning eth_getLogs every block
EthereumStreamBuilder::build_pollinggives every Celo chain id a reorg threshold of 0, so each Celo polling block stream takes theis_on_main_chain+eth_getLogspath on every block. Its premises (instant finality, events only ineth_getLogs) come from the Celo L1; Celo is now an OP-stack L2. This PR makes the override switchable without changing the default.Changes
chain/ethereum/src/env.rs: newEnvVars::celo_force_getlogs, read fromGRAPH_ETHEREUM_CELO_FORCE_GETLOGS, defaulttrue.chain/ethereum/src/chain.rs: the Celo decision moves into the pure fnpolling_reorg_threshold(chain_id, celo_force_getlogs, reorg_threshold). With the flag on (default) Celo gets 0 exactly as before; with it off Celo getschain.reorg_threshold. Non-Celo chains always getchain.reorg_threshold. Thechain_id()lookup still runs for every RPC chain, as before. The code comment now states the L1-era premises and when the flag can be turned off.docs/environment-variables.md: documents the variable.Acceptance Criteria
trueinInner::celo_force_getlogs; tested byenv::tests::celo_force_getlogs_defaults_to_trueandchain::tests::polling_reorg_threshold_forces_zero_for_celo_when_flag_on(all three Celo ids get 0, chain 1 keeps its threshold).env::tests::celo_force_getlogs_can_be_turned_offandchain::tests::polling_reorg_threshold_uses_chain_threshold_for_celo_when_flag_off.Departures
NEWS.mdholds upstream release notes only, and the earlier fork patches did not edit it, so onlydocs/environment-variables.mddocuments the variable.Testing
cargo test -p graph-chain-ethereum --lib -- polling_reorg_threshold celo_force_getlogs: 4 passed.polling_reorg_thresholdfailspolling_reorg_threshold_uses_chain_threshold_for_celo_when_flag_off; afalsedefault failscelo_force_getlogs_defaults_to_true. Both restored.cargo clippy -p graph-chain-ethereum --all-targets -- -D warnings: clean.cargo check --release -p graph-chain-ethereum: clean.cargo fmt --all: applied.ddl.rschange, so the chart's same-schema rule for fork tags holds.Screenshots
No UI change.
Resolves PLT-8299
🤖 Generated with Claude Code
Produced by a hive session (PLT-8299)