Skip to content

chore(fast-inbox): delete legacy L1 inbox path (A-1386)#24791

Open
spalladino wants to merge 3 commits into
spl/a-1385-streaming-e2efrom
spl/a-1386-l1-cleanup
Open

chore(fast-inbox): delete legacy L1 inbox path (A-1386)#24791
spalladino wants to merge 3 commits into
spl/a-1385-streaming-e2efrom
spl/a-1386-l1-cleanup

Conversation

@spalladino

@spalladino spalladino commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Deletes the legacy L1 Inbox path now that propose enforces streaming-inbox consumption (AZIP-22 Fast Inbox, FI-16). Stacked on spl/a-1385-streaming-e2e; part of the Fast Inbox stack (#24784..#24790 below this one).

What is deleted

  • Frontier trees: the trees mapping, forest, HEIGHT/SIZE/EMPTY_ROOT, the per-message tree insert, getRoot(), and the whole consume() flow.
  • LAG / inboxLag: the LAG immutable and _lag/_height constructor args (the Inbox constructor is now (rollup, feeAsset, version, bucketRingSize)), RollupConfigInput.inboxLag and its RollupCore pass-through, and Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT from the Inbox construction.
  • Dead event field: the MessageSent.checkpointNumber (former inProgress) argument, which became meaningless once consume() stopped advancing it.
  • Orphaned errors: Inbox__Unauthorized, Inbox__MustBuildBeforeConsume, Rollup__InvalidInHash.

What is re-homed / kept

  • The compact message index now reads the current bucket's running total (totalMsgCount) instead of a parallel counter; InboxState.inProgress and getInProgress() are gone.
  • The 128-bit rollingHash, InboxState.{rollingHash, totalMessagesInserted}, getState(), and getTotalMessagesInserted() are kept: the node still consumes them for message sync and L1-reorg detection. Their removal is the node cleanup's job (FI-18).
  • FrontierLib is kept — it still backs the base-parity (test/Parity.t.sol) and merkle (test/merkle/Frontier.t.sol) tests, which are unrelated to the Inbox (parity-circuit territory, FI-17). The plan's "delete the file" assumption is contradicted by grep.

TS follow-through

  • ethereum InboxContract: drop getLag(), drop the MessageSent.checkpointNumber decode, stop reading inProgress; InboxContractState.treeInProgress is now optional (no longer tracked on-chain).
  • Stop threading inboxLag through queries.getL1ContractsConfig and the L1 deploy env. The broader AZTEC_INBOX_LAG config sweep (ethereum/src/config.ts, foundation, stdlib, ~30 e2e configs) is deferred to FI-18, which explicitly owns it.
  • Archiver decode derives the message's checkpoint number from the compact index (the event no longer carries it), keeping the legacy per-checkpoint store shape untouched for FI-18.
  • Removed the obsolete advanceInboxInProgress cheat code + its inbox-drift tests, and the orphaned archiver inHash-mismatch sync test (the cross-check was removed at the flip).

Gas

Deleting the frontier insert is a large sendL2Message win. Whole-test gas (forge test on InboxBuckets.t.sol), before → after:

Case Before After
First-ever message 175,251 116,835
First message of a new L1 block 329,460 195,555
Absorb into an existing bucket 286,673 149,968
Rollover mid-block (256 messages) 18,923,988 3,068,480

Per-call sendL2Message gas after cleanup: first-ever 99,526; first-of-new-block 53,763; existing-bucket absorb 9,273; rollover 53,801.

Testing

  • forge build + forge test green: 887 passed, 0 failed. This fixes 4 pre-existing baseline failures the flip stranded (fee_portal/TokenPortal deposit tests using tree-relative indices + the old event shape).
  • @aztec/ethereum builds clean; config/queries unit tests green.
  • @aztec/archiver has no self-owned type errors; message_store (36), archiver-sync (59), and the decode/struct suites (58) all pass. (Pre-existing noir-protocol-circuits-types stale-artifact errors are unaffected.)
  • e2e not run locally. The stability gate ("a few days of green e2e/networks before deleting the fallback") applies at merge time for this stacked line, not at PR creation.

Review follow-up (phase-2 final review)

Deleting the inbox-drift bot test left bot.test.ts's cheatCodes variable unused (lint error); a follow-up commit removes it.

Remove the frontier-tree machinery, legacy consume(), the LAG/inboxLag
plumbing and the dead MessageSent event field now that propose enforces
streaming-inbox consumption (AZIP-22 Fast Inbox).

Inbox / IInbox:
- Drop the frontier tree forest (trees mapping, forest, HEIGHT/SIZE/EMPTY_ROOT),
  the per-message tree insert, getRoot(), and consume().
- Drop the LAG immutable and the _lag/_height constructor args; the constructor
  now takes only (rollup, feeAsset, version, bucketRingSize).
- Source the compact message index from the current bucket's running total
  instead of a parallel counter; drop InboxState.inProgress and getInProgress().
- Drop the meaningless checkpointNumber (former inProgress) from MessageSent.
- Keep the 128-bit rolling hash, InboxState.{rollingHash,totalMessagesInserted}
  and getState()/getTotalMessagesInserted(): the node still consumes them for
  message sync and L1-reorg detection until that path is retired.

Rollup / config / errors:
- Remove RollupConfigInput.inboxLag and the RollupCore constructor pass-through;
  drop Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT from the Inbox construction.
- Sweep orphaned errors Inbox__Unauthorized, Inbox__MustBuildBeforeConsume and
  Rollup__InvalidInHash; refresh the now-stale ProposeLib NatSpec.

Tests: delete the frontier/consume suites and fuzz, re-home the bucket/rolling-hash
coverage, update the propose-path fixtures (inHash is an unconstrained hint now),
and fix the flip-stranded fee-portal/token-portal index and event expectations.

FrontierLib is kept: it still backs the base-parity and merkle Frontier tests.
… (A-1386)

Track the regenerated Inbox ABI after the legacy L1 path was removed
(AZIP-22 Fast Inbox):

- ethereum InboxContract: drop getLag() (the LAG getter is gone) and the
  MessageSent checkpointNumber decode; getState() no longer reads inProgress and
  InboxContractState.treeInProgress becomes optional (no longer tracked on-chain).
- Stop threading inboxLag through queries/getL1ContractsConfig and the L1 deploy
  env; the broader AZTEC_INBOX_LAG config removal is deferred to the node cleanup.
- archiver decode: derive the message's checkpoint number from the compact index
  (the event no longer carries it), keeping the legacy per-checkpoint store shape.
- Remove the obsolete advanceInboxInProgress cheat code and its inbox-drift tests;
  drop the orphaned archiver inHash-mismatch sync test (the cross-check was removed
  at the flip). Add the flip-stranded bucketHint to the propose-call test fixtures.
…ift test removal (A-1386)

Deleting the inbox-drift bot test left the suite's cheatCodes variable (and
its import) unused, tripping lint.
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