Skip to content

feat(evm): add gas boost retry option for contract deploys [CLD-2779]#1047

Merged
graham-chainlink merged 1 commit into
mainfrom
ggoh/CLD-2779/evm-deploy-gas-boost-retry
Jun 16, 2026
Merged

feat(evm): add gas boost retry option for contract deploys [CLD-2779]#1047
graham-chainlink merged 1 commit into
mainfrom
ggoh/CLD-2779/evm-deploy-gas-boost-retry

Conversation

@graham-chainlink

@graham-chainlink graham-chainlink commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Why

In order to take advantage of the contract.NewDeploy method used by the operations-gen cli, we need to add support for gas limit bumping as we currently support for legacy deploy MCMS contract changesets.

Note this already exist in cld-changesets here, moving and refactoring this to CLDF makes more sense to other users can take advantage of this option.

Summary

  • Adds RetryDeployWithGasBoost and GasBoostConfig for operations2 EVM contract deploys, increasing gas limit and price on retries after gas-related failures.
  • Extends DeployInput with optional GasLimit and GasPrice fields and applies them via deployTransactOpts on EVM deploy paths.
  • Classifies retryable gas errors using geth sentinels (errors.Is) with a string fallback for RPC-wrapped messages.

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2779

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 52b0949

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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 adds an opt-in “gas boost” retry option for operations2 EVM contract deploys, allowing deploy retries to progressively increase gas limit and gas price when failures look gas-related, and threads optional gas overrides through the EVM deploy path.

Changes:

  • Added RetryDeployWithGasBoost + GasBoostConfig and supporting helpers for classifying gas-related failures and computing boosted gas values.
  • Extended DeployInput with optional GasLimit/GasPrice and applied them via deployTransactOpts on the EVM deploy path.
  • Added unit tests for gas boosting logic and expanded deployment tests to cover gas overrides.

Reviewed changes

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

Show a summary per file
File Description
chain/evm/operations2/contract/gas_boost.go Implements gas-boost retry option, retryable error classification, and transact opts override helper.
chain/evm/operations2/contract/gas_boost_test.go Adds tests covering boosted gas calculations, retryable error detection, and transact opts behavior.
chain/evm/operations2/contract/deploy.go Extends deploy input with gas overrides and applies them to EVM deploy transact opts.
chain/evm/operations2/contract/deployment_test.go Adds coverage for deploys when gas overrides are provided.
.changeset/dry-paws-unite.md Declares a minor release for the new deploy gas bumping option.
go.mod Updates dependencies (including several version bumps and indirect dependency changes).
go.sum Syncs checksums with the updated dependency graph.

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

Comment thread chain/evm/operations2/contract/gas_boost.go Outdated
Comment thread chain/evm/operations2/contract/deploy.go Outdated
Enable RetryDeployWithGasBoost to raise gas limit and price on
gas-related deploy failures, with optional overrides wired through
DeployInput for EVM deployments.
@graham-chainlink graham-chainlink force-pushed the ggoh/CLD-2779/evm-deploy-gas-boost-retry branch from db74e59 to 52b0949 Compare June 16, 2026 04:16
@graham-chainlink graham-chainlink marked this pull request as ready for review June 16, 2026 04:16
@graham-chainlink graham-chainlink requested a review from a team as a code owner June 16, 2026 04:16
Copilot AI review requested due to automatic review settings June 16, 2026 04:16

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

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

Comment thread chain/evm/operations2/contract/deploy.go
Comment thread go.mod
Comment on lines +140 to +148
var gasRetryableErrorPatterns = []string{
"out of gas",
"gas required exceeds allowance",
"intrinsic gas too low",
"underpriced",
"replacement transaction underpriced",
"max fee per gas less than block base fee",
"exceeds block gas limit",
}

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.

nit(noaction): I wonder if we can find better ways to detect retryable errors. I've seen this pattern in gauntlet too, but I've never been happy about it. Wondering if there's better mechanisms nowadays

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah i know! I dont like this too, currently i am just using a hybrid approach of hardcoded strings plus sentinel errors that we know exist

@graham-chainlink graham-chainlink added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit e389ad2 Jun 16, 2026
27 of 29 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/CLD-2779/evm-deploy-gas-boost-retry branch June 16, 2026 06:14
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.

3 participants