Skip to content

Merge upstream changes#9

Open
pdobacz wants to merge 19 commits intoforks/monad_ninefrom
upstream
Open

Merge upstream changes#9
pdobacz wants to merge 19 commits intoforks/monad_ninefrom
upstream

Conversation

@pdobacz
Copy link
Collaborator

@pdobacz pdobacz commented Feb 12, 2026

IMPORTANT: Merge with MERGE COMMIT!

This PR merges ~2 days of upstream changes into forks/monad_nine, our default branch.

I'm having this because I want to have our upstream contribution refactor(tests): Add fork parameter to Initcode generator out of the way before merging mip3 branch.

Also, upstream improvements and refactoring brought two issues to light:

  • our G_STORAGE_UPDATE value should in Monad compound the same update as G_COLD_SLOAD, since these work in tandem in EELS
  • EIP-7825 tests started running and failing for some reason, so I've cherry picked our fix Fix TX_MAX_GAS_LIMIT for monad forks which rectifies these tests (Monad adopts tx gas limit cap differently, but the tests can work for Monad as well with just a bit of config effort)

Opening as Draft because tests don't fill, but I want to see how the history works correctly now after #7 🎉

Ready for review

pdobacz and others added 19 commits February 9, 2026 09:55
)

* refactor(tests): Add fork parameter to Initcode generator

Initcode class now uses fork-specific gas costs and memory expansion
formula instead of hardcoded values.

Co-Authored-By: Claude Opus 4.5

* Fixes after review

Co-authored-by: Mario Vega <marioevz@gmail.com>

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
* fix(tests): EIP-7883 modexp - fix gas formula

* fix(tests): EIP-7883 use old spec at Osaka siblings

* Fixup comment & gas formula after review
…reum#2182)

* refactor(bloatnet): split stubs.json into mainnet and bloatnet variants

Separate stub mappings so mainnet-only benchmarks (XEN, USDC, IMT, STR)
use stubs_mainnet.json while bloatnet benchmarks (including 30GB_ERC20)
use stubs_bloatnet.json.

* fix: update file name

---------

Co-authored-by: LouisTsai <q1030176@gmail.com>
* feat(testing/fill): Account-hash-based deploy addresses

* fix(testing): Allow EOAs to have code for collisions

* fix(tests): All tests using pre.fund_address

* fix(tests): Tests setting EOA code

* fixes

* Fixes

* Add correct markers to all tests

* fix(testing): test generator use appropriate mark

* fix(testing/filler): Logic

* refactor(tests): Remove most pre-alloc-group markers

* feat(filler): Make pre-alloc auto-groupable

* fix: bug, add unit test

* refactor: Remove `pre_fund_address` marker

* refactor: Remove extra flags

* fix: execute

* refactor: Move helper methods

* fix: Separators

* fix: Static tests

* fix: Tox, review comments

* fix(tests): Mark test_creates_collisions

* Update tests/prague/eip7702_set_code_tx/test_set_code_txs.py

Co-authored-by: felipe <fselmo2@gmail.com>

* fix: `pre.fund_address`

---------

Co-authored-by: felipe <fselmo2@gmail.com>
* feat(testing/vm): Cache bytecode's keccak

* feat(testing/vm): Cache bytecode gas cost/refund

* feat(tests/benchmark): Cache created contract address

* feat(tests/benchmarking): Cache access list

* refactor: refactor caching with module-level ``@cache``

---------

Co-authored-by: fselmo <fselmo2@gmail.com>
* chore: update style guidelines

* Apply suggestion from @fselmo

Co-authored-by: felipe <fselmo2@gmail.com>

---------

