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:
Alexander Theißen
2022-05-09 11:25:14 +02:00
committed by GitHub
parent e30c18d61d
commit 4b64c9085a
4 changed files with 63 additions and 10 deletions
+3 -2
View File
@@ -24,8 +24,8 @@ use crate::{
storage::Storage,
wasm::{PrefabWasmModule, ReturnCode as RuntimeReturnCode},
weights::WeightInfo,
BalanceOf, Code, CodeStorage, Config, ContractInfoOf, DefaultAddressGenerator, Error, Pallet,
Schedule,
BalanceOf, Code, CodeStorage, Config, ContractInfoOf, DefaultAddressGenerator,
DefaultContractAccessWeight, Error, Pallet, Schedule,
};
use assert_matches::assert_matches;
use codec::Encode;
@@ -287,6 +287,7 @@ impl Config for Test {
type DepositPerByte = DepositPerByte;
type DepositPerItem = DepositPerItem;
type AddressGenerator = DefaultAddressGenerator;
type ContractAccessWeight = DefaultContractAccessWeight<BlockWeights>;
}
pub const ALICE: AccountId32 = AccountId32::new([1u8; 32]);