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

fix(protocol): deep copy context transition #18859

Merged
merged 2 commits into from
Feb 3, 2025
Merged
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
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