From 070b13efbd5322c4a3a4a914144ac44ba87b4a55 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Feb 2023 22:03:42 -0800 Subject: [PATCH] added config.toml example values to different config setups, added TxArrivalWaitRaw string for toml and hcl value inputs --- docs/cli/example_config.toml | 13 +++++++------ internal/cli/dumpconfig.go | 1 + internal/cli/server/config.go | 4 +++- packaging/templates/mainnet-v1/archive/config.toml | 1 + .../mainnet-v1/sentry/sentry/bor/config.toml | 1 + .../mainnet-v1/sentry/validator/bor/config.toml | 1 + .../mainnet-v1/without-sentry/bor/config.toml | 1 + packaging/templates/testnet-v4/archive/config.toml | 1 + .../testnet-v4/sentry/sentry/bor/config.toml | 1 + .../testnet-v4/sentry/validator/bor/config.toml | 1 + .../testnet-v4/without-sentry/bor/config.toml | 1 + 11 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/cli/example_config.toml b/docs/cli/example_config.toml index 64ef60ae12..052353b18b 100644 --- a/docs/cli/example_config.toml +++ b/docs/cli/example_config.toml @@ -19,12 +19,13 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec "32000000" = "0x875500011e5eecc0c554f95d07b31cf59df4ca2505f4dbbfffa7d4e4da917c68" [p2p] - maxpeers = 50 # Maximum number of network peers (network disabled if set to 0) - maxpendpeers = 50 # Maximum number of pending connection attempts - bind = "0.0.0.0" # Network binding address - port = 30303 # Network listening port - nodiscover = false # Disables the peer discovery mechanism (manual peer addition) - nat = "any" # NAT port mapping mechanism (any|none|upnp|pmp|extip:) + maxpeers = 50 # Maximum number of network peers (network disabled if set to 0) + maxpendpeers = 50 # Maximum number of pending connection attempts + bind = "0.0.0.0" # Network binding address + port = 30303 # Network listening port + nodiscover = false # Disables the peer discovery mechanism (manual peer addition) + nat = "any" # NAT port mapping mechanism (any|none|upnp|pmp|extip:) + txarrivalwait = "500ms" # Maximum duration to wait before requesting an announced transaction [p2p.discovery] v5disc = false # Enables the experimental RLPx V5 (Topic Discovery) mechanism bootnodes = [] # Comma separated enode URLs for P2P discovery bootstrap diff --git a/internal/cli/dumpconfig.go b/internal/cli/dumpconfig.go index a748af3357..c585afeb39 100644 --- a/internal/cli/dumpconfig.go +++ b/internal/cli/dumpconfig.go @@ -62,6 +62,7 @@ func (c *DumpconfigCommand) Run(args []string) int { userConfig.Gpo.IgnorePriceRaw = userConfig.Gpo.IgnorePrice.String() userConfig.Cache.RejournalRaw = userConfig.Cache.Rejournal.String() userConfig.Cache.TrieTimeoutRaw = userConfig.Cache.TrieTimeout.String() + userConfig.P2P.TxArrivalWaitRaw = userConfig.P2P.TxArrivalWait.String() if err := toml.NewEncoder(os.Stdout).Encode(userConfig); err != nil { c.UI.Error(err.Error()) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 15a8eac8ce..453c5c2c24 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -134,7 +134,8 @@ type P2PConfig struct { // TxArrivalWait sets the maximum duration the transaction fetcher will wait for // an announced transaction to arrive before explicitly requesting it - TxArrivalWait time.Duration `hcl:"txarrivalwait,optional" toml:"txarrivalwait,optional"` + TxArrivalWait time.Duration `hcl:"-,optional" toml:"-"` + TxArrivalWaitRaw string `hcl:"txarrivalwait,optional" toml:"txarrivalwait,optional"` } type P2PDiscovery struct { @@ -636,6 +637,7 @@ func (c *Config) fillTimeDurations() error { {"txpool.rejournal", &c.TxPool.Rejournal, &c.TxPool.RejournalRaw}, {"cache.rejournal", &c.Cache.Rejournal, &c.Cache.RejournalRaw}, {"cache.timeout", &c.Cache.TrieTimeout, &c.Cache.TrieTimeoutRaw}, + {"p2p.txarrivalwait", &c.P2P.TxArrivalWait, &c.P2P.TxArrivalWaitRaw}, } for _, x := range tds { diff --git a/packaging/templates/mainnet-v1/archive/config.toml b/packaging/templates/mainnet-v1/archive/config.toml index 9eaafd3bee..cf5aeec17f 100644 --- a/packaging/templates/mainnet-v1/archive/config.toml +++ b/packaging/templates/mainnet-v1/archive/config.toml @@ -18,6 +18,7 @@ gcmode = "archive" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml index 94dd6634f0..4847761617 100644 --- a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml @@ -18,6 +18,7 @@ syncmode = "full" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml index 9c55683c96..cf03ec5a98 100644 --- a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml @@ -20,6 +20,7 @@ syncmode = "full" # maxpendpeers = 50 # bind = "0.0.0.0" # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml index 573f1f3be8..a474b90bb0 100644 --- a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml @@ -20,6 +20,7 @@ syncmode = "full" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/testnet-v4/archive/config.toml b/packaging/templates/testnet-v4/archive/config.toml index 1762fdf117..5cef74137d 100644 --- a/packaging/templates/testnet-v4/archive/config.toml +++ b/packaging/templates/testnet-v4/archive/config.toml @@ -18,6 +18,7 @@ gcmode = "archive" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml index ae191cec2c..89481eb275 100644 --- a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml @@ -18,6 +18,7 @@ syncmode = "full" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml index b441cc137d..e99d24a5ac 100644 --- a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml @@ -20,6 +20,7 @@ syncmode = "full" # maxpendpeers = 50 # bind = "0.0.0.0" # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = [] diff --git a/packaging/templates/testnet-v4/without-sentry/bor/config.toml b/packaging/templates/testnet-v4/without-sentry/bor/config.toml index 05a254e184..db72000c18 100644 --- a/packaging/templates/testnet-v4/without-sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/without-sentry/bor/config.toml @@ -20,6 +20,7 @@ syncmode = "full" # bind = "0.0.0.0" # nodiscover = false # nat = "any" + # txarrivalwait = "500ms" # [p2p.discovery] # v5disc = false # bootnodes = []