-
Notifications
You must be signed in to change notification settings - Fork 55
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
chore(halo/voter): improve errors and logs #2437
Conversation
return nil, errors.Wrap(err, "att root [BUG]") // Should error in Verify | ||
} | ||
if duplicate[attRoot] { | ||
log.Warn(ctx, "Rejecting duplicate identical vote", nil) |
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.
when the same sig is included, it isn't a double sign
} | ||
if duplicate[attRoot] { | ||
log.Warn(ctx, "Rejecting duplicate identical vote", nil) | ||
return respReject, nil |
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.
Since we're returning with an error on duplicate votes and double signing, is it somehow possible to cause a dos by re-submitting valid votes of honest validators or by a perpetual double-signing by a malicious validator? Potentially the votes deduplicated somewhere in the stack before the voter can get them, but I wonder why just logging a warning and skipping is not 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.
This is during VerifyVoteExtension
when verifying other validator's votes. Not sure where else this could be done?
doubleSignCounter.WithLabelValues(ethAddr.Hex()).Inc() | ||
log.Warn(ctx, "Rejecting duplicate slashable vote", err) | ||
|
||
return respReject, nil | ||
} | ||
duplicate[vote.AttestHeader.ToXChain()] = true | ||
doubleSign[vote.AttestHeader.ToXChain()] = true |
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.
Nit: the name is potentially misleading as presence in the map does not imply a double-signing yet. It is used to detected the double signing... Same with duplicate
actually.
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.
mmm, I don't find it so confusing, just read the code...?
Add temporary logs to voter to debug duplicate vote issue.
issue: #2286