karalabe / ssz

Opinionated 0-alloc SSZ codec for Go
https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md
BSD 3-Clause "New" or "Revised" License
39 stars 7 forks source link

bug(serialization): round-trip is not the same #18

Closed itsdevbear closed 1 month ago

itsdevbear commented 3 months ago

Linking from BeaconKit repo: https://github.com/berachain/beacon-kit/pull/1834

itsdevbear commented 3 months ago

cc: @sbudella-gco

cc

karalabe commented 2 months ago

Sorry, was on holiday last week. Will try to work my way through these soon.

itsdevbear commented 2 months ago

all good, hope it was fun!

karalabe commented 1 month ago

Hmm, yes, https://go.dev/play/p/7gEv_kOwC9I

Go apparently allows slicing into a nil slice and it remains a nil slice. for some reason I thought it would crash on slicing nil. That's why it wasn't caught. Will fix.