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 authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent 2f44aecd97
commit fb7c191234
7 files changed
+38 -146

No files matched your search

+1 -7
View File
@@ -300,17 +300,11 @@ impl pallet_substrate_bridge::Config for Runtime {
type BridgedChain = bp_rialto::Rialto;
}
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_rialto::BlockNumber = bp_rialto::SESSION_LENGTH;
}
impl pallet_finality_verifier::Config for Runtime {
type BridgedChain = bp_rialto::Rialto;
type HeaderChain = pallet_substrate_bridge::Module<Runtime>;
type AncestryProof = Vec<bp_rialto::Header>;
type AncestryChecker = bp_header_chain::LinearAncestryChecker;
type MaxHeadersInSingleProof = MaxHeadersInSingleProof;
}
impl pallet_shift_session_manager::Config for Runtime {}
+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 {}