Module outbox_proof

Module outbox_proof 

Source
Expand description

Merkle proof construction for L2→L1 send messages.

Implements NodeInterface.constructOutboxProof(size, leaf). Walks the Merkle accumulator from leaf toward the root, collecting sibling positions at each level. Nodes within the committed range (< size) come from L2ToL1Tx / SendMerkleUpdate event logs; nodes past the balanced-tree boundary come from partial accumulator state.

Structs§

LevelAndLeaf
A position in the Merkle tree: level (0 = leaves) + leaf index within that level.
ProofPlan
Result of planning a proof construction: which nodes to fetch from logs (query) and which nodes form the proof path (nodes), plus which of those are “partials” that are computed from the accumulator state rather than fetched.

Functions§

encode_outbox_proof
ABI-encode the outbox proof return value.
finalize_proof
Given a resolved map from LevelAndLeaf → hash (fetched from log scan + partials), walk the proof path and return (send, root, proof_vec) ready for ABI encoding.
plan_proof
Plan the outbox-proof walk: given the tree size (send count) and the leaf we want to prove, compute the list of sibling positions that together form the proof path.