fix(evm): ignore transactions that exceed the network's max gas limit.#165
Merged
gustavogama-cll merged 2 commits intodevelopfrom Nov 21, 2025
Merged
fix(evm): ignore transactions that exceed the network's max gas limit.#165gustavogama-cll merged 2 commits intodevelopfrom
gustavogama-cll merged 2 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
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
maxGasLimitparameter 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.
ab48e7e to
171275f
Compare
171275f to
7232655
Compare
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 20, 2025
#165) fix: add maxGasLimit parameter
Contributor
Author
|
@ecPablo , I fixed one of the flakey tests. Will need another approval. |
ecPablo
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ExecuteBatchcall 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-limitflag or theMAX_GAS_LIMITenvironment variable`.