Skip to content

fix(evm): ignore transactions that exceed the network's max gas limit.#165

Merged
gustavogama-cll merged 2 commits intodevelopfrom
ggama/fix-rootstock-gas-limit
Nov 21, 2025
Merged

fix(evm): ignore transactions that exceed the network's max gas limit.#165
gustavogama-cll merged 2 commits intodevelopfrom
ggama/fix-rootstock-gas-limit

Conversation

@gustavogama-cll
Copy link
Copy Markdown
Contributor

What

This PR updates the EVM execution logic such that it ignores transactions that exceed the network's maximum gas limit.

Why

This is in response to an issue identified in the Rootstock chain, where large proposal operations were exceeding the networks limit and draining the NOP's funds as the timelock worker service would keep trying to execute the operation repeatedly.

How

The timelock-worker now "dry-run"s the RBACTimelock.ExecuteBatch call and checks the estimated gas. If it's above the network's maximum gas limit, the transaction is not executed and is automatically de-scheduled.

In order to specify the network's maximum gas limit, one can use the command line --max-gas-limit flag or the MAX_GAS_LIMIT environment variable`.

@gustavogama-cll gustavogama-cll marked this pull request as ready for review November 20, 2025 06:17
@gustavogama-cll gustavogama-cll requested a review from a team as a code owner November 20, 2025 06:17
Copy link
Copy Markdown

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

This PR updates the EVM timelock worker to prevent execution of transactions that exceed the network's maximum gas limit. This addresses an issue on the Rootstock chain where large operations repeatedly drained NOP funds through failed execution attempts.

Key changes:

  • Adds maxGasLimit parameter throughout the codebase to specify network gas limits
  • Implements gas estimation before transaction execution to check against the limit
  • Automatically de-schedules transactions exceeding the gas limit to prevent repeated execution attempts

Reviewed Changes

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

Show a summary per file
File Description
pkg/timelock/operations_evm.go Adds gas estimation logic and max gas limit validation before executing transactions
pkg/timelock/worker_evm.go Adds maxGasLimit field to WorkerEVM struct and updates constructor signature
cmd/start.go Adds --max-gas-limit CLI flag support
pkg/cli/config.go Adds MAX_GAS_LIMIT environment variable configuration
pkg/timelock/worker_evm_test.go Updates test helper signatures to include maxGasLimit parameter
pkg/timelock/const_test.go Adds testMaxGasLimit constant for tests
tests/integration/evm/timelock_test.go Adds test for max gas limit behavior and updates existing test calls
tests/integration/evm/onchain_ops.go Grants necessary roles during deployment for proper test execution
pkg/timelock/scheduler.go Adds buffering to scheduler channels
pkg/timelock/retry.go Removes unused retryAttempts variable
tests/containers/geth.go Comments out log consumer configuration
Makefile Adds CTF_CONFIGS environment variable to test command

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

Comment thread pkg/timelock/operations_evm.go Outdated
Comment thread tests/integration/evm/timelock_test.go Outdated
@gustavogama-cll gustavogama-cll force-pushed the ggama/fix-rootstock-gas-limit branch from ab48e7e to 171275f Compare November 20, 2025 06:23
@gustavogama-cll gustavogama-cll force-pushed the ggama/fix-rootstock-gas-limit branch from 171275f to 7232655 Compare November 20, 2025 06:31
ecPablo
ecPablo previously approved these changes Nov 20, 2025
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo left a comment

Choose a reason for hiding this comment

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

LGTM!

@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@gustavogama-cll
Copy link
Copy Markdown
Contributor Author

@ecPablo , I fixed one of the flakey tests. Will need another approval.

@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 21, 2025
Merged via the queue into develop with commit edece15 Nov 21, 2025
14 of 15 checks passed
@gustavogama-cll gustavogama-cll deleted the ggama/fix-rootstock-gas-limit branch November 21, 2025 02:19
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