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

use slice instead of pointer to [32]byte array in SuffixDiff #388

Closed
gballet opened this issue Sep 4, 2023 · 2 comments
Closed

use slice instead of pointer to [32]byte array in SuffixDiff #388

gballet opened this issue Sep 4, 2023 · 2 comments

Comments

@gballet
Copy link
Member

gballet commented Sep 4, 2023

It is possible to use a slice and check that the value casts to the right length by using a marshaling structure.

@jsign
Copy link
Collaborator

jsign commented Aug 28, 2024

@gballet
Copy link
Member Author

gballet commented Aug 29, 2024

It turns out that, indeed, empty slices are encoded as null and so we could use []byte to do this. This would requite us to double-check that the decoded value is always 32 bytes however, so we need to add more code after deserialization.

The issue comes with SSZ encoding, which Péter wants to push in the engine api. This should be implemented with optionals, but there is one issue: there is no support for them in most SSZ libraries (except of course ssz.zig, the best SSZ library out there ❤️ ) so I guess the spec will change in order to either support stable containers or simply use something like #447. So there's no point in keeping this issue open, the problem will fix itself.

@gballet gballet closed this as completed Aug 29, 2024
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

2 participants