Skip to content

Commit

Permalink
Fix default gas limit on execution config
Browse files Browse the repository at this point in the history
  • Loading branch information
Bez625 committed Oct 30, 2024
1 parent 6cd1d0c commit de2d8ca
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.9.2:
- update go-eth2-wallet-dirk to enable mixed signing thresholds for multisign
- fix issue with execution config gas_limit not being used

1.9.1:
- ensure that secondary validator registrations take place for all accounts
Expand Down
6 changes: 5 additions & 1 deletion services/blockrelay/v2/executionconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ func (e *ExecutionConfig) setInitialRelayOptions(_ context.Context,
} else {
configRelay.MinValue = *e.MinValue
}
setRelayConfig(configRelay, baseRelayConfig, config.FeeRecipient, fallbackGasLimit)
if e.GasLimit == nil {
setRelayConfig(configRelay, baseRelayConfig, config.FeeRecipient, fallbackGasLimit)
} else {
setRelayConfig(configRelay, baseRelayConfig, config.FeeRecipient, *e.GasLimit)
}
config.Relays = append(config.Relays, configRelay)
}
}
Expand Down
56 changes: 56 additions & 0 deletions services/blockrelay/v2/executionconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,62 @@ func TestConfig(t *testing.T) {
},
},
},
{
name: "ExecutionConfigDefaultGasLimit",
executionConfig: &v2.ExecutionConfig{
GasLimit: &gasLimit4,
Proposers: []*v2.ProposerConfig{},
FeeRecipient: &feeRecipient3,
Relays: map[string]*v2.BaseRelayConfig{
"https://relay1.com/": {},
},
},
account: account1,
pubkey: pubkey1,
fallbackFeeRecipient: feeRecipient1,
fallbackGasLimit: gasLimit1,
expected: &beaconblockproposer.ProposerConfig{
FeeRecipient: feeRecipient3,
Relays: []*beaconblockproposer.RelayConfig{
{
Address: "https://relay1.com/",
FeeRecipient: feeRecipient3,
GasLimit: gasLimit4,
Grace: grace0,
MinValue: minValue0,
},
},
},
},
{
name: "ExecutionConfigDefaultAndRelayGasLimit",
executionConfig: &v2.ExecutionConfig{
GasLimit: &gasLimit4,
Proposers: []*v2.ProposerConfig{},
FeeRecipient: &feeRecipient3,
Relays: map[string]*v2.BaseRelayConfig{
"https://relay1.com/": {
GasLimit: &gasLimit3,
},
},
},
account: account1,
pubkey: pubkey1,
fallbackFeeRecipient: feeRecipient1,
fallbackGasLimit: gasLimit1,
expected: &beaconblockproposer.ProposerConfig{
FeeRecipient: feeRecipient3,
Relays: []*beaconblockproposer.RelayConfig{
{
Address: "https://relay1.com/",
FeeRecipient: feeRecipient3,
GasLimit: gasLimit3,
Grace: grace0,
MinValue: minValue0,
},
},
},
},
{
name: "InvalidProposerConfig",
executionConfig: &v2.ExecutionConfig{
Expand Down

0 comments on commit de2d8ca

Please sign in to comment.