Skip to content

Conversation

samliok
Copy link
Collaborator

@samliok samliok commented Aug 28, 2025

I could add this for notarizations, but it seems like we are not planning on re-requesting notarizations?

This solves #187

@samliok samliok linked an issue Aug 28, 2025 that may be closed by this pull request
@yacovm
Copy link
Collaborator

yacovm commented Aug 28, 2025

I could add this for notarizations, but it seems like we are not planning on re-requesting notarizations?

This solves #187

I don't think we have this problem for notarizations, because we first filter out the notarizations that are bad, don't we?

epoch.go Outdated
@@ -1767,6 +1769,7 @@ func (e *Epoch) createFinalizedBlockVerificationTask(block Block, finalization F
e.Logger.Error("Failed to index finalization", zap.Error(err))
return md.Digest
}
e.Logger.Info("Finalized block", zap.Uint64("round", md.Round), zap.Uint64("seq", md.Seq))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this used for debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, removing

epoch.go Outdated
@@ -1747,6 +1748,9 @@ func (e *Epoch) createFinalizedBlockVerificationTask(block Block, finalization F
verifiedBlock, err := block.Verify(context.Background())
if err != nil {
e.Logger.Debug("Failed verifying block", zap.Error(err))
// if we fail to verify the block, we re-add to request timeout
index := rand.Int() % len(finalization.QC.Signers())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this rand is fairly deterministic in tests, and also not random in production.

Can we just read 2 random bytes from crypto random and reduce it modulo the node count? It'll be close enough to random, while not uniform, but good enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -562,3 +566,94 @@ func TestReplicationMalformedQuorumRound(t *testing.T) {
laggingNode.e.AdvanceTime(laggingNode.e.StartTime.Add(simplex.DefaultReplicationRequestTimeout * 2))
laggingNode.storage.waitForBlockCommit(startSeq)
}

func TestReplicationResendsFinalizedBlocksThatFailedVerification(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test LGTM

@samliok samliok force-pushed the resend-failed-verify branch from b3da6fe to 09149a8 Compare September 3, 2025 14:53
@yacovm yacovm merged commit 3712a59 into main Sep 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-add ReplicationTask if verification fails
2 participants