Contracts: Remove ED from base deposit (#3536)

- Update internal logic so that the storage_base_deposit does not
include ED
- add v16 migration to update ContractInfo struct with this change

Before:
<img width="820" alt="Screenshot 2024-03-21 at 11 23 29"
src="https://github.com/paritytech/polkadot-sdk/assets/521091/a0a8df0d-e743-42c5-9e16-cf2ec1aa949c">

After:
![Screenshot 2024-03-21 at 11 23
42](https://github.com/paritytech/polkadot-sdk/assets/521091/593235b0-b866-4915-b653-2071d793228b)

---------

Co-authored-by: Cyrill Leutwiler <cyrill@parity.io>
Co-authored-by: command-bot <>
This commit is contained in:
PG Herveou
2024-04-10 22:32:53 +02:00
committed by GitHub
parent d21a41f238
commit 643aa2be2a
8 changed files with 174 additions and 42 deletions
+23
View File
@@ -58,6 +58,7 @@ pub trait WeightInfo {
fn v13_migration_step() -> Weight;
fn v14_migration_step() -> Weight;
fn v15_migration_step() -> Weight;
fn v16_migration_step() -> Weight;
fn migration_noop() -> Weight;
fn migrate() -> Weight;
fn on_runtime_upgrade_noop() -> Weight;
@@ -271,6 +272,17 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
/// Storage: `Contracts::ContractInfoOf` (r:2 w:1)
/// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`)
fn v16_migration_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `409`
// Estimated: `6349`
// Minimum execution time: 12_595_000 picoseconds.
Weight::from_parts(13_059_000, 6349)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `Contracts::MigrationInProgress` (r:1 w:1)
/// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`)
fn migration_noop() -> Weight {
@@ -1540,6 +1552,17 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
/// Storage: `Contracts::ContractInfoOf` (r:2 w:1)
/// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`)
fn v16_migration_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `409`
// Estimated: `6349`
// Minimum execution time: 12_595_000 picoseconds.
Weight::from_parts(13_059_000, 6349)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `Contracts::MigrationInProgress` (r:1 w:1)
/// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`)
fn migration_noop() -> Weight {