mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
contracts: Add configurable per-storage item cost (#7819)
* Rework rent parameters * No need for empty_pair_count any longer * Parameterize runtime
This commit is contained in:
committed by
GitHub
parent
dd4625a1e7
commit
a208da1d18
@@ -709,13 +709,17 @@ impl pallet_tips::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const TombstoneDeposit: Balance = 16 * MILLICENTS;
|
||||
pub const RentByteFee: Balance = 4 * MILLICENTS;
|
||||
pub const RentDepositOffset: Balance = 1000 * MILLICENTS;
|
||||
pub const TombstoneDeposit: Balance = deposit(
|
||||
1,
|
||||
sp_std::mem::size_of::<pallet_contracts::ContractInfo<Runtime>>() as u32
|
||||
);
|
||||
pub const DepositPerContract: Balance = TombstoneDeposit::get();
|
||||
pub const DepositPerStorageByte: Balance = deposit(0, 1);
|
||||
pub const DepositPerStorageItem: Balance = deposit(1, 0);
|
||||
pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS);
|
||||
pub const SurchargeReward: Balance = 150 * MILLICENTS;
|
||||
pub const SignedClaimHandicap: u32 = 2;
|
||||
pub const MaxDepth: u32 = 32;
|
||||
pub const StorageSizeOffset: u32 = 8;
|
||||
pub const MaxValueSize: u32 = 16 * 1024;
|
||||
// The lazy deletion runs inside on_initialize.
|
||||
pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *
|
||||
@@ -736,9 +740,10 @@ impl pallet_contracts::Config for Runtime {
|
||||
type RentPayment = ();
|
||||
type SignedClaimHandicap = SignedClaimHandicap;
|
||||
type TombstoneDeposit = TombstoneDeposit;
|
||||
type StorageSizeOffset = StorageSizeOffset;
|
||||
type RentByteFee = RentByteFee;
|
||||
type RentDepositOffset = RentDepositOffset;
|
||||
type DepositPerContract = DepositPerContract;
|
||||
type DepositPerStorageByte = DepositPerStorageByte;
|
||||
type DepositPerStorageItem = DepositPerStorageItem;
|
||||
type RentFraction = RentFraction;
|
||||
type SurchargeReward = SurchargeReward;
|
||||
type MaxDepth = MaxDepth;
|
||||
type MaxValueSize = MaxValueSize;
|
||||
|
||||
Reference in New Issue
Block a user