ssvlabs / ssv-spec

GNU General Public License v3.0
25 stars 22 forks source link

Revert changes in `HashTreeRoot` and SSZ encoding for backwards-compatibility #354

Closed moshe-blox closed 7 months ago

moshe-blox commented 7 months ago

fastssz was upgraded in #324 and it changed the roots for ConsensusData, SignedMessage and SSVMessage, which would be a fork.

This fastssz upgrade included a crucial hashing fix, replacing PutBytes with Append in order to prevent double-merkleization in HashTreeRoot methods, thereby changing roots for []byte fields exceeding 32 bytes.

It's noted that Beacon spec tests appear unaffected by this change, as they don't contain fields exceeding the threshold for the double-merkleization bug. However, we don't know that Beacon messages are absolutely not impacted.

Therefore, we propose inspecting the changes in _encoding.go files between the currently and previously imported versions of go-eth2-client, to ensure that any change from PutBytes to Append is encoding a field which can not exceed 32 bytes in size.

Two more changes were done to preserve backwards-compatibility:

moshe-blox commented 7 months ago

Closed in favor of #361