Skip to content

fix: Rex3 system address exemption, doc updates, and tests#166

Merged
Troublor merged 1 commit intomainfrom
william/fix/rex3-system-address-exemption-docs-tests
Feb 12, 2026
Merged

fix: Rex3 system address exemption, doc updates, and tests#166
Troublor merged 1 commit intomainfrom
william/fix/rex3-system-address-exemption-docs-tests

Conversation

@Troublor
Copy link
Collaborator

Summary

  • Add MEGA_SYSTEM_ADDRESS exemption to the Rex3 SLOAD-based oracle gas detention path in host.rs. Without this, system transactions that read oracle storage would be incorrectly subject to gas detention.
  • Update Rex3.md spec to document SLOAD-based detention semantics (caller-agnostic triggering, DELEGATECALL escape, system address exemption semantic difference from pre-Rex3 CALL-based path).
  • Fix stale documentation referencing hardcoded "1M" oracle gas limits across tracker.rs, instructions.rs, mod.rs, README.md, and BLOCK_AND_TX_LIMITS.md.
  • Add 8 new tests covering system address exemption, non-oracle SLOAD, nested call chains, combined block env + oracle limits, sendHint interception, and keyless deploy compute gas limit enforcement.

Changes

File Change
crates/mega-evm/src/evm/host.rs Add MEGA_SYSTEM_ADDRESS exemption to Rex3 SLOAD oracle detention
specs/Rex3.md Document SLOAD semantics, fix grammar
README.md Add 2 missing Rex3 features
crates/mega-evm/src/evm/mod.rs Fix Rex3/Rex4 doc comments
crates/mega-evm/src/evm/instructions.rs Fix stale 1M gas reference
crates/mega-evm/src/access/tracker.rs Fix stale 1M gas references in examples
docs/BLOCK_AND_TX_LIMITS.md Add SLOAD + keyless deploy to Rex3 section
crates/mega-evm/tests/rex3/system_address.rs New: 2 system address exemption tests
crates/mega-evm/tests/rex3/oracle_gas_limit.rs Add 4 new oracle SLOAD tests
crates/mega-evm/tests/rex3/keyless_deploy.rs Add 1 compute gas limit test
crates/mega-evm/tests/rex3/main.rs Add mod system_address

Test plan

  • cargo check -p mega-evm passes
  • cargo test -p mega-evm — all 311 tests pass (15 rex3 tests, including 8 new)
  • cargo fmt --all --check — clean
  • cargo clippy --workspace --lib --examples --tests --benches --all-features --locked — clean

…, update docs and tests

- Add MEGA_SYSTEM_ADDRESS check in host.rs sload() to exempt system
  transactions from Rex3 SLOAD-based oracle gas detention
- Update Rex3.md spec with SLOAD semantics (caller-agnostic, DELEGATECALL
  escape, system address exemption difference)
- Fix stale doc references (1M -> spec-dependent) in tracker.rs,
  instructions.rs, mod.rs, README.md, BLOCK_AND_TX_LIMITS.md
- Add 8 new tests: system address exemption, non-oracle SLOAD, nested
  calls, combined limits, sendHint, keyless deploy compute gas limit
@Troublor Troublor merged commit 513295b into main Feb 12, 2026
2 checks passed
@Troublor Troublor deleted the william/fix/rex3-system-address-exemption-docs-tests branch February 12, 2026 14: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.

1 participant