Introduce a maximum code size and head data size (#835)

* add a maximum code size and head data size

* get existing tests passing

* add tests for slots logic

* test registrar behavior

* introduce maximums and bump versions

* address review grumbles

* work around publicizing derive

* remove unneeded and wrong doc
This commit is contained in:
Robert Habermeier
2020-02-11 19:21:56 +01:00
committed by GitHub
parent 9b23f3f1f0
commit 295151338d
6 changed files with 314 additions and 19 deletions
+8 -1
View File
@@ -77,7 +77,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1047,
spec_version: 1048,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
@@ -461,6 +461,11 @@ impl attestations::Trait for Runtime {
type RewardAttestation = Staking;
}
parameter_types! {
pub const MaxCodeSize: u32 = 10 * 1024 * 1024; // 10 MB
pub const MaxHeadDataSize: u32 = 20 * 1024; // 20 KB
}
impl parachains::Trait for Runtime {
type Origin = Origin;
type Call = Call;
@@ -468,6 +473,8 @@ impl parachains::Trait for Runtime {
type Randomness = RandomnessCollectiveFlip;
type ActiveParachains = Registrar;
type Registrar = Registrar;
type MaxCodeSize = MaxCodeSize;
type MaxHeadDataSize = MaxHeadDataSize;
}
parameter_types! {