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

chore(halo/voter): improve errors and logs #2437

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Conversation

corverroos
Copy link
Collaborator

Add temporary logs to voter to debug duplicate vote issue.

issue: #2286

return nil, errors.Wrap(err, "att root [BUG]") // Should error in Verify
}
if duplicate[attRoot] {
log.Warn(ctx, "Rejecting duplicate identical vote", nil)
Copy link
Collaborator Author

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
Copy link
Contributor

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?

Copy link
Collaborator Author

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
Copy link
Contributor

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.

Copy link
Collaborator Author

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...?

@corverroos corverroos merged commit 9d4f7ae into main Nov 11, 2024
19 checks passed
@corverroos corverroos deleted the corver/votelogs branch November 11, 2024 13:55
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.

2 participants