Skip to content

Commit

Permalink
MEL bound state-trie-migration (paritytech#11639)
Browse files Browse the repository at this point in the history
* MEL bound state-trie-migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* wip

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use sp_std

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Add doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Set MaxKeyLen default to 512

Just to be sure that it will work. There is also no real penalty
from over-estimating it.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix assert_err_with_weight macro

Looks like I'm the only one using it anyway...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests that use env macro

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
  • Loading branch information
2 people authored and godcodehunter committed Jun 22, 2022
1 parent 7ecbd12 commit efa9e9a
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 54 deletions.
2 changes: 2 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1492,12 +1492,14 @@ impl pallet_whitelist::Config for Runtime {
parameter_types! {
pub const MigrationSignedDepositPerItem: Balance = 1 * CENTS;
pub const MigrationSignedDepositBase: Balance = 20 * DOLLARS;
pub const MigrationMaxKeyLen: u32 = 512;
}

impl pallet_state_trie_migration::Config for Runtime {
type Event = Event;
type ControlOrigin = EnsureRoot<AccountId>;
type Currency = Balances;
type MaxKeyLen = MigrationMaxKeyLen;
type SignedDepositPerItem = MigrationSignedDepositPerItem;
type SignedDepositBase = MigrationSignedDepositBase;
// Warning: this is not advised, as it might allow the chain to be temporarily DOS-ed.
Expand Down
Loading

0 comments on commit efa9e9a

Please sign in to comment.