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

use mainnet as default config #4302

Merged
merged 1 commit into from
Nov 8, 2022
Merged
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
21 changes: 20 additions & 1 deletion beacon_chain/networking/network_metadata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,27 @@ proc getMetadataForNetwork*(

metadata


proc getRuntimeConfig*(
eth2Network: Option[string]): RuntimeConfig {.raises: [Defect, IOError].} =
## Returns the run-time config for a network specified on the command line
## If the network is not explicitly specified, the function will act as the
## regular Nimbus binary, returning the mainnet config.
##
## TODO the assumption that the input variable is a CLI config option is not
## quite appropriate in such as low-level function. The "assume mainnet by
## default" behavior is something that should be handled closer to the `conf`
## layer.
if eth2Network.isSome:
return getMetadataForNetwork(eth2Network.get).cfg
defaultRuntimeConfig

when const_preset == "mainnet":
when defined(gnosisChainBinary):
gnosisMetadata.cfg
else:
mainnetMetadata.cfg
else:
# This is a non-standard build (i.e. minimal), and the function was most
# likely executed in a test. The best we can do is return a fully default
# config:
defaultRuntimeConfig