Skip to content

Safeguard FeeHistory Estimator - #515

Merged
dimriou merged 8 commits into
developfrom
oev-1641_safeguard_fee_history_estimator
Aug 3, 2026
Merged

Safeguard FeeHistory Estimator#515
dimriou merged 8 commits into
developfrom
oev-1641_safeguard_fee_history_estimator

Conversation

@dimriou

@dimriou dimriou commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR:

  • Checks for nil entries in feeHistory's rewards.
  • Adds a minimum CacheTimeout check.
  • Switches to non-blocking refresh to avoid getting stuck
  • Now makes maxFeePerGas and priorityFeeThreshold updates consistent - prevents priorityFeeThreshold being lower than maxFeePerGas at a given instance, which can trigger false positive connectivity errors.
  • Unifies dynamic fee variables under one dynamic fee cache structure.
  • Fixes a bug where base wouldn't update if the maxFeePerGas and priorityFeeThreshold were not available.
  • Introduces a newNoMempoolBaseFeeBufferPercentage for chains without a mempool i.e. Arbitrum, to prevent insufficient base fee errors.
  • Improves structure and name conventions across the board

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-evm

⚠️ Breaking Changes (1)

pkg/gas.(*FeeHistoryEstimator) (1)
  • RefreshDynamicPrice — 🗑️ Removed

✅ Compatible Changes (3)

pkg/gas (2)
  • MinimumCacheTimeout — ➕ Added

  • NoMempoolBaseFeeBufferPercentage — ➕ Added

pkg/gas.(*FeeHistoryEstimator) (1)
  • RefreshDynamicFee — ➕ Added

📄 View full apidiff report

@dimriou
dimriou marked this pull request as ready for review July 30, 2026 09:50
@dimriou
dimriou requested a review from a team as a code owner July 30, 2026 09:50
Copilot AI review requested due to automatic review settings July 30, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the FeeHistoryEstimator against edge cases from eth_feeHistory responses and reduces the risk of bump operations blocking on refresh signaling.

Changes:

  • Add a minimum CacheTimeout validation during FeeHistoryEstimator.Start().
  • Guard against nil percentile entries in feeHistory.Reward when computing priority fee stats.
  • Make refresh signaling non-blocking by buffering refreshCh and using a best-effort send helper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pkg/gas/fee_history_estimator.go Adds CacheTimeout validation, nil-reward handling, caps max dynamic fee fields, and switches refresh signaling to non-blocking behavior.
pkg/gas/fee_history_estimator_test.go Updates tests to use t.Context() and adds a startup validation test for CacheTimeout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/gas/fee_history_estimator.go
Comment thread pkg/gas/fee_history_estimator.go Outdated
Comment thread pkg/gas/fee_history_estimator_test.go Outdated
@dimriou
dimriou enabled auto-merge (squash) July 30, 2026 10:31
dhaidashenko
dhaidashenko previously approved these changes Jul 30, 2026
@dimriou
dimriou disabled auto-merge July 31, 2026 08:34
@dimriou
dimriou marked this pull request as ready for review July 31, 2026 12:59
@dimriou
dimriou merged commit 7761248 into develop Aug 3, 2026
41 checks passed
@dimriou
dimriou deleted the oev-1641_safeguard_fee_history_estimator branch August 3, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants