From df4e36320b1513d2cdae48d179ad18af6137e4ee Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 8 Oct 2024 21:12:33 +0800 Subject: [PATCH 1/2] Add function to ITaikoL1 for Nethermind Preconf --- .../contracts/layer1/based/ITaikoL1.sol | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/protocol/contracts/layer1/based/ITaikoL1.sol b/packages/protocol/contracts/layer1/based/ITaikoL1.sol index 1c97592fb4..1d6517ec01 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoL1.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoL1.sol @@ -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; From a67b4a3e26f11c9fcdfe290c084fd6990ac08025 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 8 Oct 2024 21:16:45 +0800 Subject: [PATCH 2/2] Update TaikoL1.sol --- packages/protocol/contracts/layer1/based/TaikoL1.sol | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoL1.sol b/packages/protocol/contracts/layer1/based/TaikoL1.sol index 521a371054..a12e8b19e6 100644 --- a/packages/protocol/contracts/layer1/based/TaikoL1.sol +++ b/packages/protocol/contracts/layer1/based/TaikoL1.sol @@ -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); } @@ -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