BeaconState
to zkVMBeaconState
from consensus-spec-tests yaml files.BeamState
constructed with a subset of BeaconState
fields, pass it into the guest zkVM, and journaled back to the host machine.After being stuck trying to construct a BeaconState
from scratch, I was finally able to escape by constructing it from consensus-spec-tests
test data instead. Thanks to Jun's suggestion and Kolby's code in ream/testing/ef-tests
that made this straightforward.
Initially I tried passing the full BeaconState
into the guest VM but the guest threw this error back:
The BeaconState
is a huge container so figuring out what went wrong would be hard. So I created BeamState
within the consenzero
repo and assigned the field over from BeaconState
one by one until the error shows. This is the culprit:
It seems that risc0
does not know how to deserialize ssz_types::serde_utils::quoted_u64_var_list
hence the error "value: NotSupported". So I've asked Risc0 team on Discord and waiting for their response.
For now I'd rather wait for their response than spending more time debugging myself since this is likely from their guest implementation.
While waiting for their response, I'll just proceed to build as many BeamState
field as possible without errors then start trying out the state transition.
guest::env::FdReader::read()
behaviorBeamState
and see there are more errors elsewhere.