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

feat(protocol): allow getTransition to be called for all blocks #17268

Merged
merged 5 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
13 changes: 1 addition & 12 deletions packages/protocol/contracts/L1/libs/LibUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ library LibUtils {
view
returns (TaikoData.TransitionState storage)
{
_checkBlockId(_state, _blockId);
(TaikoData.Block storage blk, uint64 slot) = getBlock(_state, _config, _blockId);

uint32 tid = getTransitionId(_state, blk, slot, _parentHash);
Expand All @@ -59,7 +58,6 @@ library LibUtils {
view
returns (TaikoData.TransitionState storage)
{
_checkBlockId(_state, _blockId);
(TaikoData.Block storage blk, uint64 slot) = getBlock(_state, _config, _blockId);

if (_tid == 0 || _tid >= blk.nextTransitionId) revert L1_TRANSITION_NOT_FOUND();
Expand All @@ -81,9 +79,7 @@ library LibUtils {
{
slot_ = _blockId % _config.blockRingBufferSize;
blk_ = _state.blocks[slot_];
if (blk_.blockId != _blockId) {
revert L1_INVALID_BLOCK_ID();
}
if (blk_.blockId != _blockId) revert L1_INVALID_BLOCK_ID();
}

/// @dev Retrieves the ID of the transition with a given parentHash.
Expand Down Expand Up @@ -121,11 +117,4 @@ library LibUtils {
return block.timestamp >= deadline;
}
}

function _checkBlockId(TaikoData.State storage _state, uint64 _blockId) private view {
TaikoData.SlotB memory b = _state.slotB;
if (_blockId < b.lastVerifiedBlockId || _blockId >= b.numBlocks) {
revert L1_INVALID_BLOCK_ID();
}
}
}
2 changes: 2 additions & 0 deletions packages/protocol/deployments/mainnet-contract-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@
- deployed on May 1, 2024 @commit `56dddf2b6`
- Upgraded from `0x99Ba70E62cab0cB983e66F72330fBDDC11d85501` to `0x9fBBedBBcBb753E7214BE08381efE10d89D712fE` @commit `b90b932` @tx`0x416560cd96dc75ccffebe889e8d1ab3e08b33f814dc4a2bf7c6f9555071d1f6f`
- `Init2()` called and reset block hash to `0411D9F84A525864E0A7E8BB51667D49C6BF73820AF9E4BC76EA66ADB6BE8903` @tx `0x7311fee56f87294e336393b55939489bc1e810c402f304013475d04c90ca32a9`
- todo:
- upgrade the implementation again

#### assignment_hook

Expand Down
Loading