Inject contract deployments - #157
Open
jochem-brouwer wants to merge 5 commits into
Open
Conversation
LouisTsai-Csie
force-pushed
the
inject-contract-deployment-tx
branch
2 times, most recently
from
June 19, 2026 05:03
7ce9312 to
9af1f6a
Compare
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 adds on top of PR 156
PR 156 generates the stateful benchmark payloads:
gas-bump→funding→ adeploy phase (
test_deploy_existing_contracts) → the measured benchmark run.This branch extends that with:
Deploy output becomes prestate. The deploy phase's payloads are promoted
into
setup-global-test.txt(the base replayed before every test, likegas-bump.txt/funding.txt) instead of being a measured scenario, and theaddon 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).
Two-fork runs (
--benchmark-fork). Fill the setup/prestate on--forkand the benchmarks on a later fork. The mitm addon is restarted for the
benchmark phase with a
min_block_timestampfloor (read from the genesisfork-transition timestamp) so benchmark blocks land past the transition (and
use the correct
engine_newPayloadversion), whilereuse_globalspreservesthe 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_contractsalso creates EIP-7702 delegate EOAs(delegate
i→i-thEXISTING_CONTRACT_DIFFcontract) as part of theprestate.
helpers.py: derivablediff_delegate_authority(i)/diff_delegate_target(fork, i)so any benchmark can target the delegates.diff_to_delegated_contract_diffthat sends transfers tothose prestate delegates.
How to use
inject-contract-deployments, execution-specsdeployments.T(e.g. Osaka@0, Amsterdam@
Tviaeip7928TransitionTimestampand the otherAmsterdam EIP transitions; the generator reads
Tfrom the genesis).Flow: boot Nethermind on the transition genesis → gas-bump + funding (Osaka) →
deploy phase (Osaka): contracts + 7702 delegates promoted to the
setup-global-test.txtprestate → addon restarts for Amsterdam → benchmark(Amsterdam): transfers to the delegated EOAs.
Single-fork: drop
--benchmark-forkand use a normal (non-transition)genesis; the run behaves like PR 156 plus the prestate-promotion change.