Skip to content

Commit 48cbd2b

Browse files
committed
chore(fast-inbox): circuits cleanup and checkpoint header format (A-1387)
FI-17 of the Fast Inbox (AZIP-22) stack. Stacked on #24791 (A-1386); it removes the legacy `inHash` from the checkpoint header now that the consensus flip (#24789, A-1384) has switched validation to the streaming rolling hash. After this PR, `inboxRollingHash` is the checkpoint's only inbox commitment. ## Consensus-format change - The checkpoint header loses its `inHash` field across all three preimage layers in lockstep: noir `CheckpointHeader` (`checkpoint_header.nr`), TS `CheckpointHeader` (`stdlib/src/rollup/checkpoint_header.ts`), and Solidity `ProposedHeaderLib` (struct + hash packing). The field ordering is otherwise unchanged; the header shrinks by one field (32 bytes: `CHECKPOINT_HEADER_SIZE_IN_BYTES` 380 to 348, `CHECKPOINT_HEADER_LENGTH` 14 to 13). - The header-hash fixtures were regenerated from `checkpoint_header.test.ts` (the established workflow) and pasted into the noir tests; the p2p golden-byte fixture (`wire_compat_fixtures.ts`) was refreshed for the checkpoint-proposal serialization, which shrinks by exactly the one removed field. The block-proposal wire fixture is unchanged (block-level `inHash` is out of scope, see A-1388). ## Circuits and constants - Strips the dead unconstrained `in_hash` pass-through from the sized `InboxParity<S>` circuit and `ParityPublicInputs` (noir + TS + the hand-written `noir-protocol-circuits-types` conversion wrappers). The circuit is kept (sized-parity, per FI-06's topology decision), so no VK-tree indices move. - Retires `NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP` (replaced everywhere by `MAX_L1_TO_L2_MSGS_PER_CHECKPOINT`, same value 1024) and the now-dead `NUM_MSGS_PER_BASE_PARITY`, `NUM_BASE_PARITY_PER_ROOT_PARITY`, and `L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH`. Generated constants (`constants.gen.ts`, `ConstantsGen.sol`) were regenerated via `remake-constants`. - Deletes `FrontierLib.sol` and its tests (`Parity.t.sol`, the `Frontier` harness and merkle test) now that their last users are gone. ## Verification - Noir: `types::checkpoint_header` (5/5), `rollup_lib::parity` and `checkpoint_root::parity_tests` (15/15), and the checkpoint-root header-assembly path pass locally. The full `checkpoint_root` suite (68 tests) is too slow to run in full locally and rides CI. - Solidity: `forge test` green across `Rollup`, `RollupFieldRange`, `Inbox`, `InboxBuckets`, `RollupGetters` (76/76), covering header hashing and the regenerated checkpoint fixtures. - Jest: `checkpoint_header`, the p2p wire-compat suites, and the parity/messaging suites pass (43 tests), confirming the fixture regeneration is byte-consistent. - VK/artifact/Prover.toml regeneration and the generated Noir ABI types ride CI (local `yarn build` in `noir-protocol-circuits-types` / `simulator` / `prover-client` is expected to fail on stale circuit artifacts until then); e2e and the broken-zone typecheck are the CI-of-record for those. ## Stack Part of the Fast Inbox stack #24784 through #24791 (umbrella #24774): A-1379 (#24784), A-1380 (#24785), A-1381 (#24786), A-1382 (#24787), A-1383 (#24788), A-1384 flip (#24789), A-1385 (#24790), A-1386 (#24791, base of this PR). Resolves A-1387. ## l1 publisher inbox consumption via the streaming selector (CI fix, pass-8) The A-1387 inHash-removal rewrite left `l1_publisher.integration.test.ts` hardcoding `previousInboxRollingHash = Fr.ZERO` and `bucketHint = 0n` while consuming real L1→L2 messages, so message-consuming checkpoints reverted on L1 with `Rollup__InvalidInboxRollingHash` / `UnconsumedInboxMessages` (masked every prior CI round behind earlier failures). `INBOX_LAG_SECONDS` is an L1-time censorship cutoff, not whole checkpoints, so no checkpoint-depth shift register reproduces the aged bucket set. The test now mirrors the real Inbox buckets into its `MockL1ToL2MessageSource` and reuses the production `selectInboxBucketForBlock` (which mirrors `ProposeLib.validateInboxConsumption`) to pick exactly the buckets each checkpoint must consume, deriving the consumed bundle, the propose bucket hint, and the header rolling hash from that one selection. Box: 13/13, verified at a-1387 and a-1388. Replaces #24792.
1 parent be17101 commit 48cbd2b

59 files changed

Lines changed: 161 additions & 504 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

l1-contracts/scripts/constants-codegen/solidity.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
"EMPTY_EPOCH_OUT_HASH",
99
"FEE_JUICE_ADDRESS",
1010
"BLS12_POINT_COMPRESSED_BYTES",
11-
"ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH",
12-
"NUM_MSGS_PER_BASE_PARITY",
13-
"NUM_BASE_PARITY_PER_ROOT_PARITY"
11+
"ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH"
1412
]

l1-contracts/src/core/libraries/crypto/FrontierLib.sol

Lines changed: 0 additions & 91 deletions
This file was deleted.

l1-contracts/src/core/libraries/rollup/ProposedHeaderLib.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct ProposedHeader {
2121
bytes32 lastArchiveRoot;
2222
bytes32 blockHeadersHash;
2323
bytes32 blobsHash;
24-
bytes32 inHash;
2524
bytes32 inboxRollingHash;
2625
bytes32 outHash;
2726
Slot slotNumber;
@@ -56,7 +55,6 @@ library ProposedHeaderLib {
5655
_header.lastArchiveRoot,
5756
_header.blockHeadersHash,
5857
_header.blobsHash,
59-
_header.inHash,
6058
_header.inboxRollingHash,
6159
_header.outHash,
6260
_header.slotNumber,

l1-contracts/test/Parity.t.sol

Lines changed: 0 additions & 80 deletions
This file was deleted.

l1-contracts/test/RollupFieldRange.t.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ contract RollupFieldRangeTest is RollupBase {
164164
vm.warp(max(block.timestamp, Timestamp.unwrap(ts)));
165165

166166
_populateInbox(full.populate.sender, full.populate.recipient, full.populate.l1ToL2Content);
167-
// The header's inHash field is an unconstrained pass-through hint post-flip; propose does not check it.
168-
header.inHash = bytes32(0);
169167
header.gasFees.feePerL2Gas = SafeCast.toUint128(rollup.getManaMinFeeAt(ts, true));
170168

171169
// Every field the range check guards, set to the maximal in-range value.

l1-contracts/test/base/DecoderBase.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ contract DecoderBase is TestBase {
4646
address coinbase;
4747
bytes32 feeRecipient;
4848
GasFees gasFees;
49-
bytes32 inHash;
5049
bytes32 inboxRollingHash;
5150
bytes32 lastArchiveRoot;
5251
bytes32 outHash;
@@ -104,7 +103,6 @@ contract DecoderBase is TestBase {
104103
lastArchiveRoot: full.checkpoint.header.lastArchiveRoot,
105104
blockHeadersHash: full.checkpoint.header.blockHeadersHash,
106105
blobsHash: full.checkpoint.header.blobsHash,
107-
inHash: full.checkpoint.header.inHash,
108106
inboxRollingHash: full.checkpoint.header.inboxRollingHash,
109107
outHash: full.checkpoint.header.outHash,
110108
slotNumber: Slot.wrap(full.checkpoint.header.slotNumber),

l1-contracts/test/base/RollupBase.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ contract RollupBase is DecoderBase {
171171

172172
// We jump to the time of the block, always past the L1 block the messages above landed in.
173173
vm.warp(max(block.timestamp + 1, Timestamp.unwrap(full.checkpoint.header.timestamp)));
174-
// The header's inHash field is an unconstrained pass-through hint post-flip; propose does not check it.
175-
full.checkpoint.header.inHash = bytes32(0);
176174
// Streaming Inbox: reference the newest bucket so the checkpoint consumes all messages
177175
// seeded above and the mandatory-consumption assert is trivially satisfied (a wrong ref could only revert).
178176
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();

l1-contracts/test/escape-hatch/integration/EscapeHatchIntegrationBase.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,17 @@ abstract contract EscapeHatchIntegrationBase is ValidatorSelectionTestBase {
130130
* @dev Uses:
131131
* - archive: GENESIS_ARCHIVE_ROOT
132132
* - oracleInput: zero
133-
* - header fields from fixture for blockHeadersHash/blobsHash/inHash/outHash, rest overridden
133+
* - header fields from fixture for blockHeadersHash/blobsHash/outHash, rest overridden
134134
*/
135135
function _buildProposeArgs(address _proposer) internal view returns (ProposeArgs memory args, bytes memory blobs) {
136136
bytes32 archive = bytes32(Constants.GENESIS_ARCHIVE_ROOT);
137137
Slot slotNumber = rollup.getCurrentSlot();
138138

139-
// Build header fresh, only copying blockHeadersHash/blobsHash/inHash/outHash from fixture
139+
// Build header fresh, only copying blockHeadersHash/blobsHash/outHash from fixture
140140
ProposedHeader memory header = ProposedHeader({
141141
lastArchiveRoot: archive,
142142
blockHeadersHash: full.checkpoint.header.blockHeadersHash,
143143
blobsHash: full.checkpoint.header.blobsHash,
144-
inHash: full.checkpoint.header.inHash,
145144
inboxRollingHash: full.checkpoint.header.inboxRollingHash,
146145
outHash: full.checkpoint.header.outHash,
147146
slotNumber: slotNumber,

l1-contracts/test/fixtures/empty_checkpoint_1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"lastArchiveRoot": "0x177a4955b31ecaafad999753938a44e526b54c5ba5d536688227f85f15cfbdf5",
3535
"blockHeadersHash": "0x2e3e0911389bc48fa8126a93273d016cc7dc08019f8ffc5f1f5ae7d90745eaa2",
3636
"blobsHash": "0x00e5b752fe6bc2154155ff3a979c4c5fa91d3ac0d716169ac521e1560fd83b2b",
37-
"inHash": "0x00de7b349d2306334734e4f58b1302a6ed5a6c796a706f6597a5641b6d468223",
3837
"inboxRollingHash": "0x00cad6497cf81748167158f149ba70c31f34c68b0ae1b156117de63e073d14b5",
3938
"outHash": "0x00c95e0ceb41951039e1592745ec2faea9866f6eaf01bf189a4463b4143af093",
4039
"slotNumber": 99,
@@ -48,7 +47,7 @@
4847
"totalManaUsed": 0,
4948
"accumulatedFees": 0
5049
},
51-
"headerHash": "0x0002fc455005d993521be4e6f8ed92d1e0b50e58b21445881c87d02ed51a1e4c",
50+
"headerHash": "0x00230a553b85ec7931eded45ec1ea096e47789226758b16dca0403f5ab53f3d6",
5251
"numTxs": 0
5352
}
5453
}

l1-contracts/test/fixtures/empty_checkpoint_2.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"lastArchiveRoot": "0x09d45c1e01b8596153838a068ddb470ead95e6e1e151f40b4d48664c1e311af6",
3535
"blockHeadersHash": "0x0b3bda1754ca30707b8c0bbe72760c68e574cf23309e7e4fd7cabea36b4078da",
3636
"blobsHash": "0x000e9acabf609c9c113078ecb383ba6310573ce246958b605452132617d2c960",
37-
"inHash": "0x006504de282a40084bb8098456a915c645d53482d351db52fa9433b6cd638763",
3837
"inboxRollingHash": "0x0080dbf2bd9576e81fd99fc0f9d35bfd7fc15a6221d0b6e1e92a1884f14d0c84",
3938
"outHash": "0x00c95e0ceb41951039e1592745ec2faea9866f6eaf01bf189a4463b4143af093",
4039
"slotNumber": 102,
@@ -48,7 +47,7 @@
4847
"totalManaUsed": 0,
4948
"accumulatedFees": 0
5049
},
51-
"headerHash": "0x00120ecaf7a72f61adf3c8ee180acd930401221668a4792a8f91584755840d16",
50+
"headerHash": "0x00a184a160ada9af4ba75961ba596043d76f56c75b2e7e9652a0c162a7bf59b9",
5251
"numTxs": 0
5352
}
5453
}

0 commit comments

Comments
 (0)