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

Add NodeEncoding trait #24

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

axic
Copy link
Contributor

@axic axic commented Sep 9, 2019

No description provided.

@gballet
Copy link
Owner

gballet commented Sep 10, 2019

I understand that this is still in progress and it might change. Still, I'm commenting so that you don't spend too much time going in the wrong direction: in its current state, this code binds Node serialization to rlp. The idea behind that library is to factor the algorithm and leave details such as the encoding format.

So if someone (presumably in the eth1 world) needs RLP, they just need to implement rlp::Encodable (which is already done). If someone wants to use SSZ, then they will need to implement somthing like ssz::Encodable. And if someone wants JSON (currently in the pipe), they can implement serde::Serializable.

Maybe I misunderstand what you're trying to do. Just please update the description when you have a moment.

@axic
Copy link
Contributor Author

axic commented Sep 27, 2019

I'm not sure what is the confusion, but since the the proof builder and verifier both internally encode things, you need a trait to run that encoding, which is not tied to RLP.

And this is only the first step. You'd provide different impls of Node to make_multiproof and rebuild which either fully use RLP or SSZ, but this trait is shared between the two.

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.

2 participants