Closed itsdevbear closed 1 week ago
[!WARNING]
Review failed
The pull request is closed.
These changes focus on improving the SSZ (Simple Serialize) functionality for handling binary encoding, marshalling, and generating Merkle roots. This includes adding new basic types, simplifying serialization methods, and testing with fuzz functions. The updates make the SSZ processes more streamlined, flexible, and robust, adhering to SSZ format specifications.
Files | Change Summary |
---|---|
mod/primitives/pkg/ssz/merkleizer_test.go |
Modified MarshalSSZ method in BasicItem struct to use binary encoding. |
mod/primitives/pkg/ssz/serialization.go |
Removed specific unmarshalling and marshalling functions; lean towards a generic serialization approach. |
mod/primitives/pkg/ssz/serialization_test.go |
Replaced individual test functions with fuzz testing functions for various types. |
mod/primitives/pkg/ssz/types/basic.go |
Introduced basic types and their SSZ serialization/deserialization methods. |
mod/primitives/pkg/ssz/types/constants.go |
Added constants for byte and bit sizes used in chunk processing and serialization. |
mod/primitives/pkg/ssz/types/interfaces.go |
Defined the Merkleizer interface for merkleizing various SSZ types. |
mod/primitives/pkg/ssz/types/list_basic.go |
Added functionality for handling lists of basic types (SSZListBasic ) with serialization and Merkle root methods. |
mod/primitives/pkg/ssz/types/vector_basic.go |
Introduced functionality for handling vectors of basic types (SSZVectorBasic ). |
mod/primitives/pkg/ssz/types/vector_basic_test.go |
Added test cases for SSZ vectors of various basic types, covering size calculation, hashing, and marshaling. |
🐰 "In bytes and bits, a tale we spin,
Marshaled now from deep within,
With roots of Merkle, strong and bright,
Our SSZ shines in data's night.
Constant bytes, anew they gleam,
Our code now seamless as a dream." 🌟
Summary by CodeRabbit
New Features
SSZBool
,SSZUInt8
,SSZUInt16
,SSZUInt32
,SSZUInt64
,SSZByte
) with serialization, deserialization, and hashing methods.SSZVectorBasic
) and lists (SSZListBasic
), including methods for size calculation, marshaling, and hashing.Bug Fixes
Tests
Refactor