Check the payload block hash rule on live nodes before gloas refuses

Open
#818 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Start with crates/net/p2p/src/beacon/payload_hash.rs and docs/spec_deviations.md; review the existing counters and ignored payload_hash::tests::verify_block_cost test. After deployment, track mismatch and validation overload metrics across the named networks for several days, measure worst case peak memory, and verify final header fields and the envelope counter on Platåberget before changing envelope_verdict to refuse mismatches.

Written by the indexing model from the issue text.

Description

lambdaclass/ethlambda#770 added a rule the consensus specification does not have: beacon p2p rebuilds the execution header from a payload's fields and compares keccak256(rlp(header)) with its block_hash (crates/net/p2p/src/beacon/payload_hash.rs). A pre-gloas gossip block that does not match is IGNOREd. A gloas envelope is only counted and logged, because the Amsterdam header may still change. The PR pinned the encoding with real-chain vectors per fork and a local check over 200 mainnet blocks, but nothing on a running node, which is out of a code review's scope.

What to measure once it is deployed:

  • lean_beacon_payload_block_hash_mismatch_total{kind} on the mainnet, Hoodi, Sepolia and Platåberget followers: it should stay at zero for several days. A non-zero block count means honest blocks are being dropped from gossip. A non-zero envelope count means the gloas encoding is off.
  • Validation-permit saturation on beacon_block: the rate of lean_beacon_gossip_validation_total{kind="beacon_block",reason="overloaded"} before and after. The hash runs inside a gossip_validation_permits permit (about 0.24 ms for a 238-transaction mainnet block, up to 0.6 s for the worst-case block at the size limit; see docs/spec_deviations.md).
  • Peak memory of the worst case (1,048,576 tiny transactions, each copied into the trie). It was not measured; the ignored payload_hash::tests::verify_block_cost could measure it locally.

Before gloas refuses on a mismatch (envelope_verdict in payload_hash.rs):

  • re-pin block_access_list_hash and slot_number against the final EIP-7928 and EIP-7843 header, with a real envelope from a network on the final header;
  • check the envelope counter has stayed at zero on Platåberget.

Refusing would then mean turning envelope_verdict into the same Ignore(PayloadBlockHashMismatch) path block_verdict uses.

Dominant language
Rust
Stars
86
Forks
34
Avg merge
9d 20h
Merged PRs (30d)
77

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lambdaclass/ethlambda

All issues in lambdaclass/ethlambda

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.