Skip to content

Commit

Permalink
fix update totalVerifiedBatches!
Browse files Browse the repository at this point in the history
  • Loading branch information
invocamanman committed Jun 18, 2024
1 parent 57f3184 commit 5184e5b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contracts/v2/PolygonRollupManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,19 @@ contract PolygonRollupManager is
// Update totalSequencedBatches
totalSequencedBatches -= lastBatchSequenced - targetBatch;

// Clean pending state if any
// Check pending state
if (rollup.lastPendingState > 0) {
// update total verified batches
uint64 currentLastVerifiedBatch = _getLastVerifiedBatch(rollup);
totalVerifiedBatches -=
currentLastVerifiedBatch -
rollup.lastVerifiedBatch;

rollup.lastPendingState = 0;
rollup.lastPendingStateConsolidated = 0;
}

// Callback the consensus contract
// Clean pending state if any
rollupContract.rollbackBatches(
targetBatch,
rollup.sequencedBatches[targetBatch].accInputHash
Expand Down

0 comments on commit 5184e5b

Please sign in to comment.