-
Notifications
You must be signed in to change notification settings - Fork 5
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
IF: Add logger for vote related logging #28
Conversation
…call. Remove unused ulog.
…related logging to vote_logger.
// Called from net threads | ||
vote_status block_state::aggregate_vote(const vote_message& vote) { | ||
// Called from vote threads | ||
vote_status block_state::aggregate_vote(uint32_t connection_id, const vote_message& vote) { |
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.
connection_id
has nothing to do with voting, it is here only for logging. Not sure if it is appropriate to add it as a parameter to vote related functions. No other ways to log connection_id
?
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.
Or hide it inside vote_message?
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.
We can't put it in vote_message
. It is really nice to have it 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.
OK. Just add a comment in the function interface indicating connection_id is only for debugging.
// Called from net threads | ||
vote_status block_state::aggregate_vote(const vote_message& vote) { | ||
// Called from vote threads | ||
vote_status block_state::aggregate_vote(uint32_t connection_id, const vote_message& vote) { |
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.
I think it would be slightly better to pass std::optional<uint32_t>
so that the API would work even if the add_vote
didn't come from a net connection.
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.
Currently it uses 0
for that, but could go with optional
if you think it is cleaner.
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.
Totally up to you.
Note:start |
hotstuff
logger withvote
logger.vote
logger.shared_ptr
creation per callResolves #14