This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Verify Ancestry between Headers #3963
Merged
HCastano
merged 12 commits into
paritytech:hc-jp-bridge-module
from
HCastano:hc-verify-ancestry-proofs
Nov 4, 2019
Merged
Verify Ancestry between Headers #3963
HCastano
merged 12 commits into
paritytech:hc-jp-bridge-module
from
HCastano:hc-verify-ancestry-proofs
Nov 4, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
It looks like @HCastano signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
jimpo
suggested changes
Oct 30, 2019
jimpo
suggested changes
Oct 31, 2019
8bf295f to
f861879
Compare
Contributor
Author
|
Sorry for those force pushes, my rebase didn't go as smoothly as I expected :P |
jimpo
approved these changes
Nov 1, 2019
HCastano
added a commit
to HCastano/substrate
that referenced
this pull request
Nov 11, 2019
* Create module for checking ancestry proofs * Use Vec of Headers instead of a HashMap * Move the ancestry verification into the lib.rs file * Change the proof format to exclude `child` and `ancestor` headers * Add a testing function for building header chains * Rename AncestorNotFound error to InvalidAncestryProof * Use ancestor hash instead of header when verifying ancestry * Clean up some stuff missed in the merge
HCastano
added a commit
that referenced
this pull request
Dec 12, 2019
* Create module for checking ancestry proofs * Use Vec of Headers instead of a HashMap * Move the ancestry verification into the lib.rs file * Change the proof format to exclude `child` and `ancestor` headers * Add a testing function for building header chains * Rename AncestorNotFound error to InvalidAncestryProof * Use ancestor hash instead of header when verifying ancestry * Clean up some stuff missed in the merge
HCastano
added a commit
that referenced
this pull request
Jan 10, 2020
* Create module for checking ancestry proofs * Use Vec of Headers instead of a HashMap * Move the ancestry verification into the lib.rs file * Change the proof format to exclude `child` and `ancestor` headers * Add a testing function for building header chains * Rename AncestorNotFound error to InvalidAncestryProof * Use ancestor hash instead of header when verifying ancestry * Clean up some stuff missed in the merge
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an
AncestryProofCheckerthat is used to verify whether a givenchildheader is an ancestor of a givenancestorheader. It does this by working its way through a hash map ofHashes => Headerswhich should contain all the headers betweenchildandancestor. In the future I think it's possible to change this method to use something like the Log2 Ancestry proposed by Rob in #2053.One thing I've been thinking about that I don't know the answer to is how to ensure that somebody doesn't send a proof that contains an arbitrarily large number of headers. This would be bad since we're checking every header in the proof until we find something what we're looking for, or run out of headers.
The diff here isn't totally accurate, since it's built on top of #3915 which is still waiting to go in. The only thing that was actually added here was
srml/bridge/src/ancestry_proof.rs.