Grandpa Pallet Pruning (#890)

* Pruning.

* Add tests.

* Address review.
This commit is contained in:
Tomasz Drwięga
2021-04-13 17:30:39 +02:00
committed by Bastian Köcher
parent a783775ca5
commit f92449a461
4 changed files with 70 additions and 0 deletions
+8
View File
@@ -309,12 +309,19 @@ parameter_types! {
// call per block.
pub const MaxRequests: u32 = 50;
pub const WestendValidatorCount: u32 = 255;
// Number of headers to keep.
//
// Assuming the worst case of every header being finalized, we will keep headers for at least a
// week.
pub const HeadersToKeep: u32 = 7 * bp_millau::DAYS as u32;
}
pub type RialtoGrandpaInstance = ();
impl pallet_bridge_grandpa::Config for Runtime {
type BridgedChain = bp_rialto::Rialto;
type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep;
// TODO [#391]: Use weights generated for the Millau runtime instead of Rialto ones.
type WeightInfo = pallet_bridge_grandpa::weights::RialtoWeight<Runtime>;
@@ -324,6 +331,7 @@ pub type WestendGrandpaInstance = pallet_bridge_grandpa::Instance1;
impl pallet_bridge_grandpa::Config<WestendGrandpaInstance> for Runtime {
type BridgedChain = bp_westend::Westend;
type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep;
// TODO [#391]: Use weights generated for the Millau runtime instead of Rialto ones.
type WeightInfo = pallet_bridge_grandpa::weights::RialtoWeight<Runtime>;