From c9c514b1dbe4f422301e923e36eff1a3ce0a9598 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Sat, 27 May 2023 20:56:23 +0300 Subject: [PATCH 1/2] make CI great again --- .gitlab-ci.yml | 2 +- runtime/src/lib.rs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f33b8f4..65a1ba9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,7 +76,7 @@ build-linux: <<: *build-refs script: - time cargo build --release - # - time cargo test --release --all + - time cargo test --release --all - mkdir -p ./artifacts/substrate-contracts-node-linux/ - cp target/release/substrate-contracts-node ./artifacts/substrate-contracts-node-linux/substrate-contracts-node diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 21427f5..edcc3dd 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -23,7 +23,6 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; - // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, @@ -134,6 +133,16 @@ const fn deposit(items: u32, bytes: u32) -> Balance { (items as Balance * UNIT + (bytes as Balance) * (5 * MILLIUNIT / 100)) / 10 } +fn schedule() -> pallet_contracts::Schedule { + pallet_contracts::Schedule { + limits: pallet_contracts::Limits { + runtime_memory: 1024 * 1024 * 1024, + ..Default::default() + }, + ..Default::default() + } +} + impl pallet_insecure_randomness_collective_flip::Config for Runtime {} parameter_types! { @@ -315,7 +324,7 @@ impl pallet_assets::Config for Runtime { parameter_types! { pub const DepositPerItem: Balance = deposit(1, 0); pub const DepositPerByte: Balance = deposit(0, 1); - pub Schedule: pallet_contracts::Schedule = Default::default(); + pub Schedule: pallet_contracts::Schedule = schedule::(); pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); } @@ -350,7 +359,7 @@ impl pallet_contracts::Config for Runtime { type CallFilter = AllowBalancesCall; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; - type CallStack = [pallet_contracts::Frame; 31]; + type CallStack = [pallet_contracts::Frame; 5]; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type ChainExtension = pallet_assets_chain_extension::substrate::AssetsExtension; From 9318fe73bd441b0a90cddb5bb63e8b18b3fa6dad Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Sat, 27 May 2023 21:21:42 +0300 Subject: [PATCH 2/2] deepen the call stack to the max possible --- runtime/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index edcc3dd..81ef5d4 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -23,6 +23,7 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; + // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, @@ -359,7 +360,7 @@ impl pallet_contracts::Config for Runtime { type CallFilter = AllowBalancesCall; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; - type CallStack = [pallet_contracts::Frame; 5]; + type CallStack = [pallet_contracts::Frame; 23]; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type ChainExtension = pallet_assets_chain_extension::substrate::AssetsExtension;