Skip to content

"FeeBoost" : SVR Gas Strategy#417

Merged
augustbleeds merged 6 commits intodevelopfrom
augustus.fee-boost
May 4, 2026
Merged

"FeeBoost" : SVR Gas Strategy#417
augustbleeds merged 6 commits intodevelopfrom
augustus.fee-boost

Conversation

@augustbleeds
Copy link
Copy Markdown
Contributor

Instead of a separate gas config, we opt for a simpler approach to just use the max fee each if the feeboost ie enabled on txmv2

Copilot AI review requested due to automatic review settings April 8, 2026 19:32
@augustbleeds augustbleeds requested review from a team and dimriou as code owners April 8, 2026 19:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

👋 augustbleeds, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

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

⚠️ Breaking Changes (2)

pkg/config.TransactionManagerV2 (1)
  • FeeBoost — ➕ Added
pkg/txm (1)
  • NewAttemptBuilder — Type changed:
func(
  func(github.com/ethereum/go-ethereum/common.Address) *github.com/smartcontractkit/chainlink-evm/pkg/assets.Wei, 
  github.com/smartcontractkit/chainlink-evm/pkg/gas.EvmFeeEstimator, 
  github.com/smartcontractkit/chainlink-evm/pkg/keys.TxSigner, 
  uint64, 
  + bool
)
*attemptBuilder

✅ Compatible Changes (1)

pkg/config/toml.TransactionManagerV2Config (1)
  • FeeBoost — ➕ Added

📄 View full apidiff report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a FeeBoost configuration flag for TxM v2 (intended for SVR/DualBroadcast) that forces transaction attempts to use the estimator’s “max fee” path for more aggressive gas pricing, and wires the flag through builder/test/docs updates.

Changes:

  • Introduce FeeBoost in TxM v2 TOML/config interfaces and documentation.
  • Plumb a feeBoost flag into txm.NewAttemptBuilder and use it to select GetMaxFee (and skip bumping) for attempts.
  • Update unit/integration tests and example configs to include the new parameter/setting.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/txmgr/builder.go Computes feeBoost (gated by DualBroadcast) and passes it into the attempt builder.
pkg/txm/attempt_builder.go Adds feeBoost flag; switches attempt fee selection to GetMaxFee when enabled and skips bumping.
pkg/txm/attempt_builder_test.go Updates constructor call sites for the new feeBoost parameter.
pkg/txm/txm_test.go Updates constructor call sites for the new feeBoost parameter.
pkg/txm/integration-tests/integration_test.go Updates constructor call sites for the new feeBoost parameter.
pkg/config/config.go Extends TransactionManagerV2 interface with FeeBoost() bool.
pkg/config/chain_scoped_transactions.go Implements FeeBoost() for chain-scoped TMv2 config.
pkg/config/toml/config.go Adds FeeBoost to TOML struct and merge behavior.
pkg/config/toml/config_test.go Updates defaults/docs alignment tests and full-config expectations for FeeBoost.
pkg/config/toml/docs.toml Documents the new FeeBoost option.
pkg/config/toml/testdata/config-full.toml Adds FeeBoost = true to the full TOML example.
CONFIG.md Documents the new FeeBoost option in the generated config docs.
Comments suppressed due to low confidence (1)

pkg/txm/attempt_builder.go:49

  • When feeBoost is enabled, NewAttempt calls GetMaxFee with a.feeBoost but still passes a.emptyTxLimitDefault as the feeLimit. This value is intended for purge/empty transactions and can cause normal transactions to either (a) fail with ErrFeeLimitTooLow when EstimateLimit is enabled (because providedGasLimit becomes too low), or (b) be broadcast with an under-sized gas limit when EstimateLimit is disabled. Use tx.SpecifiedGasLimit for the feeLimit in the feeBoost path (and only fall back to emptyTxLimitDefault when tx.IsPurgeable).
	if tx.IsPurgeable || a.feeBoost {
		fee, estimatedGasLimit, err = a.EvmFeeEstimator.GetMaxFee(ctx, tx.Data, a.emptyTxLimitDefault, a.priceMaxKey(tx.FromAddress), &tx.FromAddress, &tx.ToAddress)
		if err != nil {
			return nil, err
		}
	} else {
		fee, estimatedGasLimit, err = a.EvmFeeEstimator.GetFee(ctx, tx.Data, tx.SpecifiedGasLimit, a.priceMaxKey(tx.FromAddress), &tx.FromAddress, &tx.ToAddress)

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

Comment on lines 73 to 78
func (a *attemptBuilder) NewAgnosticBumpAttempt(ctx context.Context, lggr logger.Logger, tx *types.Transaction, dynamic bool) (attempt *types.Attempt, err error) {
// if the transaction is purgeable, NewAttempt will return the max fee instantly, so there is no need to bump
// if the transaction is purgeable or feeBoost is enabled, NewAttempt will return the max fee instantly, so there is no need to bump
attempt, err = a.NewAttempt(ctx, lggr, tx, dynamic)
if tx.IsPurgeable || err != nil {
if tx.IsPurgeable || a.feeBoost || err != nil {
return
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The new feeBoost behavior (always using GetMaxFee and skipping bumping) isn’t covered by tests. Add a unit test that constructs an attemptBuilder with feeBoost=true and asserts (1) GetMaxFee is called with the transaction’s SpecifiedGasLimit (or 0) for non-purgeable txs, and (2) NewAgnosticBumpAttempt returns after the initial attempt without calling BumpFee.

Copilot uses AI. Check for mistakes.
pavel-raykov
pavel-raykov previously approved these changes Apr 9, 2026
Comment thread pkg/txm/attempt_builder.go Outdated
// if the transaction is purgeable or feeBoost is enabled, NewAttempt will return the max fee instantly, so there is no need to bump
attempt, err = a.NewAttempt(ctx, lggr, tx, dynamic)
if tx.IsPurgeable || err != nil {
if tx.IsPurgeable || a.feeBoost || err != nil {
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.

Since we have another case, I would split the error check from the rest, just for better clarity.

Comment thread pkg/txm/attempt_builder.go Outdated
Comment thread pkg/txm/attempt_builder.go Outdated
var err error
if tx.IsPurgeable {
if tx.IsPurgeable || a.feeBoost {
fee, estimatedGasLimit, err = a.EvmFeeEstimator.GetMaxFee(ctx, tx.Data, a.emptyTxLimitDefault, a.priceMaxKey(tx.FromAddress), &tx.FromAddress, &tx.ToAddress)
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.

There is a bug here: GetMaxFee uses the emptyTxLimitDefault which is only correct in case of an empty transaction. We need to use SpecifiedGasLimit instead.

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.

Please add a test case in attempt_builder_test.go

Comment thread pkg/config/toml/docs.toml
@augustbleeds augustbleeds merged commit 156addb into develop May 4, 2026
34 of 35 checks passed
@augustbleeds augustbleeds deleted the augustus.fee-boost branch May 4, 2026 17:42
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.

5 participants