Repository navigation
fix(ethereum): default missing sha3Uncles for pre-Gingerbread Celo blocks - #6743
Closed
HusseinAdeiza wants to merge 1 commit into
Closed
HusseinAdeiza wants to merge 1 commit into
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>
Collaborator
|
Duplicate of #6737 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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