Skip to content
10 changes: 5 additions & 5 deletions consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,9 @@ func (p *Pbft) runAcceptState(ctx context.Context) { // start new round

// send the preprepare message
p.sendPreprepareMsg()
p.sendPrepareMsg()

if !p.state.IsLocked() {
// send the prepare message since we are ready to move the state
p.sendPrepareMsg()
} else {
if p.state.IsLocked() {
// proposer node is already locked to the same proposal => fast-track and send commit message straight away
p.sendCommitMsg()
}
Expand Down Expand Up @@ -400,7 +398,8 @@ func (p *Pbft) runAcceptState(ctx context.Context) { // start new round
if p.state.IsLocked() {
// the state is locked, we need to receive the same proposal
if p.state.proposal.Equal(proposal) {
// fast-track (send a commit message) and wait for validations
// fast-track (send prepare and commit message) and wait for validations
p.sendPrepareMsg()
p.sendCommitMsg()
p.setState(ValidateState)
} else {
Expand All @@ -411,6 +410,7 @@ func (p *Pbft) runAcceptState(ctx context.Context) { // start new round
p.logger.Printf("[%s] Relocking to a propsal: %v", p.validator.NodeID(), proposal.Data)
p.state.proposal = proposal
p.state.lock(msg.View.Round)
p.sendPrepareMsg()
p.sendCommitMsg()
p.setState(ValidateState)
} else {
Expand Down
4 changes: 2 additions & 2 deletions consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestTransition_AcceptState_Proposer_Locked(t *testing.T) {
sequence: 1,
state: ValidateState,
locked: true,
outgoing: 2, // preprepare and prepare
outgoing: 3, // preprepare, prepare and commit
})
assert.Equal(t, i.state.proposal.Data, mockProposal)
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestTransition_AcceptState_Validator_LockCorrect(t *testing.T) {
sequence: 1,
state: ValidateState,
locked: true,
outgoing: 1, // prepare message
outgoing: 2, // prepare message
})
}

Expand Down
4 changes: 2 additions & 2 deletions e2e/e2e_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ func TestE2E_Network_Stuck_Locked_Node_Dropped(t *testing.T) {
t.Logf("Node %v, running: %v, isProposalLocked: %v, no proposal set\n", n.name, n.IsRunning(), n.pbft.IsLocked())
}
}
// TODO: Temporary assertion until liveness issue is fixed
assert.Error(t, err)

assert.NoError(t, err)
}

func TestE2E_Partition_OneMajority(t *testing.T) {
Expand Down