chain/ethereum: send eth_getBlockReceipts block hash as plain string param (#5835)#6647
Open
cargopete wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes #5835. graph-node sends
eth_getBlockReceiptswith the block hash as anEIP-1898 object param (
[{"blockHash":"0x.."}]) rather than the plain stringform (
["0x.."]). Some clients (e.g. taraxa-node) only accept the plain stringand reject the object with
INVALID_PARAMS.This happens because both block-receipts call sites go through alloy's typed
Provider::get_block_receipts(BlockId), andBlockId::from(block_hash)serializes a
BlockId::Hashas{"blockHash": ".."}.When the capability probe (
check_block_receipt_support) fails on such a node,graph-node caches "block receipts unsupported" and permanently falls back to one
eth_getTransactionReceiptper transaction — correct data, but materially sloweringestion and far more RPC load.
Fix
Add a small helper that issues a raw request with the hash as a plain string:
Both call sites (
check_block_receipt_supportandfetch_block_receipts_with_retry)now route through it. The plain-string form is accepted by all known
implementations, and remains valid for nodes that currently work (they accept
both forms).
Testing
block_receipts_param_is_plain_hash_stringasserting the newparam serializes to a string array
["0x.."], and pinning the old object formas a regression guard.
ethereum_adapterunit tests pass (incl.test_check_block_receipts_support).cargo fmt,cargo clippy --all-targets, andcargo check --releaseclean forgraph-chain-ethereum.Trade-off
A node that accepts only the EIP-1898 object form and not the plain string
would regress. In practice this is the rarer (and arguably non-conformant) case —
the plain hash string is the canonical Geth form and, per the issue reporter, the
form "all implementations" accept. Flagging it explicitly for maintainer review.