Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

GalRogozinski
Copy link
Contributor

@GalRogozinski GalRogozinski commented Feb 1, 2024

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:

  • Encoding of types.Contribution was copied over from v0.3.4
  • spec.DataVersion is now being decremented in encodings and incremented in decodings, because all of the values were incremented by 1 in go-eth2-client.

GalRogozinski and others added 3 commits January 31, 2024 22:51
* create jsons

* compare with jsons

* generate jsons for qbft signed message

* compare qbft signed message with json state

* fix lint error

* generate jsons for create msg test

* generate jsons for create msg test

* use correct test type

* use correct test name
* Revert "Revert "Deneb Support (#324)""

This reverts commit 0a559e2.

* use custom old encodings

* generate-jsons

* Add phase0 version

* Bellatrix -> Capella on a single test

* Generate jsons

* Revert Capella -> Deneb on a single test

---------

Co-authored-by: MatheusFranco99 <[email protected]>
Copy link
Contributor

@MatheusFranco99 MatheusFranco99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!
Nice description

@GalRogozinski GalRogozinski merged commit 3879a9e into main Feb 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants