[DRAFT] Generate Hive Test Fixtures
Introduces a new generator type, api, that can be used to produce hive test fixtures.
The fixtures specify a post state file that is used by hive as checkpoint sync start point for the consensus client.
The produced tests contain a hive.yaml file that lists a series of verifications/actions that hive must perform after the client is started. At the moment, only a single Beacon API verification is supported, but this list of actions can be expanded to perform P2P tasks.
The config file configs/hive.yaml is introduced, and its only purpose is to change the fork versions in order for the clients to accept the configuration files (otherwise the consensus client (prysm) fails with "cannot add config with conflicting fork version schedule").
Decorator hive_state is also introduced and performs two tasks:
- Changes the state's genesis time from zero to
MIN_GENESIS_TIMEin order for clients to accept the genesis state and post state as checkpoint sync, otherwise client (prysm) fails with "panic: zero genesis time". - Yields the start state as
genesis.ssz_snappy, which is then used by hive to configure the consensus client
setup.py was also modified in order to set PRESET_BASE in the resulting python module to the actual value found in the config yaml file (it was previously forced to the preset name value).
Open questions:
- The new preset file
configs/hive.yamlshould only be used to generate tests in theapigenerator, but I'm not sure how to put a limit to this. - There might be a simpler way to modify the fork version values without having to create an entire config file only for this.
Requires https://github.com/ethereum/hive/pull/784 to run the fixtures.
@marioevz Where do you stand on this? Do you want to get this cleaned up to get merged? Or want to leave as draft for now
@marioevz Where do you stand on this? Do you want to get this cleaned up to get merged? Or want to leave as draft for now
Sorry I didn't make the time to finish this up yet, the problem at the moment is that the hive part is not really working yet, but I've been working on execution layer and haven't been able to work on the fixes yet, so there might be some small modifications to this PR based on fixes on the hive side.
Let me try to clean it up this week and have it merged, if there are any modifications based on the eventual hive fixes, I'll open up a follow up PR if that's ok.
Needs to be revisited/rewritten, closing for now.