Skip to content

Commit 2c63cb0

Browse files
authored
fix(protocol): fix liveness bond related tokenomics issue (#16684)
1 parent 2b27477 commit 2c63cb0

19 files changed

Lines changed: 2195 additions & 360 deletions

packages/protocol/contracts/L1/TaikoData.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ library TaikoData {
106106
uint96 contestBond;
107107
uint64 timestamp; // slot 6 (90 bits)
108108
uint16 tier;
109-
uint8 contestations;
109+
uint8 __reserved1;
110110
}
111111

112112
/// @dev Struct containing data required for verifying a block.

packages/protocol/contracts/L1/TaikoErrors.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ pragma solidity 0.8.24;
1111
abstract contract TaikoErrors {
1212
error L1_ALREADY_CONTESTED();
1313
error L1_ALREADY_PROVED();
14-
error L1_ASSIGNED_PROVER_NOT_ALLOWED();
1514
error L1_BLOB_NOT_AVAILABLE();
1615
error L1_BLOB_NOT_FOUND();
1716
error L1_BLOCK_MISMATCH();
17+
error L1_CANNOT_CONTEST();
1818
error L1_INVALID_BLOCK_ID();
1919
error L1_INVALID_CONFIG();
2020
error L1_INVALID_GENESIS_HASH();

packages/protocol/contracts/L1/TaikoEvents.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,17 @@ abstract contract TaikoEvents {
2727
);
2828
/// @dev Emitted when a block is verified.
2929
/// @param blockId The ID of the verified block.
30-
/// @param assignedProver The block's assigned prover.
3130
/// @param prover The prover whose transition is used for verifying the
3231
/// block.
3332
/// @param blockHash The hash of the verified block.
3433
/// @param stateRoot The block's state root.
3534
/// @param tier The tier ID of the proof.
36-
/// @param contestations Number of total contestations.
3735
event BlockVerified(
3836
uint256 indexed blockId,
39-
address indexed assignedProver,
4037
address indexed prover,
4138
bytes32 blockHash,
4239
bytes32 stateRoot,
43-
uint16 tier,
44-
uint8 contestations
40+
uint16 tier
4541
);
4642

4743
/// @notice Emitted when some state variable values changed.

packages/protocol/contracts/L1/TaikoL1.sol

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,8 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors {
138138
/// @notice Gets the details of a block.
139139
/// @param _blockId Index of the block.
140140
/// @return blk_ The block.
141-
/// @return ts_ The transition used to verify this block.
142-
function getBlock(uint64 _blockId)
143-
public
144-
view
145-
returns (TaikoData.Block memory blk_, TaikoData.TransitionState memory ts_)
146-
{
147-
uint64 slot;
148-
(blk_, slot) = LibUtils.getBlock(state, getConfig(), _blockId);
149-
150-
if (blk_.verifiedTransitionId != 0) {
151-
ts_ = state.transitions[slot][blk_.verifiedTransitionId];
152-
}
141+
function getBlock(uint64 _blockId) public view returns (TaikoData.Block memory blk_) {
142+
(blk_,) = LibUtils.getBlock(state, getConfig(), _blockId);
153143
}
154144

155145
/// @notice Gets the state transition for a specific block.
@@ -167,10 +157,25 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors {
167157
return LibUtils.getTransition(state, getConfig(), _blockId, _parentHash);
168158
}
169159

160+
/// @notice Gets the state transition for a specific block.
161+
/// @param _blockId Index of the block.
162+
/// @param _tid The transition id.
163+
/// @return The state transition data of the block.
164+
function getTransition(
165+
uint64 _blockId,
166+
uint32 _tid
167+
)
168+
public
169+
view
170+
returns (TaikoData.TransitionState memory)
171+
{
172+
return LibUtils.getTransition(state, getConfig(), _blockId, _tid);
173+
}
170174
/// @notice Gets the state variables of the TaikoL1 contract.
171175
/// @dev This method can be deleted once node/client stops using it.
172176
/// @return State variables stored at SlotA.
173177
/// @return State variables stored at SlotB.
178+
174179
function getStateVariables()
175180
public
176181
view

0 commit comments

Comments
 (0)