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

network: new default gossip fanout setting for relays #5005

Merged
merged 3 commits into from
Jan 23, 2023
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
10 changes: 10 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ const ParticipationRegistryFilename = "partregistry.sqlite"
// built-in supported consensus protocols.
const ConfigurableConsensusProtocolsFilename = "consensus.json"

// The default gossip fanout setting when configured as a relay (here, as we
// do not expose in normal config so it is not in code generated local_defaults.go
const defaultRelayGossipFanout = 8

// LoadConfigFromDisk returns a Local config structure based on merging the defaults
// with settings loaded from the config file from the custom dir. If the custom file
// cannot be loaded, the default config is returned (with the error from loading the
Expand Down Expand Up @@ -124,6 +128,12 @@ func mergeConfigFromFile(configpath string, source Local) (Local, error) {
source.Archival = true
source.EnableLedgerService = true
source.EnableBlockService = true

// If gossip fanout has not been explicitly overridden, use defaultRelayGossipFanout
// rather then the default gossip fanout setting from defaultLocal
if source.GossipFanout == defaultLocal.GossipFanout {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this prevent relays from explicitly overriding this fanout change back the current local default value of 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though they could set 3 or 5.

source.GossipFanout = defaultRelayGossipFanout
}
}

return source, err
Expand Down
6 changes: 3 additions & 3 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,13 @@ type Local struct {
MaxAPIResourcesPerAccount uint64 `version[21]:"100000"`

// AgreementIncomingVotesQueueLength sets the size of the buffer holding incoming votes.
AgreementIncomingVotesQueueLength uint64 `version[21]:"10000"`
AgreementIncomingVotesQueueLength uint64 `version[21]:"10000" version[27]:"20000"`

// AgreementIncomingProposalsQueueLength sets the size of the buffer holding incoming proposals.
AgreementIncomingProposalsQueueLength uint64 `version[21]:"25"`
AgreementIncomingProposalsQueueLength uint64 `version[21]:"25" version[27]:"50"`

// AgreementIncomingBundlesQueueLength sets the size of the buffer holding incoming bundles.
AgreementIncomingBundlesQueueLength uint64 `version[21]:"7"`
AgreementIncomingBundlesQueueLength uint64 `version[21]:"7" version[27]:"15"`

// MaxAcctLookback sets the maximum lookback range for account states,
// i.e. the ledger can answer account states questions for the range Latest-MaxAcctLookback...Latest
Expand Down
6 changes: 3 additions & 3 deletions config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var defaultLocal = Local{
Version: 27,
AccountUpdatesStatsInterval: 5000000000,
AccountsRebuildSynchronousMode: 1,
AgreementIncomingBundlesQueueLength: 7,
AgreementIncomingProposalsQueueLength: 25,
AgreementIncomingVotesQueueLength: 10000,
AgreementIncomingBundlesQueueLength: 15,
AgreementIncomingProposalsQueueLength: 50,
AgreementIncomingVotesQueueLength: 20000,
AnnounceParticipationKey: true,
Archival: false,
BaseLoggerDebugLevel: 4,
Expand Down
6 changes: 3 additions & 3 deletions installer/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"Version": 27,
"AccountUpdatesStatsInterval": 5000000000,
"AccountsRebuildSynchronousMode": 1,
"AgreementIncomingBundlesQueueLength": 7,
"AgreementIncomingProposalsQueueLength": 25,
"AgreementIncomingVotesQueueLength": 10000,
"AgreementIncomingBundlesQueueLength": 15,
"AgreementIncomingProposalsQueueLength": 50,
"AgreementIncomingVotesQueueLength": 20000,
"AnnounceParticipationKey": true,
"Archival": false,
"BaseLoggerDebugLevel": 4,
Expand Down
14 changes: 7 additions & 7 deletions test/testdata/configs/config-v27.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"Version": 27,
"AccountUpdatesStatsInterval": 5000000000,
"AccountsRebuildSynchronousMode": 1,
"AgreementIncomingBundlesQueueLength": 7,
"AgreementIncomingProposalsQueueLength": 25,
"AgreementIncomingVotesQueueLength": 10000,
"AgreementIncomingBundlesQueueLength": 15,
"AgreementIncomingProposalsQueueLength": 50,
"AgreementIncomingVotesQueueLength": 20000,
"AnnounceParticipationKey": true,
"Archival": false,
"BaseLoggerDebugLevel": 4,
Expand Down Expand Up @@ -51,7 +51,6 @@
"EnableRuntimeMetrics": false,
"EnableTopAccountsReporting": false,
"EnableTxBacklogRateLimiting": false,
"TxBacklogSize": 26000,
"EnableUsageLog": false,
"EnableVerbosedTransactionSyncLogging": false,
"EndpointAddress": "127.0.0.1:0",
Expand All @@ -68,9 +67,9 @@
"LogArchiveMaxAge": "",
"LogArchiveName": "node.archive.log",
"LogSizeLimit": 1073741824,
"MaxAcctLookback": 4,
"MaxAPIBoxPerApplication": 100000,
"MaxAPIResourcesPerAccount": 100000,
"MaxAcctLookback": 4,
"MaxCatchpointDownloadDuration": 7200000000000,
"MaxConnectionsPerIP": 30,
"MinCatchpointFileDownloadBytesPerSecond": 20480,
Expand All @@ -97,13 +96,14 @@
"RunHosted": false,
"SuggestedFeeBlockHistory": 3,
"SuggestedFeeSlidingWindowSize": 50,
"TelemetryToLog": true,
"TLSCertFile": "",
"TLSKeyFile": "",
"TelemetryToLog": true,
"TransactionSyncDataExchangeRate": 0,
"TransactionSyncSignificantMessageThreshold": 0,
"TxBacklogServiceRateWindowSeconds": 10,
"TxBacklogReservedCapacityPerPeer": 20,
"TxBacklogServiceRateWindowSeconds": 10,
"TxBacklogSize": 26000,
"TxIncomingFilteringFlags": 1,
"TxPoolExponentialIncreaseFactor": 2,
"TxPoolSize": 75000,
Expand Down