From 5465108f6ad1d8de02fbb375c1378c6d1ba01653 Mon Sep 17 00:00:00 2001 From: Dimitris Date: Wed, 9 Oct 2024 18:13:20 +0300 Subject: [PATCH] FHE return ErrConnectivity error when halting bumping --- .changeset/healthy-flowers-nail.md | 5 +++++ core/chains/evm/gas/fee_history_estimator.go | 4 ++-- core/chains/evm/gas/fee_history_estimator_test.go | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/healthy-flowers-nail.md diff --git a/.changeset/healthy-flowers-nail.md b/.changeset/healthy-flowers-nail.md new file mode 100644 index 00000000000..aefc463472d --- /dev/null +++ b/.changeset/healthy-flowers-nail.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +Return ErrConnectivity error when halting bumping #internal diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go index 8d7b82dbcc3..e3d46a28694 100644 --- a/core/chains/evm/gas/fee_history_estimator.go +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -385,8 +385,8 @@ func (f *FeeHistoryEstimator) BumpDynamicFee(ctx context.Context, originalFee Dy } if bumpedMaxPriorityFeePerGas.Cmp(priorityFeeThreshold) > 0 { - return bumped, fmt.Errorf("bumpedMaxPriorityFeePerGas: %s is above market's %sth percentile: %s, bumping is halted", - bumpedMaxPriorityFeePerGas, strconv.Itoa(ConnectivityPercentile), priorityFeeThreshold) + return bumped, fmt.Errorf("%w: bumpedMaxPriorityFeePerGas: %s is above market's %sth percentile: %s, bumping is halted", + commonfee.ErrConnectivity, bumpedMaxPriorityFeePerGas, strconv.Itoa(ConnectivityPercentile), priorityFeeThreshold) } bumpedMaxFeePerGas, err = LimitBumpedFee(originalFee.GasFeeCap, currentDynamicPrice.GasFeeCap, bumpedMaxFeePerGas, maxPrice) diff --git a/core/chains/evm/gas/fee_history_estimator_test.go b/core/chains/evm/gas/fee_history_estimator_test.go index 4558233552d..8edc8ae5c58 100644 --- a/core/chains/evm/gas/fee_history_estimator_test.go +++ b/core/chains/evm/gas/fee_history_estimator_test.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/v2/common/fee" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -411,6 +412,7 @@ func TestFeeHistoryEstimatorBumpDynamicFee(t *testing.T) { assert.NoError(t, err) _, err = u.BumpDynamicFee(tests.Context(t), originalFee, globalMaxPrice, nil) assert.Error(t, err) + assert.True(t, fee.IsBumpErr(err)) }) t.Run("returns max price if the aggregation of max and original bumped fee is higher", func(t *testing.T) {