Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(protocol): add functions to ITaikoL1 for Nethermind Preconf #18217

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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