Skip to content

test: add Rex1 compute gas detention reset tests#238

Open
pieakshat wants to merge 1 commit intomegaeth-labs:mainfrom
pieakshat:akshat/test/rex1-compute-gas-reset
Open

test: add Rex1 compute gas detention reset tests#238
pieakshat wants to merge 1 commit intomegaeth-labs:mainfrom
pieakshat:akshat/test/rex1-compute-gas-reset

Conversation

@pieakshat
Copy link
Copy Markdown

Summary

Adds a dedicated tests/rex1/ module covering the Rex1 fix for compute gas detention state leaking between transactions.

Before Rex1, volatile data access (oracle call, TIMESTAMP, etc.) in TX1 would lower the detained compute gas limit, and that lowered limit persisted
into subsequent transactions within the same block — causing unrelated transactions to fail with ComputeGasLimitExceeded.
Rex1 fixes this by resetting detained_limit to the base TX compute gas limit at the start of each transaction.

Five tests are added across three scenarios:

  • Oracle detention (CALL to oracle contract): Rex1 resets the 1M cap between txs; REX spec does not (bug preserved for backward compat).
  • Block-env detention (TIMESTAMP opcode): same reset behavior for the 20M block-env cap — this scenario had no existing test coverage.
  • Multi-transaction reset: verifies the reset is persistent across multiple rounds of volatile → expensive transactions, not a one-time event.

Test plan

  • cargo test -p mega-evm --test rex1 — all 5 tests pass.
  • cargo test -p mega-evm — full suite passes with no regressions.

Labels checklist

  • spec: spec:stable
  • comp: comp:core
  • api: api:unchanged

@pieakshat
Copy link
Copy Markdown
Author

hi, any updates on this?

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.

1 participant