Skip to content

Commit

Permalink
Merge pull request #712 from rocket-pool/block-gas-limit-param
Browse files Browse the repository at this point in the history
Add suggested block gas limit parameter
  • Loading branch information
0xfornax authored Dec 6, 2024
2 parents 9adcac9 + 1b95bd6 commit 3e9c68b
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 gas limit
SuggestedBlockGasLimit config.Parameter `yaml:"suggestedBlockGasLimit,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,
},

SuggestedBlockGasLimit: config.Parameter{
ID: "suggestedBlockGasLimit",
Name: "Suggested Block Gas Limit",
Description: "The block gas 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, config.ContainerID_Validator},
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.SuggestedBlockGasLimit,
&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 uint64 = 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 gas limit
SuggestedBlockGasLimit config.Parameter `yaml:"suggestedBlockGasLimit,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,
},

SuggestedBlockGasLimit: config.Parameter{
ID: "suggestedBlockGasLimit",
Name: "Suggested Block Gas Limit",
Description: "The block gas 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.SuggestedBlockGasLimit,
&cfg.P2pPort,
&cfg.EthstatsLabel,
&cfg.EthstatsLogin,
Expand Down

0 comments on commit 3e9c68b

Please sign in to comment.