Skip to content

Commit

Permalink
FHE return ErrConnectivity error when halting bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Oct 9, 2024
1 parent 4c3e7ec commit 5465108
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-flowers-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Return ErrConnectivity error when halting bumping #internal
4 changes: 2 additions & 2 deletions core/chains/evm/gas/fee_history_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions core/chains/evm/gas/fee_history_estimator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5465108

Please sign in to comment.