Sync Westend to Millau (#824)

* make finality verifier pallet instantiable

* add second instance of finality verifier pallet to the Millau runtime

* add Westend -> Millau headers relay

* use wss to connect to public westend nodes

* initialize with best_finalized_block

* typo

* Revert "initialize with best_finalized_block"

This reverts commit 954ed2832372d67618abc1a06d47e66faa93f674.

* pass VoterSet by ref

* new bridge initialization code

* loop upper bound

* Polkadot -> Westend

* fixed tests compilation

* default-features

* assert
This commit is contained in:
Svyatoslav Nikolsky
2021-03-16 10:09:02 +03:00
committed by Bastian Köcher
parent 249a8f73ff
commit d749bc3a96
18 changed files with 474 additions and 136 deletions
@@ -57,7 +57,7 @@ pub fn decode_justification_target<Header: HeaderT>(
pub fn verify_justification<Header: HeaderT>(
finalized_target: (Header::Hash, Header::Number),
authorities_set_id: SetId,
authorities_set: VoterSet<AuthorityId>,
authorities_set: &VoterSet<AuthorityId>,
raw_justification: &[u8],
) -> Result<(), Error>
where
@@ -76,7 +76,7 @@ where
// signatures are valid. We'll check the validity of the signatures later since they're more
// resource intensive to verify.
let ancestry_chain = AncestryChain::new(&justification.votes_ancestries);
match finality_grandpa::validate_commit(&justification.commit, &authorities_set, &ancestry_chain) {
match finality_grandpa::validate_commit(&justification.commit, authorities_set, &ancestry_chain) {
Ok(ref result) if result.ghost().is_some() => {}
_ => return Err(Error::InvalidJustificationCommit),
}