diff --git a/packages/protocol/contracts/layer1/based/LibProving.sol b/packages/protocol/contracts/layer1/based/LibProving.sol index 0c96335ec8d..3ead8de2ed5 100644 --- a/packages/protocol/contracts/layer1/based/LibProving.sol +++ b/packages/protocol/contracts/layer1/based/LibProving.sol @@ -34,6 +34,7 @@ library LibProving { bool sameTransition; bool postFork; uint64 proposedAt; + bool isSyncBlock; } /// @notice Emitted when a transition is proved. @@ -261,7 +262,9 @@ library LibProving { local.proposedAt = local.postFork ? local.meta.proposedAt : blk.proposedAt; - if (LibUtils.shouldSyncStateRoot(_config.stateRootSyncInternal, local.blockId)) { + local.isSyncBlock = + LibUtils.shouldSyncStateRoot(_config.stateRootSyncInternal, local.blockId); + if (local.isSyncBlock) { local.stateRoot = ctx_.tran.stateRoot; } @@ -367,8 +370,9 @@ library LibProving { local.isTopTier = local.tier.contestBond == 0; - local.sameTransition = - ctx_.tran.blockHash == ts.blockHash && local.stateRoot == ts.stateRoot; + local.sameTransition = local.isSyncBlock + ? ctx_.tran.blockHash == ts.blockHash && local.stateRoot == ts.stateRoot + : ctx_.tran.blockHash == ts.blockHash; if (local.proof.tier > ts.tier) { // Handles the case when an incoming tier is higher than the current transition's tier.