Skip to content

Commit

Permalink
feat(protocol): add proposeBlocksV2 method to ProverSet (#18115)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>
Co-authored-by: dantaik <dantaik@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 18, 2024
1 parent 5f976c4 commit 0743a99
Show file tree
Hide file tree
Showing 3 changed files with 951 additions and 2,183 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/layer1/based/ITaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface ITaikoL1 {
external
returns (TaikoData.BlockMetadataV2 memory meta_);

/// @notice Proposes a Taiko L2 block (version 2)
/// @notice Proposes multiple Taiko L2 blocks (version 2)
/// @param _paramsArr A list of encoded BlockParamsV2 objects.
/// @param _txListArr A list of txList.
/// @return metaArr_ The metadata objects of the proposed L2 blocks.
Expand Down
21 changes: 15 additions & 6 deletions packages/protocol/contracts/layer1/provers/ProverSet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ contract ProverSet is EssentialContract, IERC1271 {
external
payable
onlyProver
nonReentrant
{
ITaikoL1(taikoL1()).proposeBlock(_params, _txList);
}
Expand All @@ -104,13 +103,24 @@ contract ProverSet is EssentialContract, IERC1271 {
external
payable
onlyProver
nonReentrant
{
ITaikoL1(taikoL1()).proposeBlockV2(_params, _txList);
}

/// @notice Propose multiple Taiko blocks.
function proposeBlocksV2(
bytes[] calldata _paramsArr,
bytes[] calldata _txListArr
)
external
payable
onlyProver
{
ITaikoL1(taikoL1()).proposeBlocksV2(_paramsArr, _txListArr);
}

/// @notice Proves or contests a Taiko block.
function proveBlock(uint64 _blockId, bytes calldata _input) external onlyProver nonReentrant {
function proveBlock(uint64 _blockId, bytes calldata _input) external onlyProver {
ITaikoL1(taikoL1()).proveBlock(_blockId, _input);
}

Expand All @@ -122,18 +132,17 @@ contract ProverSet is EssentialContract, IERC1271 {
)
external
onlyProver
nonReentrant
{
ITaikoL1(taikoL1()).proveBlocks(_blockId, _input, _batchProof);
}

/// @notice Deposits Taiko token to TaikoL1 contract.
function depositBond(uint256 _amount) external onlyAuthorized nonReentrant {
function depositBond(uint256 _amount) external onlyAuthorized {
ITaikoL1(taikoL1()).depositBond(_amount);
}

/// @notice Withdraws Taiko token from TaikoL1 contract.
function withdrawBond(uint256 _amount) external onlyAuthorized nonReentrant {
function withdrawBond(uint256 _amount) external onlyAuthorized {
ITaikoL1(taikoL1()).withdrawBond(_amount);
}

Expand Down
Loading

0 comments on commit 0743a99

Please sign in to comment.