Skip to content

Commit

Permalink
chore(protocol): add functions to ITaikoL1 for Nethermind Preconf (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Oct 8, 2024
1 parent 30ed0e7 commit e349d22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
17 changes: 17 additions & 0 deletions packages/protocol/contracts/layer1/based/ITaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ interface ITaikoL1 {
/// @param _pause True if paused.
function pauseProving(bool _pause) external;

/// @notice Gets the details of a block.
/// @param _blockId Index of the block.
/// @return blk_ The block.
function getBlockV2(uint64 _blockId) external view returns (TaikoData.BlockV2 memory blk_);

/// @notice Gets the state transition for a specific block.
/// @param _blockId Index of the block.
/// @param _tid The transition id.
/// @return The state transition data of the block.
function getTransition(
uint64 _blockId,
uint32 _tid
)
external
view
returns (TaikoData.TransitionState memory);

/// @notice Deposits Taiko token to be used as bonds.
/// @param _amount The amount of Taiko token to deposit.
function depositBond(uint256 _amount) external;
Expand Down
9 changes: 2 additions & 7 deletions packages/protocol/contracts/layer1/based/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
blk_ = LibData.blockV2toV1(blk);
}

/// @notice Gets the details of a block.
/// @param _blockId Index of the block.
/// @return blk_ The block.
/// @inheritdoc ITaikoL1
function getBlockV2(uint64 _blockId) external view returns (TaikoData.BlockV2 memory blk_) {
(blk_,) = LibUtils.getBlock(state, getConfig(), _blockId);
}
Expand Down Expand Up @@ -229,10 +227,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
return LibUtils.getTransitions(state, getConfig(), _blockIds, _parentHashes);
}

/// @notice Gets the state transition for a specific block.
/// @param _blockId Index of the block.
/// @param _tid The transition id.
/// @return The state transition data of the block.
/// @inheritdoc ITaikoL1
function getTransition(
uint64 _blockId,
uint32 _tid
Expand Down

0 comments on commit e349d22

Please sign in to comment.