Skip to content

Inject contract deployments - #157

Open
jochem-brouwer wants to merge 5 commits into
inject-contract-deployment-txfrom
inject-contract-deployments
Open

Inject contract deployments#157
jochem-brouwer wants to merge 5 commits into
inject-contract-deployment-txfrom
inject-contract-deployments

Conversation

@jochem-brouwer

@jochem-brouwer jochem-brouwer commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

What this adds on top of PR 156

PR 156 generates the stateful benchmark payloads: gas-bumpfunding → a
deploy phase (test_deploy_existing_contracts) → the measured benchmark run.
This branch extends that with:

  1. Deploy output becomes prestate. The deploy phase's payloads are promoted
    into setup-global-test.txt (the base replayed before every test, like
    gas-bump.txt / funding.txt) instead of being a measured scenario, and the
    addon anchors benchmark scenarios on that deploy head. So predeployed
    contracts/EOAs exist before the measured run and the client under test does
    not deploy them during it (and therefore can't warm/cache them).

  2. Two-fork runs (--benchmark-fork). Fill the setup/prestate on --fork
    and the benchmarks on a later fork. The mitm addon is restarted for the
    benchmark phase with a min_block_timestamp floor (read from the genesis
    fork-transition timestamp) so benchmark blocks land past the transition (and
    use the correct engine_newPayload version), while reuse_globals preserves
    the prestate across the restart. Omit --benchmark-fork → single-fork,
    unchanged behavior.

Paired execution-specs changes (as changes to PR 2947 (note: PR not to execution-specs but as PR on top of PR 2947 as PR 9))

  • test_deploy_existing_contracts also creates EIP-7702 delegate EOAs
    (delegate ii-th EXISTING_CONTRACT_DIFF contract) as part of the
    prestate.
  • helpers.py: derivable diff_delegate_authority(i) /
    diff_delegate_target(fork, i) so any benchmark can target the delegates.
  • New benchmark case diff_to_delegated_contract_diff that sends transfers to
    those prestate delegates.

How to use

  1. Check out: gas-benchmarks inject-contract-deployments, execution-specs
    deployments.
  2. Provide a genesis scheduling the benchmark fork at a high timestamp T
    (e.g. Osaka@0, Amsterdam@T via eip7928TransitionTimestamp and the other
    Amsterdam EIP transitions; the generator reads T from the genesis).
  3. Run:
python3 eest_stateful_generator.py \
  --fork Osaka --benchmark-fork Amsterdam \
  --genesis-path <osaka-amsterdam-transition>.json \
  --chain mainnet --rpc-chain-id 1 \
  --rpc-seed-key <key> --rpc-address <addr> \
  --test-path tests/benchmark/stateful/bloatnet/ \
  --parameter_filter diff_to_delegated_contract_diff \
  --eest_mode repricing \
  --gas-bump-count <N> --gas-benchmark-values <V> \
  --eest-no-pull

Flow: boot Nethermind on the transition genesis → gas-bump + funding (Osaka) →
deploy phase (Osaka): contracts + 7702 delegates promoted to the
setup-global-test.txt prestate → addon restarts for Amsterdam → benchmark
(Amsterdam): transfers to the delegated EOAs.

Single-fork: drop --benchmark-fork and use a normal (non-transition)
genesis; the run behaves like PR 156 plus the prestate-promotion change.

@LouisTsai-Csie
LouisTsai-Csie force-pushed the inject-contract-deployment-tx branch 2 times, most recently from 7ce9312 to 9af1f6a Compare June 19, 2026 05:03
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.

2 participants