Merge pull request #3456 from rlan35/main

make commit sig timeout longer, also return early for onCommit
pull/3455/head
Rongjian Lan 4 years ago committed by GitHub
commit 3c0b2880cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      consensus/consensus_v2.go
  2. 11
      consensus/leader.go
  3. 2
      internal/chain/reward.go

@ -32,10 +32,10 @@ var (
// timeout constant
const (
// CommitSigSenderTimeout is the timeout for sending the commit sig to finish block proposal
CommitSigSenderTimeout = 6 * time.Second
CommitSigSenderTimeout = 10 * time.Second
// CommitSigReceiverTimeout is the timeout for the receiving side of the commit sig
// if timeout, the receiver should instead ready directly from db for the commit sig
CommitSigReceiverTimeout = 4 * time.Second
CommitSigReceiverTimeout = 8 * time.Second
)
// IsViewChangingMode return true if curernt mode is viewchanging

@ -211,6 +211,17 @@ func (consensus *Consensus) onCommit(msg *msg_pb.Message) {
if !consensus.isRightBlockNumAndViewID(recvMsg) {
return
}
// proceed only when the message is not received before
for _, signer := range recvMsg.SenderPubkeys {
signed := consensus.Decider.ReadBallot(quorum.Commit, signer.Bytes)
if signed != nil {
consensus.getLogger().Debug().
Str("validatorPubKey", signer.Bytes.Hex()).
Msg("[OnCommit] Already Received commit message from the validator")
return
}
}
commitBitmap := consensus.commitBitmap
// has to be called before verifying signature

@ -31,7 +31,7 @@ import (
// timeout constant
const (
// AsyncBlockProposalTimeout is the timeout which will abort the async block proposal.
AsyncBlockProposalTimeout = 5 * time.Second
AsyncBlockProposalTimeout = 9 * time.Second
)
func ballotResultBeaconchain(

Loading…
Cancel
Save