-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fork-choice integration test format and example (WIP) #17
Comments
The test scenario files are generated by augmenting our current Kotlin fork choice tests, the code is not part of a public repo yet. |
I've pushed test executor and other test updates. https://github.com/harmony-dev/beacon-chain-java/tree/tests/fork-choice-integration-tests/qa/src/test/kotlin/qa There are two Kotlin files with tests, one for block tests and another one for attestations. They can be run using IDEA. When run, they will generate yaml test scenario files. Which can be run by test_executor. Currently, we are using pseudo BLS signature implementation so that tests run faster. There are also other sources of incompatibilities (like file format extra fields), but I am working on fixing them. |
New test scenarios attached fork_choice_integration_tests.zip |
I've finally adapted fork choice tests so that their format is aligned with the existing eth2.0-spec-tests. Tests are for v0.10.1 tag - I have validated them with Teku, which currently supports v0.10.1. There are problems to be resolved yet:
However, it closely matches the existing tests format, so, it will be easier to adopt. In general, I would propose another format, where parts are assembled into one file. Another idea is to move common test parts to a common directory. Test format becomes more like a graph. However, it will occupy much less disk space and will require less I/O, which is important if many tests are to be generated. |
@ericsson49 Great, thanks for this work :). Regarding the problems:
If we want to ship this fast I think it's best to provide states and blocks as |
@protolambda Thanks for the comments! I do want to put more time. I want to develop or generate more tests to improve coverage and disk space. Most tests do not require BLS and so can be run pretty fast. So the main problem is disk usage. |
@protolambda Two main ideas:
At the moment, parts are blocks, states and attestations. But they can be any top-level containers, defined by eth2.0 specs. Sub-parts like AttestationData will be more difficult to handle. Test description is a
An additional optimization is that The link above illustrates the ideas. The storage savings are significant:
As a result, there is about 1.5K data per test on average, plus cached stuff, which is additionally 1K or 5K on average, depending on whether cache is compressed or not. |
Are you hand specifying the tests to ensure reuse of the cache or do you have a method to deduplicate given a set of tests? |
I record events during a test run, and when converting the trace to a file, I'm using a de-dup cache. |
In general, I'm thinking about three-four levels of de-duplication:
The proposed test format solves the first issue. The second one may be interesting, since implementations can cache |
I've generated a version fork choice tests for v012x branch and put them here. Code to generate and to run the tests against The tests currently do not support optional checks. Optional checks may be required, if some client do not buffer early blocks/attestations and just drop them. Currently, the tests assume such messages are buffered and re-inserted when appropriate (e.g. current slot incremented or a referenced block has arrived). Therefore, such checks can be made optional, to support variations in implementations, though I personally believe it's not a good idea. My priority has been to agree on the fork choice test format and release some official fork choice integration tests first. Test generation code also does not yet conform to beacon chain test generators rules and guidelines. |
I've created a version of fork choice test format, which allows optional checks, e.g.:
instead of just
|
I've updated tests to match v0.12.2. Tests are here and here (optional checks). |
Thanks! This is great work. Are we planning to merge these into the official eth2.0-spec-tests repo? |
|
The issue is opened to communicate the initial draft version of the proposed format for fork choice integration-style compatibility test suite.
It's an early stage work in progress and will change. However, the main idea will stay the same.
It is to be moved to a GitHub repo at some point, when it's mature enough.
There will be common files like spec constants and genesis states, but this is to be defined.
There is a file for each test case (yaml format currently, but can be SSZ as well).
Each test consists of test steps, each step being either an event (slot, block or attestation) or a condition to verify. There is also an initial state (should be spec constants plus genesis state, however the last one is lengthy, currently only amount of validators is specified in the file.
Test file format:
A file with several examples attached
Stale integration_tests_on_attestation.zip
New version fork_choice_integration_tests.zip
The text was updated successfully, but these errors were encountered: