Stop Importing Full Header Chain (#707)

* Make AncestryProof type more flexible

* Only import single finalized header instead of a chain

* Fix unchecked header import tests

* Add option for limiting ancestry proof size

* Update finality verifier Config in runtimes

* Update some documentation

* Fix Clippy warning

* Allow AncestryChecker to return proof size

Stops us from abusing the `Size` trait

* Remove Size impl for Vec<T>

* Remove size contraints for ancestry proofs

With different proof types its unclear how to "size" should be interpreted,
so we remove this requirement all together to avoid confusion.
This commit is contained in:
Hernando Castano
2021-02-10 05:14:58 -05:00
committed by Bastian Köcher
parent 2f44aecd97
commit fb7c191234
7 changed files with 38 additions and 146 deletions
+1 -7
View File
@@ -407,17 +407,11 @@ impl pallet_substrate_bridge::Config for Runtime {
type BridgedChain = bp_millau::Millau;
}
parameter_types! {
// We'll use the length of a session on the bridged chain as our bound since GRANDPA is
// guaranteed to produce a justification every session.
pub const MaxHeadersInSingleProof: bp_millau::BlockNumber = bp_millau::SESSION_LENGTH;
}
impl pallet_finality_verifier::Config for Runtime {
type BridgedChain = bp_millau::Millau;
type HeaderChain = pallet_substrate_bridge::Module<Runtime>;
type AncestryProof = Vec<bp_millau::Header>;
type AncestryChecker = bp_header_chain::LinearAncestryChecker;
type MaxHeadersInSingleProof = MaxHeadersInSingleProof;
}
impl pallet_shift_session_manager::Config for Runtime {}