-
Notifications
You must be signed in to change notification settings - Fork 38
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
Setup basics of vetomint #44
Conversation
} = event | ||
{ | ||
if state.round != round { | ||
return None; |
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.
Why it returns None?
if we got BlockProposalCreated event with wrong round,
it represents a) we got wrong proposal, or b) we were in wrong round.
in case of a), None would suit for it, but I wonder case b).
is b) solved by other mod?
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.
If the node is in a wrong round, the only way of getting out of it is just providing valid prevotes and precommits for the missing rounds. There is nothing to do in this case, anyway.
} => { | ||
let total_voting_power = height_info.validators.iter().sum::<VotingPower>(); | ||
if round != state.round { | ||
return None; |
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.
ditto!
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.
LGTM!
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.
LGTM otherwise
vetomint/src/lib.rs
Outdated
prevotes_total: VotingPower, | ||
prevotes_favor: BTreeMap<BlockIdentifier, VotingPower>, | ||
/// If on-5f-prevotes has ever been triggered? | ||
triggered_5f_prevote: bool, |
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.
Why do we need this?
if 5f prevote is triggered, the consensus step is changed to Precommit, so it will not be retriggered.
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.
Then why do we have for the first time
in the pseudo code? It is conditioned by while step = prevote
anyway.
1. It involves some interface changes. 2. The reason that the state machine keeps the event queue is for handling asynchronous `getValue()`. 3. Still many logics are unimplemented
handling asynchronous
getValue()
.