gencodec icon indicating copy to clipboard operation
gencodec copied to clipboard

Temp Check: SSZ

Open itsdevbear opened this issue 1 year ago • 5 comments

@fjl are you open to adding SSZ here?

I can implement.

itsdevbear avatar Mar 06 '24 16:03 itsdevbear

can either homeroll or use fastssz

itsdevbear avatar Mar 06 '24 16:03 itsdevbear

Yeah, why not. Question is mostly, how it will be done. Does fastssz support encoding by reflection?

fjl avatar Mar 06 '24 16:03 fjl

Looking at fastssz, it doesn't seem so easy. ssz.Marshal expects a Marshaler as argument, which is supposed to perform the encoding and also should be able to compute the encoded size. So I guess your idea would be to generate a Marshaler implementation? Then you're basically reimplementing the sszgen tool.

fjl avatar Mar 06 '24 16:03 fjl

The main purpose of gencodec is features such as 'required fields' and the 'override type'. If you need these, I think you'd be much better off just implementing them in sszgen.

fjl avatar Mar 06 '24 16:03 fjl

@fjl we are playing around with something internally, will share our findings in the next couple weeks

itsdevbear avatar Mar 20 '24 15:03 itsdevbear