Repository navigation
fix(ethereum): default missing sha3Uncles for pre-Gingerbread Celo blocks - #6743
HusseinAdeiza wants to merge 1 commit into
Conversation
…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>
|
Duplicate of #6737 |
|
Fair — #6737 covers the same ground and closing this is right, no argument. Only real difference is where it sits: theirs fills the field at deserialize time, mine at the transport layer, so a block response stays correct whichever type the caller decodes into. Only worth remembering if another Celo-only missing field turns up. Thanks for pointing me at it. |
|
#6737 covers the same surface and was merged Oct 20, so I'm closing this one in its favor. The branch stays available if anything here is worth lifting. |
|
Verified — #6737 (tmigone, merged 2026-10-20) covers the same missing |
Fixes #6738
Problem
Since the alloy migration in #6063 (released in v0.42.0), blocks from chains whose RPC omits
sha3Unclesfail deserialization withmissing field sha3Unclesand 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
typefields):json_patch::patch_uncles_hash- when a block result lackssha3Uncles, insert the canonical empty-uncles hash0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347(keccak256 of the RLP of an empty list)PatchingHttpnow also patches block-method responses (eth_getBlockByHash/eth_getBlockByNumber); the patch only fires when the field is absent, so standard chains are unaffectedVerification
None), non-block methods left alonecargo build -p graph-chain-ethereumclean,cargo test -p graph-chain-ethereum --lib transport6/6 pass,cargo test -p graph --lib json_patch9/9 passcargo fmt --checkclean