srml: system: prune block hash mapping (#3062)

* srml: system: prune block number to hash mapping

* srml: system: add test for block hash mapping pruning

* node: bump runtime version

* srml: system: wrap long line

* srml: system: use parameter type for block hash count

* srml: system: prune block hash mapping before storage root calculation

* srml: system: keep the genesis hash in block number map
This commit is contained in:
André Silva
2019-07-09 16:07:38 +01:00
committed by Gavin Wood
parent 459eb94c38
commit ed630e5eda
21 changed files with 149 additions and 15 deletions
+5 -1
View File
@@ -18,7 +18,7 @@
use super::*;
use std::cell::RefCell;
use srml_support::impl_outer_origin;
use srml_support::{impl_outer_origin, parameter_types};
use substrate_primitives::H256;
use primitives::{
traits::{BlakeTwo256, IdentityLookup, ConvertInto},
@@ -107,6 +107,9 @@ pub fn set_next_validators(next: Vec<u64>) {
#[derive(Clone, Eq, PartialEq)]
pub struct Test;
parameter_types! {
pub const BlockHashCount: u64 = 250;
}
impl system::Trait for Test {
type Origin = Origin;
type Index = u64;
@@ -117,6 +120,7 @@ impl system::Trait for Test {
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = ();
type BlockHashCount = BlockHashCount;
}
impl timestamp::Trait for Test {
type Moment = u64;