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

SSZ zig enhancement #29

Open
Tracked by #27
GrapeBaBa opened this issue Nov 18, 2024 · 3 comments
Open
Tracked by #27

SSZ zig enhancement #29

GrapeBaBa opened this issue Nov 18, 2024 · 3 comments

Comments

@GrapeBaBa
Copy link
Member

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.

@eightfilms
Copy link
Contributor

eightfilms commented Nov 19, 2024

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

@GrapeBaBa
Copy link
Member Author

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

@fearlessfe
Copy link
Contributor

fearlessfe commented Nov 19, 2024

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants