Skip to content

Commit

Permalink
remove non-validator option
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Feb 29, 2024
1 parent 097aa5c commit 8c3201b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 40 deletions.
1 change: 0 additions & 1 deletion vms/avm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func TestParseConfig(t *testing.T) {
MaxValidatorSetStaleness: time.Nanosecond,
TargetGossipSize: network.DefaultConfig.TargetGossipSize,
PushGossipNumValidators: network.DefaultConfig.PushGossipNumValidators,
PushGossipNumNonValidators: network.DefaultConfig.PushGossipNumNonValidators,
PushGossipNumPeers: network.DefaultConfig.PushGossipNumPeers,
PushGossipDiscardedCacheSize: network.DefaultConfig.PushGossipDiscardedCacheSize,
PushGossipMaxRegossipFrequency: network.DefaultConfig.PushGossipMaxRegossipFrequency,
Expand Down
4 changes: 0 additions & 4 deletions vms/avm/network/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var DefaultConfig = Config{
MaxValidatorSetStaleness: time.Minute,
TargetGossipSize: 20 * units.KiB,
PushGossipNumValidators: 10,
PushGossipNumNonValidators: 0,
PushGossipNumPeers: 0,
PushGossipDiscardedCacheSize: 1024,
PushGossipMaxRegossipFrequency: 10 * time.Second,
Expand All @@ -38,9 +37,6 @@ type Config struct {
// PushGossipNumValidators is the number of validators to push transactions
// to per round of gossip.
PushGossipNumValidators int `json:"push-gossip-num-validators"`
// PushGossipNumNonValidators is the number of non-validators to push
// transactions to per round of gossip.
PushGossipNumNonValidators int `json:"push-gossip-num-non-validators"`
// PushGossipNumPeers is the number of peers to push transactions to per
// round of gossip.
PushGossipNumPeers int `json:"push-gossip-num-peers"`
Expand Down
7 changes: 5 additions & 2 deletions vms/avm/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import (
"github.com/ava-labs/avalanchego/vms/components/message"
)

const txGossipHandlerID = 0
const (
txGossipHandlerID = 0
pushGossipNumNonValidators = 0
)

var (
_ common.AppHandler = (*Network)(nil)
Expand Down Expand Up @@ -95,7 +98,7 @@ func New(
txGossipClient,
txGossipMetrics,
config.PushGossipNumValidators,
config.PushGossipNumNonValidators,
pushGossipNumNonValidators,
config.PushGossipNumPeers,
config.PushGossipDiscardedCacheSize,
config.TargetGossipSize,
Expand Down
1 change: 0 additions & 1 deletion vms/avm/network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var (
MaxValidatorSetStaleness: time.Second,
TargetGossipSize: 1,
PushGossipNumValidators: 1,
PushGossipNumNonValidators: 0,
PushGossipNumPeers: 0,
PushGossipDiscardedCacheSize: 1,
PushGossipMaxRegossipFrequency: time.Second,
Expand Down
47 changes: 22 additions & 25 deletions vms/platformvm/config/execution_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ func TestExecutionConfigUnmarshal(t *testing.T) {
"max-validator-set-staleness": 1,
"target-gossip-size": 2,
"push-gossip-num-validators": 3,
"push-gossip-num-non-validators": 4,
"push-gossip-num-peers": 5,
"push-gossip-discarded-cache-size": 6,
"push-gossip-max-regossip-frequency": 7,
"push-gossip-frequency": 8,
"pull-gossip-poll-size": 9,
"pull-gossip-frequency": 10,
"pull-gossip-throttling-period": 11,
"pull-gossip-throttling-limit": 12,
"expected-bloom-filter-elements": 13,
"expected-bloom-filter-false-positive-probability": 14,
"max-bloom-filter-false-positive-probability": 15
"push-gossip-num-peers": 4,
"push-gossip-discarded-cache-size": 5,
"push-gossip-max-regossip-frequency": 6,
"push-gossip-frequency": 7,
"pull-gossip-poll-size": 8,
"pull-gossip-frequency": 9,
"pull-gossip-throttling-period": 10,
"pull-gossip-throttling-limit": 11,
"expected-bloom-filter-elements": 12,
"expected-bloom-filter-false-positive-probability": 13,
"max-bloom-filter-false-positive-probability": 14
},
"block-cache-size": 1,
"tx-cache-size": 2,
Expand All @@ -77,18 +76,17 @@ func TestExecutionConfigUnmarshal(t *testing.T) {
MaxValidatorSetStaleness: 1,
TargetGossipSize: 2,
PushGossipNumValidators: 3,
PushGossipNumNonValidators: 4,
PushGossipNumPeers: 5,
PushGossipDiscardedCacheSize: 6,
PushGossipMaxRegossipFrequency: 7,
PushGossipFrequency: 8,
PullGossipPollSize: 9,
PullGossipFrequency: 10,
PullGossipThrottlingPeriod: 11,
PullGossipThrottlingLimit: 12,
ExpectedBloomFilterElements: 13,
ExpectedBloomFilterFalsePositiveProbability: 14,
MaxBloomFilterFalsePositiveProbability: 15,
PushGossipNumPeers: 4,
PushGossipDiscardedCacheSize: 5,
PushGossipMaxRegossipFrequency: 6,
PushGossipFrequency: 7,
PullGossipPollSize: 8,
PullGossipFrequency: 9,
PullGossipThrottlingPeriod: 10,
PullGossipThrottlingLimit: 11,
ExpectedBloomFilterElements: 12,
ExpectedBloomFilterFalsePositiveProbability: 13,
MaxBloomFilterFalsePositiveProbability: 14,
},
BlockCacheSize: 1,
TxCacheSize: 2,
Expand Down Expand Up @@ -133,7 +131,6 @@ func TestExecutionConfigUnmarshal(t *testing.T) {
MaxValidatorSetStaleness: 1,
TargetGossipSize: 2,
PushGossipNumValidators: DefaultExecutionConfig.Network.PushGossipNumValidators,
PushGossipNumNonValidators: DefaultExecutionConfig.Network.PushGossipNumNonValidators,
PushGossipNumPeers: DefaultExecutionConfig.Network.PushGossipNumPeers,
PushGossipDiscardedCacheSize: DefaultExecutionConfig.Network.PushGossipDiscardedCacheSize,
PushGossipMaxRegossipFrequency: DefaultExecutionConfig.Network.PushGossipMaxRegossipFrequency,
Expand Down
4 changes: 0 additions & 4 deletions vms/platformvm/network/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var DefaultConfig = Config{
MaxValidatorSetStaleness: time.Minute,
TargetGossipSize: 20 * units.KiB,
PushGossipNumValidators: 10,
PushGossipNumNonValidators: 0,
PushGossipNumPeers: 0,
PushGossipDiscardedCacheSize: 1024,
PushGossipMaxRegossipFrequency: 10 * time.Second,
Expand All @@ -38,9 +37,6 @@ type Config struct {
// PushGossipNumValidators is the number of validators to push transactions
// to per round of gossip.
PushGossipNumValidators int `json:"push-gossip-num-validators"`
// PushGossipNumNonValidators is the number of non-validators to push
// transactions to per round of gossip.
PushGossipNumNonValidators int `json:"push-gossip-num-non-validators"`
// PushGossipNumPeers is the number of peers to push transactions to per
// round of gossip.
PushGossipNumPeers int `json:"push-gossip-num-peers"`
Expand Down
7 changes: 5 additions & 2 deletions vms/platformvm/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import (
"github.com/ava-labs/avalanchego/vms/platformvm/txs/mempool"
)

const TxGossipHandlerID = 0
const (
TxGossipHandlerID = 0
pushGossipNumNonValidators = 0
)

var errMempoolDisabledWithPartialSync = errors.New("mempool is disabled partial syncing")

Expand Down Expand Up @@ -94,7 +97,7 @@ func New(
txGossipClient,
txGossipMetrics,
config.PushGossipNumValidators,
config.PushGossipNumNonValidators,
pushGossipNumNonValidators,
config.PushGossipNumPeers,
config.PushGossipDiscardedCacheSize,
config.TargetGossipSize,
Expand Down
1 change: 0 additions & 1 deletion vms/platformvm/network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var (
MaxValidatorSetStaleness: time.Second,
TargetGossipSize: 1,
PushGossipNumValidators: 1,
PushGossipNumNonValidators: 0,
PushGossipNumPeers: 0,
PushGossipDiscardedCacheSize: 1,
PushGossipMaxRegossipFrequency: time.Second,
Expand Down

0 comments on commit 8c3201b

Please sign in to comment.