Add signature replay, fix single-node startup, change log statements#10
Open
tschuyebuhl wants to merge 3 commits intomasterfrom
Open
Add signature replay, fix single-node startup, change log statements#10tschuyebuhl wants to merge 3 commits intomasterfrom
tschuyebuhl wants to merge 3 commits intomasterfrom
Conversation
I decided to remove it for now and will add it back later
DavidVentura
reviewed
Mar 6, 2026
Contributor
DavidVentura
left a comment
There was a problem hiding this comment.
nice to see the raft events<>signer sm
| In other words, a proposal should only be signed if it’s at a higher height, or a higher round for the same height. Once a proposal or vote has been signed for a given height and round, a proposal should never be signed for the same height and round. | ||
| */ | ||
| fn should_sign_proposal(state: &ConsensusData, proposal: &Proposal) -> bool { | ||
| pub fn should_sign_proposal(state: &ConsensusData, proposal: &Proposal) -> bool { |
Contributor
There was a problem hiding this comment.
why pub, feels dangerous
| #[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, PartialEq)] | ||
| #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)] | ||
| #[serde(default)] | ||
| pub struct ConsensusData { |
Contributor
There was a problem hiding this comment.
derive default is pretty spicy, you can forget the round attr and the Default::default() will screw you
i'd say add from_hrs or impl From, From, ... and those fill in with empty vecs
| // TODO: don't connect if we are not the master; it will block the master from connecting | ||
| // and we need to close the connection on leadership loss | ||
| match rx.recv() { | ||
| Ok(RaftEvent::LeadershipChanged(from, to)) => { |
Contributor
There was a problem hiding this comment.
mmmmmmmm feels a little bit off, but i think it's fine.
i'll see if i can come up with an idea
| ..Default::default() | ||
| }; | ||
|
|
||
| let current_state = raft_node.signer_state.read().unwrap().clone(); |
Contributor
There was a problem hiding this comment.
this logic should be part of the type, or check module or should_sign, etc.
then it'll be easier to consider the cases in isolation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To simplify the leader loop, I removed the
localpersistence modeGist of the changes is:
LightReadyto advance the commit index. This is a quirk of the raft-rs lib, where in single-node mode, progress automatically updates quorum, and thecommitchanges after advance. This caused replays on Nebula restarts.