-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): propose a batch blocks conditionally (#18570)
Co-authored-by: YoGhurt111 <[email protected]>
- Loading branch information
1 parent
abcec66
commit e846f62
Showing
10 changed files
with
62 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ interface IHasRecipient { | |
} | ||
|
||
/// @title ProverSet | ||
/// @notice A contract that holds TKO token and acts as a Taiko prover. This contract will simply | ||
/// relay `proveBlock` calls to TaikoL1 so msg.sender doesn't need to hold any TKO. | ||
/// @notice A contract that holds TAIKO token and acts as a Taiko prover. This contract will simply | ||
/// relay `proveBlock` calls to TaikoL1 so msg.sender doesn't need to hold any TAIKO. | ||
/// @custom:security-contact [email protected] | ||
contract ProverSet is EssentialContract, IERC1271 { | ||
bytes4 private constant _EIP1271_MAGICVALUE = 0x1626ba7e; | ||
|
@@ -94,18 +94,19 @@ contract ProverSet is EssentialContract, IERC1271 { | |
LibAddress.sendEtherAndVerify(admin, _amount); | ||
} | ||
|
||
/// @notice Proposes a block only when it is the first block proposal in the current L1 block. | ||
function proposeBlockV2Conditionally( | ||
bytes calldata _params, | ||
bytes calldata _txList | ||
/// @notice Proposes a batch blocks only when it is the first batch blocks proposal in the | ||
/// current L1 block. | ||
function proposeBlocksV2Conditionally( | ||
bytes[] calldata _params, | ||
bytes[] calldata _txList | ||
) | ||
external | ||
onlyProver | ||
{ | ||
ITaikoL1 taiko = ITaikoL1(taikoL1()); | ||
// Ensure this block is the first block proposed in the current L1 block. | ||
require(taiko.lastProposedIn() != block.number, NOT_FIRST_PROPOSAL()); | ||
taiko.proposeBlockV2(_params, _txList); | ||
taiko.proposeBlocksV2(_params, _txList); | ||
} | ||
|
||
/// @notice Propose a Taiko block. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5b4b0cd271534aa72d865afa5fc55e0ee4b16b73 | ||
ab50d406172e879e7436c70a41bda674bfc6e441 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters