-
Notifications
You must be signed in to change notification settings - Fork 39
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
Choose which Ethereum headers to track in Ethereum light client #1050
Comments
Let me explain first on how the data is generated and, how it is used during the verification. Generation phaseLodestar stores three checkpoints:
Currently in the update data, we get these two fields:
Since there is no use case to use both of the finality checkpoints at a single time, we don't need to provide both of them in the update data. Changing the update data generation process to return the info about justified header by keeping the data type the same is easiest to handle in Therefore, I changed lodestar to do the following:
Verification phaseThe only difference is when we check the merkle root. Currently, we have let finalized_root = update.finalized_header.beacon.tree_hash_root();
validate_merkle_branch(
&finalized_root.into(),
&update.finality_branch,
floorlog2(FINALIZED_ROOT_INDEX),
get_subtree_index(FINALIZED_ROOT_INDEX),
&update.attested_header.beacon.state_root,
)?; So to create a verifier that is capable of verifying both the justified and the finalized checkpoints, we are going to add this choice to the enum Finality {
Justified,
Finalized,
}
trait LightClientContext {
fn finality_choice(&self) -> Finality;
} By adding this capability to the context trait, we won't have to deploy two different contracts each time to track finalized and justified headers but we will specify the finality that we want to track during the instantiation of the light client by putting it to the |
We are going to support both headers |
Either
Finalized
orJustified
(@aeryz will expand this issue)The text was updated successfully, but these errors were encountered: