Skip to content

Commit 6594e08

Browse files
committed
chore(fast-inbox): drop inHash from the L1 checkpoint header and delete FrontierLib (A-1387)
Remove inHash from the ProposedHeader struct and its hash preimage in ProposedHeaderLib, keeping the packing byte-for-byte in lockstep with the noir and stdlib checkpoint headers. Update the decoder base struct and the propose test helpers, and regenerate the checkpoint fixtures (drop header.inHash, recompute headerHash). Delete FrontierLib and its only remaining users: the parity cross-check test (Parity.t.sol, which verified the deleted parity circuits) and the frontier merkle test/harness. The frontier tree is gone from both circuits and L1.
1 parent 7510703 commit 6594e08

16 files changed

Lines changed: 8 additions & 268 deletions

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
@@ -169,8 +169,6 @@ contract RollupBase is DecoderBase {
169169
vm.warp(max(block.timestamp, Timestamp.unwrap(full.checkpoint.header.timestamp)));
170170

171171
_populateInbox(full.populate.sender, full.populate.recipient, full.populate.l1ToL2Content);
172-
// The header's inHash field is an unconstrained pass-through hint post-flip; propose does not check it.
173-
full.checkpoint.header.inHash = bytes32(0);
174172
// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket so the checkpoint consumes all messages
175173
// seeded above and the mandatory-consumption assert is trivially satisfied (a wrong ref could only revert).
176174
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
}

l1-contracts/test/fixtures/mixed_checkpoint_1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"lastArchiveRoot": "0x177a4955b31ecaafad999753938a44e526b54c5ba5d536688227f85f15cfbdf5",
6868
"blockHeadersHash": "0x087b6f59388fa4207876ee1b50521ff838d6eed422d0ad07ff996393f32a77e6",
6969
"blobsHash": "0x001bef3ff3f657c565ff86d5072186f7f2bfddb8a31ca0714562c164fe954d84",
70-
"inHash": "0x00de7b349d2306334734e4f58b1302a6ed5a6c796a706f6597a5641b6d468223",
7170
"inboxRollingHash": "0x00cad6497cf81748167158f149ba70c31f34c68b0ae1b156117de63e073d14b5",
7271
"outHash": "0x00cffdbb0e7f5e164d314d781d38ae31230910a3bae4c34e7df6222df71b1539",
7372
"slotNumber": 99,
@@ -81,7 +80,7 @@
8180
"totalManaUsed": 0,
8281
"accumulatedFees": 0
8382
},
84-
"headerHash": "0x00c1431d117825d25f8169e35eb70ed4b16c0fc4b3cac85506852c240d03740e",
83+
"headerHash": "0x00f1c11fddfca8ff6073d1715c8b886d501facad96b7b032fb440462849697b8",
8584
"numTxs": 4
8685
}
8786
}

0 commit comments

Comments
 (0)