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

State Sync Health Check #1892

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: extend `TestDynamicStateSyncTransition_PendingTree_VerifyBlockW…
…ithInvalidAncestor`
elvis.sabanovic committed Jan 24, 2025
commit 9ba3848ffe05b46b3a8c81dee08c8e36342730d0
1 change: 1 addition & 0 deletions snow/health_check.go
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ func newStateSyncHealthChecker[I, O, A Block](vm *VM[I, O, A]) *stateSyncHealthC
s.lock.Lock()
defer s.lock.Unlock()

fmt.Printf("Received: %s\n", output.GetID())
delete(s.unresolvedBlocks, output.GetID())
return nil
},
24 changes: 11 additions & 13 deletions snow/vm_test.go
Original file line number Diff line number Diff line change
@@ -912,19 +912,17 @@ func TestDynamicStateSyncTransition_PendingTree_VerifyBlockWithInvalidAncestor(t

invalidatedChildBlk2 := invalidatedChildBlock2.Verify(ctx)
ce.require.ErrorIs(invalidatedChildBlk2, errParentFailedVerification)
//
//// Reject all blocks
//for _, blk := range []*StatefulBlock[*TestBlock, *TestBlock, *TestBlock]{
// parsedBlk1, parsedBlk2,
//} {
// fmt.Printf("%s: ID\n", blk.ID())
// fmt.Printf("%s: ParentID\n", blk.Parent())
// blk.verified = true
// ce.require.NoError(blk.Reject(ctx))
//}
//
//_, err = ce.vm.HealthCheck(ctx)
//ce.require.NoError(err)

// Reject all blocks
for _, blk := range []*StatefulBlock[*TestBlock, *TestBlock, *TestBlock]{
parsedBlk1, parsedBlk2,
} {
blk.verified = true
ce.require.NoError(blk.Reject(ctx))
}

_, err = ce.vm.HealthCheck(ctx)
ce.require.NoError(err)
}

func TestDynamicStateSync_FinishOnAcceptedAncestor(t *testing.T) {