Skip to content

Commit

Permalink
Rename Step::NewRound to Step::Unstarted
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Dec 18, 2023
1 parent 1b40c10 commit 11961de
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Code/driver/src/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ where
round: Round,
) -> Option<RoundInput<Ctx>> {
match pending_step {
Step::NewRound => None, // Some(RoundInput::NewRound),
Step::Unstarted => None,

Step::Propose => None,

Expand Down
2 changes: 1 addition & 1 deletion Code/itf/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Step {
pub fn to_round_step(&self) -> Option<RoundStep> {
match self {
Step::None => None,
Step::NewRound => Some(RoundStep::NewRound),
Step::NewRound => Some(RoundStep::Unstarted),
Step::Propose => Some(RoundStep::Propose),
Step::Prevote => Some(RoundStep::Prevote),
Step::Precommit => Some(RoundStep::Precommit),
Expand Down
8 changes: 4 additions & 4 deletions Code/round/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ impl<Value> RoundValue<Value> {
/// The step of consensus in this round
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum Step {
/// The round has just started
NewRound,
/// The round has not started yet
Unstarted,

/// We are at the propose step.
/// Propose step.
/// Either we are the proposer or we are waiting for a proposal.
Propose,

Expand Down Expand Up @@ -74,7 +74,7 @@ where
Self {
height,
round,
step: Step::NewRound,
step: Step::Unstarted,
locked: None,
valid: None,
}
Expand Down
6 changes: 3 additions & 3 deletions Code/round/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ where
//

// L18
(Step::NewRound, Input::NewRound(round)) if info.is_proposer() => {
(Step::Unstarted, Input::NewRound(round)) if info.is_proposer() => {
// Update the round
state.round = round;

Expand All @@ -79,7 +79,7 @@ where
}

// L11/L20
(Step::NewRound, Input::NewRound(round)) => {
(Step::Unstarted, Input::NewRound(round)) => {
// Update the round
state.round = round;

Expand Down Expand Up @@ -426,7 +426,7 @@ pub fn round_skip<Ctx>(state: State<Ctx>, round: Round) -> Transition<Ctx>
where
Ctx: Context,
{
let new_state = state.with_round(round).with_step(Step::NewRound);
let new_state = state.with_round(round).with_step(Step::Unstarted);
Transition::to(new_state).with_output(Output::NewRound(round))
}

Expand Down
6 changes: 3 additions & 3 deletions Code/test/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ pub fn new_round(round: Round) -> State<TestContext> {
State {
height: Height::new(1),
round,
step: Step::NewRound,
step: Step::Unstarted,
valid: None,
locked: None,
}
Expand All @@ -339,7 +339,7 @@ pub fn new_round_with_proposal_and_valid(round: Round, proposal: Proposal) -> St
State {
height: Height::new(1),
round,
step: Step::NewRound,
step: Step::Unstarted,
valid: Some(RoundValue {
value: proposal.value,
round: Round::new(0),
Expand All @@ -355,7 +355,7 @@ pub fn new_round_with_proposal_and_locked_and_valid(
State {
height: Height::new(1),
round,
step: Step::NewRound,
step: Step::Unstarted,
valid: Some(RoundValue {
value: proposal.value,
round: Round::new(0),
Expand Down
6 changes: 3 additions & 3 deletions Code/test/tests/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ fn driver_steps_not_proposer_timeout_multiple_rounds() {
new_state: State {
height: Height::new(1),
round: Round::new(1),
step: Step::NewRound,
step: Step::Unstarted,
locked: None,
valid: None,
},
Expand Down Expand Up @@ -1105,7 +1105,7 @@ fn driver_steps_skip_round_skip_threshold() {
new_state: State {
height,
round: Round::new(1),
step: Step::NewRound,
step: Step::Unstarted,
locked: None,
valid: None,
},
Expand Down Expand Up @@ -1206,7 +1206,7 @@ fn driver_steps_skip_round_quorum_threshold() {
new_state: State {
height,
round: Round::new(1),
step: Step::NewRound,
step: Step::Unstarted,
locked: None,
valid: None,
},
Expand Down

0 comments on commit 11961de

Please sign in to comment.