Skip to content

Commit 66c5b6f

Browse files
authored
update finalizeBatchWithProof -> finalizeBatchWithProof4844
1 parent a36e4b0 commit 66c5b6f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/content/docs/en/technology/chain/rollup.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function commitBatchWithBlobProof(
6161
bytes[] memory chunks,
6262
bytes calldata skippedL1MessageBitmap,
6363
bytes calldata blobDataProof
64-
) external;
64+
) external override OnlySequencer;
6565
```
6666

6767
After the `commitBatchWithBlobProof` function verifies the parent batch is committed before, it constructs the batch header of the batch and stores the hash of the batch header in the `ScrollChain` contract.
@@ -90,24 +90,27 @@ In addition, the `commitBatchWithBlobProof` function contains a bitmap of skippe
9090

9191
## Finalize Transaction
9292

93-
The Finalize Transaction finalizes the previously-committed batch with a validity proof. The transaction also submits the state root and the withdraw root after the batch. Here is the function signature of `finalizeBatchWithProof`:
93+
The Finalize Transaction finalizes the previously-committed batch with a validity proof. The transaction also submits the state root and the withdraw root after the batch. Here is the function signature of `finalizeBatchWithProof4844`:
9494

9595
```solidity
96-
function finalizeBatchWithProof(
96+
function finalizeBatchWithProof4844(
9797
bytes calldata batchHeader,
98-
bytes32 prevStateRoot,
98+
bytes32,
9999
bytes32 postStateRoot,
100100
bytes32 withdrawRoot,
101+
bytes calldata blobDataProof,
101102
bytes calldata aggrProof
102103
) external override OnlyProver
103104
```
104105

105-
The `finalizeBatchWithProof` function first verifies if the batch has been committed in the contract. It then calculates the public input hash as follows
106+
The `finalizeBatchWithProof4844` function first verifies if the batch has been committed in the contract. It then calculates the public input hash as follows
106107

107108
```
108-
publicInputHash := keccak(chainId || prevStateRoot || postStateRoot || withdrawRoot || batch.dataHash)
109+
publicInputHash := keccak(chainId || prevStateRoot || postStateRoot || withdrawRoot || batch.dataHash || blobDataProof[0:64] || blobVersionedHash)
109110
```
110111

112+
, where the `prevStateRoot` is read from the `finalizedStateRoots` map variable on the contract and `blobVersionedHash` is as described in the [Codec](#batchheader-codec) section.
113+
111114
The public input hash and the validity proof are sent to the plonk solidity verifier. Once the verification passes, the new state root and withdraw root are stored in the `ScrollChain` contract.
112115

113116
```solidity

0 commit comments

Comments
 (0)