Skip to content

Commit

Permalink
fix check for overflow assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Dec 13, 2024
1 parent 2ad72e0 commit e54d8d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions assertions/poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ func (m *Manager) PostAssertionBasedOnParent(
return none, errors.Wrapf(err, "could not get execution state at batch count %d with parent block hash %v", batchCount, parentBlockHash)
}

// If the assertion is not an overflow assertion (has a 0 position in batch),
// then should check if we need to wait for the minimum number of blocks in between
// assertions. Overflow ones are not subject to this check onchain.
if newState.GlobalState.PosInBatch == 0 {
// If the assertion is not an overflow assertion i.e !(newState.GlobalState.Batch < batchCount) derived from
// contracts check for overflow assertion => assertion.afterState.globalState.u64Vals[0] < assertion.beforeStateData.configData.nextInboxPosition)
// then should check if we need to wait for the minimum number of blocks between assertions and a minimum time since parent assertion creation.
// Overflow ones are not subject to this check onchain.
if newState.GlobalState.Batch >= batchCount {
if err = m.waitToPostIfNeeded(ctx, parentCreationInfo); err != nil {
return none, err
}
Expand Down

0 comments on commit e54d8d7

Please sign in to comment.