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 #362

Closed GalRogozinski closed 7 months ago

GalRogozinski commented 7 months ago

Description

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.

The changes that were done to preserve backwards-compatibility: