Skip to content

fix(ethereum): default missing sha3Uncles for pre-Gingerbread Celo blocks - #6743

Closed
HusseinAdeiza wants to merge 1 commit into
graphprotocol:masterfrom
HusseinAdeiza:fix/celo-missing-sha3-uncles
Closed

HusseinAdeiza wants to merge 1 commit into
graphprotocol:masterfrom
HusseinAdeiza:fix/celo-missing-sha3-uncles

Conversation

@HusseinAdeiza

Copy link
Copy Markdown

Fixes #6738

Problem

Since the alloy migration in #6063 (released in v0.42.0), blocks from chains whose RPC omits sha3Uncles fail deserialization with missing field sha3Uncles and retry endlessly. Pre-Gingerbread Celo (mainnet < 21616000) is exactly this case: those headers have no uncles hash, so nodes omit the field. The rust-web3 fork used before v0.42.0 defaulted the field; the default was not ported.

Fix

Extend the existing JSON-patch mechanism (the same one that adds missing type fields):

  • json_patch::patch_uncles_hash - when a block result lacks sha3Uncles, insert the canonical empty-uncles hash 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 (keccak256 of the RLP of an empty list)
  • PatchingHttp now also patches block-method responses (eth_getBlockByHash/eth_getBlockByNumber); the patch only fires when the field is absent, so standard chains are unaffected

Verification

  • new tests: field added on block methods, existing value preserved (patch returns None), non-block methods left alone
  • cargo build -p graph-chain-ethereum clean, cargo test -p graph-chain-ethereum --lib transport 6/6 pass, cargo test -p graph --lib json_patch 9/9 pass
  • cargo fmt --check clean

…ocks

Since the alloy migration (graphprotocol#6063), blocks from chains whose RPC omits
`sha3Uncles` fail deserialization with `missing field sha3Uncles` and retry
endlessly. Pre-Gingerbread Celo (mainnet < 21616000) is exactly this case:
those headers have no uncles hash, so nodes omit the field. The rust-web3 fork
this repo used before v0.42.0 defaulted the field; the default was not ported.

Patch the response in `PatchingHttp` the same way missing `type` fields are
already handled: when a block-method result lacks `sha3Uncles`, insert the
canonical empty-uncles hash (keccak256(rlp([]))),
0x1dcc4de8...d49347. The patch only fires when the field is absent, so
standard chains (whose RPC always includes it) are unaffected.

Tests cover: field added on block methods, existing value preserved
(`patch_response` returns None), and non-block methods left alone.

Fixes graphprotocol#6738

Signed-off-by: Hussein Adeiza Yunusa <HusseinAdeiza@users.noreply.github.com>
@dimitrovmaksim

Copy link
Copy Markdown
Collaborator

Duplicate of #6737

@dimitrovmaksim dimitrovmaksim marked this as a duplicate of #6737 Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Celo blocks before Gingerbread fail to parse since v0.42.0 (missing sha3Uncles)

2 participants