-
Notifications
You must be signed in to change notification settings - Fork 472
feat(testing): Stateful Engine X Format and Fill Transition Tool #2125
Copy link
Copy link
Open
Labels
A-spec-specsArea: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)A-spec-toolsArea: Specification Tooling—Tools for the Ethereum specification (eg. `src/ethereum_spec_tools/*`)Area: Specification Tooling—Tools for the Ethereum specification (eg. `src/ethereum_spec_tools/*`)A-test-benchmarkArea: execution_testing.benchmark and tests/benchmarkArea: execution_testing.benchmark and tests/benchmarkA-test-client-clisArea: execution_testing.client_clisArea: execution_testing.client_clisA-test-consumeArea: execution_testing.cli.pytest_commands.plugins.consumeArea: execution_testing.cli.pytest_commands.plugins.consumeC-featCategory: an improvement or new featureCategory: an improvement or new featureE-hardExperience: difficult, probably not for the faint of heartExperience: difficult, probably not for the faint of heartP-highstaleThe Issue/PR has not had any activity for 60 days. PRs will be automatically closed.The Issue/PR has not had any activity for 60 days. PRs will be automatically closed.
Description
Metadata
Metadata
Assignees
Labels
A-spec-specsArea: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)A-spec-toolsArea: Specification Tooling—Tools for the Ethereum specification (eg. `src/ethereum_spec_tools/*`)Area: Specification Tooling—Tools for the Ethereum specification (eg. `src/ethereum_spec_tools/*`)A-test-benchmarkArea: execution_testing.benchmark and tests/benchmarkArea: execution_testing.benchmark and tests/benchmarkA-test-client-clisArea: execution_testing.client_clisArea: execution_testing.client_clisA-test-consumeArea: execution_testing.cli.pytest_commands.plugins.consumeArea: execution_testing.cli.pytest_commands.plugins.consumeC-featCategory: an improvement or new featureCategory: an improvement or new featureE-hardExperience: difficult, probably not for the faint of heartExperience: difficult, probably not for the faint of heartP-highstaleThe Issue/PR has not had any activity for 60 days. PRs will be automatically closed.The Issue/PR has not had any activity for 60 days. PRs will be automatically closed.
Type
Fields
No fields configured for issues without a type.
Original idea from this comment: ethpandaops/gas-lighting-tracker#34 (comment)
New
StatefulBlockchainEngineFixtureSimilar to
BlockchainEngineXFixturewhere all tests use the same genesis pre-allocation but with the main difference is that the pre-allocation is not included in a JSON file, rather it is a pointer to a stateful snapshot, which is the snapshot that should be used to initialize the client running the tests.New
StatefulTransitionToolSince the stateful snapshot is extremely big, it will not be possible to use common t8n tools, because these ingest the full pre-allocation via a JSON file, and since this file would be too big to process, it will be inefficient and maybe impossible.
Proposed solution is to create a new
TransitionToolsubclass that uses a fully instantiated client to perform the state transition.Instantiation
The
start_servermethod of this new class would reach out to the running client to verify it's running the correct snapshot, and that the client supports thetesting_buildBlockV1endpoint.State transition evaluation
The
evaluatemethod of this class would:testing_buildBlockV1call to the client to build a block with the list of transactions it requires to be included.Parallelism
Since we only have one instance of the client, and the client would need to rollback to a previous state via forkchoice update, it might not be possible to use xdist when filling these tests, but it's an open question.
Modified Fill Process
Not exhaustive list of requirements:
New flag to activate mode
Perhaps we can add a new flag to
fillto enable this mode,--stateful, which requires some other flags to be passed, e.g. the RPC address of the full client running the snapshot, and also a flag that contains the reference to the snapshot (the state root hash perhaps?)Other Considerations
Since we are relying on a pre-existing snapshot, we cannot modify the storage pre-allocation (perhaps we can? and produce a snapshot-delta?) the test filler must be modified slightly to do the
pre.deploy_contract,pre.fund_eoa, etc., in blocks on top of the snapshot, and then run the test blocks on top of these "setup blocks".We also can take special care of using stubs during filling too in order to replace
pre.deploy_contractwith contracts we are sure exist in the snapshot.