Update specs/light_client/merkle_proofs.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>
This commit is contained in:
vbuterin 2019-08-01 08:07:57 -04:00 committed by GitHub
parent cb1a0cbd5f
commit ed3749264b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ def get_expanded_indices(indices: List[int]) -> List[int]:
branches = set() branches = set()
for index in indices: for index in indices:
branches = branches.union(set(get_branch_indices(index) + [index])) branches = branches.union(set(get_branch_indices(index) + [index]))
return sorted(list([x for x in branches if x*2 not in branches or x*2+1 not in branches]))[::-1] return sorted([x for x in branches if x*2 not in branches or x*2+1 not in branches])[::-1]
``` ```
Generating a proof that covers paths `p1 ... pn` is simply a matter of taking the chunks in the SSZ hash tree with generalized indices `get_expanded_indices([p1 ... pn])`. Generating a proof that covers paths `p1 ... pn` is simply a matter of taking the chunks in the SSZ hash tree with generalized indices `get_expanded_indices([p1 ... pn])`.