Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct TempCheckpointLog {
bytes32 attestationsHash;
bytes32 payloadDigest;
Slot slotNumber;
// Streaming Inbox consumption counts (AZIP-22 Fast Inbox). `inboxMsgTotal` is the cumulative Inbox message count
// Streaming Inbox consumption counts. `inboxMsgTotal` is the cumulative Inbox message count
// consumed as of this checkpoint (the child's parent-total origin); `inboxConsumedBucket` is the bucket sequence
// number the header's rolling hash corresponds to. Declared next to the slot number so the three share one storage
// slot (4 + 8 + 8 of 32 bytes): propose writes and reads that slot for the slot-progression check anyway.
Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/src/core/libraries/rollup/EpochProofLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ library EpochProofLib {
);
}

// Boundary anchoring for the Inbox rolling-hash chain (AZIP-22 Fast Inbox), mirroring previousArchive/endArchive:
// Boundary anchoring for the Inbox rolling-hash chain, mirroring previousArchive/endArchive:
// both ends of the claimed chain segment must match the rolling hashes recorded at propose for checkpoints
// _start - 1 and _end. The start needs this to be sound - the previous checkpoint's header is not among this
// proof's public inputs, so nothing else pins where the segment begins. The end is already pinned transitively
Expand Down Expand Up @@ -343,7 +343,7 @@ library EpochProofLib {

publicInputs[2] = _args.outHash;

// Inbox rolling-hash chain segment consumed across the epoch (AZIP-22 Fast Inbox). The start is validated above
// Inbox rolling-hash chain segment consumed across the epoch. The start is validated above
// against the record written at propose for checkpoint _start - 1; the end is pinned transitively through the
// stored checkpoint header hashes (see the anchoring block in assertAcceptable).
publicInputs[3] = _args.previousInboxRollingHash;
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/src/core/libraries/rollup/ProposeLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ProposeArgs {
bytes32 archive;
OracleInput oracleInput;
ProposedHeader header;
// Sequence number of the Inbox bucket the header's `inboxRollingHash` corresponds to (AZIP-22 Fast Inbox).
// Sequence number of the Inbox bucket the header's `inboxRollingHash` corresponds to.
// Unsigned lookup aid kept out of the attested payload digest: a wrong hint can only revert, never change what is
// accepted, since integrity comes from the rolling-hash equality check against the committee-signed header.
uint256 bucketHint;
Expand Down Expand Up @@ -269,8 +269,8 @@ library ProposeLib {
uint256 checkpointNumber = tips.getPending() + 1;
tips = tips.updatePending(checkpointNumber);

// Validate the streaming Inbox consumption against the parent checkpoint's consumed position (AZIP-22 Fast
// Inbox). The parent is checkpointNumber - 1, always available: checkpoint 0 carries the {0,0,0} genesis base
// Validate the streaming Inbox consumption against the parent checkpoint's consumed position.
// The parent is checkpointNumber - 1, always available: checkpoint 0 carries the {0,0,0} genesis base
// case written at initialization. rollupStore.tips is not committed until below, so the parent read still sees
// the parent as the pending tip. The returned cumulative total is stored in this checkpoint's record so its
// child validates against it and, since temp-log records rewind with the pending chain on a prune, the record
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/src/core/libraries/rollup/STFLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ library STFLib {
excessMana: 0, manaUsed: 0, ethPerFeeAsset: _initialEthPerFeeAsset, congestionCost: 0, proverCost: 0
}),
// Genesis Inbox consumption base case, matching the Inbox's genesis bucket-0 sentinel {0, 0, 0}, so
// checkpoint 1 validates its consumption against it (AZIP-22 Fast Inbox).
// checkpoint 1 validates its consumption against it.
inboxRollingHash: bytes32(0),
inboxMsgTotal: 0,
inboxConsumedBucket: 0
Expand Down Expand Up @@ -311,7 +311,7 @@ library STFLib {
}

/**
* @notice Retrieves the cumulative Inbox message count consumed as of a checkpoint (AZIP-22 Fast Inbox)
* @notice Retrieves the cumulative Inbox message count consumed as of a checkpoint
* @dev Gas-efficient accessor reading only the streaming-inbox consumed total. Reverts if the checkpoint is stale.
* @param _checkpointNumber The checkpoint number to get the consumed total for
* @return The cumulative Inbox message count consumed as of the checkpoint
Expand All @@ -321,7 +321,7 @@ library STFLib {
}

/**
* @notice Retrieves the Inbox rolling hash a checkpoint committed to (AZIP-22 Fast Inbox)
* @notice Retrieves the Inbox rolling hash a checkpoint committed to
* @dev Gas-efficient accessor reading only the streaming-inbox rolling hash. Reverts if the checkpoint is stale.
* @param _checkpointNumber The checkpoint number to get the rolling hash for
* @return The consensus Inbox rolling hash recorded for the checkpoint
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/messagebridge/Inbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ contract Inbox is IInbox {
currentTree = trees[inProgress];
}

// Compact cumulative message index (AZIP-22 Fast Inbox): the zero-based position of this message in the Inbox's
// Compact cumulative message index: the zero-based position of this message in the Inbox's
// insertion order, equal to the number of messages inserted before it. It is embedded in the leaf preimage and
// matches the streaming L1-to-L2 tree's leaf count, so consumers do not need per-checkpoint tree geometry.
uint256 index = totalMessagesInserted;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/Inbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ contract InboxTest is Test {

function testFuzzInsert(DataStructures.L1ToL2Msg memory _message) public checkInvariant {
Inbox.InboxState memory stateBefore = inbox.getState();
// Compact cumulative index (AZIP-22 Fast Inbox): the message's index is the count inserted before it.
// Compact cumulative index: the message's index is the count inserted before it.
uint256 globalLeafIndex = stateBefore.totalMessagesInserted;
DataStructures.L1ToL2Msg memory message = _boundMessage(_message, globalLeafIndex);

Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/InboxBuckets.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ contract InboxBucketsTest is Test {
recipient: recipient,
content: content,
secretHash: secretHash,
// Compact cumulative index (AZIP-22 Fast Inbox): the first message against a fresh Inbox has index 0.
// Compact cumulative index: the first message against a fresh Inbox has index 0.
index: inbox.getState().totalMessagesInserted
});
bytes32 leaf = Hash.sha256ToField(message);
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ contract RollupTest is RollupBase {
interim.feeAmount = interim.manaUsed * interim.minFee + interim.portalBalance;
header.accumulatedFees = interim.feeAmount;

// Streaming Inbox (AZIP-22 Fast Inbox): nothing is seeded here, so reference the genesis bucket (hash 0).
// Streaming Inbox: nothing is seeded here, so reference the genesis bucket (hash 0).
header.inboxRollingHash = bytes32(0);

// Assert that balance have NOT been increased by proposing the checkpoint
Expand Down Expand Up @@ -937,7 +937,7 @@ contract RollupTest is RollupBase {
}

// The epoch-proof anchoring pins the rolling-hash chain start to the record written at propose for checkpoint
// start - 1 (AZIP-22 Fast Inbox), mirroring previousArchive. A wrong previousInboxRollingHash must be rejected.
// start - 1, mirroring previousArchive. A wrong previousInboxRollingHash must be rejected.
function testGetEpochProofPublicInputsRejectsWrongPreviousInboxRollingHash() public setUpFor("empty_checkpoint_1") {
_proposeCheckpoint("empty_checkpoint_1", 1);

Expand Down Expand Up @@ -965,7 +965,7 @@ contract RollupTest is RollupBase {
}

// The end of the rolling-hash chain segment is pinned to the hash recorded at propose for the epoch's last
// checkpoint (AZIP-22 Fast Inbox), mirroring endArchive. A wrong endInboxRollingHash must be rejected here rather
// checkpoint, mirroring endArchive. A wrong endInboxRollingHash must be rejected here rather
// than surfacing as a generic proof-verification failure.
function testGetEpochProofPublicInputsRejectsWrongEndInboxRollingHash() public setUpFor("empty_checkpoint_1") {
_proposeCheckpoint("empty_checkpoint_1", 1);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/RollupFieldRange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ contract RollupFieldRangeTest is RollupBase {

vm.blobhashes(this.getBlobHashes(full.checkpoint.blobCommitments));

// Streaming Inbox (AZIP-22 Fast Inbox): nothing is seeded here, so reference the genesis bucket (hash 0).
// Streaming Inbox: nothing is seeded here, so reference the genesis bucket (hash 0).
header.inboxRollingHash = bytes32(0);

ProposeArgs memory args =
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/test/base/RollupBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ contract RollupBase is DecoderBase {
previousArchive: parentCheckpointLog.archive,
endArchive: endFull.checkpoint.archive,
outHash: endFull.checkpoint.header.outHash,
// Anchor the rolling-hash chain start to the record written at propose for checkpoint start - 1 (AZIP-22 Fast
// Inbox). The end value is unchecked on L1 but supplied for completeness.
// Anchor the rolling-hash chain start to the record written at propose for checkpoint start - 1.
// The end value is unchecked on L1 but supplied for completeness.
previousInboxRollingHash: proposedHeaders[startCheckpointNumber - 1].inboxRollingHash,
endInboxRollingHash: proposedHeaders[endCheckpointNumber].inboxRollingHash,
proverId: _prover
Expand Down Expand Up @@ -174,7 +174,7 @@ contract RollupBase is DecoderBase {
// Legacy frontier root for the header's inHash field. Unchecked at propose post-flip, but kept because the
// fixtures were generated with it as part of the header hash.
full.checkpoint.header.inHash = rollup.getInbox().getRoot(full.checkpoint.checkpointNumber);
// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket so the checkpoint consumes all messages
// Streaming Inbox: reference the newest bucket so the checkpoint consumes all messages
// seeded above and the mandatory-consumption assert is trivially satisfied (a wrong ref could only revert).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
full.checkpoint.header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/benchmark/happy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ contract BenchmarkRollupTest is FeeModelTestPoints, DecoderBase {
header.totalManaUsed = manaSpent;
header.accumulatedFees = uint256(manaMinFee) * manaSpent;

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (nothing seeded here, so the genesis bucket).
// Streaming Inbox: reference the newest bucket (nothing seeded here, so the genesis bucket).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/compression/PreHeating.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ contract PreHeatingTest is FeeModelTestPoints, DecoderBase {
header.totalManaUsed = manaSpent;
header.accumulatedFees = uint256(manaMinFee) * manaSpent;

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (nothing seeded here, so the genesis bucket).
// Streaming Inbox: reference the newest bucket (nothing seeded here, so the genesis bucket).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ abstract contract EscapeHatchIntegrationBase is ValidatorSelectionTestBase {
accumulatedFees: 0
});

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down Expand Up @@ -211,7 +211,7 @@ abstract contract EscapeHatchIntegrationBase is ValidatorSelectionTestBase {
header.gasFees.feePerL2Gas = manaMinFee;
}

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ contract invalidateTest is EscapeHatchIntegrationBase {
header.gasFees.feePerL2Gas = manaMinFee;
}

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/fees/FeeHeaderOverflow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ contract FeeHeaderOverflowTest is DecoderBase {
header.gasFees.feePerDaGas = 0;
header.totalManaUsed = 0;

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = _rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = _rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/test/fees/FeeRollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ contract FeeRollupTest is FeeModelTestPoints, DecoderBase {
if (rollup.getCurrentSlot() == nextSlot) {
TestPoint memory point = points[Slot.unwrap(nextSlot) - 1];
Checkpoint memory b = getCheckpoint();
// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
b.header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;
skipBlobCheck(address(rollup));
Expand Down Expand Up @@ -365,7 +365,7 @@ contract FeeRollupTest is FeeModelTestPoints, DecoderBase {

Checkpoint memory b = getCheckpoint();

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
b.header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;
skipBlobCheck(address(rollup));
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/harnesses/InboxHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract InboxHarness is Inbox {
}

function getNextMessageIndex() external view returns (uint256) {
// Compact cumulative index (AZIP-22 Fast Inbox): the next message's index is the count inserted so far.
// Compact cumulative index: the next message's index is the count inserted so far.
return state.totalMessagesInserted;
}
}
4 changes: 2 additions & 2 deletions l1-contracts/test/portals/TokenPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ contract TokenPortalTest is Test {
testERC20.approve(address(tokenPortal), mintAmount);

// Check for the expected message.
// Compact cumulative index (AZIP-22 Fast Inbox): the first message against a fresh Inbox has index 0.
// Compact cumulative index: the first message against a fresh Inbox has index 0.
uint256 expectedIndex = 0;
DataStructures.L1ToL2Msg memory expectedMessage = _createExpectedMintPrivateL1ToL2Message(expectedIndex);

Expand Down Expand Up @@ -148,7 +148,7 @@ contract TokenPortalTest is Test {
testERC20.approve(address(tokenPortal), mintAmount);

// Check for the expected message.
// Compact cumulative index (AZIP-22 Fast Inbox): the first message against a fresh Inbox has index 0.
// Compact cumulative index: the first message against a fresh Inbox has index 0.
uint256 expectedIndex = 0;
DataStructures.L1ToL2Msg memory expectedMessage = _createExpectedMintPublicL1ToL2Message(expectedIndex);
bytes32 expectedLeaf = expectedMessage.sha256ToField();
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/tmnt419.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ contract Tmnt419Test is RollupBase {
header.gasFees.feePerL2Gas = SafeCast.toUint128(rollup.getManaMinFeeAt(Timestamp.wrap(block.timestamp), true));
header.totalManaUsed = MANA_TARGET;

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket so any seeded messages are consumed.
// Streaming Inbox: reference the newest bucket so any seeded messages are consumed.
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
header.gasFees.feePerL2Gas = manaMinFee;
}

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket, consuming the messages seeded above.
// Streaming Inbox: reference the newest bucket, consuming the messages seeded above.
uint256 bucketHint = inbox.getCurrentBucketSeq();
header.inboxRollingHash = inbox.getBucket(bucketHint).rollingHash;

Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/validator-selection/tmnt207.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ contract Tmnt207Test is RollupBase {
header.gasFees.feePerL2Gas = SafeCast.toUint128(rollup.getManaMinFeeAt(Timestamp.wrap(block.timestamp), true));
header.totalManaUsed = MANA_TARGET;

// Streaming Inbox (AZIP-22 Fast Inbox): reference the newest bucket (genesis here; nothing is seeded).
// Streaming Inbox: reference the newest bucket (genesis here; nothing is seeded).
uint256 bucketHint = rollup.getInbox().getCurrentBucketSeq();
header.inboxRollingHash = rollup.getInbox().getBucket(bucketHint).rollingHash;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use types::{
};

/// A block's L1-to-L2 message bundle: the real message leaves it inserts into the L1-to-L2 message tree, and the
/// count a block root needs to append them and absorb them into the message sponge (AZIP-22 Fast Inbox).
/// count a block root needs to append them and absorb them into the message sponge.
///
/// The `num_msgs` real messages occupy the leading lanes; the same count drives both the compact (unpadded) tree
/// append and the message-sponge absorb, matching the checkpoint's variable-size `InboxParity` proof. Lanes past
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl BlockRollupPublicInputsComposer {
/// previous block (empty for the first block).
///
/// A single `bundle.num_msgs` count drives both the compact (unpadded) tree append and the message-sponge absorb,
/// so the sponge matches the checkpoint's variable-size `InboxParity` proof (AZIP-22 Fast Inbox). The lanes past
/// so the sponge matches the checkpoint's variable-size `InboxParity` proof. The lanes past
/// `num_msgs` must be zero.
pub fn with_message_bundle(
&mut self,
Expand Down Expand Up @@ -270,7 +270,7 @@ impl BlockRollupPublicInputsComposer {
};

// Absorb data for this block into the end sponge blob. The l1-to-l2 message tree root is absorbed for every
// block (AZIP-22 Fast Inbox): any block can insert its own bundle, so the root is per-block, not
// block: any block can insert its own bundle, so the root is per-block, not
// checkpoint-constant.
let mut block_end_sponge_blob = self.end_sponge_blob;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl TestBuilder {
}

// The block's message bundle: exactly `num_msgs` real leaves, appended compactly to the tree and absorbed into the
// message sponge (AZIP-22 Fast Inbox).
// message sponge.
fn message_bundle(self) -> L1ToL2MessageBundle {
L1ToL2MessageBundle { messages: self.l1_to_l2_messages, num_msgs: self.num_msgs }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl SpongeBlob {
total_mana_used,
);

// The l1-to-l2 message tree root (the last field) is absorbed for every block (AZIP-22 Fast Inbox): any block
// The l1-to-l2 message tree root (the last field) is absorbed for every block: any block
// can now insert its own bundle, so the root differs per block and blob-syncing nodes reconstruct each block's
// message-tree root from the blob alone.
self.absorb(blob_data, blob_data.len());
Expand Down
Loading
Loading