Cannot generate SSZ object files
Closed this issue ยท 3 comments
When running go generate ./...
in the spec/deneb
directory, sszgen
exits with the following error:
[ERR]: failed to encode SignedBeaconBlock: failed to encode BeaconBlock: failed to encode BeaconBlockBody: failed to encode ExecutionPayload: could not find struct with name 'Int'
Have you ever encountered this issue?
Thank you!
Hi @mcdee this is a blocker for us. Please educate us how to properly run sszgen
๐
sszgen
doesn't support all types. uint256.Int
is something that is kind-of supported but doesn't generate the correct code, as far as I can tell (and this seems to be supported by ferranbt/fastssz#161).
What I have done in the past to address this is to change the struct to replace the uint256.Int
with [8]byte
and then generate the SSZ. Then the resultant generated code needs to be tweaked to put the uint256.Int
back in. The current executionpayload_ssz.go
can be used as a reference.
For a more permanent fix either the marshalling and unmarshalling functions in github.com/holiman/uint256 need to be altered, or fastssz needs to have its own marshalling and unmarshalling functions for uint256.Int
, but I haven't had a chance to look at either solution to date.
Thank you!