Merge branch 'master' into wb/statesync-init-deadlock

This commit is contained in:
mergify[bot]
2021-09-30 18:29:20 +00:00
committed by GitHub
3 changed files with 17 additions and 8 deletions
+4 -4
View File
@@ -164,10 +164,10 @@ laddr = "{{ .PrivValidator.ListenAddr }}"
client-certificate-file = "{{ js .PrivValidator.ClientCertificate }}"
# Client key generated while creating certificates for secure connection
validator-client-key-file = "{{ js .PrivValidator.ClientKey }}"
client-key-file = "{{ js .PrivValidator.ClientKey }}"
# Path to the Root Certificate Authority used to sign both client and server certificates
certificate-authority = "{{ js .PrivValidator.RootCA }}"
root-ca-file = "{{ js .PrivValidator.RootCA }}"
#######################################################################
@@ -447,8 +447,8 @@ rpc-servers = "{{ StringsJoin .StateSync.RPCServers "," }}"
trust-height = {{ .StateSync.TrustHeight }}
trust-hash = "{{ .StateSync.TrustHash }}"
# The trust period should be set so that Tendermint can detect and gossip misbehavior before
# it is considered expired. For chains based on the Cosmos SDK, one day less than the unbonding
# The trust period should be set so that Tendermint can detect and gossip misbehavior before
# it is considered expired. For chains based on the Cosmos SDK, one day less than the unbonding
# period should suffice.
trust-period = "{{ .StateSync.TrustPeriod }}"
+7 -3
View File
@@ -169,6 +169,8 @@ func (r *Reactor) OnStart() error {
if err := r.pool.Start(); err != nil {
return err
}
r.poolWG.Add(1)
go r.requestRoutine()
r.poolWG.Add(1)
go r.poolRoutine(false)
@@ -384,6 +386,9 @@ func (r *Reactor) SwitchToBlockSync(state sm.State) error {
r.syncStartTime = time.Now()
r.poolWG.Add(1)
go r.requestRoutine()
r.poolWG.Add(1)
go r.poolRoutine(true)
@@ -394,7 +399,6 @@ func (r *Reactor) requestRoutine() {
statusUpdateTicker := time.NewTicker(statusUpdateIntervalSeconds * time.Second)
defer statusUpdateTicker.Stop()
r.poolWG.Add(1)
defer r.poolWG.Done()
for {
@@ -455,8 +459,6 @@ func (r *Reactor) poolRoutine(stateSynced bool) {
defer trySyncTicker.Stop()
defer switchToConsensusTicker.Stop()
go r.requestRoutine()
defer r.poolWG.Done()
FOR_LOOP:
@@ -605,6 +607,8 @@ FOR_LOOP:
case <-r.closeCh:
break FOR_LOOP
case <-r.pool.Quit():
break FOR_LOOP
}
}
}
+6 -1
View File
@@ -751,13 +751,18 @@ func (chDesc ChannelDescriptor) FillDefaults() (filled ChannelDescriptor) {
// TODO: lowercase.
// NOTE: not goroutine-safe.
type Channel struct {
// Exponential moving average.
// This field must be accessed atomically.
// It is first in the struct to ensure correct alignment.
// See https://github.com/tendermint/tendermint/issues/7000.
recentlySent int64
conn *MConnection
desc ChannelDescriptor
sendQueue chan []byte
sendQueueSize int32 // atomic.
recving []byte
sending []byte
recentlySent int64 // exponential moving average
maxPacketMsgPayloadSize int