diff --git a/connections/ethereum/connection.go b/connections/ethereum/connection.go index ce36a2202..8aba39ee0 100644 --- a/connections/ethereum/connection.go +++ b/connections/ethereum/connection.go @@ -171,7 +171,7 @@ func (c *Connection) EstimateGasLondon(ctx context.Context, baseFee *big.Int) (* if c.maxGasPrice.Cmp(baseFee) < 0 { maxPriorityFeePerGas = big.NewInt(1) - maxFeePerGas = new(big.Int).Add(baseFee, maxPriorityFeePerGas) + maxFeePerGas = new(big.Int).Add(c.maxGasPrice, maxPriorityFeePerGas) return maxPriorityFeePerGas, maxFeePerGas, nil } diff --git a/connections/ethereum/connection_test.go b/connections/ethereum/connection_test.go index 5c8c94f84..feef4c7d2 100644 --- a/connections/ethereum/connection_test.go +++ b/connections/ethereum/connection_test.go @@ -100,7 +100,7 @@ func TestConnection_SafeEstimateGasMax(t *testing.T) { func TestConnection_EstimateGasLondon(t *testing.T) { // Set TestEndpoint to Goerli endpoint when testing as the current Github CI doesn't use the London version of geth - // Goerli commonly has a base fee of 7 gwei with maxPriorityFeePerGas of 4.999999993 gwei + // Goerli commonly has a base fee of 7 wei with maxPriorityFeePerGas of 4.999999993 gwei maxGasPrice := big.NewInt(100000000000) conn := NewConnection(TestEndpoint, false, AliceKp, log15.Root(), GasLimit, maxGasPrice, GasMultipler, "", "") err := conn.Connect() @@ -129,7 +129,7 @@ func TestConnection_EstimateGasLondon(t *testing.T) { func TestConnection_EstimateGasLondonMax(t *testing.T) { // Set TestEndpoint to Goerli endpoint when testing as the current Github CI doesn't use the London version of geth - // Goerli commonly has a base fee of 7 gwei with maxPriorityFeePerGas of 4.999999993 gwei + // Goerli commonly has a base fee of 7 wei with maxPriorityFeePerGas of 4.999999993 gwei maxGasPrice := big.NewInt(100) conn := NewConnection(TestEndpoint, false, AliceKp, log15.Root(), GasLimit, maxGasPrice, GasMultipler, "", "") err := conn.Connect() @@ -164,7 +164,7 @@ func TestConnection_EstimateGasLondonMax(t *testing.T) { func TestConnection_EstimateGasLondonMin(t *testing.T) { // Set TestEndpoint to Goerli endpoint when testing as the current Github CI doesn't use the London version of geth - // Goerli commonly has a base fee of 7 gwei with maxPriorityFeePerGas of 4.999999993 gwei + // Goerli commonly has a base fee of 7 wei with maxPriorityFeePerGas of 4.999999993 gwei maxGasPrice := big.NewInt(1) conn := NewConnection(TestEndpoint, false, AliceKp, log15.Root(), GasLimit, maxGasPrice, GasMultipler, "", "") err := conn.Connect() @@ -186,7 +186,7 @@ func TestConnection_EstimateGasLondonMin(t *testing.T) { } maxPriorityFeePerGas := big.NewInt(1) - maxFeePerGas := new(big.Int).Add(head.BaseFee, maxPriorityFeePerGas) + maxFeePerGas := new(big.Int).Add(maxGasPrice, maxPriorityFeePerGas) if suggestedGasTip.Cmp(maxPriorityFeePerGas) != 0 { t.Fatalf("Gas tip cap should be equal to 1. Suggested: %s Max Tip: %s", suggestedGasTip.String(), maxPriorityFeePerGas)