Skip to content

Commit

Permalink
Merge branch 'main' into fix/send-decide-vote
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad authored Dec 15, 2024
2 parents 0065cf8 + b56802d commit 6402581
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/releasers/releaser_gui_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ cp -p \
"libxml2-2.dll" \
"libzstd.dll" \
"zlib1.dll" \
"libsharpyuv-0.dll" \
"${GUI_DIR}"


Expand Down
21 changes: 7 additions & 14 deletions consensus/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,26 +313,19 @@ func (cp *changeProposer) checkJust(vte *vote.Vote) error {
func (cp *changeProposer) cpStrongTermination() {
cpDecided := cp.log.CPDecidedVoteSet(cp.round)
if cpDecided.HasAnyVoteFor(cp.cpRound, vote.CPValueNo) {
cp.cpDecide(cp.round, vote.CPValueNo)
} else if cpDecided.HasAnyVoteFor(cp.cpRound, vote.CPValueYes) {
cp.cpDecide(cp.round, vote.CPValueYes)
}
}

func (cp *changeProposer) cpDecide(round int16, cpValue vote.CPValue) {
if cpValue == vote.CPValueYes {
cp.round = round + 1
cp.cpDecided = 1
cp.enterNewState(cp.proposeState)
} else if cpValue == vote.CPValueNo {
cp.round = round
cp.cpDecided = 0

roundProposal := cp.log.RoundProposal(cp.round)
if roundProposal == nil {
cp.queryProposal()
}

cp.enterNewState(cp.prepareState)
} else if cpDecided.HasAnyVoteFor(cp.cpRound, vote.CPValueYes) {
cp.round++
cp.cpDecided = 1
cp.enterNewState(cp.proposeState)

// Check if there is any decided vote for the next round.
cp.cpStrongTermination()
}
}
2 changes: 0 additions & 2 deletions consensus/cp_decide.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func (s *cpDecideState) decide() {
QCert: cert,
}
s.signAddCPDecidedVote(hash.UndefHash, s.cpRound, vote.CPValueYes, just)
s.cpDecide(s.round, vote.CPValueYes)
} else if cpMainVotes.HasQuorumVotesFor(s.cpRound, vote.CPValueNo) {
// decided for no and proceeds to the next round
s.logger.Info("binary agreement decided", "value", 0, "round", s.cpRound)
Expand All @@ -37,7 +36,6 @@ func (s *cpDecideState) decide() {
QCert: cert,
}
s.signAddCPDecidedVote(*s.cpWeakValidity, s.cpRound, vote.CPValueNo, just)
s.cpDecide(s.round, vote.CPValueNo)
} else {
// conflicting votes
s.logger.Debug("conflicting main votes", "round", s.cpRound)
Expand Down
3 changes: 1 addition & 2 deletions network/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ func newGossipService(ctx context.Context, host lp2phost.Host, conf *Config,
lp2pps.WithMessageSignaturePolicy(lp2pps.StrictNoSign),
lp2pps.WithNoAuthor(),
lp2pps.WithMessageIdFn(MessageIDFunc),
lp2pps.WithPeerOutboundQueueSize(600),
}

if conf.IsBootstrapper {
// enable Peer eXchange on bootstrappers
// enable Peer exchange on bootstrappers
opts = append(opts, lp2pps.WithPeerExchange(true))
}

Expand Down

0 comments on commit 6402581

Please sign in to comment.