Skip to content

SSZ zig enhancement #29

Open
Open

Description

@GrapeBaBa

There is a zig ssz lib here developed by the member of Verkle/ZEAM team, but we found some issues when used it in consensus spec types. We can enhance this lib and further do optimization to make it available for both beacon and beam chain.
There is a talk at Devcon 7 which introduced high perf ssz lib implementation here which can be inspired.

Activity

  1. spiral-ladder commented on Nov 19, 2024

    @spiral-ladder

    What are some of the issues found? I guess it has to do with the issues you've opened.

  2. GrapeBaBa commented on Nov 19, 2024

    @GrapeBaBa
    MemberAuthor

    @fearlessfe Can you post all the issues and alternative solutions here to discuss

  3. fearlessfe commented on Nov 19, 2024

    @fearlessfe
    Contributor

    @eightfilms Our code is not exact the same with the ssz lib , because we use the latest version of zig, the std.builtin.Type has changed.

    In fact our encode and decode methods are from the zabi, the origin code of zabi is also from the ssz lib , but with some updates; the hashRootTree method are from the ssz lib .

    In our ssz spec tests, we find some bugs(according to the current ssz lib)

    1. when serialize struct, int, bool, array, struct with fixed length should serialize directly, the same with deserialize method
    2. there is bug in merkleize method, you can see in this pr
    3. in hashTreeRoot method, when the type is Slice, we must pass the limit, after that, it should call the mixInLength method. Now, we doesn't find a solution to pass the limit of Slice type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions