Skip to content

Block builder produces oversized blocks during stalls (MAX_PAYLOAD_SIZE violation) #259

@dimka90

Description

@dimka90

Summary

Ethlambda's build_block in crates/blockchain/src/store.rs:1018 greedily accumulates aggregated attestations from the payload pool with no per-validator dedup or size cap. During a stall, the pool grows unbounded and the next proposed block can exceed the spec's MAX_PAYLOAD_SIZE = 10 MiB (from leanSpec/networking/config.py), triggering MessageTooLarge on gossip publish and snappy decoded len exceeds max on receiving peers.

Reproduction

  1. Run a multi-client devnet
  2. Cause any disruption that backs up the attestation pool (peer drop, brief
    network partition, slow processor, etc.)
  3. The next block ethlambda proposes will accumulate all pending payloads
  4. With current XMSS proof sizes (~253 KB each), more than ~39 attestations
    exceeds the 10 MiB spec limit
  5. Observe Swarm adapter: publish failed err=MessageTooLarge in ethlambda's
    own logs, and snappy decoded len N exceeds max 10485760 in any
    peer that tries to receive the block

Root cause

build_block() iterates the entire aggregated_payloads pool and includes every entry whose source matches the current justified checkpoint. There is no per-validator dedup, no size cap, and no count cap. In normal operation the pool is small (5-10 entries) so this works fine. During stall recovery the pool can grow to 100+ entries, all of which get packed into a single block.

Spec references

  • leanSpec/src/lean_spec/subspecs/networking/config.py:12
    MAX_PAYLOAD_SIZE: Final[int] = 10 * 1024 * 1024

  • leanSpec/src/lean_spec/subspecs/sync/config.py:11
    MAX_BLOCKS_PER_REQUEST: Final[int] = 10

Metadata

Metadata

Assignees

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