-
Notifications
You must be signed in to change notification settings - Fork 996
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
Added light client related files #766
Conversation
This new proposal is really good and easy to follow, but I do have some questions:
|
I'm inclined to say that light clients can just keep asking for headers, and internally apply LMD GHOST based on the committee they're following. It is possible for this fork choice to diverge from the "official" one, but only in cases where close to 1/2 of validators or the committee are byzantine.
You authenticate the Merkle path shard block header -> beacon block header -> state -> latest_crosslink_data. |
So, the light client has a slightly weaker notion of finality. Isn't this a problem for the use case of authenticating ETH2 data in other blockchains? You cannot rely on heuristics like requesting data from other peers in such contexts.
But the
Both problems are solvable if the client is able to reconstruct another committee and then use that to authenticate a recent block header. |
So if you want to learn about finalized blocks, then you can authenticate the Merkle path shard block header -> beacon block header -> state -> finalized_epoch -> historical block root[finalized_epoch], and there's your finalized block. Even if that shard block gets reverted later, if you assume honest majority of the persistent committee, the fact that that block exists at all implies that the finalized block actually is finalized. |
Fair enough, thanks for the clarification. Am I right to assume that one of the next required steps would be to develop an automatic calculator that, given an arbitrary SSZ expression/function, can compute the size of the required Merkle proof and perhaps the minimal amount of time (gas) to verify it in a certain environment? Such a tool can also try to produce a zk-snark circuit to test the feasibility of compressing the proof. I'll be very happy to work on something like this. Having such a tool would allow us to compare in more concrete terms the various possible ways to arrange the signed data. I think there might be some reasonable optimisations brought by denormalizing the data a little bit (i.e. including an easier to reach copy of something, that can be otherwise obtained through a longer chain of links). This affects the size of the Merkle proofs, the required verification time and the size of the zk-snark circuits. As an example, even here, you are suggesting that the |
It depends on what your goals are :) If you just want to build a light client, then none of that is needed, you just need a tool to create and verify multiproofs of arbitrary SSZ objects (that happens to be on my own todolist as well). If you want to build an eth2-in-eth1 light client,then sure, though the code for that is easy; it's just verifying a Merkle multiproof.
Don't think this has anything to do with |
What's the status of these vs the files already in |
These files are newer. I feel like we should just merge this PR in soon; it's not final but it's definitely closer to final and more updated than what exists there now. |
specs/light_client/merkle_proofs.md
Outdated
return MerklePartial( | ||
root=hash_tree_root(obj), | ||
indices=indices, | ||
values= mk_multi_proof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mk_multi_proof
is undefined, and this function does not set proof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed that section entirely for now. I think the right time to bring it back would be after we have executable SSZ serialization, as then we would be able to actually generate the proofs as part of the spec (right now I'm not sure what the "final" interface in the executable spec would be...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm for now. merging
No description provided.