From 25dcd82e64ae23b35fc5be0e7a18f15129ba8d0e Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Fri, 13 Dec 2024 17:13:03 -0600 Subject: [PATCH] fix check --- assertions/poster.go | 3 ++- assertions/poster_test.go | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/assertions/poster.go b/assertions/poster.go index 755dc7627..8866c3fe3 100644 --- a/assertions/poster.go +++ b/assertions/poster.go @@ -164,7 +164,8 @@ func (m *Manager) PostAssertionBasedOnParent( // 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 { + isOverflowAssertion := newState.MachineStatus != protocol.MachineStatusErrored && newState.GlobalState.PosInBatch < batchCount + if !isOverflowAssertion { if err = m.waitToPostIfNeeded(ctx, parentCreationInfo); err != nil { return none, err } diff --git a/assertions/poster_test.go b/assertions/poster_test.go index 44c316f6b..eb7f2fd52 100644 --- a/assertions/poster_test.go +++ b/assertions/poster_test.go @@ -55,9 +55,6 @@ func TestPostAssertion(t *testing.T) { stateManager, err := statemanager.NewForSimpleMachine(t, stateManagerOpts...) require.NoError(t, err) - // Set MinimumGapToBlockCreationTime as 1 second to verify that a new assertion is only posted after 1 sec has passed - // from parent assertion creation. This will make the test run for ~19 seconds as the parent assertion time is - // ~18 seconds in the future assertionManager, err := assertions.NewManager( aliceChain, stateManager, @@ -65,7 +62,6 @@ func TestPostAssertion(t *testing.T) { types.DefensiveMode, assertions.WithPollingInterval(time.Millisecond*200), assertions.WithAverageBlockCreationTime(time.Second), - assertions.WithMinimumGapToParentAssertion(time.Second), ) require.NoError(t, err)