Skip to content
Snippets Groups Projects
Commit 9d9b346f authored by PG Herveou's avatar PG Herveou Committed by GitHub
Browse files

Companion PR for contract deletion updates (#2409)

* Companion PR for contract deletion updates

see https://github.com/paritytech/substrate/pull/13702

* Revert "Companion PR for contract deletion updates"

This reverts commit 4fb2ca53a1bdfbd7dc0d35be52525da99547c76c.

* fix lint

* update lockfile for {"polkadot", "substrate"}

---------

Co-authored-by: parity-processbot <>
parent 3717eb3d
No related merge requests found
This diff is collapsed.
use crate::{
constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime,
RuntimeBlockWeights, RuntimeCall, RuntimeEvent, Timestamp,
RuntimeCall, RuntimeEvent, Timestamp,
};
use frame_support::{
parameter_types,
traits::{ConstBool, ConstU32, Nothing},
weights::Weight,
};
use pallet_contracts::{
weights::{SubstrateWeight, WeightInfo},
Config, DefaultAddressGenerator, Frame, Schedule,
weights::SubstrateWeight, Config, DefaultAddressGenerator, Frame, Schedule,
};
pub use parachains_common::AVERAGE_ON_INITIALIZE_RATIO;
......@@ -20,15 +18,6 @@ pub const CONTRACTS_DEBUG_OUTPUT: bool = true;
parameter_types! {
pub const DepositPerItem: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
// The lazy deletion runs inside on_initialize.
pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *
RuntimeBlockWeights::get().max_block;
// The weight needed for decoding the queue should be less or equal than a fifth
// of the overall weight dedicated to the lazy deletion.
pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get().ref_time() / (
<Runtime as Config>::WeightInfo::on_initialize_per_queue_item(1).ref_time() -
<Runtime as Config>::WeightInfo::on_initialize_per_queue_item(0).ref_time()
)) / 5) as u32;
pub MySchedule: Schedule<Runtime> = Default::default();
}
......@@ -50,8 +39,6 @@ impl Config for Runtime {
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = SubstrateWeight<Self>;
type ChainExtension = ();
type DeletionQueueDepth = DeletionQueueDepth;
type DeletionWeightLimit = DeletionWeightLimit;
type Schedule = MySchedule;
type CallStack = [Frame<Self>; 5];
type AddressGenerator = DefaultAddressGenerator;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment