Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase gossip size on first push #502

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/VictoriaMetrics/fastcache v1.10.0
github.com/ava-labs/avalanchego v1.11.2-rc.7
github.com/ava-labs/avalanchego v1.11.2-rc.8
github.com/cespare/cp v0.1.0
github.com/davecgh/go-spew v1.1.1
github.com/deckarep/golang-set/v2 v2.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.11.2-rc.7 h1:aWDqgIROlJiAn9PSbDzOdD+aQzAwoe7WTLvI4fv/XO4=
github.com/ava-labs/avalanchego v1.11.2-rc.7/go.mod h1:JG6hs5+gEDm+0YnMu94mh4YhiQGKW0xhR9WkrkKJi8I=
github.com/ava-labs/avalanchego v1.11.2-rc.8 h1:fq67PkmuuUgQ3hrOgJc2jWXs9ufXEooXd3pd/Qr7Cpw=
github.com/ava-labs/avalanchego v1.11.2-rc.8/go.mod h1:oWC8sKlrThmV6fmwLo4clJV9kENVqfCjQIcxQ5L+S0E=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down
22 changes: 14 additions & 8 deletions plugin/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ const (
defaultMaxBlocksPerRequest = 0 // Default to no maximum on the number of blocks per getLogs request
defaultContinuousProfilerFrequency = 15 * time.Minute
defaultContinuousProfilerMaxFiles = 5
defaultPushGossipNumValidators = 10
defaultPushGossipNumValidators = 100
defaultPushGossipNumPeers = 0
defaultPushRegossipNumValidators = 10
defaultPushRegossipNumPeers = 0
defaultPushGossipFrequency = 100 * time.Millisecond
defaultPullGossipFrequency = 1 * time.Second
defaultTxRegossipFrequency = 10 * time.Second
defaultTxRegossipFrequency = 30 * time.Second
defaultOfflinePruningBloomFilterSize uint64 = 512 // Default size (MB) for the offline pruner to use
defaultLogLevel = "info"
defaultLogJSONFormat = false
Expand Down Expand Up @@ -152,12 +154,14 @@ type Config struct {
KeystoreInsecureUnlockAllowed bool `json:"keystore-insecure-unlock-allowed"`

// Gossip Settings
PushGossipNumValidators int `json:"push-gossip-num-validators"`
PushGossipNumPeers int `json:"push-gossip-num-peers"`
PushGossipFrequency Duration `json:"push-gossip-frequency"`
PullGossipFrequency Duration `json:"pull-gossip-frequency"`
RegossipFrequency Duration `json:"regossip-frequency"`
TxRegossipFrequency Duration `json:"tx-regossip-frequency"` // Deprecated: use RegossipFrequency instead
PushGossipNumValidators int `json:"push-gossip-num-validators"`
PushGossipNumPeers int `json:"push-gossip-num-peers"`
PushRegossipNumValidators int `json:"push-regossip-num-validators"`
PushRegossipNumPeers int `json:"push-regossip-num-peers"`
PushGossipFrequency Duration `json:"push-gossip-frequency"`
PullGossipFrequency Duration `json:"pull-gossip-frequency"`
RegossipFrequency Duration `json:"regossip-frequency"`
TxRegossipFrequency Duration `json:"tx-regossip-frequency"` // Deprecated: use RegossipFrequency instead

// Log
LogLevel string `json:"log-level"`
Expand Down Expand Up @@ -255,6 +259,8 @@ func (c *Config) SetDefaults() {
c.RegossipFrequency.Duration = defaultTxRegossipFrequency
c.PushGossipNumValidators = defaultPushGossipNumValidators
c.PushGossipNumPeers = defaultPushGossipNumPeers
c.PushRegossipNumValidators = defaultPushRegossipNumValidators
c.PushRegossipNumPeers = defaultPushRegossipNumPeers
c.PushGossipFrequency.Duration = defaultPushGossipFrequency
c.PullGossipFrequency.Duration = defaultPullGossipFrequency
c.OfflinePruningBloomFilterSize = defaultOfflinePruningBloomFilterSize
Expand Down
20 changes: 13 additions & 7 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const (
atomicTxGossipProtocol = 0x1

// gossip constants
pushGossipNumNonValidators = 0
pushGossipDiscardedElements = 16_384
txGossipBloomMinTargetElements = 8 * 1024
txGossipBloomTargetFalsePositiveRate = 0.01
Expand Down Expand Up @@ -1098,16 +1097,24 @@ func (vm *VM) initBlockBuilding() error {
return fmt.Errorf("failed to initialize atomic tx gossip metrics: %w", err)
}

pushGossipParams := gossip.BranchingFactor{
Validators: vm.config.PushGossipNumValidators,
Peers: vm.config.PushGossipNumPeers,
}
pushRegossipParams := gossip.BranchingFactor{
Validators: vm.config.PushRegossipNumValidators,
Peers: vm.config.PushRegossipNumPeers,
}

ethTxPushGossiper := vm.ethTxPushGossiper.Get()
if ethTxPushGossiper == nil {
ethTxPushGossiper, err = gossip.NewPushGossiper[*GossipEthTx](
ethTxGossipMarshaller,
ethTxPool,
ethTxGossipClient,
ethTxGossipMetrics,
vm.config.PushGossipNumValidators,
pushGossipNumNonValidators,
vm.config.PushGossipNumPeers,
pushGossipParams,
pushRegossipParams,
pushGossipDiscardedElements,
txGossipTargetMessageSize,
vm.config.RegossipFrequency.Duration,
Expand All @@ -1124,9 +1131,8 @@ func (vm *VM) initBlockBuilding() error {
vm.mempool,
atomicTxGossipClient,
atomicTxGossipMetrics,
vm.config.PushGossipNumValidators,
pushGossipNumNonValidators,
vm.config.PushGossipNumPeers,
pushGossipParams,
pushRegossipParams,
pushGossipDiscardedElements,
txGossipTargetMessageSize,
vm.config.RegossipFrequency.Duration,
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
set -euo pipefail

# Don't export them as they're used in the context of other calls
avalanche_version=${AVALANCHE_VERSION:-'v1.11.2-rc.7'}
avalanche_version=${AVALANCHE_VERSION:-'v1.11.2-rc.8'}
Loading