mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
contracts: Prevent PoV attack vector with minimal viable solution (#11372)
* Add ContractAccessWeight * Apply suggestions from code review Co-authored-by: Michael Müller <michi@parity.io> Co-authored-by: Michael Müller <michi@parity.io>
This commit is contained in:
committed by
GitHub
parent
e30c18d61d
commit
4b64c9085a
@@ -1059,8 +1059,11 @@ parameter_types! {
|
||||
pub const DepositPerByte: Balance = deposit(0, 1);
|
||||
pub const MaxValueSize: u32 = 16 * 1024;
|
||||
// The lazy deletion runs inside on_initialize.
|
||||
pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *
|
||||
RuntimeBlockWeights::get().max_block;
|
||||
pub DeletionWeightLimit: Weight = RuntimeBlockWeights::get()
|
||||
.per_class
|
||||
.get(DispatchClass::Normal)
|
||||
.max_total
|
||||
.unwrap_or(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() / (
|
||||
@@ -1093,6 +1096,7 @@ impl pallet_contracts::Config for Runtime {
|
||||
type DeletionWeightLimit = DeletionWeightLimit;
|
||||
type Schedule = Schedule;
|
||||
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
|
||||
type ContractAccessWeight = pallet_contracts::DefaultContractAccessWeight<RuntimeBlockWeights>;
|
||||
}
|
||||
|
||||
impl pallet_sudo::Config for Runtime {
|
||||
|
||||
Reference in New Issue
Block a user