Skip to content

No whole-block receipts method, so checking a block's receipt set for completeness costs one request per transaction #396

Open

Description

@SDL-A1

rustock serves rsk_getTransactionReceiptNodesByHash (the receipts-trie path
for one receipt) and rsk_getRawTransactionReceiptByHash (one receipt). There
is no eth_getBlockReceipts.

Why it is worth an issue

A Merkle branch proves inclusion: that receipt 3 is in the block. It says
nothing about a receipt 7 that the responder chose not to mention. For a
client reconstructing what a block did to an account, inclusion is the wrong
guarantee -- the failure that matters is a withheld receipt, and the only
sound check is to take the whole set and rebuild it against the header's
receiptsRoot.

Today that costs one round trip per transaction in the block, which makes the
check expensive enough that an implementer will be tempted to skip it and
trust a bloom match plus one receipt instead. The data itself is trivial:
measured on mainnet at 2.1 transactions per block, a block's entire receipt
set is about 1,265 bytes on average -- roughly one account proof. Only the
request pattern is wrong.

A light client cannot work around this, because completeness is not something
it can establish from a subset.

What would settle it

Add eth_getBlockReceipts, returning every receipt of a block in index order,
so a caller can rebuild the receipts trie and compare it to the header in one
request. The method name is the one geth, reth and
NethermindEth/nethermind#14457 all use, so tooling already knows it; the
latter also states the completeness property explicitly in its RPC contract
rather than leaving it implied.

Worth stating in the method's documentation that the returned set is the whole
set, and that the caller is expected to check it against receiptsRoot --
since the point of the method is to make that check cheap rather than to be
believed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions