Skip to content

Commit

Permalink
Add suggested block limit parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfornax committed Dec 5, 2024
1 parent 9adcac9 commit 215dd50
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
15 changes: 15 additions & 0 deletions shared/services/config/consensus-common-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type ConsensusCommonConfig struct {
// The checkpoint sync URL if used
CheckpointSyncProvider config.Parameter `yaml:"checkpointSyncProvider,omitempty"`

// The suggested block limit
SuggestedBlockLimit config.Parameter `yaml:"suggestedBlockLimit,ommitempty"`

// The port to use for gossip traffic
P2pPort config.Parameter `yaml:"p2pPort,omitempty"`

Expand Down Expand Up @@ -77,6 +80,17 @@ func NewConsensusCommonConfig(cfg *RocketPoolConfig) *ConsensusCommonConfig {
OverwriteOnUpgrade: false,
},

SuggestedBlockLimit: config.Parameter{
ID: "suggestedBlockLimit",
Name: "Suggested Block Limit",
Description: "The block limit that should be used for externally built blocks.",
Type: config.ParameterType_Uint,
Default: map[config.Network]interface{}{config.Network_All: defaultSuggestedBlockLimit},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth2},
CanBeBlank: false,
OverwriteOnUpgrade: false,
},

P2pPort: config.Parameter{
ID: P2pPortID,
Name: "P2P Port",
Expand Down Expand Up @@ -130,6 +144,7 @@ func (cfg *ConsensusCommonConfig) GetParameters() []*config.Parameter {
&cfg.Graffiti,
&cfg.CheckpointSyncProvider,
&cfg.P2pPort,
&cfg.SuggestedBlockLimit,
&cfg.ApiPort,
&cfg.OpenApiPort,
&cfg.DoppelgangerDetection,
Expand Down
28 changes: 22 additions & 6 deletions shared/services/config/execution-common-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const (
ecOpenRpcPortsID string = "openRpcPorts"

// Defaults
defaultEcP2pPort uint16 = 30303
defaultEcHttpPort uint16 = 8545
defaultEcWsPort uint16 = 8546
defaultEcEnginePort uint16 = 8551
defaultOpenEcApiPort string = string(config.RPC_Closed)
defaultSuggestedBlockLimit uint32 = 30000000
defaultEcP2pPort uint16 = 30303
defaultEcHttpPort uint16 = 8545
defaultEcWsPort uint16 = 8546
defaultEcEnginePort uint16 = 8551
defaultOpenEcApiPort string = string(config.RPC_Closed)
)

// Configuration for the Execution client
Expand All @@ -38,6 +39,9 @@ type ExecutionCommonConfig struct {
// P2P traffic port
P2pPort config.Parameter `yaml:"p2pPort,omitempty"`

// The suggested block limit
SuggestedBlockLimit config.Parameter `yaml:"suggestedBlockLimit,ommitempty"`

// Label for Ethstats
EthstatsLabel config.Parameter `yaml:"ethstatsLabel,omitempty"`

Expand Down Expand Up @@ -97,10 +101,21 @@ func NewExecutionCommonConfig(cfg *RocketPoolConfig) *ExecutionCommonConfig {
Options: rpcPortModes,
},

SuggestedBlockLimit: config.Parameter{
ID: "suggestedBlockLimit",
Name: "Suggested Block Limit",
Description: "The block limit that should be used for locally built blocks.",
Type: config.ParameterType_Uint,
Default: map[config.Network]interface{}{config.Network_All: defaultSuggestedBlockLimit},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
CanBeBlank: false,
OverwriteOnUpgrade: false,
},

P2pPort: config.Parameter{
ID: "p2pPort",
Name: "P2P Port",
Description: "The port Geth should use for P2P (blockchain) traffic to communicate with other nodes.",
Description: "The port the Execution Client should use for P2P (blockchain) traffic to communicate with other nodes.",
Type: config.ParameterType_Uint16,
Default: map[config.Network]interface{}{config.Network_All: defaultEcP2pPort},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
Expand Down Expand Up @@ -139,6 +154,7 @@ func (cfg *ExecutionCommonConfig) GetParameters() []*config.Parameter {
&cfg.WsPort,
&cfg.EnginePort,
&cfg.OpenRpcPorts,
&cfg.SuggestedBlockLimit,
&cfg.P2pPort,
&cfg.EthstatsLabel,
&cfg.EthstatsLogin,
Expand Down

0 comments on commit 215dd50

Please sign in to comment.