Skip to content

Commit

Permalink
chore: update the default per peer bandwidth limits
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Aug 30, 2023
1 parent 97fc207 commit ca70f30
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/default_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ import (
coretypes "github.com/tendermint/tendermint/types"
)

const (
// oneGigabit 1Gbit == 1 billion bits
oneGigabit = 1_000_000_000
// defaultBandwidth is the symetric bandwidth a node is assumed to have in
// bytes (not bits!)
defaultBandwidth = oneGigabit / 8
)

// bankModule defines a custom wrapper around the x/bank module's AppModuleBasic
// implementation to provide custom default genesis state.
type bankModule struct {
Expand Down Expand Up @@ -175,6 +183,9 @@ func DefaultConsensusConfig() *tmcfg.Config {
cfg.Consensus.TimeoutCommit = appconsts.TimeoutCommit
cfg.Consensus.SkipTimeoutCommit = false
cfg.TxIndex.Indexer = "null"

cfg.P2P.SendRate = int64(defaultBandwidth / cfg.P2P.MaxNumInboundPeers)
cfg.P2P.RecvRate = int64(defaultBandwidth / cfg.P2P.MaxNumInboundPeers)
return cfg
}

Expand Down

0 comments on commit ca70f30

Please sign in to comment.