Skip to content

Commit

Permalink
fix(protocol): deep copy context transition (#18859)
Browse files Browse the repository at this point in the history
Co-authored-by: Gavin “yoghurt” Yu <[email protected]>
  • Loading branch information
YoGhurt111 and Gavin “yoghurt” Yu authored Feb 3, 2025
1 parent ac3075c commit 0f4db9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/protocol/contracts/layer1/based/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ library LibProving {
Local memory local;
local.b = _state.slotB;
local.blockId = _blockId;
TaikoData.Transition memory pendingTs;

if (_batchProof.tier == 0) {
// No batch proof is available, each transition is proving using a separate proof.
Expand All @@ -220,7 +219,12 @@ library LibProving {
require(local.meta.id > local.b.lastVerifiedBlockId, L1_INVALID_BLOCK_ID());
require(local.meta.id < local.b.numBlocks, L1_INVALID_BLOCK_ID());

pendingTs = ctx_.tran;
TaikoData.Transition memory pendingTs = TaikoData.Transition({
parentHash: ctx_.tran.parentHash,
blockHash: ctx_.tran.blockHash,
stateRoot: ctx_.tran.stateRoot,
graffiti: ctx_.tran.graffiti
});

local.slot = local.meta.id % _config.blockRingBufferSize;
TaikoData.BlockV2 storage blk = _state.blocks[local.slot];
Expand Down

0 comments on commit 0f4db9b

Please sign in to comment.