Skip to content

Commit 8612778

Browse files
committed
separate enforces batch PR
1 parent 2d06562 commit 8612778

File tree

7 files changed

+286
-1312
lines changed

7 files changed

+286
-1312
lines changed

src/L1/rollup/IScrollChain.sol

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ interface IScrollChain {
6868
* Public Mutating Functions *
6969
*****************************/
7070

71-
/// @notice Commit a batch of transactions on layer 1.
72-
///
73-
/// @param version The version of current batch.
74-
/// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`.
75-
/// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`.
76-
/// @param skippedL1MessageBitmap The bitmap indicates whether each L1 message is skipped or not.
77-
function commitBatch(
78-
uint8 version,
79-
bytes calldata parentBatchHeader,
80-
bytes[] memory chunks,
81-
bytes calldata skippedL1MessageBitmap
82-
) external;
83-
8471
/// @notice Commit a batch of transactions on layer 1 with blob data proof.
8572
///
8673
/// @dev Memory layout of `blobDataProof`:
@@ -107,28 +94,6 @@ interface IScrollChain {
10794
/// @param lastBatchHeader The header of last batch to revert, see the encoding in comments of `commitBatch`.
10895
function revertBatch(bytes calldata firstBatchHeader, bytes calldata lastBatchHeader) external;
10996

110-
/// @notice Finalize a committed batch (with blob) on layer 1.
111-
///
112-
/// @dev Memory layout of `blobDataProof`:
113-
/// | z | y | kzg_commitment | kzg_proof |
114-
/// |---------|---------|----------------|-----------|
115-
/// | bytes32 | bytes32 | bytes48 | bytes48 |
116-
///
117-
/// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch.
118-
/// @param prevStateRoot The state root of parent batch.
119-
/// @param postStateRoot The state root of current batch.
120-
/// @param withdrawRoot The withdraw trie root of current batch.
121-
/// @param blobDataProof The proof for blob data.
122-
/// @param aggrProof The aggregation proof for current batch.
123-
function finalizeBatchWithProof4844(
124-
bytes calldata batchHeader,
125-
bytes32 prevStateRoot,
126-
bytes32 postStateRoot,
127-
bytes32 withdrawRoot,
128-
bytes calldata blobDataProof,
129-
bytes calldata aggrProof
130-
) external;
131-
13297
/// @notice Finalize a list of committed batches (i.e. bundle) on layer 1.
13398
/// @param batchHeader The header of last batch in current bundle, see the encoding in comments of `commitBatch.
13499
/// @param postStateRoot The state root after current bundle.
@@ -140,4 +105,37 @@ interface IScrollChain {
140105
bytes32 withdrawRoot,
141106
bytes calldata aggrProof
142107
) external;
108+
109+
/// @param The struct for batch committing.
110+
/// @param version The version of current batch.
111+
/// @param parentBatchHeader The header of parent batch, see the comments of `BatchHeaderV0Codec`.
112+
/// @param chunks The list of encoded chunks, see the comments of `ChunkCodec`.
113+
/// @param blobDataProof The proof for blob data.
114+
struct CommitStruct {
115+
uint8 version;
116+
bytes parentBatchHeader;
117+
bytes[] chunks;
118+
bytes skippedL1MessageBitmap;
119+
bytes blobDataProof;
120+
}
121+
122+
/// @param The struct for batch finalization.
123+
/// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch`.
124+
/// @param postStateRoot The state root after current batch.
125+
/// @param withdrawRoot The withdraw trie root after current batch.
126+
/// @param zkProof The zk proof for current batch (single-batch bundle).
127+
/// @param teeProof The tee proof for current batch (single-batch bundle).
128+
struct FinalizeStruct {
129+
bytes batchHeader;
130+
bytes32 postStateRoot;
131+
bytes32 withdrawRoot;
132+
bytes zkProof;
133+
bytes teeProof;
134+
}
135+
136+
/// @notice Commit a batch of transactions on layer 1 with blob data proof and finalize it.
137+
/// @param commitStruct The data needed for commit.
138+
/// @param finalizeStruct The data needed for finalize.
139+
function commitAndFinalizeBatch(CommitStruct calldata commitStruct, FinalizeStruct calldata finalizeStruct)
140+
external;
143141
}

0 commit comments

Comments
 (0)