-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A new more complete test format for ETH 2.0 testing #877
Conversation
Work in progess, suggestions welcome, aiming at fast-paced progress to get new state transition tests in |
Co-Authored-By: protolambda <proto@protolambda.com>
Co-Authored-By: protolambda <proto@protolambda.com>
Co-Authored-By: protolambda <proto@protolambda.com>
Co-Authored-By: protolambda <proto@protolambda.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your tweet:
With this, together with a "fork timeline" format, we can have a standardized way of initializing testing contexts, and test networks. 👀 Close to the standardized genesis format ETH 1.0 never got to have
Side note: eth 1.0 does have WIP standardized genesis format: ethereum/EIPs#1085
"Fork-timeline" looks like the chain configuration in client side, take eth1 client for example since they have forks already: geth, trinity, harmony. In eth2, it looks like we can define it in a list of Fork
objects.
I wonder what's the use case of having forks/chain configurable in tests? It looks like setting up a short-lived testnet and running the script of given operations - but the thing we want to test could be done with some normal slot-to-slot state transition tests too and might be more deterministic.
Co-Authored-By: protolambda <proto@protolambda.com>
Yes, the timeline is very similar to the "params" section of the genesis format proposed for eth 1. But with slots, because we can :) The "genesis" and "accounts" sections are not so compatible with eth 2: genesis of eth 2 is based on contract events on some eth-1-like chain. And I assume this is the case for a testnet as well. Either based on a connection with a real net, or just some raw contract log event data to inject in an eth 2 genesis setup. |
@hwwhww Interesting, but stating both previous and current version for every entry in the list seems very verbose. Like spelling out a raw linked list. It does bring up an interesting point however: do we want forks based on epoch number (less flexible, current |
Yes, agreed that eth2 genesis format will be quite different from eth1. Just FYI. 🙂
For the state transition test, my gut tells me that one fork setting (i.e., set that this state transition happens with which fork) is good enough for most cases. But not sure if there's any case of mulit-fork timeline requirement?
Right, but state transition tests probably only need one
I'd say based on current phase 0 design, it makes more sense to do with After all, the two different angles of test format designs so far:
I do like this solution more! 👍 |
Agreed -- epoch number. Also agree that using the
Might be useful to test a fork in rapid succession (kind of like the constantinople and petersburg forks). |
Changed fork timeline definition to use epoch numbers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of nitpicks, then ready to merge
The format
See
specs/test_formats/README.md
file in PR, includes new testing glossary, configuration considerations, and general format.Test type formats will be documented in markdown files in the
specs/test_formats/
folder.Upgrade path:
Test Types
The following test-types are proposed:
(pre state, [block...]) -> post state
(pre state, tx) -> post state
How it affects existing test types
BLS
To be updated to move the "sub types" to separate test suites, each with their own handler. I.e. it would look like:
SSZ
The SSZ tests are compatible as is, and the base generator is based of of the design of this generator.
Easy to port over to use the new base generator.
Shuffling
Although the current testing is good, it sort of mixes validator activation with the shuffling algorithm.
We may decide to change it to just test shuffling based on a list of indices later down the road.