feat: archiver syncs Inbox buckets (A-1379)#24784
Open
spalladino wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Fast Inbox stack (AZIP-22). Makes the archiver track the L1 Inbox rolling-hash buckets introduced in A-1377, validate the full-width consensus rolling-hash chain, and expose the bucket queries the sequencer/validator will consume (A-1382/A-1383). Purely additive: the legacy per-checkpoint
getL1ToL2Messagespath is unchanged.What's added
InboxMessagegainsinboxRollingHash: Fr,bucketSeq, andbucketTimestamp(the L1 block timestamp that keys the bucket).mapLogInboxMessagepropagates them; the ethereumMessageSentlog now also carries the emitting L1 block's timestamp.MessageStorepersists a per-bucket snapshot ({ inboxRollingHash, totalMsgCount, timestamp, msgCount, lastMessageIndex }) keyed by bucket sequence, plus a timestamp→sequence index for at-or-before lookups. Snapshots are written as messages are inserted and rewound (deleted / boundary-bucket recomputed) on reorg removal, all inside the existing kv-store transactions.addL1ToL2Messagesnow validates the full-width consensus rolling hash (updateInboxRollingHash) alongside the legacy 128-bit keccak chain. Both run until the streaming inbox flips on (A-1388 removes the legacy one).L1ToL2MessageSource(implemented by the archiver, supported by the mock, exposed over the archiver RPC schema):getLatestInboxBucketAtOrBefore(timestamp),getInboxBucket(seq), andgetL1ToL2MessagesBetweenBuckets(fromExclusive, toInclusive). NewInboxBuckettype + zod schema in stdlib messaging.Notes
ARCHIVER_DB_VERSIONis bumped 7 → 8, so nodes resync their L1→L2 messages from L1. Archiver message stores are rebuildable from L1, so this is acceptable on this release line.InboxMessage.l1BlockNumberis widened from UInt32 to UInt64 (the serialization was being rewritten anyway).inboxRollingHash: Frto match theupdateInboxRollingHashmirror,CheckpointHeader.inboxRollingHash, and the decodedMessageSentevent — the value is a truncated-sha256-to-field element. (The plan's provisionalconsensusRollingHash: Buffer32predates the implemented event.) The legacyrollingHash: Buffer16stays until A-1388.Out of scope
localStateMatchescannot detect it, and the allowed message-reinsertion path leaves its bucket snapshot stale). This is handled by A-1389, and bucket consumption is gated off by thestreamingInboxflag pre-flip.Testing
message_store.test.ts: bucket snapshotting (multi-message, cross-batch, rollover), full-width chain-mismatch detection, reorg rewinding, and the three queries incl. boundary cases.archiver-sync.test.ts: end-to-end sync now exercises the full-width chain validation and asserts the bucket queries against the synced state (the fake L1 state mirrors the on-chain bucket assignment).stdlibarchiver interface RPC round-trip tests for the three new methods.