Co-authored-by: felipe <fselmo2@gmail.com>
…s_cost(fork)` (ethereum#2186)

* refactor(test-tests): migrate amsterdam gas costs to use `bytecode.gas_cost(fork)`

* chore(test): DRY metadata gascost refactor

---------

Co-authored-by: fselmo <fselmo2@gmail.com>
…gas_cost(fork)` (ethereum#2191)

* refactor(test-tests): migrate cancun to osaka gas costs to use `bytecode.gas_cost(fork)`

* chore: Remove redundant `Bytecode` wrapping

* chore: Remove one redundant `Bytecode` wrapping

* fix: Hardcoded fork

* Update tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
…reum#2193)

* Add BlockException.GAS_USED_OVERFLOW mapping to ethrex exception mapper

ethrex now returns "Block gas used overflow..." for EIP-7778
pre-refund gas accounting failures (Amsterdam+), distinct from the
existing "Gas allowance exceeded..." transaction-level error.

* Add BAL exception mappings to ethrex exception mapper

Add mappings for Block Access List (EIP-7928) related exceptions:
- INVALID_BLOCK_ACCESS_LIST
- INVALID_BAL_HASH
- INVALID_BAL_EXTRA_ACCOUNT
- INVALID_BAL_MISSING_ACCOUNT
- INCORRECT_BLOCK_FORMAT

ethrex validates BAL by computing the hash and comparing against the
header, so all BAL corruption types produce the same hash mismatch
error. Additionally, index-out-of-bounds and RLP decode errors are
mapped for INVALID_BLOCK_ACCESS_LIST and INCORRECT_BLOCK_FORMAT.
…in CI (ethereum#2120)

* chore(tooling,ci): remove maxprocesses for py3 tox env

* chore(tooling,ci): throttle xdist workers locally, use all cores in CI

Replace `-n auto` with `-n {env:PYTEST_XDIST_AUTO_NUM_WORKERS:6}` in
py3 and tests_pytest_py3 tox envs. Defaults to 6 workers locally to
avoid deadlocks; CI sets the env var to `auto` for full core usage.
Removes the now-redundant `--maxprocesses` flag.

* chore(deps,ci,tooling): add `psutil` to dev deps to count physical cores

Without `psutil` pytest-xdist reports the number of logical cores.

* chore(tooling): document why py3 uses --dist=loadgroup
@pdobacz pdobacz marked this pull request as ready for review February 13, 2026 10:59
@greptile-apps
Copy link

greptile-apps bot commented Feb 13, 2026

Greptile Overview

Greptile Summary

This PR merges approximately 2 days of upstream changes into the forks/monad_nine branch. The merge brings important refactoring and improvements from upstream, while also addressing two critical issues specific to Monad:

Key Changes:

  • G_STORAGE_UPDATE Fix: Correctly compounds G_STORAGE_UPDATE with +6000 to match G_COLD_SLOAD behavior in EELS, fixing storage operation gas costs for Monad forks
  • TX_MAX_GAS_LIMIT Implementation: Sets transaction gas limit cap to 30M for Monad forks, adds validation in transaction processing, and updates EIP-7825 tests to run from MONAD_EIGHT instead of Osaka
  • Upstream Refactoring: Migrates gas cost calculations throughout tests to use Op.gas_cost(fork) and bytecode.gas_cost(fork) methods instead of manual calculations
  • Initcode Generator Enhancement: Adds fork parameter to Initcode generator (upstream contribution by this team) for proper fork-aware gas calculations
  • Precompile Gas Constants: Expands and properly initializes all precompile gas constants including BLS12-381, P256VERIFY, and others

Test Updates:

  • EIP-7825 tests now properly handle Monad's 30M gas limit cap
  • EIP-7702 tests updated with correct gas calculations and max depth handling for 30M limit
  • Multiple test markers updated to reflect Monad-specific behavior

The changes are well-structured and address the identified issues. The gas cost refactoring improves maintainability and correctness across fork-specific implementations.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and address specific issues identified through testing. The G_STORAGE_UPDATE fix correctly aligns with EELS behavior, the TX_MAX_GAS_LIMIT implementation is properly validated, and the upstream refactoring improves code quality by replacing manual gas calculations with fork-aware methods. All Monad-specific changes are isolated and clearly documented.
  • No files require special attention

Important Files Changed

Filename Overview
packages/testing/src/execution_testing/forks/forks/forks.py Adds G_STORAGE_UPDATE + 6000 fix for Monad, implements transaction_gas_limit_cap method, refactors precompile gas constants into proper initialization
src/ethereum/forks/monad_eight/transactions.py Adds TX_MAX_GAS_LIMIT constant (30M) and validation in validate_transaction, imports TransactionGasLimitExceededError
src/ethereum/forks/monad_next/transactions.py Updates TX_MAX_GAS_LIMIT from 16_777_216 to 30_000_000 to match MONAD_EIGHT
src/ethereum/forks/monad_eight/exceptions.py Adds TransactionGasLimitExceededError exception with clear documentation
tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py Changes test markers from Osaka to MONAD_EIGHT, fixes gas cost calculations to use Op.gas_cost(fork) method, adds 30M gas limit case
packages/testing/src/execution_testing/tools/tools_code/generators.py Adds fork parameter to Initcode generator, removes manual gas calculations in favor of Op.gas_cost(fork)

Last reviewed commit: 73657d7

@pdobacz pdobacz requested review from QEDK and mijovic February 13, 2026 11:06
@pdobacz
Copy link
Collaborator Author

pdobacz commented Feb 13, 2026

Ready for review. In case anyone approving wants to merge remember to make a merge commit to preserve upstream history

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.

10 participants