Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor indexL1InfoRoot to l1InfoTreeLeafCount #312

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions contracts/v2/consensus/validium/PolygonValidiumEtrog.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {
/**
* @notice Allows a sequencer to send multiple batches
* @param batches Struct array which holds the necessary data to append new batches to the sequence
* @param indexL1InfoRoot Index of the L1InfoRoot that will be used in this sequence
* @param l1InfoTreeLeafCount Count of the L1InfoTree leaf that will be used in this sequence
* @param maxSequenceTimestamp Max timestamp of the sequence. This timestamp must be inside a safety range (actual + 36 seconds).
* This timestamp should be equal or higher of the last block inside the sequence, otherwise this batch will be invalidated by circuit.
* @param expectedFinalAccInputHash This parameter must match the acc input hash after hash all the batch data
Expand All @@ -90,7 +90,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {
*/
function sequenceBatchesValidium(
ValidiumBatchData[] calldata batches,
uint32 indexL1InfoRoot,
uint32 l1InfoTreeLeafCount,
uint64 maxSequenceTimestamp,
bytes32 expectedFinalAccInputHash,
address l2Coinbase,
Expand All @@ -117,7 +117,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {

// Get global batch variables
bytes32 l1InfoRoot = globalExitRootManager.l1InfoRootMap(
indexL1InfoRoot
l1InfoTreeLeafCount
);

if (l1InfoRoot == bytes32(0)) {
Expand Down Expand Up @@ -247,7 +247,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {
/**
* @notice Allows a sequencer to send multiple batches
* @param batches Struct array which holds the necessary data to append new batches to the sequence
* @param indexL1InfoRoot Index of the L1InfoRoot that will be used in this sequence
* @param l1InfoTreeLeafCount Count of the L1InfoTree leaf that will be used in this sequence
* @param maxSequenceTimestamp Max timestamp of the sequence. This timestamp must be inside a safety range (actual + 36 seconds).
* This timestamp should be equal or higher of the last block inside the sequence, otherwise this batch will be invalidated by circuit.
* @param expectedFinalAccInputHash This parameter must match the acc input hash after hash all the batch data
Expand All @@ -257,7 +257,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {
*/
function sequenceBatches(
BatchData[] calldata batches,
uint32 indexL1InfoRoot,
uint32 l1InfoTreeLeafCount,
uint64 maxSequenceTimestamp,
bytes32 expectedFinalAccInputHash,
address l2Coinbase
Expand All @@ -267,7 +267,7 @@ contract PolygonValidiumEtrog is PolygonRollupBaseEtrog, IPolygonValidium {
}
super.sequenceBatches(
batches,
indexL1InfoRoot,
l1InfoTreeLeafCount,
maxSequenceTimestamp,
expectedFinalAccInputHash,
l2Coinbase
Expand Down
6 changes: 3 additions & 3 deletions contracts/v2/lib/PolygonRollupBaseEtrog.sol
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ abstract contract PolygonRollupBaseEtrog is
/**
* @notice Allows a sequencer to send multiple batches
* @param batches Struct array which holds the necessary data to append new batches to the sequence
* @param indexL1InfoRoot Index of the L1InfoRoot that will be used in this sequence
* @param l1InfoTreeLeafCount Count of the L1InfoTree leaf that will be used in this sequence
* @param maxSequenceTimestamp Max timestamp of the sequence. This timestamp must be inside a safety range (actual + 36 seconds).
* This timestamp should be equal or higher of the last block inside the sequence, otherwise this batch will be invalidated by circuit.
* @param expectedFinalAccInputHash This parameter must match the acc input hash after hash all the batch data
Expand All @@ -324,7 +324,7 @@ abstract contract PolygonRollupBaseEtrog is
*/
function sequenceBatches(
BatchData[] calldata batches,
uint32 indexL1InfoRoot,
uint32 l1InfoTreeLeafCount,
uint64 maxSequenceTimestamp,
bytes32 expectedFinalAccInputHash,
address l2Coinbase
Expand All @@ -350,7 +350,7 @@ abstract contract PolygonRollupBaseEtrog is

// Get global batch variables
bytes32 l1InfoRoot = globalExitRootManager.l1InfoRootMap(
indexL1InfoRoot
l1InfoTreeLeafCount
);

if (l1InfoRoot == bytes32(0)) {
Expand Down
Loading