Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@HCastano
Copy link
Contributor

Adds an AncestryProofChecker that is used to verify whether a given child header is an ancestor of a given ancestor header. It does this by working its way through a hash map of Hashes => Headers which should contain all the headers between child and ancestor. 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.

@HCastano HCastano added the A0-please_review Pull request needs code review. label Oct 30, 2019
@HCastano HCastano requested a review from jimpo October 30, 2019 09:34
@parity-cla-bot
Copy link

It looks like @HCastano signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@HCastano HCastano requested a review from jimpo October 31, 2019 15:34
@HCastano HCastano force-pushed the hc-verify-ancestry-proofs branch 2 times, most recently from 8bf295f to f861879 Compare November 1, 2019 15:04
@HCastano
Copy link
Contributor Author

HCastano commented Nov 1, 2019

Sorry for those force pushes, my rebase didn't go as smoothly as I expected :P

@HCastano HCastano merged commit b49e1e5 into paritytech:hc-jp-bridge-module Nov 4, 2019
@HCastano HCastano deleted the hc-verify-ancestry-proofs branch November 4, 2019 23:50
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 HCastano restored the hc-verify-ancestry-proofs branch November 14, 2019 10:40
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.

Labels

A0-please_review Pull request needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants