Skip to content
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
5 changes: 5 additions & 0 deletions rocketpool-cli/service/config/settings-execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type ExecutionConfigPage struct {
nethermindItems []*parameterizedFormItem
besuItems []*parameterizedFormItem
rethItems []*parameterizedFormItem
erigonItems []*parameterizedFormItem
externalEcItems []*parameterizedFormItem
}

Expand Down Expand Up @@ -63,6 +64,7 @@ func (configPage *ExecutionConfigPage) createContent() {
configPage.nethermindItems = createParameterizedFormItems(configPage.masterConfig.Nethermind.GetParameters(), configPage.layout)
configPage.besuItems = createParameterizedFormItems(configPage.masterConfig.Besu.GetParameters(), configPage.layout)
configPage.rethItems = createParameterizedFormItems(configPage.masterConfig.Reth.GetParameters(), configPage.layout)
configPage.erigonItems = createParameterizedFormItems(configPage.masterConfig.Erigon.GetParameters(), configPage.layout)
configPage.externalEcItems = createParameterizedFormItems(configPage.masterConfig.ExternalExecution.GetParameters(), configPage.layout)

// Map the parameters to the form items in the layout
Expand All @@ -72,6 +74,7 @@ func (configPage *ExecutionConfigPage) createContent() {
configPage.layout.mapParameterizedFormItems(configPage.nethermindItems...)
configPage.layout.mapParameterizedFormItems(configPage.besuItems...)
configPage.layout.mapParameterizedFormItems(configPage.rethItems...)
configPage.layout.mapParameterizedFormItems(configPage.erigonItems...)
configPage.layout.mapParameterizedFormItems(configPage.externalEcItems...)

// Set up the setting callbacks
Expand Down Expand Up @@ -132,6 +135,8 @@ func (configPage *ExecutionConfigPage) handleLocalEcChanged() {
configPage.layout.addFormItemsWithCommonParams(configPage.ecCommonItems, configPage.besuItems, configPage.masterConfig.Besu.UnsupportedCommonParams)
case cfgtypes.ExecutionClient_Reth:
configPage.layout.addFormItemsWithCommonParams(configPage.ecCommonItems, configPage.rethItems, configPage.masterConfig.Reth.UnsupportedCommonParams)
case cfgtypes.ExecutionClient_Erigon:
configPage.layout.addFormItemsWithCommonParams(configPage.ecCommonItems, configPage.erigonItems, configPage.masterConfig.Erigon.UnsupportedCommonParams)
}

configPage.layout.refresh()
Expand Down
6 changes: 6 additions & 0 deletions rocketpool-cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,10 @@ func pruneExecutionClient(yes bool) error {
} else if selectedEc == cfgtypes.ExecutionClient_Reth && pruningMode == cfgtypes.PruningMode_RollingHistoryExpiry {
fmt.Println("This will stop Reth and prune bodies and receipts outside the one-year rolling window.")
fmt.Println("This is a resource intensive operation and may lead to an increase in missed attestations until it finishes.")
} else if selectedEc == cfgtypes.ExecutionClient_Erigon {
fmt.Println("Erigon pruning is applied continuously while the client is running. There is no offline prune step.")
fmt.Println("If you just switched pruning modes, you must resync with `rocketpool service resync-eth1` before already-stored history is removed.")
return nil
} else {
fmt.Println("This will request your main execution client to prune its database, freeing up disk space. This is a resource intensive operation and may lead to an increase in missed attestations until it finishes.")
}
Expand Down Expand Up @@ -1312,6 +1316,8 @@ func serviceVersion() error {
eth1ClientString = fmt.Sprintf(format, "Besu", cfg.Besu.ContainerTag.Value.(string))
case cfgtypes.ExecutionClient_Reth:
eth1ClientString = fmt.Sprintf(format, "Reth", cfg.Reth.ContainerTag.Value.(string))
case cfgtypes.ExecutionClient_Erigon:
eth1ClientString = fmt.Sprintf(format, "Erigon", cfg.Erigon.ContainerTag.Value.(string))
default:
return fmt.Errorf("unknown local execution client [%v]", eth1Client)
}
Expand Down
132 changes: 132 additions & 0 deletions shared/services/config/erigon-params.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
package config

import (
"runtime"

"github.com/rocket-pool/smartnode/shared/types/config"
)

// Constants
const (
erigonTagProd string = "erigontech/erigon:v3.5.5"
erigonTagTest string = "erigontech/erigon:v3.5.5"
erigonEventLogInterval int = 1000
erigonStopSignal string = "SIGINT"
defaultErigonTorrentPort uint16 = 42069
)

// Configuration for Erigon
type ErigonConfig struct {
Title string `yaml:"-"`

// Common config.Parameters that Erigon doesn't support and should be hidden
UnsupportedCommonParams []string `yaml:"-"`

// Compatible consensus clients
CompatibleConsensusClients []config.ConsensusClient `yaml:"-"`

// The max number of events to query in a single event log query
EventLogInterval int `yaml:"-"`

// Max number of P2P peers to connect to
MaxPeers config.Parameter `yaml:"maxPeers,omitempty"`

// BitTorrent port used for snapshot sync
TorrentPort config.Parameter `yaml:"torrentPort,omitempty"`

// The Docker Hub tag for Erigon
ContainerTag config.Parameter `yaml:"containerTag,omitempty"`

// Custom command line flags
AdditionalFlags config.Parameter `yaml:"additionalFlags,omitempty"`
}

// Generates a new Erigon configuration
func NewErigonConfig(cfg *RocketPoolConfig) *ErigonConfig {
return &ErigonConfig{
Title: "Erigon Settings",

UnsupportedCommonParams: []string{},

CompatibleConsensusClients: []config.ConsensusClient{
config.ConsensusClient_Lighthouse,
config.ConsensusClient_Lodestar,
config.ConsensusClient_Nimbus,
config.ConsensusClient_Prysm,
config.ConsensusClient_Teku,
},

EventLogInterval: erigonEventLogInterval,

MaxPeers: config.Parameter{
ID: "maxPeers",
Name: "Max Peers",
Description: "The maximum number of peers Erigon should connect to. This can be lowered to improve performance on low-power systems or constrained networks. We recommend keeping it at 12 or higher.",
Type: config.ParameterType_Uint16,
Default: map[config.Network]interface{}{config.Network_All: calculateErigonPeers()},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
CanBeBlank: false,
OverwriteOnUpgrade: false,
},

TorrentPort: config.Parameter{
ID: "torrentPort",
Name: "Torrent Port",
Description: "The port Erigon should use for BitTorrent snapshot sync. This must be reachable from the internet (TCP and UDP), just like the P2P port.",
Type: config.ParameterType_Uint16,
Default: map[config.Network]interface{}{config.Network_All: defaultErigonTorrentPort},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
CanBeBlank: false,
OverwriteOnUpgrade: false,
},

ContainerTag: config.Parameter{
ID: "containerTag",
Name: "Container Tag",
Description: "The tag name of the Erigon container you want to use on Docker Hub.",
Type: config.ParameterType_String,
Default: map[config.Network]interface{}{
config.Network_Mainnet: erigonTagProd,
config.Network_Devnet: erigonTagTest,
config.Network_Testnet: erigonTagTest,
},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
CanBeBlank: false,
OverwriteOnUpgrade: true,
},

AdditionalFlags: config.Parameter{
ID: "additionalFlags",
Name: "Additional Flags",
Description: "Additional custom command line flags you want to pass to Erigon, to take advantage of other settings that the Smart Node's configuration doesn't cover.",
Type: config.ParameterType_String,
Default: map[config.Network]interface{}{config.Network_All: ""},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
CanBeBlank: true,
OverwriteOnUpgrade: false,
},
}
}

// Calculate the default number of Erigon peers
func calculateErigonPeers() uint16 {
if runtime.GOARCH == "arm64" {
return 16
}
return 32
}

// Get the config.Parameters for this config
func (cfg *ErigonConfig) GetParameters() []*config.Parameter {
return []*config.Parameter{
&cfg.MaxPeers,
&cfg.TorrentPort,
&cfg.ContainerTag,
&cfg.AdditionalFlags,
}
}

// The title for the config
func (cfg *ErigonConfig) GetConfigTitle() string {
return cfg.Title
}
4 changes: 2 additions & 2 deletions shared/services/config/execution-common-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ func NewExecutionCommonConfig(cfg *RocketPoolConfig) *ExecutionCommonConfig {
OverwriteOnUpgrade: false,
Options: []config.ParameterOption{{
Name: "Rolling History Expiry",
Description: "Drop block bodies and receipts older than about one year. Nethermind, Besu, and Reth support this. Geth does not yet and will use pre-Prague history expiry instead.",
Description: "Drop block bodies and receipts older than about one year. Nethermind, Besu, Reth, and Erigon support this. Geth does not yet and will use pre-Prague history expiry instead.",
Value: config.PruningMode_RollingHistoryExpiry,
}, {
Name: "History Expiry",
Description: "Drop pre-merge block bodies and receipts (EIP-4444 partial history expiry). Keeps all post-merge history.",
Description: "Drop pre-merge block bodies and receipts (EIP-4444 partial history expiry). Keeps all post-merge history. Erigon does not support pre-merge-only expiry and will keep remaining block history with full-mode state pruning.",
Value: config.PruningMode_HistoryExpiry,
}, {
Name: "Full node",
Expand Down
22 changes: 22 additions & 0 deletions shared/services/config/rocket-pool-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ type RocketPoolConfig struct {
Nethermind *NethermindConfig `yaml:"nethermind,omitempty"`
Besu *BesuConfig `yaml:"besu,omitempty"`
Reth *RethConfig `yaml:"reth,omitempty"`
Erigon *ErigonConfig `yaml:"erigon,omitempty"`
ExternalExecution *ExternalExecutionConfig `yaml:"externalExecution,omitempty"`

// Consensus client configurations
Expand Down Expand Up @@ -316,6 +317,10 @@ func NewRocketPoolConfig(rpDir string, isNativeMode bool) *RocketPoolConfig {
Name: "Reth",
Description: getAugmentedEcDescription(config.ExecutionClient_Reth, "Reth is a new Ethereum full node implementation that is focused on being user-friendly, highly modular, as well as being fast and efficient. Reth is fully open source and written in Rust."),
Value: config.ExecutionClient_Reth,
}, {
Name: "Erigon",
Description: getAugmentedEcDescription(config.ExecutionClient_Erigon, "Erigon is an execution client focused on disk efficiency and fast snapshot sync. It is fully open source and written in Go."),
Value: config.ExecutionClient_Erigon,
}},
},

Expand Down Expand Up @@ -559,6 +564,7 @@ func NewRocketPoolConfig(rpDir string, isNativeMode bool) *RocketPoolConfig {
cfg.Nethermind = NewNethermindConfig(cfg)
cfg.Besu = NewBesuConfig(cfg)
cfg.Reth = NewRethConfig(cfg)
cfg.Erigon = NewErigonConfig(cfg)
cfg.ExternalExecution = NewExternalExecutionConfig(cfg)
cfg.FallbackNormal = NewFallbackNormalConfig(cfg)
cfg.FallbackPrysm = NewFallbackPrysmConfig(cfg)
Expand Down Expand Up @@ -607,6 +613,11 @@ func getAugmentedEcDescription(client config.ExecutionClient, originalDescriptio
if totalMemoryGB < 9 {
return fmt.Sprintf("%s\n\n[red]WARNING: Nethermind currently requires over 8 GB of RAM to run smoothly. We do not recommend it for your system. This may be improved in a future release.", originalDescription)
}
case config.ExecutionClient_Erigon:
totalMemoryGB := memory.TotalMemory() / 1024 / 1024 / 1024
if totalMemoryGB < 16 {
return fmt.Sprintf("%s\n\n[red]WARNING: Erigon currently requires 16 GB of RAM to run smoothly. We do not recommend it for your system.", originalDescription)
}
}

return originalDescription
Expand Down Expand Up @@ -673,6 +684,7 @@ func (cfg *RocketPoolConfig) GetSubconfigs() map[string]config.Config {
"nethermind": cfg.Nethermind,
"besu": cfg.Besu,
"reth": cfg.Reth,
"erigon": cfg.Erigon,
"externalExecution": cfg.ExternalExecution,
"consensusCommon": cfg.ConsensusCommon,
"lighthouse": cfg.Lighthouse,
Expand Down Expand Up @@ -748,6 +760,8 @@ func (cfg *RocketPoolConfig) GetEventLogInterval() (int, error) {
return cfg.Nethermind.EventLogInterval, nil
case config.ExecutionClient_Reth:
return cfg.Reth.EventLogInterval, nil
case config.ExecutionClient_Erigon:
return cfg.Erigon.EventLogInterval, nil
default:
return 0, fmt.Errorf("can't get event log interval of unknown execution client [%v]", client)
}
Expand Down Expand Up @@ -1320,6 +1334,8 @@ func (cfg *RocketPoolConfig) GetECContainerTag() (string, error) {
return cfg.Besu.ContainerTag.Value.(string), nil
case config.ExecutionClient_Reth:
return cfg.Reth.ContainerTag.Value.(string), nil
case config.ExecutionClient_Erigon:
return cfg.Erigon.ContainerTag.Value.(string), nil
}

return "", fmt.Errorf("Unknown Execution Client %s", string(cfg.ExecutionClient.Value.(config.ExecutionClient)))
Expand All @@ -1341,6 +1357,8 @@ func (cfg *RocketPoolConfig) GetECStopSignal() (string, error) {
return besuStopSignal, nil
case config.ExecutionClient_Reth:
return rethStopSignal, nil
case config.ExecutionClient_Erigon:
return erigonStopSignal, nil
}

return "", fmt.Errorf("Unknown Execution Client %s", string(cfg.ExecutionClient.Value.(config.ExecutionClient)))
Expand Down Expand Up @@ -1379,6 +1397,8 @@ func (cfg *RocketPoolConfig) GetECMaxPeers() (uint16, error) {
return cfg.Besu.MaxPeers.Value.(uint16), nil
case config.ExecutionClient_Reth:
return cfg.Reth.MaxPeers.Value.(uint16), nil
case config.ExecutionClient_Erigon:
return cfg.Erigon.MaxPeers.Value.(uint16), nil
}

return 0, fmt.Errorf("Unknown Execution Client %s", string(cfg.ExecutionClient.Value.(config.ExecutionClient)))
Expand All @@ -1399,6 +1419,8 @@ func (cfg *RocketPoolConfig) GetECAdditionalFlags() (string, error) {
return cfg.Besu.AdditionalFlags.Value.(string), nil
case config.ExecutionClient_Reth:
return cfg.Reth.AdditionalFlags.Value.(string), nil
case config.ExecutionClient_Erigon:
return cfg.Erigon.AdditionalFlags.Value.(string), nil
}

return "", fmt.Errorf("Unknown Execution Client %s", string(cfg.ExecutionClient.Value.(config.ExecutionClient)))
Expand Down
Loading
Loading