Skip to content

feat: block proposals carry a bucket reference (A-1381)#24786

Open
spalladino wants to merge 1 commit into
spl/a-1380-world-state-per-blockfrom
spl/a-1381-proposal-bucket-ref
Open

feat: block proposals carry a bucket reference (A-1381)#24786
spalladino wants to merge 1 commit into
spl/a-1380-world-state-per-blockfrom
spl/a-1381-proposal-bucket-ref

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Adds an optional InboxBucketRef (bucketSeq, bucketTimestamp, inboxRollingHash) to BlockProposal and to the last block of CheckpointProposal (AZIP-22 Fast Inbox), so validators can derive the consumed L1-to-L2 message bundle from their own Inbox view instead of trusting a proposer-supplied list. Plumbing only for now — the sequencer passes undefined pre-flip (populated in FI-12) and the legacy validation path ignores it (validated in FI-13).

  • Signed, not an unsigned lookup aid: the reference lives inside the signed payload (getPayloadToSign), so a relay cannot strip or inject it without breaking signature recovery. The checkpoint header's inboxRollingHash remains the consensus commitment; a wrong reference can only miss the Inbox lookup. This discharges the P2-2 residual from the A-1371 design (signedness + republish path).
  • Optional-tail wire encoding, no topic-version bump: an unset proposal serializes byte-identically to the legacy format, and decoders treat EOF after the existing fields as "no reference", so mixed-version gossip keeps working. Gossip topic versions derive from deployment identity, not node software version, so mixed decoders are a hard requirement.
  • Wire-compat evidence: golden fixtures captured from the pre-change bytes pin (a) unset serialization is byte-identical, (b) legacy buffers decode as no-reference, for both proposal types.
  • CheckpointProposal enforces at construction that a set last-block reference's rolling hash equals the checkpoint header's inboxRollingHash, mirroring the existing inHash cross-check.
  • Audited every BlockProposal.fromBuffer / CheckpointProposal.fromBuffer decode site in p2p/src and message_validator.ts: none assume a strict buffer length, so the appended tail is tolerated.

Tests: InboxBucketRef round-trip/equals/schema; block + checkpoint proposal round-trips with the reference set (with and without signed txs); byte-identity vs golden fixtures when unset; legacy-buffer tolerance; signature coverage (recovery over a set reference, and recovery breaks when the reference is tampered with or injected); payload hashes differ set-vs-unset; checkpoint header-consistency check throws on mismatch.

…rence (A-1381)

Adds an optional InboxBucketRef (bucketSeq, bucketTimestamp, inboxRollingHash)
to BlockProposal and to the last block of CheckpointProposal (AZIP-22 Fast
Inbox), so validators can derive the consumed message bundle from their own
Inbox view rather than trusting a proposer-supplied list.

- The reference goes inside the signed payload (getPayloadToSign), so a relay
  cannot strip or inject it without breaking signature recovery. The checkpoint
  header's inboxRollingHash remains the consensus commitment; a wrong reference
  can only miss the lookup.
- Optional-tail wire encoding: unset proposals serialize byte-identically to the
  legacy format, and decoders treat EOF after the existing fields as "no
  reference", so mixed-version gossip keeps working with no topic-version bump.
- CheckpointProposal enforces at construction that a set last-block reference's
  rolling hash equals the checkpoint header's inboxRollingHash, mirroring the
  existing inHash cross-check.
- Plumbing only: the sequencer passes undefined pre-flip and the legacy
  validation path ignores the field (populated in FI-12, validated in FI-13).

Golden fixtures pin the pre-change bytes for the byte-identity and cross-version
tolerance tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant