-
Notifications
You must be signed in to change notification settings - Fork 1
Resend replication requests for finalized blocks that fail to verify #224
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
Conversation
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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test LGTM
b3da6fe
to
09149a8
Compare
I could add this for notarizations, but it seems like we are not planning on re-requesting notarizations?
This solves #187