From 05339e21a45abd8149ad20acfb0c970e831b2ac9 Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Tue, 17 Oct 2023 14:36:04 +0400 Subject: [PATCH] rip(gear-runtime): Remove PoA runtime (#3380) --- .github/workflows/benchmarks.yml | 17 +- .github/workflows/build.yml | 6 - .github/workflows/release.yml | 17 +- Cargo.lock | 73 +- Cargo.toml | 1 - Makefile | 4 - gcli/Cargo.toml | 1 - gcli/tests/cmd/claim.rs | 49 +- gcli/tests/cmd/info.rs | 25 - gcli/tests/cmd/transfer.rs | 16 +- gcli/tests/common/mod.rs | 20 +- gclient/src/api/calls.rs | 2 +- gclient/src/api/storage/block.rs | 2 +- gsdk/Cargo.toml | 1 - gsdk/src/metadata/impls.rs | 2 +- gsdk/src/metadata/mod.rs | 3 +- gsdk/src/signer/calls.rs | 2 +- gsdk/src/signer/storage.rs | 2 +- gsdk/src/signer/utils.rs | 2 +- gsdk/src/storage.rs | 2 +- gsdk/tests/utils/mod.rs | 9 - node/README.md | 4 +- node/authorship/Cargo.toml | 2 +- node/cli/Cargo.toml | 10 +- node/cli/src/benchmarking.rs | 35 - node/cli/src/command.rs | 51 +- node/service/Cargo.toml | 5 - node/service/src/chain_spec/gear.rs | 196 - node/service/src/chain_spec/mod.rs | 2 - node/service/src/client.rs | 46 +- node/service/src/lib.rs | 29 - node/testing/Cargo.toml | 12 +- node/testing/src/client.rs | 3 - node/testing/src/genesis.rs | 62 - node/testing/src/keyring.rs | 32 - .../benchmarking/tests/syscalls_integrity.rs | 2 +- runtime/gear/Cargo.toml | 183 - runtime/gear/build.rs | 29 - runtime/gear/src/constants.rs | 77 - runtime/gear/src/lib.rs | 807 ---- runtime/gear/src/migrations.rs | 22 - runtime/gear/src/tests.rs | 168 - runtime/gear/src/weights/frame_system.rs | 183 - runtime/gear/src/weights/mod.rs | 26 - runtime/gear/src/weights/pallet_balances.rs | 182 - runtime/gear/src/weights/pallet_gear.rs | 4162 ----------------- .../gear/src/weights/pallet_gear_voucher.rs | 68 - runtime/gear/src/weights/pallet_timestamp.rs | 83 - runtime/gear/src/weights/pallet_utility.rs | 142 - runtime/vara/Cargo.toml | 5 + runtime/vara/build.rs | 2 +- runtime/vara/src/lib.rs | 9 +- scripts/check-spec.sh | 6 +- scripts/ci_build.sh | 53 - scripts/src/check.sh | 7 +- scripts/src/clippy.sh | 10 +- scripts/src/test.sh | 6 +- scripts/unpack-weights.sh | 8 +- scripts/weight-diff.sh | 4 +- utils/gear-replay-cli/Cargo.toml | 7 - utils/gear-replay-cli/README.md | 6 +- utils/gear-replay-cli/src/cmd/gear_run.rs | 4 - utils/gear-replay-cli/src/cmd/replay_block.rs | 4 - utils/node-loader/src/batch_pool.rs | 36 +- utils/regression-analysis/Cargo.toml | 2 +- utils/regression-analysis/src/main.rs | 4 +- utils/runtime-fuzzer/Cargo.toml | 4 +- utils/runtime-fuzzer/src/lib.rs | 2 +- utils/runtime-fuzzer/src/runtime/account.rs | 16 +- utils/runtime-fuzzer/src/runtime/block.rs | 2 +- utils/runtime-fuzzer/src/runtime/mailbox.rs | 2 +- utils/runtime-fuzzer/src/runtime/mod.rs | 14 +- utils/runtime-fuzzer/src/utils.rs | 2 +- utils/wasm-builder/src/lib.rs | 2 +- utils/wasm-proc/src/main.rs | 28 + utils/weight-diff/Cargo.toml | 1 - utils/weight-diff/src/main.rs | 5 - 77 files changed, 187 insertions(+), 6943 deletions(-) delete mode 100644 node/service/src/chain_spec/gear.rs delete mode 100644 runtime/gear/Cargo.toml delete mode 100644 runtime/gear/build.rs delete mode 100644 runtime/gear/src/constants.rs delete mode 100644 runtime/gear/src/lib.rs delete mode 100644 runtime/gear/src/migrations.rs delete mode 100644 runtime/gear/src/tests.rs delete mode 100644 runtime/gear/src/weights/frame_system.rs delete mode 100644 runtime/gear/src/weights/mod.rs delete mode 100644 runtime/gear/src/weights/pallet_balances.rs delete mode 100644 runtime/gear/src/weights/pallet_gear.rs delete mode 100644 runtime/gear/src/weights/pallet_gear_voucher.rs delete mode 100644 runtime/gear/src/weights/pallet_timestamp.rs delete mode 100644 runtime/gear/src/weights/pallet_utility.rs delete mode 100755 scripts/ci_build.sh diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 9ec092b9ea2..a2932cbffa8 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -39,12 +39,10 @@ jobs: - name: Run all benchmarks run: | - ./scripts/benchmarking/run_all_benchmarks.sh -c gear-dev -m - cp ./scripts/benchmarking/weights-output/* runtime/gear/src/weights - ./scripts/benchmarking/run_all_benchmarks.sh -b -c vara-dev -m # -b to skip build + ./scripts/benchmarking/run_all_benchmarks.sh -c vara-dev -m cp ./scripts/benchmarking/weights-output/* runtime/vara/src/weights # apply some patches for `pallets/gear/src/weights.rs` - cp runtime/gear/src/weights/pallet_gear.rs pallets/gear/src/weights.rs + cp runtime/vara/src/weights/pallet_gear.rs pallets/gear/src/weights.rs sed -i -E 's/\w+::WeightInfo for SubstrateWeight/WeightInfo for SubstrateWeight/' pallets/gear/src/weights.rs # clear the target directory because our benchmarking machine is not ephemeral cargo clean @@ -57,12 +55,6 @@ jobs: path: scripts/benchmarking/benchmarking_errors.txt if-no-files-found: ignore - - name: "ACTIONS: Upload artifact with updated weights (gear)" - uses: actions/upload-artifact@v3 - with: - name: weights-gear - path: runtime/gear/src/weights/ - - name: "ACTIONS: Upload artifact with updated weights (vara)" uses: actions/upload-artifact@v3 with: @@ -79,7 +71,7 @@ jobs: with: commit_message: >- chore(runtime): update weights - file_pattern: "pallets/gear/src/ runtime/gear/src/weights/ runtime/vara/src/weights/" + file_pattern: "pallets/gear/src/ runtime/vara/src/weights/" - name: Create Pull Request if: ${{ inputs.change-type == 'pull_request' }} @@ -87,7 +79,6 @@ jobs: with: add-paths: | pallets/gear/src/ - runtime/gear/src/weights/ runtime/vara/src/weights/ commit-message: update weights branch: weights/patch @@ -96,4 +87,4 @@ jobs: chore(runtime): update weights body: | `run_all_benchmarks.sh` script is applied to update weights (branch: `${{ github.ref_name }}`, commit ${{ github.sha }}) - **Note:** If CI fails, try manually updating the heuristic tests: `runtime/{gear, vara}/src/tests.rs` + **Note:** If CI fails, try manually updating the heuristic tests: `runtime/vara/src/tests.rs` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e9855f0e6e..09ca0ceb9d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,9 +71,6 @@ jobs: - name: "Build fuzzer" run: ./scripts/gear.sh build fuzz --locked --release - - name: "Check: Gear runtime imports" - run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/gear-runtime/gear_runtime.compact.wasm - - name: "Check: Vara runtime imports" run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/vara-runtime/vara_runtime.compact.wasm @@ -164,9 +161,6 @@ jobs: cd target/wasm32-unknown-unknown/release tar czvf ../../../artifact/examples.tar.gz *.wasm cd ../../.. - cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm artifact/ - cp target/production/wbuild/gear-runtime/gear_runtime.compact.wasm artifact/ - cp target/production/wbuild/gear-runtime/gear_runtime.wasm artifact/ cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm artifact/ cp target/production/wbuild/vara-runtime/vara_runtime.compact.wasm artifact/ cp target/production/wbuild/vara-runtime/vara_runtime.wasm artifact/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38c4d7d390f..984dd6784d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,6 @@ jobs: - name: "Environment: Export versions" run: | - echo "GEAR_SPEC=$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV echo "VARA_SPEC=$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV - name: "Environment: Make `artifact` directory" @@ -79,27 +78,23 @@ jobs: - name: "Build: Production `vara-runtime`" run: cargo build -p vara-runtime --profile production --no-default-features --features std - - name: "Test: Production `vara-runtime`" - run: ./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm - - name: "Artifact: Production `vara-runtime`" run: cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_runtime_v$VARA_SPEC.wasm" - name: "Build: Production node with development runtimes" run: cargo build -p gear-cli --profile production - - name: "Test: Development runtimes" - run: | - ./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm - ./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm - - - name: "Artifact: Production node and development runtimes" + - name: "Artifact: Production node client and development `vara-runtime`" run: | - cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_devruntime_v$GEAR_SPEC.wasm" cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_devruntime_v$VARA_SPEC.wasm" cp target/production/gear artifact/gear strip artifact/gear || true + - name: "Test: Runtimes" + run: | + ./wasm-proc --check-runtime-imports --check-runtime-is-dev false "artifact/vara_runtime_v$VARA_SPEC.wasm" + ./wasm-proc --check-runtime-imports --check-runtime-is-dev true "artifact/vara_devruntime_v$VARA_SPEC.wasm" + - name: Publish uses: softprops/action-gh-release@v1 with: diff --git a/Cargo.lock b/Cargo.lock index d6fc261788e..b1334fe318a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3977,7 +3977,6 @@ dependencies = [ "frame-system", "futures", "gcli", - "gear-runtime", "gear-runtime-interface", "gear-runtime-primitives", "gear-service", @@ -4218,7 +4217,6 @@ dependencies = [ "futures", "futures-timer", "gear-common", - "gear-runtime", "gear-runtime-interface", "gear-runtime-primitives", "gear-service", @@ -4255,7 +4253,6 @@ dependencies = [ "clap 4.4.2", "frame-remote-externalities", "frame-system", - "gear-runtime", "gear-runtime-interface", "gear-runtime-primitives", "gear-service", @@ -4277,68 +4274,6 @@ dependencies = [ "vara-runtime", ] -[[package]] -name = "gear-runtime" -version = "1.0.1" -dependencies = [ - "const-str", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "gear-common", - "gear-core-processor", - "gear-lazy-pages-common", - "gear-runtime-common", - "gear-runtime-primitives", - "hex-literal", - "log", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-gear", - "pallet-gear-bank", - "pallet-gear-debug", - "pallet-gear-gas", - "pallet-gear-messenger", - "pallet-gear-payment", - "pallet-gear-program", - "pallet-gear-rpc-runtime-api", - "pallet-gear-scheduler", - "pallet-gear-staking-rewards", - "pallet-gear-staking-rewards-rpc-runtime-api", - "pallet-gear-voucher", - "pallet-grandpa", - "pallet-multisig", - "pallet-proxy", - "pallet-session", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-utility", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std 5.0.0", - "sp-transaction-pool", - "sp-version", - "static_assertions", - "substrate-build-script-utils", - "substrate-validator-set", - "substrate-wasm-builder", -] - [[package]] name = "gear-runtime-common" version = "1.0.1" @@ -4453,7 +4388,6 @@ dependencies = [ "futures-timer", "gear-authorship", "gear-common", - "gear-runtime", "gear-runtime-common", "gear-runtime-interface", "gear-runtime-primitives", @@ -4632,7 +4566,6 @@ version = "1.0.0" dependencies = [ "clap 4.4.2", "frame-support", - "gear-runtime", "indexmap 2.0.0", "pallet-gear", "serde", @@ -9452,7 +9385,6 @@ version = "0.1.0" dependencies = [ "clap 4.4.2", "frame-support", - "gear-runtime", "junit-common", "pallet-gear", "quick-xml", @@ -9460,6 +9392,7 @@ dependencies = [ "serde_json", "tabled", "thousands", + "vara-runtime", ] [[package]] @@ -9657,7 +9590,6 @@ dependencies = [ "gear-call-gen", "gear-common", "gear-core", - "gear-runtime", "gear-runtime-primitives", "gear-utils", "gear-wasm-gen", @@ -9667,10 +9599,12 @@ dependencies = [ "pallet-balances", "pallet-gear", "pallet-gear-bank", + "pallet-im-online", "parity-scale-codec", "proptest", "rand 0.8.5", "sha-1 0.10.1", + "sp-authority-discovery", "sp-consensus-babe", "sp-consensus-grandpa", "sp-consensus-slots", @@ -9679,6 +9613,7 @@ dependencies = [ "sp-keyring", "sp-runtime", "static_assertions", + "vara-runtime", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 188ba10a2c2..064c7f9220e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -208,7 +208,6 @@ gear-lazy-pages = { path = "lazy-pages" } gear-lazy-pages-common = { path = "lazy-pages/common", default-features = false } gear-lazy-pages-interface = { path = "lazy-pages/interface", default-features = false } gear-node-testing = { path = "node/testing" } -gear-runtime = { path = "runtime/gear", default-features = false } gear-runtime-common = { path = "runtime/common", default-features = false } gear-runtime-interface = { path = "runtime-interface", default-features = false } gear-sandbox = { path = "sandbox/sandbox", default-features = false } diff --git a/Makefile b/Makefile index 2fc739d8a52..147ed020b68 100644 --- a/Makefile +++ b/Makefile @@ -68,10 +68,6 @@ gear-replay: gear-replay-vara-native: @ ./scripts/gear.sh build gear-replay --release --no-default-features --features=std,vara-native -.PHONY: gear-replay-gear-native -gear-replay-gear-native: - @ ./scripts/gear.sh build gear-replay --release --no-default-features --features=std,gear-native - # Check section .PHONY: check check: diff --git a/gcli/Cargo.toml b/gcli/Cargo.toml index 1f9c745c706..16f0dc1850a 100644 --- a/gcli/Cargo.toml +++ b/gcli/Cargo.toml @@ -60,7 +60,6 @@ which.workspace = true [features] node-key = [ "libp2p" ] -vara-testing = [ ] [package.metadata.docs.rs] all-features = true diff --git a/gcli/tests/cmd/claim.rs b/gcli/tests/cmd/claim.rs index 316eacbd1d0..7d9e57b924d 100644 --- a/gcli/tests/cmd/claim.rs +++ b/gcli/tests/cmd/claim.rs @@ -17,20 +17,40 @@ // along with this program. If not, see . //! Integration tests for command `send` -#![cfg(not(feature = "vara-testing"))] -use crate::common::{ - self, traits::NodeExec, Args, Result, ALICE_SS58_ADDRESS as ADDRESS, MESSAGER_SENT_VALUE, -}; + +use crate::common::{self, logs, traits::NodeExec, Args, Result, ALICE_SS58_ADDRESS as ADDRESS}; use gsdk::Api; const REWARD_PER_BLOCK: u128 = 75_000; // 3_000 gas * 25 value per gas #[tokio::test] async fn test_command_claim_works() -> Result<()> { + // hack to check initial alice balance + let (initial_balance, initial_stash) = { + let mut node = common::dev()?; + + node.wait_for_log_record(logs::gear_node::IMPORTING_BLOCKS)?; + + // Get balance of the testing address + let signer = Api::new(Some(&node.ws())) + .await? + .signer("//Alice//stash", None)?; + ( + signer.api().get_balance(ADDRESS).await.unwrap_or(0), + signer + .api() + .get_balance(&signer.address()) + .await + .unwrap_or(0), + ) + }; + let node = common::create_messager().await?; // Check the mailbox of the testing account - let signer = Api::new(Some(&node.ws())).await?.signer("//Alice", None)?; + let signer = Api::new(Some(&node.ws())) + .await? + .signer("//Alice//stash", None)?; let mailbox = signer .api() .mailbox(Some(common::alice_account_id()), 10) @@ -39,21 +59,18 @@ async fn test_command_claim_works() -> Result<()> { assert_eq!(mailbox.len(), 1); let id = hex::encode(mailbox[0].0.id.0); - // Claim value from message id + let burned_before = signer.api().get_balance(&signer.address()).await? - initial_stash; let before = signer.api().get_balance(ADDRESS).await?; + + // Claim value from message id let _ = node.run(Args::new("claim").message_id(id))?; + + let burned_after = signer.api().get_balance(&signer.address()).await? - initial_stash; let after = signer.api().get_balance(ADDRESS).await?; - // # TODO - // - // not using `//Alice` or estimating the reward - // before this checking. - let expected = MESSAGER_SENT_VALUE + REWARD_PER_BLOCK; - assert_eq!( - after.saturating_sub(before), - expected, - "Alice should have received the value of the message plus the reward ({expected})" - ); + assert_eq!(initial_balance - before - burned_before, REWARD_PER_BLOCK,); + + assert_eq!(initial_balance - burned_after, after); Ok(()) } diff --git a/gcli/tests/cmd/info.rs b/gcli/tests/cmd/info.rs index 544f701cee9..90360519a59 100644 --- a/gcli/tests/cmd/info.rs +++ b/gcli/tests/cmd/info.rs @@ -23,23 +23,6 @@ use crate::common::{ Args, Result, }; -#[cfg(not(feature = "vara-testing"))] -const EXPECTED_BALANCE: &str = r#" -AccountInfo { - nonce: 0, - consumers: 1, - providers: 1, - sufficients: 0, - data: AccountData { - free: 1152921504606846976, - reserved: 0, - misc_frozen: 0, - fee_frozen: 0, - }, -} -"#; - -#[cfg(feature = "vara-testing")] const EXPECTED_BALANCE: &str = r#" AccountInfo { nonce: 0, @@ -55,20 +38,12 @@ AccountInfo { } "#; -#[cfg(feature = "vara-testing")] const EXPECTED_MAILBOX: &str = r#" destination: "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", payload: "0x", value: 0, "#; -#[cfg(not(feature = "vara-testing"))] -const EXPECTED_MAILBOX: &str = r#" - destination: "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", - payload: "0x", - value: 5000, -"#; - #[tokio::test] async fn test_action_balance_works() -> Result<()> { common::login_as_alice().expect("login failed"); diff --git a/gcli/tests/cmd/transfer.rs b/gcli/tests/cmd/transfer.rs index 4c58dae94e0..074da2ef944 100644 --- a/gcli/tests/cmd/transfer.rs +++ b/gcli/tests/cmd/transfer.rs @@ -17,21 +17,13 @@ // along with this program. If not, see . //! Integration tests for command `deploy` -#![cfg(not(feature = "vara-testing"))] + use crate::common::{self, logs, Args, NodeExec, Result}; use gsdk::Api; // Testing account -// -// Secret phrase: tumble tenant update heavy sad draw present tray atom chunk animal exhaust -// Network ID: substrate -// Secret seed: 0xd13d64420f7e304a1bfd4a17a5cda3f14b4e98034abe2cbd4fc05214c6ba2488 -// Public key (hex): 0x62bd03f963e636deea9139b00e33e6800f3c1afebb5f69b47ed07c07be549e78 -// Account ID: 0x62bd03f963e636deea9139b00e33e6800f3c1afebb5f69b47ed07c07be549e78 -// Public key (SS58): 5EJAhWN49JDfn58DpkERvCrtJ5X3sHue93a1hH4nB9KngGSs -// SS58 Address: 5EJAhWN49JDfn58DpkERvCrtJ5X3sHue93a1hH4nB9KngGSs const SURI: &str = "tumble tenant update heavy sad draw present tray atom chunk animal exhaust"; -const ADDRESS: &str = "5EJAhWN49JDfn58DpkERvCrtJ5X3sHue93a1hH4nB9KngGSs"; +const ADDRESS: &str = "kGhmTEymraqSPa1NYjXzqbko2p4Ge1CmEfACtC1s4aC5hTPYk"; #[tokio::test] async fn test_command_transfer_works() -> Result<()> { @@ -45,14 +37,14 @@ async fn test_command_transfer_works() -> Result<()> { let before = signer.api().get_balance(ADDRESS).await.unwrap_or(0); // Run command transfer - let value = 1_000_000_000u128; + let value = 1_000_000_000_000_000u128; let _ = node.run( Args::new("transfer") .destination(ADDRESS) .amount(value.to_string()), )?; - let after = signer.api().get_balance(ADDRESS).await?; + let after = signer.api().get_balance(ADDRESS).await.unwrap_or(0); assert_eq!( after.saturating_sub(before), value, diff --git a/gcli/tests/common/mod.rs b/gcli/tests/common/mod.rs index a317186e4e8..dbbafc92d1c 100644 --- a/gcli/tests/common/mod.rs +++ b/gcli/tests/common/mod.rs @@ -38,12 +38,10 @@ pub mod logs; mod result; pub mod traits; -#[cfg(not(feature = "vara-testing"))] mod prelude { pub use scale_info::scale::Encode; - pub const ALICE_SS58_ADDRESS: &str = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"; - pub const MESSAGER_SENT_VALUE: u128 = 5_000; + pub const ALICE_SS58_ADDRESS: &str = "kGkLEU3e3XXkJp2WK4eNpVmSab5xUNL9QtmLPh8QfCL2EgotW"; } #[cfg(not(feature = "vara-testing"))] @@ -73,16 +71,7 @@ pub fn gcli(args: impl IntoIterator) -> Result { /// Run the dev node pub fn dev() -> Result { - #[cfg(feature = "vara-testing")] let args = vec!["--tmp", "--dev"]; - #[cfg(not(feature = "vara-testing"))] - let args = vec![ - "--tmp", - "--chain=gear-dev", - "--alice", - "--validator", - "--reserved-only", - ]; Node::try_from_path(env::bin("gear"), args).map_err(Into::into) } @@ -107,7 +96,7 @@ pub fn program_id(bin: &[u8], salt: &[u8]) -> ProgramId { /// AccountId32 of `addr` pub fn alice_account_id() -> AccountId32 { - AccountId32::from_ss58check("5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY") + AccountId32::from_ss58check("kGkLEU3e3XXkJp2WK4eNpVmSab5xUNL9QtmLPh8QfCL2EgotW") .expect("Invalid address") } @@ -119,11 +108,6 @@ pub async fn create_messager() -> Result { let args = Args::new("upload").program(env::wasm_bin("demo_messager.opt.wasm")); - #[cfg(not(feature = "vara-testing"))] - let args = args - .payload("0x".to_owned() + &hex::encode(MESSAGER_SENT_VALUE.encode())) - .value("10000000"); - let _ = node.run(args)?; Ok(node) } diff --git a/gclient/src/api/calls.rs b/gclient/src/api/calls.rs index 322d458d876..a8733d8d375 100644 --- a/gclient/src/api/calls.rs +++ b/gclient/src/api/calls.rs @@ -34,7 +34,6 @@ use gsdk::{ metadata::{ balances::Event as BalancesEvent, gear::Event as GearEvent, - gear_runtime::RuntimeCall, runtime_types::{ frame_system::pallet::Call as SystemCall, gear_common::{ @@ -48,6 +47,7 @@ use gsdk::{ }, system::Event as SystemEvent, utility::Event as UtilityEvent, + vara_runtime::RuntimeCall, Convert, Event, }, Error as GsdkError, GearGasNode, GearGasNodeId, diff --git a/gclient/src/api/storage/block.rs b/gclient/src/api/storage/block.rs index 65a92e6c802..3458fe9c24f 100644 --- a/gclient/src/api/storage/block.rs +++ b/gclient/src/api/storage/block.rs @@ -18,7 +18,7 @@ use super::{GearApi, Result}; use crate::Error; -use gsdk::{config::Header, ext::sp_core::H256, metadata::gear_runtime::RuntimeEvent}; +use gsdk::{config::Header, ext::sp_core::H256, metadata::vara_runtime::RuntimeEvent}; use subxt::config::Header as _; type GearBlock = Header; diff --git a/gsdk/Cargo.toml b/gsdk/Cargo.toml index 9ecf26935dc..35b7fdb4c22 100644 --- a/gsdk/Cargo.toml +++ b/gsdk/Cargo.toml @@ -48,4 +48,3 @@ demo-waiter = { workspace = true, features = ["std"] } [features] testing = [ "rand" ] -vara-testing = [] diff --git a/gsdk/src/metadata/impls.rs b/gsdk/src/metadata/impls.rs index d2d88bfeb34..f695436da7d 100644 --- a/gsdk/src/metadata/impls.rs +++ b/gsdk/src/metadata/impls.rs @@ -17,7 +17,6 @@ // along with this program. If not, see . use super::{ - gear_runtime::{RuntimeCall, RuntimeEvent}, runtime_types::{ frame_system::pallet::Call as SystemCall, gear_common::{ @@ -30,6 +29,7 @@ use super::{ pallet_gear::pallet::Call as GearCall, pallet_sudo::pallet::Call as SudoCall, }, + vara_runtime::{RuntimeCall, RuntimeEvent}, }; use core::ops::{Index, IndexMut}; use gear_core::{ids, message, message::UserMessage}; diff --git a/gsdk/src/metadata/mod.rs b/gsdk/src/metadata/mod.rs index e43b9e5292d..4a523fbefef 100644 --- a/gsdk/src/metadata/mod.rs +++ b/gsdk/src/metadata/mod.rs @@ -29,8 +29,7 @@ pub use self::{ calls::{self, CallInfo}, exports::*, runtime_types::runtime_types::{ - self, sp_runtime::DispatchError, vara_runtime as gear_runtime, - vara_runtime::RuntimeEvent as Event, + self, sp_runtime::DispatchError, vara_runtime, vara_runtime::RuntimeEvent as Event, }, storage::{self, StorageInfo}, }, diff --git a/gsdk/src/signer/calls.rs b/gsdk/src/signer/calls.rs index 5a656d0875f..061cdf0caad 100644 --- a/gsdk/src/signer/calls.rs +++ b/gsdk/src/signer/calls.rs @@ -22,8 +22,8 @@ use crate::{ config::GearConfig, metadata::{ calls::{BalancesCall, GearCall, SudoCall, UtilityCall}, - gear_runtime::RuntimeCall, runtime_types::sp_weights::weight_v2::Weight, + vara_runtime::RuntimeCall, }, Error, Result, TxInBlock, }; diff --git a/gsdk/src/signer/storage.rs b/gsdk/src/signer/storage.rs index 25628995559..6854c2b1afb 100644 --- a/gsdk/src/signer/storage.rs +++ b/gsdk/src/signer/storage.rs @@ -20,7 +20,6 @@ use crate::{ config::GearConfig, metadata::{ - gear_runtime::RuntimeCall, runtime_types::{ frame_system::pallet::Call, gear_common::{ActiveProgram, Program}, @@ -28,6 +27,7 @@ use crate::{ pallet_gear_bank::pallet::BankAccount, }, storage::{GearBankStorage, GearGasStorage, GearProgramStorage}, + vara_runtime::RuntimeCall, }, signer::Inner, utils::storage_address_bytes, diff --git a/gsdk/src/signer/utils.rs b/gsdk/src/signer/utils.rs index b97ce0b0d48..759d2477c63 100644 --- a/gsdk/src/signer/utils.rs +++ b/gsdk/src/signer/utils.rs @@ -23,7 +23,7 @@ use crate::{ backtrace::BacktraceStatus, config::GearConfig, metadata::{ - calls::SudoCall, gear_runtime::RuntimeCall, sudo::Event as SudoEvent, CallInfo, Event, + calls::SudoCall, sudo::Event as SudoEvent, vara_runtime::RuntimeCall, CallInfo, Event, }, result::Result, signer::SignerRpc, diff --git a/gsdk/src/storage.rs b/gsdk/src/storage.rs index f391d2d2a55..96dd567a2c7 100644 --- a/gsdk/src/storage.rs +++ b/gsdk/src/storage.rs @@ -19,7 +19,6 @@ //! Gear storage apis use crate::{ metadata::{ - gear_runtime::RuntimeEvent, runtime_types::{ frame_system::{AccountInfo, EventRecord}, gear_common::{storage::primitives::Interval, ActiveProgram, Program}, @@ -31,6 +30,7 @@ use crate::{ GearBankStorage, GearGasStorage, GearMessengerStorage, GearProgramStorage, GearStorage, SessionStorage, SystemStorage, TimestampStorage, }, + vara_runtime::RuntimeEvent, }, result::{Error, Result}, utils::storage_address_bytes, diff --git a/gsdk/tests/utils/mod.rs b/gsdk/tests/utils/mod.rs index 6c0696c2b28..845e67b8de5 100644 --- a/gsdk/tests/utils/mod.rs +++ b/gsdk/tests/utils/mod.rs @@ -25,16 +25,7 @@ pub fn dev_node() -> Node { // Use release build because of performance reasons. let bin_path = env!("CARGO_MANIFEST_DIR").to_owned() + "/../target/release/gear"; - #[cfg(not(feature = "vara-testing"))] let args = vec!["--tmp", "--dev"]; - #[cfg(feature = "vara-testing")] - let args = vec![ - "--tmp", - "--chain=vara-dev", - "--alice", - "--validator", - "--reserved-only", - ]; Node::try_from_path(bin_path, args) .expect("Failed to start node: Maybe it isn't built with --release flag?") diff --git a/node/README.md b/node/README.md index d10116cb91b..a7fb6552a71 100644 --- a/node/README.md +++ b/node/README.md @@ -154,7 +154,7 @@ Let's do the upgrade step by step: 3. Build your new node with ```bash - cargo build --release -p gear-runtime + cargo build --release -p vara-runtime ``` It will be node state that we will be upgrading to. @@ -175,7 +175,7 @@ toggle the "file upload" switch on the right-hand side of the "code" input field to the `setCode` function. Click the "code" input field, and select one of the Wasm binaries that defines the upgraded runtime: ```bash -target/release/wbuild/gear-runtime/gear_runtime.compact.wasm +target/release/wbuild/vara-runtime/vara_runtime.compact.wasm ``` Leave the value for the `weight` parameter at the default of `0x00`. Click "Submit Transaction" and then "Sign and Submit". diff --git a/node/authorship/Cargo.toml b/node/authorship/Cargo.toml index 0ea077deb9a..35d4e1b83b0 100644 --- a/node/authorship/Cargo.toml +++ b/node/authorship/Cargo.toml @@ -56,7 +56,7 @@ pallet-balances = { workspace = true, features = ["std"] } pallet-gear = { workspace = true, features = ["std"] } pallet-gear-messenger = { workspace = true, features = ["std"] } pallet-gear-program = { workspace = true, features = ["std"] } -testing = {workspace = true, features = ["vara-native"] } +testing.workspace = true vara-runtime = { workspace = true, features = ["std", "dev"] } demo-mul-by-const = { workspace = true, features = ["debug"] } env_logger.workspace = true diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 693b8b86db6..83ca987a440 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -33,7 +33,6 @@ pallet-gear-payment = { workspace = true, features = ["std"] } pallet-gear-staking-rewards = { workspace = true, optional = true, features = ["std"] } # Gear Runtimes -gear-runtime = { workspace = true, optional = true, features = ["std", "dev"] } vara-runtime = { workspace = true, optional = true, features = ["std", "dev"] } # Substrate client @@ -63,25 +62,24 @@ gcli = { workspace = true, optional = true } substrate-build-script-utils.workspace = true [features] -default = ["gear-native", "vara-native"] -gear-native = [ - "gear-runtime", - "service/gear-native", -] +default = ["vara-native"] vara-native = [ "vara-runtime", "service/vara-native", "pallet-gear-staking-rewards", ] runtime-benchmarks = [ + "vara-runtime?/runtime-benchmarks", "service/runtime-benchmarks", "frame-benchmarking", "frame-benchmarking-cli/runtime-benchmarks", ] runtime-benchmarks-checkers = [ + "vara-runtime?/runtime-benchmarks", "service/runtime-benchmarks-checkers", ] try-runtime = [ + "vara-runtime?/try-runtime", "service/try-runtime", "try-runtime-cli/try-runtime", ] diff --git a/node/cli/src/benchmarking.rs b/node/cli/src/benchmarking.rs index 85da0e72834..e49bbda4b46 100644 --- a/node/cli/src/benchmarking.rs +++ b/node/cli/src/benchmarking.rs @@ -66,41 +66,6 @@ macro_rules! with_signed_payload { } } => { match $self.$client.as_ref() { - #[cfg(feature = "gear-native")] - Client::Gear($client) => { - use gear_runtime as runtime; - - $( $setup )* - let $extra: runtime::SignedExtra = ( - frame_system::CheckNonZeroSender::::new(), - frame_system::CheckSpecVersion::::new(), - frame_system::CheckTxVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckMortality::::from( - sp_runtime::generic::Era::mortal($period, $current_block), - ), - frame_system::CheckNonce::::from($nonce), - frame_system::CheckWeight::::new(), - pallet_gear_payment::CustomChargeTransactionPayment::::from($tip), - ); - - let $raw_payload = runtime::SignedPayload::from_raw( - $call.clone(), - $extra.clone(), - ( - (), - runtime::VERSION.spec_version, - runtime::VERSION.transaction_version, - $genesis, - $best_hash, - (), - (), - (), - ), - ); - - $( $usage )* - }, #[cfg(feature = "vara-native")] Client::Vara($client) => { use vara_runtime as runtime; diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 6e571242efc..231885232a7 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -55,28 +55,20 @@ impl SubstrateCli for Cli { // Common "dev" chain. `vara-runtime` is prioritized. #[cfg(feature = "vara-native")] "dev" => Box::new(chain_spec::vara::development_config()?), - #[cfg(all(feature = "gear-native", not(feature = "vara-native")))] - "dev" => Box::new(chain_spec::gear::development_config()?), - #[cfg(not(any(feature = "gear-native", feature = "vara-native")))] + #[cfg(not(feature = "vara-native"))] "dev" => return Err("No runtimes specified to compile."), // Specific "dev" chains. - #[cfg(feature = "gear-native")] - "gear-dev" => Box::new(chain_spec::gear::development_config()?), #[cfg(feature = "vara-native")] "vara-dev" => Box::new(chain_spec::vara::development_config()?), // Common "local" chain. `vara-runtime` is prioritized. #[cfg(feature = "vara-native")] "local" => Box::new(chain_spec::vara::local_testnet_config()?), - #[cfg(all(feature = "gear-native", not(feature = "vara-native")))] - "local" => Box::new(chain_spec::gear::local_testnet_config()?), - #[cfg(not(any(feature = "gear-native", feature = "vara-native")))] + #[cfg(not(feature = "vara-native"))] "local" => return Err("No runtimes specified to compile."), // Specific "local" chains. - #[cfg(feature = "gear-native")] - "gear-local" => Box::new(chain_spec::gear::local_testnet_config()?), #[cfg(feature = "vara-native")] "vara-local" => Box::new(chain_spec::vara::local_testnet_config()?), @@ -107,22 +99,14 @@ impl SubstrateCli for Cli { let chain_spec = Box::new(chain_spec::RawChainSpec::from_json_file(path.clone())?) as Box; - match (chain_spec.is_gear(), chain_spec.is_vara()) { - // Corner cases. - (true, true) => unreachable!("Chain spec couldn't be both of gear and vara runtime"), - (false, false) => return Err("Unable to identify chain spec as gear or vara runtime".into()), - - // Gear specs. - #[cfg(feature = "gear-runtime")] - (true, ..) => Box::new(chain_spec::gear::ChainSpec::from_json_file(path)?), - #[cfg(not(feature = "gear-runtime"))] - (true, ..) => return Err("Gear runtime is not available. Please compile the node with `-F gear-native` to enable it.".into()), - + if chain_spec.is_vara() { // Vara specs. #[cfg(feature = "vara-runtime")] - (.., true) => Box::new(chain_spec::vara::ChainSpec::from_json_file(path)?), + return Ok(Box::new(chain_spec::vara::ChainSpec::from_json_file(path)?)); #[cfg(not(feature = "vara-runtime"))] - (.., true) => return Err("Vara runtime is not available. Please compile the node with `-F vara-native` to enable it.".into()), + return Err("Vara runtime is not available. Please compile the node with `-F vara-native` to enable it.".into()); + } else { + return Err("Unable to identify chain spec as vara runtime".into()); } } }) @@ -130,8 +114,6 @@ impl SubstrateCli for Cli { fn native_runtime_version(spec: &Box) -> &'static RuntimeVersion { match spec { - #[cfg(feature = "gear-native")] - spec if spec.is_gear() => &service::gear_runtime::VERSION, #[cfg(feature = "vara-native")] spec if spec.is_vara() => &service::vara_runtime::VERSION, _ => panic!("Invalid chain spec"), @@ -147,8 +129,6 @@ macro_rules! unwrap_client { $code:expr ) => { match $client.as_ref() { - #[cfg(feature = "gear-native")] - service::Client::Gear($client) => $code, #[cfg(feature = "vara-native")] service::Client::Vara($client) => $code, #[allow(unreachable_patterns)] @@ -288,11 +268,6 @@ pub fn run() -> sc_cli::Result<()> { ); } match &config.chain_spec { - #[cfg(feature = "gear-native")] - spec if spec.is_gear() => cmd - .run::( - config, - ), #[cfg(feature = "vara-native")] spec if spec.is_vara() => cmd .run::( @@ -395,18 +370,6 @@ pub fn run() -> sc_cli::Result<()> { .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; match chain_spec { - #[cfg(feature = "gear-native")] - spec if spec.is_gear() => runner.async_run(|_| { - let info_provider = - substrate_info(gear_runtime::constants::time::SLOT_DURATION); - Ok(( - cmd.run::::ExtendHostFunctions, - >, _>(Some(info_provider)), - task_manager, - )) - }), #[cfg(feature = "vara-native")] spec if spec.is_vara() => runner.async_run(|_| { let info_provider = diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index d23b0e3d914..4512a2e40bd 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -31,7 +31,6 @@ authorship.workspace = true # Gear Runtimes common = { workspace = true, features = ["std"] } gear-runtime-common = { workspace = true, features = ["std"] } -gear-runtime = { workspace = true, optional = true, features = ["std", "dev"] } vara-runtime = { workspace = true, optional = true, features = ["std", "dev"] } # Substrate Client @@ -102,7 +101,6 @@ try-runtime-cli = { workspace = true, optional = true } substrate-build-script-utils.workspace = true [features] -gear-native = ["gear-runtime"] vara-native = [ "vara-runtime", "pallet-staking", @@ -112,15 +110,12 @@ vara-native = [ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", - "gear-runtime?/runtime-benchmarks", "vara-runtime?/runtime-benchmarks", ] runtime-benchmarks-checkers = [ - "gear-runtime?/runtime-benchmarks-checkers", "vara-runtime?/runtime-benchmarks-checkers", ] try-runtime = [ - "gear-runtime?/try-runtime", "vara-runtime?/try-runtime", "try-runtime-cli", ] diff --git a/node/service/src/chain_spec/gear.rs b/node/service/src/chain_spec/gear.rs deleted file mode 100644 index 3b0c20c7c6e..00000000000 --- a/node/service/src/chain_spec/gear.rs +++ /dev/null @@ -1,196 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -use crate::chain_spec::{get_account_id_from_seed, get_from_seed, AccountId, Extensions}; -use gear_runtime::{ - constants::currency::EXISTENTIAL_DEPOSIT, BabeConfig, BalancesConfig, GenesisConfig, - GrandpaConfig, SessionConfig, SessionKeys, SudoConfig, SystemConfig, ValidatorSetConfig, - WASM_BINARY, -}; -use gear_runtime_common::constants::BANK_ADDRESS; -use sc_service::ChainType; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_consensus_grandpa::AuthorityId as GrandpaId; -use sp_core::sr25519; - -/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = sc_service::GenericChainSpec; - -/// Generate authority keys. -pub fn authority_keys_from_seed(s: &str) -> (AccountId, BabeId, GrandpaId) { - ( - get_account_id_from_seed::(s), - get_from_seed::(s), - get_from_seed::(s), - ) -} - -pub fn development_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Development", - // ID - "gear_dev", - ChainType::Development, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![authority_keys_from_seed("Alice")], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - ], - BANK_ADDRESS.into(), - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - None, - // Extensions - Default::default(), - )) -} - -pub fn local_testnet_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Local testnet wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Gear Local Testnet", - // ID - "gear_local_testnet", - ChainType::Local, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![ - authority_keys_from_seed("Alice"), - authority_keys_from_seed("Bob"), - ], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - ], - BANK_ADDRESS.into(), - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - None, - // Extensions - Default::default(), - )) -} - -/// Configure initial storage state for FRAME modules. -fn testnet_genesis( - wasm_binary: &[u8], - initial_authorities: Vec<(AccountId, BabeId, GrandpaId)>, - root_key: AccountId, - endowed_accounts: Vec, - bank_account: AccountId, - _enable_println: bool, -) -> GenesisConfig { - // Configure endowed accounts with initial balance of 1 << 60. - let mut balances = endowed_accounts - .iter() - .cloned() - .map(|k| (k, 1u128 << 60)) - .collect::>(); - - balances.push((bank_account, EXISTENTIAL_DEPOSIT)); - - GenesisConfig { - system: SystemConfig { - // Add Wasm runtime to storage. - code: wasm_binary.to_vec(), - }, - balances: BalancesConfig { balances }, - validator_set: ValidatorSetConfig { - initial_validators: initial_authorities - .iter() - .map(|x| x.0.clone()) - .collect::>(), - }, - babe: BabeConfig { - authorities: Default::default(), - epoch_config: Some(gear_runtime::BABE_GENESIS_EPOCH_CONFIG), - }, - grandpa: GrandpaConfig { - authorities: Default::default(), - }, - session: SessionConfig { - keys: initial_authorities - .into_iter() - .map(|x| { - ( - x.0.clone(), - x.0, - SessionKeys { - babe: x.1, - grandpa: x.2, - }, - ) - }) - .collect::>(), - }, - sudo: SudoConfig { - // Assign network admin rights. - key: Some(root_key), - }, - transaction_payment: Default::default(), - } -} diff --git a/node/service/src/chain_spec/mod.rs b/node/service/src/chain_spec/mod.rs index e6934cd1123..1a9d149d45a 100644 --- a/node/service/src/chain_spec/mod.rs +++ b/node/service/src/chain_spec/mod.rs @@ -25,8 +25,6 @@ use sp_runtime::traits::IdentifyAccount; use serde::{Deserialize, Serialize}; -#[cfg(feature = "gear-native")] -pub mod gear; #[cfg(feature = "vara-native")] pub mod vara; diff --git a/node/service/src/client.rs b/node/service/src/client.rs index b118fe36453..e4371a885a8 100644 --- a/node/service/src/client.rs +++ b/node/service/src/client.rs @@ -40,40 +40,9 @@ pub type FullBackend = sc_service::TFullBackend; pub type FullClient = sc_service::TFullClient>; -#[cfg(not(any(feature = "gear-native", feature = "vara-native",)))] +#[cfg(not(feature = "vara-native"))] compile_error!("at least one runtime feature must be enabled"); -/// The native executor instance for default network. -#[cfg(feature = "gear-native")] -pub struct GearExecutorDispatch; - -#[cfg(feature = "gear-native")] -impl sc_executor::NativeExecutionDispatch for GearExecutorDispatch { - /// Only enable the benchmarking host functions when we actually want to benchmark. - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = ( - // Only for runtime-benchmarks host functions. - gear_ri::gear_debug::HostFunctions, - frame_benchmarking::benchmarking::HostFunctions, - gear_ri::gear_ri::HostFunctions, - gear_ri::sandbox::HostFunctions, - ); - /// Otherwise we only use the default Substrate host functions. - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = ( - gear_ri::gear_ri::HostFunctions, - gear_ri::sandbox::HostFunctions, - ); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - gear_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - gear_runtime::native_version() - } -} - /// The native executor instance for standalone network. #[cfg(feature = "vara-native")] pub struct VaraExecutorDispatch; @@ -238,8 +207,6 @@ macro_rules! with_client { } } => { match $self { - #[cfg(feature = "gear-native")] - Self::Gear($client) => { $( $code )* }, #[cfg(feature = "vara-native")] Self::Vara($client) => { $( $code )* }, } @@ -249,21 +216,10 @@ macro_rules! with_client { /// A client instance of Gear. #[derive(Clone)] pub enum Client { - #[cfg(feature = "gear-native")] - Gear(Arc>), #[cfg(feature = "vara-native")] Vara(Arc>), } -#[cfg(feature = "gear-native")] -impl From>> for Client { - fn from( - client: Arc>, - ) -> Self { - Self::Gear(client) - } -} - #[cfg(feature = "vara-native")] impl From>> for Client { fn from( diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index f2b34d07c4a..53908609161 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -43,8 +43,6 @@ pub use sc_client_api::AuxStore; use sc_consensus_babe::{self, SlotProportion}; pub use sp_blockchain::{HeaderBackend, HeaderMetadata}; -#[cfg(feature = "gear-native")] -pub use gear_runtime; #[cfg(feature = "vara-native")] pub use vara_runtime; @@ -54,17 +52,11 @@ mod client; pub mod rpc; pub trait IdentifyVariant { - /// Returns `true` if this is a configuration for gear network. - fn is_gear(&self) -> bool; - /// Returns `true` if this is a configuration for the vara network. fn is_vara(&self) -> bool; } impl IdentifyVariant for Box { - fn is_gear(&self) -> bool { - self.id().to_lowercase().starts_with("gear") - } fn is_vara(&self) -> bool { self.id().to_lowercase().starts_with("vara") } @@ -122,17 +114,6 @@ pub fn new_chain_ops( ServiceError, > { match &config.chain_spec { - #[cfg(feature = "gear-native")] - spec if spec.is_gear() => { - chain_ops!( - config, - rpc_calculations_multiplier, - rpc_max_batch_size, - gear_runtime, - GearExecutorDispatch, - Gear - ) - } #[cfg(feature = "vara-native")] spec if spec.is_vara() => { chain_ops!( @@ -669,16 +650,6 @@ pub fn new_full( rpc_max_batch_size: u64, ) -> Result { match &config.chain_spec { - #[cfg(feature = "gear-native")] - spec if spec.is_gear() => new_full_base::( - config, - disable_hardware_benchmarks, - |_, _| (), - max_gas, - rpc_calculations_multiplier, - rpc_max_batch_size, - ) - .map(|NewFullBase { task_manager, .. }| task_manager), #[cfg(feature = "vara-native")] spec if spec.is_vara() => new_full_base::( config, diff --git a/node/testing/Cargo.toml b/node/testing/Cargo.toml index e2e965ccf82..612f4249882 100644 --- a/node/testing/Cargo.toml +++ b/node/testing/Cargo.toml @@ -22,10 +22,9 @@ scale-info = { workspace = true, features = ["derive"] } runtime-primitives.workspace = true common.workspace = true pallet-gear-rpc-runtime-api.workspace = true -gear-runtime = { workspace = true, optional = true, features = ["dev"] } -vara-runtime = { workspace = true, optional = true, features = ["dev"] } +vara-runtime = { workspace = true, features = ["dev"] } gear-runtime-interface.workspace = true -service.workspace = true +service = { workspace = true, features = ["vara-native"] } # Substrate Client sc-block-builder.workspace = true @@ -55,7 +54,7 @@ frame-support.workspace = true frame-benchmarking.workspace = true [features] -default = ["std", "vara-native"] +default = ["std"] std = [ "runtime-primitives/std", "common/std", @@ -70,8 +69,5 @@ std = [ "frame-system/std", "frame-support/std", "frame-benchmarking/std", - "gear-runtime?/std", - "vara-runtime?/std", + "vara-runtime/std", ] -gear-native = ["gear-runtime", "service/gear-native"] -vara-native = ["vara-runtime", "service/vara-native"] diff --git a/node/testing/src/client.rs b/node/testing/src/client.rs index cfe51e2fa67..ef49bd5b6e3 100644 --- a/node/testing/src/client.rs +++ b/node/testing/src/client.rs @@ -18,12 +18,9 @@ //! Utilities to build a `TestClient` for gear- or vara-runtime. -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -use gear_runtime as runtime; use sp_runtime::BuildStorage; /// Re-export test-client utilities. pub use substrate_test_client::*; -#[cfg(feature = "vara-native")] use vara_runtime as runtime; // A unit struct which implements `NativeExecutionDispatch` feeding in the hard-coded runtime diff --git a/node/testing/src/genesis.rs b/node/testing/src/genesis.rs index 019e3f93948..7bb246513fa 100644 --- a/node/testing/src/genesis.rs +++ b/node/testing/src/genesis.rs @@ -19,14 +19,8 @@ //! Genesis Configuration. use crate::keyring::*; -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -use gear_runtime::{ - constants::currency::*, AccountId, BabeConfig, BalancesConfig, GenesisConfig, GrandpaConfig, - SessionConfig, SudoConfig, SystemConfig, BABE_GENESIS_EPOCH_CONFIG, WASM_BINARY, -}; use sp_keyring::{Ed25519Keyring, Sr25519Keyring}; use sp_runtime::{Perbill, Perquintill}; -#[cfg(feature = "vara-native")] use vara_runtime::{ constants::currency::*, AccountId, BabeConfig, BalancesConfig, GenesisConfig, GrandpaConfig, SessionConfig, StakerStatus, StakingConfig, StakingRewardsConfig, SudoConfig, SystemConfig, @@ -46,7 +40,6 @@ pub fn genesis_config(code: Option<&[u8]>) -> GenesisConfig { /// Create genesis runtime configuration for tests adding some extra /// endowed accounts if needed. -#[cfg(feature = "vara-native")] pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec) -> GenesisConfig { let mut endowed = vec![ (alice(), 111 * ECONOMIC_UNITS), @@ -134,58 +127,3 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec) -> Gen }, } } - -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec) -> GenesisConfig { - let mut endowed = vec![ - (alice(), 111 * ECONOMIC_UNITS), - (bob(), 100 * ECONOMIC_UNITS), - (charlie(), 100_000_000 * ECONOMIC_UNITS), - (dave(), 111 * ECONOMIC_UNITS), - (eve(), 101 * ECONOMIC_UNITS), - (ferdie(), 100 * ECONOMIC_UNITS), - ]; - - endowed.extend( - extra_endowed - .into_iter() - .map(|endowed| (endowed, 100 * ECONOMIC_UNITS)), - ); - - GenesisConfig { - system: SystemConfig { - code: code - .map(|x| x.to_vec()) - .unwrap_or_else(|| wasm_binary().to_vec()), - }, - balances: BalancesConfig { balances: endowed }, - babe: BabeConfig { - authorities: vec![], - epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG), - }, - grandpa: GrandpaConfig { - authorities: vec![], - }, - session: SessionConfig { - keys: vec![ - ( - alice(), - dave(), - to_session_keys(&Ed25519Keyring::Alice, &Sr25519Keyring::Alice), - ), - ( - bob(), - eve(), - to_session_keys(&Ed25519Keyring::Bob, &Sr25519Keyring::Bob), - ), - ( - charlie(), - ferdie(), - to_session_keys(&Ed25519Keyring::Charlie, &Sr25519Keyring::Charlie), - ), - ], - }, - sudo: Default::default(), - transaction_payment: Default::default(), - } -} diff --git a/node/testing/src/keyring.rs b/node/testing/src/keyring.rs index f0a74f264e9..3f6a6172440 100644 --- a/node/testing/src/keyring.rs +++ b/node/testing/src/keyring.rs @@ -19,14 +19,9 @@ //! Test accounts available in runtime for testing. use codec::Encode; -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -use gear_runtime::{ - CustomChargeTransactionPayment, RuntimeCall, SessionKeys, SignedExtra, UncheckedExtrinsic, -}; use runtime_primitives::{AccountId, Index}; use sp_keyring::{AccountKeyring, Ed25519Keyring, Sr25519Keyring}; use sp_runtime::generic::Era; -#[cfg(feature = "vara-native")] use vara_runtime::{ CustomChargeTransactionPayment, RuntimeCall, SessionKeys, SignedExtra, StakingBlackList, UncheckedExtrinsic, @@ -66,7 +61,6 @@ pub fn ferdie() -> AccountId { } /// Convert keyrings into `SessionKeys`. -#[cfg(feature = "vara-native")] pub fn to_session_keys( ed25519_keyring: &Ed25519Keyring, sr25519_keyring: &Sr25519Keyring, @@ -79,19 +73,7 @@ pub fn to_session_keys( } } -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -pub fn to_session_keys( - ed25519_keyring: &Ed25519Keyring, - sr25519_keyring: &Sr25519Keyring, -) -> SessionKeys { - SessionKeys { - babe: sr25519_keyring.to_owned().public().into(), - grandpa: ed25519_keyring.to_owned().public().into(), - } -} - /// Creates transaction extra. -#[cfg(feature = "vara-native")] pub fn signed_extra(nonce: Index) -> SignedExtra { ( StakingBlackList::new(), @@ -106,20 +88,6 @@ pub fn signed_extra(nonce: Index) -> SignedExtra { ) } -#[cfg(all(not(feature = "vara-native"), feature = "gear-native"))] -pub fn signed_extra(nonce: Index) -> SignedExtra { - ( - frame_system::CheckNonZeroSender::new(), - frame_system::CheckSpecVersion::new(), - frame_system::CheckTxVersion::new(), - frame_system::CheckGenesis::new(), - frame_system::CheckEra::from(Era::mortal(256, 0)), - frame_system::CheckNonce::from(nonce), - frame_system::CheckWeight::new(), - CustomChargeTransactionPayment::from(0), - ) -} - /// Sign given a `CheckedExtrinsic`. pub fn sign( xt: CheckedExtrinsic, diff --git a/pallets/gear/src/benchmarking/tests/syscalls_integrity.rs b/pallets/gear/src/benchmarking/tests/syscalls_integrity.rs index 1ea38d50329..8df659cde24 100644 --- a/pallets/gear/src/benchmarking/tests/syscalls_integrity.rs +++ b/pallets/gear/src/benchmarking/tests/syscalls_integrity.rs @@ -907,7 +907,7 @@ where let next_mid = utils::get_next_message_id::(utils::default_account::()); let (random, expected_bn) = T::Randomness::random(next_mid.as_ref()); - // If we use gear-runtime, current epoch starts at block 0, + // If we use vara-runtime, current epoch starts at block 0, // But mock runtime will reference currently proceeding block number, // so we add to currently got value. #[cfg(feature = "std")] diff --git a/runtime/gear/Cargo.toml b/runtime/gear/Cargo.toml deleted file mode 100644 index 0fd0e349dd7..00000000000 --- a/runtime/gear/Cargo.toml +++ /dev/null @@ -1,183 +0,0 @@ -[package] -name = "gear-runtime" -version.workspace = true -authors.workspace = true -edition.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true -build = "build.rs" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -const-str.workspace = true -log.workspace = true -parity-scale-codec.workspace = true -scale-info = { workspace = true, features = ["derive"] } -static_assertions.workspace = true -validator-set.workspace = true - -# Substrate deps -frame-support.workspace = true -frame-system.workspace = true -frame-try-runtime = { workspace = true, optional = true } -frame-executive.workspace = true -pallet-authorship.workspace = true -pallet-babe.workspace = true -pallet-balances.workspace = true -pallet-grandpa.workspace = true -pallet-multisig.workspace = true -pallet-proxy.workspace = true -pallet-session.workspace = true -pallet-sudo.workspace = true -pallet-timestamp.workspace = true -pallet-transaction-payment.workspace = true -pallet-utility.workspace = true -sp-api.workspace = true -sp-block-builder.workspace = true -sp-consensus-babe.workspace = true -sp-core.workspace = true -sp-inherents.workspace = true -sp-offchain.workspace = true -sp-runtime.workspace = true -sp-session.workspace = true -sp-std.workspace = true -sp-transaction-pool.workspace = true -sp-version.workspace = true - -# Used for the node template's RPCs -frame-system-rpc-runtime-api.workspace = true -pallet-transaction-payment-rpc-runtime-api.workspace = true - -# Used for runtime benchmarking -frame-benchmarking = { workspace = true, optional = true } -frame-system-benchmarking = { workspace = true, optional = true } -hex-literal = { workspace = true, optional = true } - -# Internal deps -common.workspace = true -runtime-common.workspace = true -pallet-gear-scheduler.workspace = true -pallet-gear-messenger.workspace = true -pallet-gear-program.workspace = true -pallet-gear-bank.workspace = true -pallet-gear.workspace = true -pallet-gear-debug = { workspace = true, optional = true } -pallet-gear-gas.workspace = true -pallet-gear-payment.workspace = true -pallet-gear-voucher.workspace = true -pallet-gear-rpc-runtime-api.workspace = true -runtime-primitives.workspace = true -pallet-gear-staking-rewards.workspace = true -pallet-gear-staking-rewards-rpc-runtime-api.workspace = true - -[build-dependencies] -substrate-build-script-utils.workspace = true -substrate-wasm-builder = { workspace = true, optional = true } - -[dev-dependencies] -gear-core-processor.workspace = true -gear-lazy-pages-common.workspace = true - -[features] -default = ["std"] -std = [ - "common/std", - "frame-try-runtime?/std", - "frame-system-benchmarking?/std", - "frame-benchmarking?/std", - "frame-executive/std", - "frame-support/std", - "frame-system/std", - "frame-system-rpc-runtime-api/std", - "pallet-authorship/std", - "pallet-babe/std", - "pallet-balances/std", - "pallet-gear-program/std", - "pallet-gear-scheduler/std", - "pallet-gear-bank/std", - "pallet-gear/std", - "pallet-gear-debug?/std", - "pallet-gear-gas/std", - "pallet-gear-payment/std", - "pallet-gear-rpc-runtime-api/std", - "runtime-primitives/std", - "validator-set/std", - "pallet-grandpa/std", - "pallet-multisig/std", - "pallet-proxy/std", - "pallet-session/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-utility/std", - "runtime-common/std", - "scale-info/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-babe/std", - "sp-core/std", - "sp-inherents/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "substrate-wasm-builder", - "pallet-gear-staking-rewards-rpc-runtime-api/std", - "pallet-gear-staking-rewards/std", -] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "hex-literal", - "pallet-balances/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-gear/runtime-benchmarks", - "pallet-gear-voucher/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] -fuzz = [ - "common/fuzz", - "pallet-gear/fuzz", - "pallet-gear-gas/fuzz" -] -runtime-benchmarks-checkers = [ - "pallet-gear/runtime-benchmarks-checkers", -] -try-runtime = [ - "frame-executive/try-runtime", - "frame-try-runtime", - "frame-system/try-runtime", - "frame-support/try-runtime", - "pallet-gear/try-runtime", - "pallet-gear-messenger/try-runtime", - "pallet-gear-payment/try-runtime", - "pallet-gear-program/try-runtime", - "pallet-gear-gas/try-runtime", - "pallet-gear-bank/try-runtime", - "pallet-gear-scheduler/try-runtime", - "pallet-gear-voucher/try-runtime", - "pallet-gear-debug?/try-runtime", - "pallet-authorship/try-runtime", - "pallet-babe/try-runtime", - "pallet-balances/try-runtime", - "pallet-grandpa/try-runtime", - "pallet-multisig/try-runtime", - "pallet-proxy/try-runtime", - "pallet-session/try-runtime", - "pallet-sudo/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-utility/try-runtime", - "validator-set/try-runtime", - "runtime-common/try-runtime", -] -dev = ["pallet-gear-debug"] diff --git a/runtime/gear/build.rs b/runtime/gear/build.rs deleted file mode 100644 index 07778f95f5c..00000000000 --- a/runtime/gear/build.rs +++ /dev/null @@ -1,29 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -fn main() { - substrate_build_script_utils::generate_cargo_keys(); - #[cfg(all(feature = "std", not(feature = "fuzz")))] - { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() - } -} diff --git a/runtime/gear/src/constants.rs b/runtime/gear/src/constants.rs deleted file mode 100644 index 0b4e927003b..00000000000 --- a/runtime/gear/src/constants.rs +++ /dev/null @@ -1,77 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -/// Currency related constants -pub mod currency { - use runtime_primitives::Balance; - - pub const UNITS: Balance = 1_000_000_000_000; // 10^(-12) precision - - /// The existential deposit. - pub const EXISTENTIAL_DEPOSIT: Balance = 500; - - /// The program rent cost per block. - pub const RENT_COST_PER_BLOCK: Balance = 125_000_000; - - // TODO: the actual numbers, if matter, are subject to review (#2655) - pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 150 + (bytes as Balance) * 60 - } -} - -/// Time and block constants -pub mod time { - use runtime_primitives::{BlockNumber, Moment}; - - /// Since BABE is probabilistic this is the average expected block time that - /// we are targeting. Blocks will be produced at a minimum duration defined - /// by `SLOT_DURATION`, but some slots will not be allocated to any - /// authority and hence no block will be produced. We expect to have this - /// block time on average following the defined slot duration and the value - /// of `c` configured for BABE (where `1 - c` represents the probability of - /// a slot being empty). - /// This value is only used indirectly to define the unit constants below - /// that are expressed in blocks. The rest of the code should use - /// `SLOT_DURATION` instead (like the Timestamp pallet for calculating the - /// minimum period). - /// - /// If using BABE with secondary slots (default) then all of the slots will - /// always be assigned, in which case `MILLISECS_PER_BLOCK` and - /// `SLOT_DURATION` should have the same value. - /// - /// - pub const MILLISECS_PER_BLOCK: Moment = 1000; - - // NOTE: Currently it is not possible to change the slot duration after the chain has started. - // Attempting to do so will brick block production. - pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - - // Time is measured by number of blocks. - pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); - pub const HOURS: BlockNumber = MINUTES * 60; - pub const DAYS: BlockNumber = HOURS * 24; - pub const WEEKS: BlockNumber = DAYS * 7; - pub const MONTHS: BlockNumber = WEEKS * 4; - - // NOTE: Currently it is not possible to change the epoch duration after the chain has started. - // Attempting to do so will brick block production. - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 2 * HOURS; - - // 1 in 4 blocks (on average, not counting collisions) will be primary BABE blocks. - pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); -} diff --git a/runtime/gear/src/lib.rs b/runtime/gear/src/lib.rs deleted file mode 100644 index 9f48f117cba..00000000000 --- a/runtime/gear/src/lib.rs +++ /dev/null @@ -1,807 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] - -// Make the WASM binary available. -#[cfg(all(feature = "std", not(feature = "fuzz")))] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -use common::storage::{Mailbox, Messenger}; -use frame_support::weights::ConstantMultiplier; -pub use frame_support::{ - codec::{Decode, Encode, MaxEncodedLen}, - construct_runtime, - dispatch::{DispatchClass, WeighData}, - parameter_types, - traits::{ - ConstU128, ConstU32, Contains, FindAuthor, InstanceFilter, KeyOwnerProofSystem, Randomness, - StorageInfo, - }, - weights::{ - constants::{ - BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_MILLIS, - WEIGHT_REF_TIME_PER_SECOND, - }, - Weight, - }, - PalletId, RuntimeDebug, StorageValue, -}; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, -}; -pub use pallet_gear::manager::{ExtManager, HandleKind}; -pub use pallet_gear_payment::{CustomChargeTransactionPayment, DelegateFee}; -use pallet_grandpa::{ - fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, -}; -pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; -use runtime_common::constants::BANK_ADDRESS; -pub use runtime_common::{ - constants::{ - RENT_DISABLED_DELTA_WEEK_FACTOR, RENT_FREE_PERIOD_MONTH_FACTOR, RENT_RESUME_WEEK_FACTOR, - RESUME_SESSION_DURATION_HOUR_FACTOR, - }, - impl_runtime_apis_plus_common, BlockHashCount, DealWithFees, AVERAGE_ON_INITIALIZE_RATIO, - GAS_LIMIT_MIN_PERCENTAGE_NUM, NORMAL_DISPATCH_RATIO, VALUE_PER_GAS, -}; -pub use runtime_primitives::{AccountId, Signature}; -use runtime_primitives::{Balance, BlockNumber, Hash, Index, Moment}; -use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, ConstBool, ConstU64, OpaqueMetadata, H256}; -use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor, OpaqueKeys}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, Percent, -}; -use sp_std::{ - convert::{TryFrom, TryInto}, - prelude::*, -}; -#[cfg(feature = "std")] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; -use static_assertions::const_assert; - -pub use frame_system::Call as SystemCall; -pub use pallet_balances::Call as BalancesCall; -pub use pallet_timestamp::Call as TimestampCall; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; - -pub use pallet_gear; -#[cfg(feature = "dev")] -pub use pallet_gear_debug; -pub use pallet_gear_gas; -pub use pallet_gear_payment; - -pub mod constants; - -pub use constants::{currency::*, time::*}; - -mod migrations; - -// Weights used in the runtime. -mod weights; - -// By this we inject compile time version including commit hash -// (https://github.com/paritytech/substrate/blob/297b3948f4a0f7f6504d4b654e16cb5d9201e523/utils/build-script-utils/src/version.rs#L44) -// into the WASM runtime blob. This is used by the `runtime_wasmBlobVersion` RPC call. -// The format of the version is `x.y.z-commit_hash`, where the `x.y.z` is the version of this crate, -// and the `commit_hash` is the hash of the commit from which the WASM blob was built. -#[cfg(all(target_arch = "wasm32", target_os = "unknown"))] -#[link_section = "wasm_blob_version"] -static _WASM_BLOB_VERSION: [u8; const_str::to_byte_array!(env!("SUBSTRATE_CLI_IMPL_VERSION")) - .len()] = const_str::to_byte_array!(env!("SUBSTRATE_CLI_IMPL_VERSION")); - -// The version of the runtime specification. -// -// Full node will not attempt to use its native runtime in substitute for the -// on-chain WASM runtime unless all of `spec_name`, `spec_version`, and -// `authoring_version` are the same between WASM and native. -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("gear"), - impl_name: create_runtime_str!("gear"), - apis: RUNTIME_API_VERSIONS, - authoring_version: 1, - spec_version: 1010, - impl_version: 1, - transaction_version: 1, - state_version: 1, -}; - -/// The BABE epoch configuration at genesis. -pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = - sp_consensus_babe::BabeEpochConfiguration { - c: PRIMARY_PROBABILITY, - allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, - }; - -// We'll verify that WEIGHT_REF_TIME_PER_SECOND does not overflow, -// allowing us to use the simple divide operator instead of a saturating or checked one. -const_assert!(WEIGHT_REF_TIME_PER_SECOND.checked_div(3).is_some()); - -/// We allow for 1/3 of block time for computations, with maximum proof size. -/// -/// It's 1/3 sec for gear runtime with 1 second block duration. -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND / 3, u64::MAX); - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -parameter_types! { - pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 42; - pub RuntimeBlockWeights: BlockWeights = runtime_common::block_weights_for(MAXIMUM_BLOCK_WEIGHT); - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); -} - -// Configure FRAME pallets to include in runtime. -impl frame_system::Config for Runtime { - /// The basic call filter to use in dispatchable. - type BaseCallFilter = frame_support::traits::Everything; - /// Block & extrinsics weights: base values and limits. - type BlockWeights = RuntimeBlockWeights; - /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// The weight of database operations that the runtime can invoke. - type DbWeight = RocksDbWeight; - /// Version of the runtime. - type Version = Version; - /// Converts a module to the index of the module in `construct_runtime!`. - /// - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// What to do if a new account is created. - type OnNewAccount = (); - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); - /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = weights::frame_system::SubstrateWeight; - /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; - /// The set code logic, just the default since we're not a parachain. - type OnSetCode = (); - type MaxConsumers = ConstU32<16>; -} - -parameter_types! { - pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64; - pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; - pub const MaxAuthorities: u32 = 32; -} - -impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ExpectedBlockTime; - type EpochChangeTrigger = pallet_babe::ExternalTrigger; - type DisabledValidators = (); - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - type KeyOwnerProof = sp_core::Void; - type EquivocationReportSystem = (); -} - -impl pallet_grandpa::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - - type MaxSetIdSessionEntries = ConstU64<0>; - - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - type KeyOwnerProof = sp_core::Void; - type EquivocationReportSystem = (); -} - -impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = (); -} - -parameter_types! { - pub const MinimumPeriod: Moment = SLOT_DURATION / 2; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = Moment; - type OnTimestampSet = Babe; - type MinimumPeriod = MinimumPeriod; - type WeightInfo = weights::pallet_timestamp::SubstrateWeight; -} - -impl pallet_balances::Config for Runtime { - type MaxLocks = ConstU32<50>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ConstU128; - type AccountStore = System; - type WeightInfo = weights::pallet_balances::SubstrateWeight; -} - -parameter_types! { - pub const TransactionByteFee: Balance = 1; - pub const QueueLengthStep: u128 = 1000; - pub const OperationalFeeMultiplier: u8 = 5; -} - -impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = CurrencyAdapter>; - type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = ConstantMultiplier>; - type LengthToFee = ConstantMultiplier>; - type FeeMultiplierUpdate = pallet_gear_payment::GearFeeMultiplier; -} - -parameter_types! { - pub const MinAuthorities: u32 = 1; -} - -impl validator_set::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type AddRemoveOrigin = EnsureRoot; - type MinAuthorities = MinAuthorities; -} - -impl_opaque_keys! { - pub struct SessionKeys { - pub babe: Babe, - pub grandpa: Grandpa, - } -} - -impl pallet_session::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ValidatorId = ::AccountId; - type ValidatorIdOf = validator_set::ValidatorOf; - type ShouldEndSession = Babe; - type NextSessionRotation = Babe; - type SessionManager = ValidatorSet; - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type WeightInfo = pallet_session::weights::SubstrateWeight; -} - -impl pallet_sudo::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} - -impl pallet_utility::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type WeightInfo = weights::pallet_utility::SubstrateWeight; - type PalletsOrigin = OriginCaller; -} - -parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); -} - -impl pallet_multisig::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = ConstU32<100>; - type WeightInfo = pallet_multisig::weights::SubstrateWeight; -} - -parameter_types! { - // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = deposit(1, 8); - // Additional storage item size of 33 bytes. - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const AnnouncementDepositBase: Balance = deposit(1, 8); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); -} - -/// The type used to represent the kinds of proxying allowed. -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - scale_info::TypeInfo, -)] -pub enum ProxyType { - Any, - NonTransfer, - CancelProxy, - SudoBalances, -} - -impl Default for ProxyType { - fn default() -> Self { - Self::Any - } -} - -impl InstanceFilter for ProxyType { - fn filter(&self, c: &RuntimeCall) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => { - !matches!(c, RuntimeCall::Balances(..) | RuntimeCall::Sudo(..)) - } - ProxyType::CancelProxy => { - matches!( - c, - RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) - ) - } - ProxyType::SudoBalances => match c { - RuntimeCall::Sudo(pallet_sudo::Call::sudo { call: x }) => { - matches!(x.as_ref(), &RuntimeCall::Balances(..)) - } - RuntimeCall::Utility(..) => true, - _ => false, - }, - } - } - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::NonTransfer, _) => true, - _ => false, - } - } -} - -impl pallet_proxy::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = ConstU32<32>; - type WeightInfo = pallet_proxy::weights::SubstrateWeight; - type MaxPending = ConstU32<32>; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; -} - -impl pallet_gear_program::Config for Runtime { - type Scheduler = GearScheduler; - type CurrentBlockNumber = Gear; -} - -parameter_types! { - pub const GasLimitMaxPercentage: Percent = Percent::from_percent(GAS_LIMIT_MIN_PERCENTAGE_NUM); - pub BlockGasLimit: u64 = GasLimitMaxPercentage::get() * RuntimeBlockWeights::get() - .max_block.ref_time(); - - pub const ReserveThreshold: u32 = 1; - pub const WaitlistCost: u64 = 100; - pub const MailboxCost: u64 = 100; - pub const ReservationCost: u64 = 100; - pub const DispatchHoldCost: u64 = 100; - - pub const OutgoingLimit: u32 = 1024; - pub const MailboxThreshold: u64 = 3000; - - pub const PerformanceMultiplier: u32 = 100; -} - -parameter_types! { - pub Schedule: pallet_gear::Schedule = Default::default(); - pub BankAddress: AccountId = BANK_ADDRESS.into(); - pub const GasMultiplier: common::GasMultiplier = common::GasMultiplier::ValuePerGas(VALUE_PER_GAS); -} - -impl pallet_gear_bank::Config for Runtime { - type Currency = Balances; - type BankAddress = BankAddress; - type GasMultiplier = GasMultiplier; -} - -impl pallet_gear::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Randomness = pallet_babe::RandomnessFromOneEpochAgo; - type WeightInfo = weights::pallet_gear::SubstrateWeight; - type Schedule = Schedule; - type OutgoingLimit = OutgoingLimit; - type PerformanceMultiplier = PerformanceMultiplier; - type DebugInfo = DebugInfo; - type CodeStorage = GearProgram; - type ProgramStorage = GearProgram; - type MailboxThreshold = MailboxThreshold; - type ReservationsLimit = ConstU64<256>; - type Messenger = GearMessenger; - type GasProvider = GearGas; - type BlockLimiter = GearGas; - type Scheduler = GearScheduler; - type QueueRunner = Gear; - type Voucher = GearVoucher; - type ProgramRentFreePeriod = ConstU32<{ MONTHS * RENT_FREE_PERIOD_MONTH_FACTOR }>; - type ProgramResumeMinimalRentPeriod = ConstU32<{ WEEKS * RENT_RESUME_WEEK_FACTOR }>; - type ProgramRentCostPerBlock = ConstU128; - type ProgramResumeSessionDuration = ConstU32<{ HOURS * RESUME_SESSION_DURATION_HOUR_FACTOR }>; - - #[cfg(feature = "runtime-benchmarks")] - type ProgramRentEnabled = ConstBool; - - #[cfg(not(feature = "runtime-benchmarks"))] - type ProgramRentEnabled = ConstBool; - - type ProgramRentDisabledDelta = ConstU32<{ WEEKS * RENT_DISABLED_DELTA_WEEK_FACTOR }>; -} - -#[cfg(feature = "dev")] -impl pallet_gear_debug::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = pallet_gear_debug::weights::GearSupportWeight; - type CodeStorage = GearProgram; - type ProgramStorage = GearProgram; - type Messenger = GearMessenger; -} - -impl pallet_gear_scheduler::Config for Runtime { - type BlockLimiter = GearGas; - type ReserveThreshold = ReserveThreshold; - type WaitlistCost = WaitlistCost; - type MailboxCost = MailboxCost; - type ReservationCost = ReservationCost; - type DispatchHoldCost = DispatchHoldCost; -} - -impl pallet_gear_gas::Config for Runtime { - type BlockGasLimit = BlockGasLimit; -} - -impl pallet_gear_messenger::Config for Runtime { - type BlockLimiter = GearGas; - type CurrentBlockNumber = Gear; -} - -pub struct ExtraFeeFilter; -impl Contains for ExtraFeeFilter { - fn contains(call: &RuntimeCall) -> bool { - // Calls that affect message queue and are subject to extra fee - matches!( - call, - RuntimeCall::Gear(pallet_gear::Call::create_program { .. }) - | RuntimeCall::Gear(pallet_gear::Call::upload_program { .. }) - | RuntimeCall::Gear(pallet_gear::Call::send_message { .. }) - | RuntimeCall::Gear(pallet_gear::Call::send_reply { .. }) - ) - } -} - -pub struct DelegateFeeAccountBuilder; -// TODO: in case of the `send_reply` prepaid call we have to iterate through the -// user's mailbox to dig out the stored message source `program_id` to check if it has -// issued a voucher to pay for the reply extrinsic transaction fee. -// Isn't there a better way to do that? -impl DelegateFee for DelegateFeeAccountBuilder { - fn delegate_fee(call: &RuntimeCall, who: &AccountId) -> Option { - match call { - RuntimeCall::GearVoucher(pallet_gear_voucher::Call::call { - call: pallet_gear_voucher::PrepaidCall::SendMessage { destination, .. }, - }) => Some(GearVoucher::voucher_account_id(who, destination)), - RuntimeCall::GearVoucher(pallet_gear_voucher::Call::call { - call: pallet_gear_voucher::PrepaidCall::SendReply { reply_to_id, .. }, - }) => <::Mailbox as Mailbox>::peek(who, reply_to_id).map( - |stored_message| GearVoucher::voucher_account_id(who, &stored_message.source()), - ), - _ => None, - } - } -} - -impl pallet_gear_payment::Config for Runtime { - type ExtraFeeCallFilter = ExtraFeeFilter; - type Messenger = GearMessenger; - type DelegateFee = DelegateFeeAccountBuilder; -} - -parameter_types! { - pub const VoucherPalletId: PalletId = PalletId(*b"py/vouch"); -} - -impl pallet_gear_voucher::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type PalletId = VoucherPalletId; - type WeightInfo = weights::pallet_gear_voucher::SubstrateWeight; - type CallsDispatcher = Gear; -} - -impl frame_system::offchain::SendTransactionTypes for Runtime -where - RuntimeCall: From, -{ - type Extrinsic = UncheckedExtrinsic; - type OverarchingCall = RuntimeCall; -} - -// Create the runtime by composing the FRAME pallets that were previously configured. -// -// # NOTE -// -// While updating the indexes, please update the indexes in `gsdk/src/metadata/mod.rs` -// as well, example: https://github.com/gear-tech/gear/pull/2370/commits/a82cb5ba365cf47aef2c42a285a1793a86e711c1 -#[cfg(feature = "dev")] -construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = runtime_primitives::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system = 0, - Timestamp: pallet_timestamp = 1, - Authorship: pallet_authorship = 2, - Babe: pallet_babe = 3, - Grandpa: pallet_grandpa = 4, - Balances: pallet_balances = 5, - TransactionPayment: pallet_transaction_payment = 6, - Session: pallet_session = 7, - Utility: pallet_utility = 8, - Proxy: pallet_proxy = 9, - Multisig: pallet_multisig = 10, - ValidatorSet: validator_set = 98, - Sudo: pallet_sudo = 99, - - // Gear pallets - GearProgram: pallet_gear_program = 100, - GearMessenger: pallet_gear_messenger = 101, - GearScheduler: pallet_gear_scheduler = 102, - GearGas: pallet_gear_gas = 103, - Gear: pallet_gear = 104, - GearPayment: pallet_gear_payment = 105, - GearVoucher: pallet_gear_voucher = 106, - GearBank: pallet_gear_bank = 107, - - // Only available with "dev" feature on - GearDebug: pallet_gear_debug = 199, - } -); - -#[cfg(not(feature = "dev"))] -construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = runtime_primitives::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system = 0, - Timestamp: pallet_timestamp = 1, - Authorship: pallet_authorship = 2, - Babe: pallet_babe = 3, - Grandpa: pallet_grandpa = 4, - Balances: pallet_balances = 5, - TransactionPayment: pallet_transaction_payment = 6, - Session: pallet_session = 7, - Utility: pallet_utility = 8, - Proxy: pallet_proxy = 9, - Multisig: pallet_multisig = 10, - ValidatorSet: validator_set = 98, - Sudo: pallet_sudo = 99, - - // Gear pallets - GearProgram: pallet_gear_program = 100, - GearMessenger: pallet_gear_messenger = 101, - GearScheduler: pallet_gear_scheduler = 102, - GearGas: pallet_gear_gas = 103, - Gear: pallet_gear = 104, - GearPayment: pallet_gear_payment = 105, - GearVoucher: pallet_gear_voucher = 106, - GearBank: pallet_gear_bank = 107, - } -); - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - CustomChargeTransactionPayment, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; -/// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, - migrations::Migrations, ->; - -#[cfg(test)] -mod tests; - -#[cfg(feature = "dev")] -type DebugInfo = GearDebug; -#[cfg(not(feature = "dev"))] -type DebugInfo = (); - -#[cfg(feature = "runtime-benchmarks")] -#[macro_use] -extern crate frame_benchmarking; - -#[cfg(feature = "runtime-benchmarks")] -mod benches { - define_benchmarks!( - // Substrate pallets - [frame_system, SystemBench::] - [pallet_balances, Balances] - [pallet_timestamp, Timestamp] - [pallet_utility, Utility] - // Gear pallets - [pallet_gear, Gear] - [pallet_gear_voucher, GearVoucher] - ); -} - -impl_runtime_apis_plus_common! { - impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeConfiguration { - // The choice of `c` parameter (where `1 - c` represents the - // probability of a slot being empty), is done in accordance to the - // slot duration and expected target block time, for safely - // resisting network delays of maximum two seconds. - // - sp_consensus_babe::BabeConfiguration { - slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), - c: BABE_GENESIS_EPOCH_CONFIG.c, - authorities: Babe::authorities().to_vec(), - randomness: Babe::randomness(), - allowed_slots: BABE_GENESIS_EPOCH_CONFIG.allowed_slots, - } - } - - fn current_epoch_start() -> sp_consensus_babe::Slot { - Babe::current_epoch_start() - } - - fn current_epoch() -> sp_consensus_babe::Epoch { - Babe::current_epoch() - } - - fn next_epoch() -> sp_consensus_babe::Epoch { - Babe::next_epoch() - } - - fn generate_key_ownership_proof( - _slot: sp_consensus_babe::Slot, - _authority_id: sp_consensus_babe::AuthorityId, - ) -> Option { - None - } - - fn submit_report_equivocation_unsigned_extrinsic( - equivocation_proof: sp_consensus_babe::EquivocationProof<::Header>, - key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Babe::submit_unsigned_equivocation_report( - equivocation_proof, - key_owner_proof, - ) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { - // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to - // have a backtrace here. If any of the pre/post migration checks fail, we shall stop - // right here and right now. - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) - } - - fn execute_block( - block: Block, - state_root_check: bool, - signature_check: bool, - select: frame_try_runtime::TryStateSelect - ) -> Weight { - log::info!( - target: "node-runtime", - "try-runtime: executing block {:?} / root checks: {:?} / signature_checks: {:?} / try-state-select: {:?}", - block.header.hash(), - state_root_check, - signature_check, - select, - ); - // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to - // have a backtrace here. - Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() - } - } - - impl pallet_gear_staking_rewards_rpc_runtime_api::GearStakingRewardsApi for Runtime { - fn inflation_info() -> pallet_gear_staking_rewards::InflationInfo { - unimplemented!(); - } - } -} diff --git a/runtime/gear/src/migrations.rs b/runtime/gear/src/migrations.rs deleted file mode 100644 index 248916f1fad..00000000000 --- a/runtime/gear/src/migrations.rs +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#[allow(unused)] -use crate::*; - -pub type Migrations = (); diff --git a/runtime/gear/src/tests.rs b/runtime/gear/src/tests.rs deleted file mode 100644 index c3ee466a2d6..00000000000 --- a/runtime/gear/src/tests.rs +++ /dev/null @@ -1,168 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -use super::*; -use crate::Runtime; -use gear_core_processor::configs::PageCosts; -use gear_lazy_pages_common::LazyPagesWeights; -use pallet_gear::{InstructionWeights, MemoryWeights}; -use runtime_common::weights::{check_instructions_weights, check_pages_weights}; - -#[test] -fn instruction_weights_heuristics_test() { - let weights = InstructionWeights::::default(); - - let expected_weights = InstructionWeights { - version: 0, - _phantom: core::marker::PhantomData, - - i64const: 150, - i64load: 11_575, - i32load: 8_000, - i64store: 29_000, - i32store: 20_000, - select: 7_100, - r#if: 8_000, - br: 3_300, - br_if: 6_000, - br_table: 10_900, - br_table_per_entry: 300, - - call: 4_900, - call_per_local: 0, - call_indirect: 22_100, - call_indirect_per_param: 2_000, - - local_get: 600, - local_set: 1_900, - local_tee: 1_500, - global_get: 2_000, - global_set: 3_000, - memory_current: 14_200, - - i64clz: 6_100, - i32clz: 6_100, - i64ctz: 6_700, - i32ctz: 6_700, - i64popcnt: 1_000, - i32popcnt: 800, - i64eqz: 4_000, - i32eqz: 2_400, - i32extend8s: 800, - i32extend16s: 800, - i64extend8s: 800, - i64extend16s: 800, - i64extend32s: 800, - i64extendsi32: 800, - i64extendui32: 400, - i32wrapi64: 200, - i64eq: 4_200, - i32eq: 2_200, - i64ne: 4_200, - i32ne: 2_200, - - i64lts: 4_000, - i32lts: 2_000, - i64ltu: 4_000, - i32ltu: 2_000, - i64gts: 4_000, - i32gts: 2_000, - i64gtu: 4_000, - i32gtu: 2_000, - i64les: 4_000, - i32les: 2_000, - i64leu: 4_000, - i32leu: 2_000, - - i64ges: 4_000, - i32ges: 2_000, - i64geu: 4_000, - i32geu: 2_000, - i64add: 2_500, - i32add: 1_000, - i64sub: 3_000, - i32sub: 1_000, - i64mul: 4_000, - i32mul: 2_300, - i64divs: 4_800, - i32divs: 3_800, - - i64divu: 5_200, - i32divu: 4_200, - i64rems: 21_100, - i32rems: 15_100, - i64remu: 4_300, - i32remu: 4_300, - i64and: 3_000, - i32and: 1_000, - i64or: 3_000, - i32or: 1_000, - i64xor: 3_000, - i32xor: 1_000, - - i64shl: 2_500, - i32shl: 1_000, - i64shrs: 2_500, - i32shrs: 1_000, - i64shru: 2_500, - i32shru: 1_000, - i64rotl: 2_000, - i32rotl: 1_000, - i64rotr: 2_500, - i32rotr: 1_000, - }; - - check_instructions_weights(weights, expected_weights); -} - -#[test] -fn page_costs_heuristic_test() { - let page_costs: PageCosts = MemoryWeights::::default().into(); - let lazy_pages_weights: LazyPagesWeights = page_costs.lazy_pages_weights(); - - let expected_pages_costs = PageCosts { - lazy_pages_signal_read: 28_000_000.into(), - lazy_pages_signal_write: 33_000_000.into(), - lazy_pages_signal_write_after_read: 9_500_000.into(), - lazy_pages_host_func_read: 29_000_000.into(), - lazy_pages_host_func_write: 33_000_000.into(), - lazy_pages_host_func_write_after_read: 10_700_000.into(), - load_page_data: 9_700_000.into(), - upload_page_data: 104_000_000.into(), - static_page: 100.into(), - mem_grow: 906_170.into(), - parachain_load_heuristic: 0.into(), - }; - - let expected_lazy_pages_weights = LazyPagesWeights { - signal_read: 28_000_000.into(), - signal_write: 138_000_000.into(), - signal_write_after_read: 112_000_000.into(), - host_func_read: 29_000_000.into(), - host_func_write: 137_000_000.into(), - host_func_write_after_read: 112_000_000.into(), - load_page_storage_data: 9_700_000.into(), - }; - - check_pages_weights( - page_costs, - expected_pages_costs, - lazy_pages_weights, - expected_lazy_pages_weights, - ); -} diff --git a/runtime/gear/src/weights/frame_system.rs b/runtime/gear/src/weights/frame_system.rs deleted file mode 100644 index 3cd2ae74282..00000000000 --- a/runtime/gear/src/weights/frame_system.rs +++ /dev/null @@ -1,183 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for frame_system -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/frame_system.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for frame_system. -pub trait WeightInfo { - fn remark(b: u32, ) -> Weight; - fn remark_with_event(b: u32, ) -> Weight; - fn set_heap_pages() -> Weight; - fn set_storage(i: u32, ) -> Weight; - fn kill_storage(i: u32, ) -> Weight; - fn kill_prefix(p: u32, ) -> Weight; -} - -/// Weights for frame_system using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl frame_system::WeightInfo for SubstrateWeight { - /// The range of component `b` is `[0, 1310720]`. - fn remark(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_718_000 picoseconds. - Weight::from_parts(1_167_483, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(460, 0).saturating_mul(b.into())) - } - /// The range of component `b` is `[0, 1310720]`. - fn remark_with_event(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_244_000 picoseconds. - Weight::from_parts(6_378_000, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_432, 0).saturating_mul(b.into())) - } - fn set_heap_pages() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 3_227_000 picoseconds. - Weight::from_parts(3_417_000, 1485) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// The range of component `i` is `[0, 1000]`. - fn set_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_736_000 picoseconds. - Weight::from_parts(1_802_000, 0) - // Standard Error: 891 - .saturating_add(Weight::from_parts(687_558, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// The range of component `i` is `[0, 1000]`. - fn kill_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_660_000 picoseconds. - Weight::from_parts(1_742_000, 0) - // Standard Error: 793 - .saturating_add(Weight::from_parts(525_505, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// The range of component `p` is `[0, 1000]`. - fn kill_prefix(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `70 + p * (69 ±0)` - // Estimated: `73 + p * (70 ±0)` - // Minimum execution time: 3_380_000 picoseconds. - Weight::from_parts(3_486_000, 73) - // Standard Error: 1_481 - .saturating_add(Weight::from_parts(1_131_430, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// The range of component `b` is `[0, 1310720]`. - fn remark(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_718_000 picoseconds. - Weight::from_parts(1_167_483, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(460, 0).saturating_mul(b.into())) - } - /// The range of component `b` is `[0, 1310720]`. - fn remark_with_event(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_244_000 picoseconds. - Weight::from_parts(6_378_000, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_432, 0).saturating_mul(b.into())) - } - fn set_heap_pages() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 3_227_000 picoseconds. - Weight::from_parts(3_417_000, 1485) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// The range of component `i` is `[0, 1000]`. - fn set_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_736_000 picoseconds. - Weight::from_parts(1_802_000, 0) - // Standard Error: 891 - .saturating_add(Weight::from_parts(687_558, 0).saturating_mul(i.into())) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// The range of component `i` is `[0, 1000]`. - fn kill_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_660_000 picoseconds. - Weight::from_parts(1_742_000, 0) - // Standard Error: 793 - .saturating_add(Weight::from_parts(525_505, 0).saturating_mul(i.into())) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// The range of component `p` is `[0, 1000]`. - fn kill_prefix(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `70 + p * (69 ±0)` - // Estimated: `73 + p * (70 ±0)` - // Minimum execution time: 3_380_000 picoseconds. - Weight::from_parts(3_486_000, 73) - // Standard Error: 1_481 - .saturating_add(Weight::from_parts(1_131_430, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) - } -} diff --git a/runtime/gear/src/weights/mod.rs b/runtime/gear/src/weights/mod.rs deleted file mode 100644 index b4eebedfe52..00000000000 --- a/runtime/gear/src/weights/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2021-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! A list of the different weight modules for our runtime. - -pub mod frame_system; -pub mod pallet_balances; -pub mod pallet_gear; -pub mod pallet_gear_voucher; -pub mod pallet_timestamp; -pub mod pallet_utility; diff --git a/runtime/gear/src/weights/pallet_balances.rs b/runtime/gear/src/weights/pallet_balances.rs deleted file mode 100644 index 7663008fa87..00000000000 --- a/runtime/gear/src/weights/pallet_balances.rs +++ /dev/null @@ -1,182 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for pallet_balances -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_balances.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_balances. -pub trait WeightInfo { - fn transfer() -> Weight; - fn transfer_keep_alive() -> Weight; - fn set_balance_creating() -> Weight; - fn set_balance_killing() -> Weight; - fn force_transfer() -> Weight; - fn transfer_all() -> Weight; - fn force_unreserve() -> Weight; -} - -/// Weights for pallet_balances using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl pallet_balances::WeightInfo for SubstrateWeight { - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 29_973_000 picoseconds. - Weight::from_parts(30_964_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn transfer_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 21_364_000 picoseconds. - Weight::from_parts(21_759_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn set_balance_creating() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 12_571_000 picoseconds. - Weight::from_parts(12_903_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn set_balance_killing() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 15_846_000 picoseconds. - Weight::from_parts(16_097_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 31_127_000 picoseconds. - Weight::from_parts(31_645_000, 6196) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - fn transfer_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 27_627_000 picoseconds. - Weight::from_parts(28_344_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn force_unreserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 12_036_000 picoseconds. - Weight::from_parts(12_609_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 29_973_000 picoseconds. - Weight::from_parts(30_964_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn transfer_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 21_364_000 picoseconds. - Weight::from_parts(21_759_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn set_balance_creating() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 12_571_000 picoseconds. - Weight::from_parts(12_903_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn set_balance_killing() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 15_846_000 picoseconds. - Weight::from_parts(16_097_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 31_127_000 picoseconds. - Weight::from_parts(31_645_000, 6196) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - fn transfer_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 27_627_000 picoseconds. - Weight::from_parts(28_344_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn force_unreserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 12_036_000 picoseconds. - Weight::from_parts(12_609_000, 3593) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } -} diff --git a/runtime/gear/src/weights/pallet_gear.rs b/runtime/gear/src/weights/pallet_gear.rs deleted file mode 100644 index b86b0c49d63..00000000000 --- a/runtime/gear/src/weights/pallet_gear.rs +++ /dev/null @@ -1,4162 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for pallet_gear -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=pallet_gear --extrinsic=alloc,alloc_in_handle,alloc_per_page,claim_value,create_program,db_read_per_kb,db_write_per_kb,free,gr_block_height,gr_block_timestamp,gr_create_program,gr_create_program_per_kb,gr_create_program_wgas,gr_create_program_wgas_per_kb,gr_debug,gr_debug_per_kb,gr_gas_available,gr_message_id,gr_pay_program_rent,gr_program_id,gr_random,gr_read,gr_read_per_kb,gr_reply_code,gr_reply_deposit,gr_reply_per_kb,gr_reply_push,gr_reply_push_input,gr_reply_push_input_per_kb,gr_reply_push_per_kb,gr_reply_to,gr_reply_wgas_per_kb,gr_reservation_reply_commit_per_kb,gr_reservation_reply_per_kb,gr_reservation_send,gr_reservation_send_commit,gr_reservation_send_per_kb,gr_reserve_gas,gr_send,gr_send_commit,gr_send_commit_wgas,gr_send_init,gr_send_input,gr_send_input_wgas,gr_send_per_kb,gr_send_push,gr_send_push_input,gr_send_push_input_per_kb,gr_send_push_per_kb,gr_send_wgas,gr_send_wgas_per_kb,gr_signal_code,gr_signal_from,gr_size,gr_source,gr_system_reserve_gas,gr_unreserve_gas,gr_value,gr_value_available,gr_wake,initial_allocation,instantiate_module_per_kb,instr_br,instr_br_if,instr_br_table,instr_br_table_per_entry,instr_call,instr_call_const,instr_call_indirect,instr_call_indirect_per_param,instr_call_per_local,instr_global_get,instr_global_set,instr_i32add,instr_i32and,instr_i32clz,instr_i32ctz,instr_i32divs,instr_i32divu,instr_i32eq,instr_i32eqz,instr_i32extend16s,instr_i32extend8s,instr_i32ges,instr_i32geu,instr_i32gts,instr_i32gtu,instr_i32les,instr_i32leu,instr_i32load,instr_i32lts,instr_i32ltu,instr_i32mul,instr_i32ne,instr_i32or,instr_i32popcnt,instr_i32rems,instr_i32remu,instr_i32rotl,instr_i32rotr,instr_i32shl,instr_i32shrs,instr_i32shru,instr_i32store,instr_i32sub,instr_i32wrapi64,instr_i32xor,instr_i64add,instr_i64and,instr_i64clz,instr_i64ctz,instr_i64divs,instr_i64divu,instr_i64eq,instr_i64eqz,instr_i64extend16s,instr_i64extend32s,instr_i64extend8s,instr_i64extendsi32,instr_i64extendui32,instr_i64ges,instr_i64geu,instr_i64gts,instr_i64gtu,instr_i64les,instr_i64leu,instr_i64load,instr_i64lts,instr_i64ltu,instr_i64mul,instr_i64ne,instr_i64or,instr_i64popcnt,instr_i64rems,instr_i64remu,instr_i64rotl,instr_i64rotr,instr_i64shl,instr_i64shrs,instr_i64shru,instr_i64store,instr_i64sub,instr_i64xor,instr_if,instr_local_get,instr_local_set,instr_local_tee,instr_memory_current,instr_select,lazy_pages_host_func_read,lazy_pages_host_func_write,lazy_pages_host_func_write_after_read,lazy_pages_load_page_storage_data,lazy_pages_signal_read,lazy_pages_signal_write,lazy_pages_signal_write_after_read,mem_grow,pay_program_rent,reinstrument_per_kb,resume_session_commit,resume_session_init,resume_session_push,send_message,send_reply,tasks_pause_program,tasks_pause_program_uninited,tasks_remove_from_mailbox,tasks_remove_from_waitlist,tasks_remove_gas_reservation,tasks_remove_resume_session,tasks_send_dispatch,tasks_send_user_message,tasks_send_user_message_to_mailbox,tasks_wake_message,tasks_wake_message_no_wake,upload_code,upload_program --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_gear. -pub trait WeightInfo { - fn gr_reply(r: u32, ) -> Weight; - fn gr_reply_wgas(r: u32, ) -> Weight; - fn gr_reply_commit(r: u32, ) -> Weight; - fn gr_reply_commit_wgas(r: u32, ) -> Weight; - fn gr_reply_input(r: u32, ) -> Weight; - fn gr_reply_input_wgas(r: u32, ) -> Weight; - fn gr_reservation_reply(r: u32, ) -> Weight; - fn gr_reservation_reply_commit(r: u32, ) -> Weight; - fn gr_exit(r: u32, ) -> Weight; - fn gr_leave(r: u32, ) -> Weight; - fn gr_wait(r: u32, ) -> Weight; - fn gr_wait_for(r: u32, ) -> Weight; - fn gr_wait_up_to(r: u32, ) -> Weight; - fn db_write_per_kb(c: u32, ) -> Weight; - fn db_read_per_kb(c: u32, ) -> Weight; - fn instantiate_module_per_kb(c: u32, ) -> Weight; - fn claim_value() -> Weight; - fn pay_program_rent() -> Weight; - fn resume_session_init() -> Weight; - fn resume_session_push(c: u32, ) -> Weight; - fn resume_session_commit(c: u32, ) -> Weight; - fn upload_code(c: u32, ) -> Weight; - fn create_program(s: u32, ) -> Weight; - fn upload_program(c: u32, s: u32, ) -> Weight; - fn send_message(p: u32, ) -> Weight; - fn send_reply(p: u32, ) -> Weight; - fn initial_allocation(q: u32, ) -> Weight; - fn alloc_in_handle(q: u32, ) -> Weight; - fn reinstrument_per_kb(c: u32, ) -> Weight; - fn alloc(r: u32, ) -> Weight; - fn alloc_per_page(p: u32, ) -> Weight; - fn free(r: u32, ) -> Weight; - fn gr_reserve_gas(r: u32, ) -> Weight; - fn gr_unreserve_gas(r: u32, ) -> Weight; - fn gr_system_reserve_gas(r: u32, ) -> Weight; - fn gr_message_id(r: u32, ) -> Weight; - fn gr_program_id(r: u32, ) -> Weight; - fn gr_source(r: u32, ) -> Weight; - fn gr_value(r: u32, ) -> Weight; - fn gr_value_available(r: u32, ) -> Weight; - fn gr_gas_available(r: u32, ) -> Weight; - fn gr_size(r: u32, ) -> Weight; - fn gr_read(r: u32, ) -> Weight; - fn gr_read_per_kb(n: u32, ) -> Weight; - fn gr_block_height(r: u32, ) -> Weight; - fn gr_block_timestamp(r: u32, ) -> Weight; - fn gr_random(n: u32, ) -> Weight; - fn gr_reply_deposit(r: u32, ) -> Weight; - fn gr_send(r: u32, ) -> Weight; - fn gr_send_per_kb(n: u32, ) -> Weight; - fn gr_send_wgas(r: u32, ) -> Weight; - fn gr_send_wgas_per_kb(n: u32, ) -> Weight; - fn gr_send_input(r: u32, ) -> Weight; - fn gr_send_input_wgas(r: u32, ) -> Weight; - fn gr_send_init(r: u32, ) -> Weight; - fn gr_send_push(r: u32, ) -> Weight; - fn gr_send_push_per_kb(n: u32, ) -> Weight; - fn gr_send_commit(r: u32, ) -> Weight; - fn gr_send_commit_wgas(r: u32, ) -> Weight; - fn gr_reservation_send(r: u32, ) -> Weight; - fn gr_reservation_send_per_kb(n: u32, ) -> Weight; - fn gr_reservation_send_commit(r: u32, ) -> Weight; - fn gr_reply_per_kb(n: u32, ) -> Weight; - fn gr_reply_wgas_per_kb(n: u32, ) -> Weight; - fn gr_reply_push(r: u32, ) -> Weight; - fn gr_reply_push_per_kb(n: u32, ) -> Weight; - fn gr_reservation_reply_per_kb(n: u32, ) -> Weight; - fn gr_reservation_reply_commit_per_kb(n: u32, ) -> Weight; - fn gr_reply_to(r: u32, ) -> Weight; - fn gr_signal_code(r: u32, ) -> Weight; - fn gr_signal_from(r: u32, ) -> Weight; - fn gr_reply_push_input(r: u32, ) -> Weight; - fn gr_reply_push_input_per_kb(n: u32, ) -> Weight; - fn gr_send_push_input(r: u32, ) -> Weight; - fn gr_send_push_input_per_kb(n: u32, ) -> Weight; - fn gr_debug(r: u32, ) -> Weight; - fn gr_debug_per_kb(n: u32, ) -> Weight; - fn gr_reply_code(r: u32, ) -> Weight; - fn gr_wake(r: u32, ) -> Weight; - fn gr_create_program(r: u32, ) -> Weight; - fn gr_create_program_per_kb(p: u32, s: u32, ) -> Weight; - fn gr_create_program_wgas(r: u32, ) -> Weight; - fn gr_create_program_wgas_per_kb(p: u32, s: u32, ) -> Weight; - fn gr_pay_program_rent(r: u32, ) -> Weight; - fn lazy_pages_signal_read(p: u32, ) -> Weight; - fn lazy_pages_signal_write(p: u32, ) -> Weight; - fn lazy_pages_signal_write_after_read(p: u32, ) -> Weight; - fn lazy_pages_load_page_storage_data(p: u32, ) -> Weight; - fn lazy_pages_host_func_read(p: u32, ) -> Weight; - fn lazy_pages_host_func_write(p: u32, ) -> Weight; - fn lazy_pages_host_func_write_after_read(p: u32, ) -> Weight; - fn mem_grow(r: u32, ) -> Weight; - fn instr_i64load(r: u32, ) -> Weight; - fn instr_i32load(r: u32, ) -> Weight; - fn instr_i64store(r: u32, ) -> Weight; - fn instr_i32store(r: u32, ) -> Weight; - fn instr_select(r: u32, ) -> Weight; - fn instr_if(r: u32, ) -> Weight; - fn instr_br(r: u32, ) -> Weight; - fn instr_br_if(r: u32, ) -> Weight; - fn instr_br_table(r: u32, ) -> Weight; - fn instr_br_table_per_entry(e: u32, ) -> Weight; - fn instr_call_const(r: u32, ) -> Weight; - fn instr_call(r: u32, ) -> Weight; - fn instr_call_indirect(r: u32, ) -> Weight; - fn instr_call_indirect_per_param(p: u32, ) -> Weight; - fn instr_call_per_local(l: u32, ) -> Weight; - fn instr_local_get(r: u32, ) -> Weight; - fn instr_local_set(r: u32, ) -> Weight; - fn instr_local_tee(r: u32, ) -> Weight; - fn instr_global_get(r: u32, ) -> Weight; - fn instr_global_set(r: u32, ) -> Weight; - fn instr_memory_current(r: u32, ) -> Weight; - fn instr_i64clz(r: u32, ) -> Weight; - fn instr_i32clz(r: u32, ) -> Weight; - fn instr_i64ctz(r: u32, ) -> Weight; - fn instr_i32ctz(r: u32, ) -> Weight; - fn instr_i64popcnt(r: u32, ) -> Weight; - fn instr_i32popcnt(r: u32, ) -> Weight; - fn instr_i64eqz(r: u32, ) -> Weight; - fn instr_i32eqz(r: u32, ) -> Weight; - fn instr_i32extend8s(r: u32, ) -> Weight; - fn instr_i32extend16s(r: u32, ) -> Weight; - fn instr_i64extend8s(r: u32, ) -> Weight; - fn instr_i64extend16s(r: u32, ) -> Weight; - fn instr_i64extend32s(r: u32, ) -> Weight; - fn instr_i64extendsi32(r: u32, ) -> Weight; - fn instr_i64extendui32(r: u32, ) -> Weight; - fn instr_i32wrapi64(r: u32, ) -> Weight; - fn instr_i64eq(r: u32, ) -> Weight; - fn instr_i32eq(r: u32, ) -> Weight; - fn instr_i64ne(r: u32, ) -> Weight; - fn instr_i32ne(r: u32, ) -> Weight; - fn instr_i64lts(r: u32, ) -> Weight; - fn instr_i32lts(r: u32, ) -> Weight; - fn instr_i64ltu(r: u32, ) -> Weight; - fn instr_i32ltu(r: u32, ) -> Weight; - fn instr_i64gts(r: u32, ) -> Weight; - fn instr_i32gts(r: u32, ) -> Weight; - fn instr_i64gtu(r: u32, ) -> Weight; - fn instr_i32gtu(r: u32, ) -> Weight; - fn instr_i64les(r: u32, ) -> Weight; - fn instr_i32les(r: u32, ) -> Weight; - fn instr_i64leu(r: u32, ) -> Weight; - fn instr_i32leu(r: u32, ) -> Weight; - fn instr_i64ges(r: u32, ) -> Weight; - fn instr_i32ges(r: u32, ) -> Weight; - fn instr_i64geu(r: u32, ) -> Weight; - fn instr_i32geu(r: u32, ) -> Weight; - fn instr_i64add(r: u32, ) -> Weight; - fn instr_i32add(r: u32, ) -> Weight; - fn instr_i64sub(r: u32, ) -> Weight; - fn instr_i32sub(r: u32, ) -> Weight; - fn instr_i64mul(r: u32, ) -> Weight; - fn instr_i32mul(r: u32, ) -> Weight; - fn instr_i64divs(r: u32, ) -> Weight; - fn instr_i32divs(r: u32, ) -> Weight; - fn instr_i64divu(r: u32, ) -> Weight; - fn instr_i32divu(r: u32, ) -> Weight; - fn instr_i64rems(r: u32, ) -> Weight; - fn instr_i32rems(r: u32, ) -> Weight; - fn instr_i64remu(r: u32, ) -> Weight; - fn instr_i32remu(r: u32, ) -> Weight; - fn instr_i64and(r: u32, ) -> Weight; - fn instr_i32and(r: u32, ) -> Weight; - fn instr_i64or(r: u32, ) -> Weight; - fn instr_i32or(r: u32, ) -> Weight; - fn instr_i64xor(r: u32, ) -> Weight; - fn instr_i32xor(r: u32, ) -> Weight; - fn instr_i64shl(r: u32, ) -> Weight; - fn instr_i32shl(r: u32, ) -> Weight; - fn instr_i64shrs(r: u32, ) -> Weight; - fn instr_i32shrs(r: u32, ) -> Weight; - fn instr_i64shru(r: u32, ) -> Weight; - fn instr_i32shru(r: u32, ) -> Weight; - fn instr_i64rotl(r: u32, ) -> Weight; - fn instr_i32rotl(r: u32, ) -> Weight; - fn instr_i64rotr(r: u32, ) -> Weight; - fn instr_i32rotr(r: u32, ) -> Weight; - fn tasks_remove_resume_session() -> Weight; - fn tasks_remove_gas_reservation() -> Weight; - fn tasks_send_user_message_to_mailbox() -> Weight; - fn tasks_send_user_message() -> Weight; - fn tasks_send_dispatch() -> Weight; - fn tasks_wake_message() -> Weight; - fn tasks_wake_message_no_wake() -> Weight; - fn tasks_remove_from_waitlist() -> Weight; - fn tasks_remove_from_mailbox() -> Weight; - fn tasks_pause_program(c: u32, ) -> Weight; - fn tasks_pause_program_uninited(c: u32, ) -> Weight; - fn allocation_cost() -> Weight; - fn grow_cost() -> Weight; - fn initial_cost() -> Weight; - fn load_cost() -> Weight; - fn instr_i64const(r: u32, ) -> Weight; -} - -/// Weights for pallet_gear using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl pallet_gear::WeightInfo for SubstrateWeight { - /// The range of component `r` is `[0, 1]`. - fn gr_reply(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_792_000 picoseconds. - Weight::from_parts(103_063_604, 0) - // Standard Error: 103_375 - .saturating_add(Weight::from_parts(18_929_072, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_154_000 picoseconds. - Weight::from_parts(107_249_232, 0) - // Standard Error: 99_969 - .saturating_add(Weight::from_parts(19_062_846, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 98_701_000 picoseconds. - Weight::from_parts(109_478_842, 0) - // Standard Error: 104_175 - .saturating_add(Weight::from_parts(10_887_124, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_commit_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 102_910_000 picoseconds. - Weight::from_parts(109_181_566, 0) - // Standard Error: 81_801 - .saturating_add(Weight::from_parts(12_077_508, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 719_481_000 picoseconds. - Weight::from_parts(765_485_196, 0) - // Standard Error: 676_170 - .saturating_add(Weight::from_parts(17_778_524, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_input_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 720_914_000 picoseconds. - Weight::from_parts(776_554_516, 0) - // Standard Error: 1_018_495 - .saturating_add(Weight::from_parts(38_306_948, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reservation_reply(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 105_823_000 picoseconds. - Weight::from_parts(112_820_586, 0) - // Standard Error: 82_530 - .saturating_add(Weight::from_parts(14_370_506, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reservation_reply_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 102_415_000 picoseconds. - Weight::from_parts(110_005_402, 0) - // Standard Error: 87_514 - .saturating_add(Weight::from_parts(6_578_880, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_exit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_593_000 picoseconds. - Weight::from_parts(104_873_732, 0) - // Standard Error: 2_095_391 - .saturating_add(Weight::from_parts(193_359_282, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_leave(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_619_000 picoseconds. - Weight::from_parts(99_623_244, 0) - // Standard Error: 1_945_328 - .saturating_add(Weight::from_parts(179_784_494, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 92_936_000 picoseconds. - Weight::from_parts(100_139_452, 0) - // Standard Error: 1_753_555 - .saturating_add(Weight::from_parts(132_465_876, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait_for(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_955_000 picoseconds. - Weight::from_parts(100_650_632, 0) - // Standard Error: 2_018_388 - .saturating_add(Weight::from_parts(178_916_382, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait_up_to(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_467_000 picoseconds. - Weight::from_parts(102_532_790, 0) - // Standard Error: 2_065_180 - .saturating_add(Weight::from_parts(187_152_790, 0).saturating_mul(r.into())) - } - fn allocation_cost() -> Weight { - // To be changed with the proper value. - T::DbWeight::get().writes(1) - } - fn grow_cost() -> Weight { - // To be changed with the proper value. - T::DbWeight::get().writes(1) - } - fn initial_cost() -> Weight { - T::DbWeight::get().writes(1) - } - fn load_cost() -> Weight { - T::DbWeight::get().reads(1) - } - /// The range of component `c` is `[0, 512]`. - fn db_write_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_040_000 picoseconds. - Weight::from_parts(1_087_000, 0) - // Standard Error: 940 - .saturating_add(Weight::from_parts(251_751, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// The range of component `c` is `[0, 512]`. - fn db_read_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `79 + c * (1024 ±0)` - // Estimated: `3543 + c * (1024 ±0)` - // Minimum execution time: 3_333_000 picoseconds. - Weight::from_parts(3_463_000, 3543) - // Standard Error: 966 - .saturating_add(Weight::from_parts(678_430, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(Weight::from_parts(0, 1024).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 512]`. - fn instantiate_module_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 61_586_000 picoseconds. - Weight::from_parts(95_956_778, 0) - // Standard Error: 5_472 - .saturating_add(Weight::from_parts(2_353_352, 0).saturating_mul(c.into())) - } - fn claim_value() -> Weight { - // Proof Size summary in bytes: - // Measured: `1304` - // Estimated: `51293` - // Minimum execution time: 105_420_000 picoseconds. - Weight::from_parts(109_120_000, 51293) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(12_u64)) - } - fn pay_program_rent() -> Weight { - // Proof Size summary in bytes: - // Measured: `923` - // Estimated: `21372` - // Minimum execution time: 54_290_000 picoseconds. - Weight::from_parts(55_929_000, 21372) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - fn resume_session_init() -> Weight { - // Proof Size summary in bytes: - // Measured: `570` - // Estimated: `17214` - // Minimum execution time: 29_539_000 picoseconds. - Weight::from_parts(30_515_000, 17214) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// The range of component `c` is `[0, 64]`. - fn resume_session_push(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `355` - // Estimated: `7640` - // Minimum execution time: 8_426_000 picoseconds. - Weight::from_parts(5_984_423, 7640) - // Standard Error: 33_789 - .saturating_add(Weight::from_parts(13_895_151, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// The range of component `c` is `[0, 2044]`. - fn resume_session_commit(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1457 + c * (16389 ±0)` - // Estimated: `42178 + c * (131112 ±0)` - // Minimum execution time: 71_198_000 picoseconds. - Weight::from_parts(72_033_000, 42178) - // Standard Error: 159_543 - .saturating_add(Weight::from_parts(54_764_270, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 131112).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 250]`. - fn upload_code(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `46` - // Estimated: `5134` - // Minimum execution time: 77_259_000 picoseconds. - Weight::from_parts(52_968_469, 5134) - // Standard Error: 43_186 - .saturating_add(Weight::from_parts(59_988_588, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// The range of component `s` is `[0, 4194304]`. - fn create_program(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1043` - // Estimated: `49852` - // Minimum execution time: 96_734_000 picoseconds. - Weight::from_parts(136_364_170, 49852) - // Standard Error: 0 - .saturating_add(Weight::from_parts(2_592, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(12_u64)) - } - /// The range of component `c` is `[0, 250]`. - /// The range of component `s` is `[0, 4194304]`. - fn upload_program(c: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `453` - // Estimated: `44268` - // Minimum execution time: 11_047_048_000 picoseconds. - Weight::from_parts(211_012_859, 44268) - // Standard Error: 157_221 - .saturating_add(Weight::from_parts(59_860_835, 0).saturating_mul(c.into())) - // Standard Error: 9 - .saturating_add(Weight::from_parts(2_554, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(16_u64)) - } - /// The range of component `p` is `[0, 2097152]`. - fn send_message(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `530` - // Estimated: `31259` - // Minimum execution time: 73_682_000 picoseconds. - Weight::from_parts(48_414_295, 31259) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_040, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// The range of component `p` is `[0, 2097152]`. - fn send_reply(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1303` - // Estimated: `53823` - // Minimum execution time: 122_837_000 picoseconds. - Weight::from_parts(97_209_014, 53823) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_068, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(16_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) - } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `979` - // Estimated: `89393` - // Minimum execution time: 354_207_000 picoseconds. - Weight::from_parts(374_297_966, 89393) - .saturating_add(T::DbWeight::get().reads(31_u64)) - .saturating_add(T::DbWeight::get().writes(24_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `979` - // Estimated: `89133` - // Minimum execution time: 368_424_000 picoseconds. - Weight::from_parts(387_073_481, 89133) - // Standard Error: 1_472 - .saturating_add(Weight::from_parts(4_343, 0).saturating_mul(q.into())) - .saturating_add(T::DbWeight::get().reads(31_u64)) - .saturating_add(T::DbWeight::get().writes(24_u64)) - } - /// The range of component `c` is `[0, 512]`. - fn reinstrument_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `211 + c * (1075 ±0)` - // Estimated: `3899 + c * (2150 ±0)` - // Minimum execution time: 58_209_000 picoseconds. - Weight::from_parts(58_498_000, 3899) - // Standard Error: 35_860 - .saturating_add(Weight::from_parts(58_109_594, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 2150).saturating_mul(c.into())) - } - /// The range of component `r` is `[0, 20]`. - fn alloc(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 92_645_000 picoseconds. - Weight::from_parts(95_763_000, 0) - // Standard Error: 3_691_564 - .saturating_add(Weight::from_parts(713_537_659, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[1, 512]`. - fn alloc_per_page(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 495_006_000 picoseconds. - Weight::from_parts(421_459_793, 0) - // Standard Error: 9_156 - .saturating_add(Weight::from_parts(29_070_022, 0).saturating_mul(p.into())) - } - /// The range of component `r` is `[0, 20]`. - fn free(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 219_414_000 picoseconds. - Weight::from_parts(206_118_379, 0) - // Standard Error: 320_555 - .saturating_add(Weight::from_parts(64_665_141, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 256]`. - fn gr_reserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_871_000 picoseconds. - Weight::from_parts(104_318_392, 0) - // Standard Error: 4_224 - .saturating_add(Weight::from_parts(2_443_618, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 256]`. - fn gr_unreserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 152_658_000 picoseconds. - Weight::from_parts(218_177_774, 0) - // Standard Error: 23_640 - .saturating_add(Weight::from_parts(2_186_094, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_system_reserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_532_000 picoseconds. - Weight::from_parts(112_244_990, 0) - // Standard Error: 370_435 - .saturating_add(Weight::from_parts(102_977_688, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_message_id(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_116_000 picoseconds. - Weight::from_parts(85_754_801, 0) - // Standard Error: 322_936 - .saturating_add(Weight::from_parts(85_646_040, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_program_id(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_226_000 picoseconds. - Weight::from_parts(96_400_189, 0) - // Standard Error: 308_975 - .saturating_add(Weight::from_parts(84_400_658, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_source(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_667_000 picoseconds. - Weight::from_parts(95_221_535, 0) - // Standard Error: 320_528 - .saturating_add(Weight::from_parts(85_320_330, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_value(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_400_000 picoseconds. - Weight::from_parts(83_830_464, 0) - // Standard Error: 333_677 - .saturating_add(Weight::from_parts(86_153_462, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_value_available(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 98_322_000 picoseconds. - Weight::from_parts(88_780_011, 0) - // Standard Error: 365_736 - .saturating_add(Weight::from_parts(86_373_607, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_gas_available(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_234_000 picoseconds. - Weight::from_parts(93_394_916, 0) - // Standard Error: 310_495 - .saturating_add(Weight::from_parts(85_678_300, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_size(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_316_000 picoseconds. - Weight::from_parts(88_012_950, 0) - // Standard Error: 309_598 - .saturating_add(Weight::from_parts(85_813_369, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_read(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 715_150_000 picoseconds. - Weight::from_parts(769_593_524, 0) - // Standard Error: 493_525 - .saturating_add(Weight::from_parts(140_935_499, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_read_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 844_162_000 picoseconds. - Weight::from_parts(851_053_000, 0) - // Standard Error: 50_294 - .saturating_add(Weight::from_parts(13_068_816, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_block_height(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_243_000 picoseconds. - Weight::from_parts(87_583_955, 0) - // Standard Error: 343_578 - .saturating_add(Weight::from_parts(84_267_053, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_block_timestamp(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_559_000 picoseconds. - Weight::from_parts(92_460_596, 0) - // Standard Error: 340_344 - .saturating_add(Weight::from_parts(85_006_110, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 20]`. - fn gr_random(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_023_000 picoseconds. - Weight::from_parts(113_045_564, 0) - // Standard Error: 350_542 - .saturating_add(Weight::from_parts(169_289_972, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_deposit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_407_000 picoseconds. - Weight::from_parts(99_094_000, 0) - // Standard Error: 3_585_438 - .saturating_add(Weight::from_parts(776_362_449, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_709_000 picoseconds. - Weight::from_parts(153_262_764, 0) - // Standard Error: 391_637 - .saturating_add(Weight::from_parts(256_389_022, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 341_633_000 picoseconds. - Weight::from_parts(345_693_000, 0) - // Standard Error: 61_029 - .saturating_add(Weight::from_parts(21_298_548, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_817_000 picoseconds. - Weight::from_parts(172_033_153, 0) - // Standard Error: 412_230 - .saturating_add(Weight::from_parts(260_826_119, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_wgas_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 353_433_000 picoseconds. - Weight::from_parts(359_185_000, 0) - // Standard Error: 60_153 - .saturating_add(Weight::from_parts(21_224_949, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 716_180_000 picoseconds. - Weight::from_parts(782_890_839, 0) - // Standard Error: 547_225 - .saturating_add(Weight::from_parts(273_570_636, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_input_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 719_827_000 picoseconds. - Weight::from_parts(805_763_844, 0) - // Standard Error: 503_245 - .saturating_add(Weight::from_parts(278_200_889, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_init(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_518_000 picoseconds. - Weight::from_parts(82_218_173, 0) - // Standard Error: 358_867 - .saturating_add(Weight::from_parts(92_408_337, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_push(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_829_368_000 picoseconds. - Weight::from_parts(1_976_758_302, 0) - // Standard Error: 349_703 - .saturating_add(Weight::from_parts(163_038_781, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_push_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 315_829_000 picoseconds. - Weight::from_parts(318_464_000, 0) - // Standard Error: 54_637 - .saturating_add(Weight::from_parts(31_280_567, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_818_937_000 picoseconds. - Weight::from_parts(1_941_969_566, 0) - // Standard Error: 412_244 - .saturating_add(Weight::from_parts(220_650_756, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_commit_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_815_762_000 picoseconds. - Weight::from_parts(1_958_182_203, 0) - // Standard Error: 374_381 - .saturating_add(Weight::from_parts(229_106_637, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reservation_send(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 259_040_000 picoseconds. - Weight::from_parts(345_586_401, 0) - // Standard Error: 402_258 - .saturating_add(Weight::from_parts(274_866_021, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_send_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 523_014_000 picoseconds. - Weight::from_parts(525_681_000, 0) - // Standard Error: 56_470 - .saturating_add(Weight::from_parts(21_443_571, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reservation_send_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_967_181_000 picoseconds. - Weight::from_parts(2_076_078_781, 0) - // Standard Error: 455_370 - .saturating_add(Weight::from_parts(246_494_683, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 114_790_000 picoseconds. - Weight::from_parts(106_908_278, 0) - // Standard Error: 1_274 - .saturating_add(Weight::from_parts(430_785, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_wgas_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 115_541_000 picoseconds. - Weight::from_parts(101_956_035, 0) - // Standard Error: 3_603 - .saturating_add(Weight::from_parts(442_387, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_push(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_082_000 picoseconds. - Weight::from_parts(138_243_307, 0) - // Standard Error: 409_163 - .saturating_add(Weight::from_parts(154_758_505, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 8192]`. - fn gr_reply_push_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 111_536_000 picoseconds. - Weight::from_parts(114_497_000, 0) - // Standard Error: 2_599 - .saturating_add(Weight::from_parts(656_994, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_reply_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 114_322_000 picoseconds. - Weight::from_parts(113_131_028, 0) - // Standard Error: 3_727 - .saturating_add(Weight::from_parts(436_168, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_reply_commit_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 117_751_000 picoseconds. - Weight::from_parts(161_418_174, 0) - // Standard Error: 6_635 - .saturating_add(Weight::from_parts(405_229, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_to(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_524_000 picoseconds. - Weight::from_parts(89_332_032, 0) - // Standard Error: 294_566 - .saturating_add(Weight::from_parts(86_798_759, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_signal_code(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_216_000 picoseconds. - Weight::from_parts(83_424_786, 0) - // Standard Error: 316_301 - .saturating_add(Weight::from_parts(84_774_296, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_signal_from(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_461_000 picoseconds. - Weight::from_parts(97_636_300, 0) - // Standard Error: 278_297 - .saturating_add(Weight::from_parts(86_743_159, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_push_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 724_902_000 picoseconds. - Weight::from_parts(784_128_285, 0) - // Standard Error: 444_406 - .saturating_add(Weight::from_parts(105_223_470, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_push_input_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 737_666_000 picoseconds. - Weight::from_parts(758_797_216, 0) - // Standard Error: 1_260 - .saturating_add(Weight::from_parts(154_837, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_push_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_498_871_000 picoseconds. - Weight::from_parts(2_688_516_696, 0) - // Standard Error: 531_545 - .saturating_add(Weight::from_parts(131_060_314, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_push_input_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_657_855_000 picoseconds. - Weight::from_parts(2_746_003_287, 0) - // Standard Error: 12_743 - .saturating_add(Weight::from_parts(13_716_214, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_debug(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_990_000 picoseconds. - Weight::from_parts(110_812_744, 0) - // Standard Error: 347_035 - .saturating_add(Weight::from_parts(120_462_128, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_debug_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 170_244_000 picoseconds. - Weight::from_parts(175_502_000, 0) - // Standard Error: 56_203 - .saturating_add(Weight::from_parts(25_870_902, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_code(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_676_000 picoseconds. - Weight::from_parts(91_226_383, 0) - // Standard Error: 320_296 - .saturating_add(Weight::from_parts(82_761_490, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_wake(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 149_319_000 picoseconds. - Weight::from_parts(230_971_562, 0) - // Standard Error: 338_138 - .saturating_add(Weight::from_parts(157_262_608, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_create_program(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 108_167_000 picoseconds. - Weight::from_parts(178_994_489, 0) - // Standard Error: 404_012 - .saturating_add(Weight::from_parts(348_487_075, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 2048]`. - /// The range of component `s` is `[1, 2048]`. - fn gr_create_program_per_kb(p: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 43_645_119_000 picoseconds. - Weight::from_parts(43_811_648_000, 0) - // Standard Error: 262_276 - .saturating_add(Weight::from_parts(7_776_587, 0).saturating_mul(p.into())) - // Standard Error: 262_263 - .saturating_add(Weight::from_parts(178_958_075, 0).saturating_mul(s.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_create_program_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 104_639_000 picoseconds. - Weight::from_parts(169_517_206, 0) - // Standard Error: 363_225 - .saturating_add(Weight::from_parts(357_078_703, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 2048]`. - /// The range of component `s` is `[1, 2048]`. - fn gr_create_program_wgas_per_kb(p: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 46_491_851_000 picoseconds. - Weight::from_parts(46_603_783_000, 0) - // Standard Error: 280_431 - .saturating_add(Weight::from_parts(7_250_257, 0).saturating_mul(p.into())) - // Standard Error: 280_417 - .saturating_add(Weight::from_parts(177_722_888, 0).saturating_mul(s.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_pay_program_rent(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_721_000 picoseconds. - Weight::from_parts(114_995_832, 0) - // Standard Error: 36_809 - .saturating_add(Weight::from_parts(1_873_016, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 97_655_000 picoseconds. - Weight::from_parts(138_058_498, 1131) - // Standard Error: 18_813 - .saturating_add(Weight::from_parts(16_311_194, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_write(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 96_083_000 picoseconds. - Weight::from_parts(98_597_000, 1131) - // Standard Error: 43_515 - .saturating_add(Weight::from_parts(42_632_421, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_write_after_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `5069931` - // Minimum execution time: 8_196_422_000 picoseconds. - Weight::from_parts(8_474_214_520, 5069931) - // Standard Error: 71_564 - .saturating_add(Weight::from_parts(41_738_666, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2048_u64)) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_load_page_storage_data(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1813 + p * (65580 ±0)` - // Estimated: `1939 + p * (75482 ±0)` - // Minimum execution time: 93_446_000 picoseconds. - Weight::from_parts(96_664_000, 1939) - // Standard Error: 46_722 - .saturating_add(Weight::from_parts(55_567_620, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 75482).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 106_137_000 picoseconds. - Weight::from_parts(107_751_954, 1131) - // Standard Error: 71_200 - .saturating_add(Weight::from_parts(41_236_505, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_write(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1496 + p * (9883 ±2)` - // Minimum execution time: 758_237_000 picoseconds. - Weight::from_parts(760_351_083, 1496) - // Standard Error: 319_479 - .saturating_add(Weight::from_parts(53_277_303, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9883).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_write_after_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `317931` - // Minimum execution time: 1_299_071_000 picoseconds. - Weight::from_parts(1_320_542_278, 317931) - // Standard Error: 364_770 - .saturating_add(Weight::from_parts(53_225_083, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(128_u64)) - } - /// The range of component `r` is `[0, 20]`. - fn mem_grow(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_118_000 picoseconds. - Weight::from_parts(7_418_987, 0) - // Standard Error: 299_976 - .saturating_add(Weight::from_parts(77_036_564, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i64load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_461_228_000 picoseconds. - Weight::from_parts(4_172_544_233, 0) - // Standard Error: 108_717 - .saturating_add(Weight::from_parts(5_492_504, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i32load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_440_105_000 picoseconds. - Weight::from_parts(4_189_326_223, 0) - // Standard Error: 94_884 - .saturating_add(Weight::from_parts(5_283_060, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i64store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_389_557_000 picoseconds. - Weight::from_parts(11_860_510_711, 0) - // Standard Error: 156_021 - .saturating_add(Weight::from_parts(9_199_358, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i32store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_497_103_000 picoseconds. - Weight::from_parts(11_330_880_436, 0) - // Standard Error: 132_247 - .saturating_add(Weight::from_parts(10_016_516, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_select(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_381_000 picoseconds. - Weight::from_parts(2_444_000, 0) - // Standard Error: 7_402 - .saturating_add(Weight::from_parts(3_876_295, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_405_000 picoseconds. - Weight::from_parts(481_308, 0) - // Standard Error: 8_161 - .saturating_add(Weight::from_parts(3_159_957, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_371_000 picoseconds. - Weight::from_parts(3_249_787, 0) - // Standard Error: 1_586 - .saturating_add(Weight::from_parts(1_582_965, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_216_000 picoseconds. - Weight::from_parts(2_300_000, 0) - // Standard Error: 6_757 - .saturating_add(Weight::from_parts(2_971_649, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_table(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_259_000 picoseconds. - Weight::from_parts(2_872_259, 0) - // Standard Error: 19_834 - .saturating_add(Weight::from_parts(5_176_111, 0).saturating_mul(r.into())) - } - /// The range of component `e` is `[1, 256]`. - fn instr_br_table_per_entry(e: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_999_000 picoseconds. - Weight::from_parts(6_015_140, 0) - // Standard Error: 1_903 - .saturating_add(Weight::from_parts(170_143, 0).saturating_mul(e.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call_const(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_308_000 picoseconds. - Weight::from_parts(5_881_148, 0) - // Standard Error: 9_069 - .saturating_add(Weight::from_parts(2_574_099, 0).saturating_mul(r.into())) - } - fn instr_i64const(r: u32, ) -> Weight { - Weight::from_parts(0, 0) - .saturating_add(Weight::from_parts(2_574_099 - - 2_423_093, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_337_000 picoseconds. - Weight::from_parts(5_123_036, 0) - // Standard Error: 12_143 - .saturating_add(Weight::from_parts(2_423_093, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call_indirect(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_736_000 picoseconds. - Weight::from_parts(16_600_828, 0) - // Standard Error: 30_025 - .saturating_add(Weight::from_parts(10_214_913, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 128]`. - fn instr_call_indirect_per_param(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 12_483_000 picoseconds. - Weight::from_parts(1_416_669, 0) - // Standard Error: 5_995 - .saturating_add(Weight::from_parts(1_336_453, 0).saturating_mul(p.into())) - } - /// The range of component `l` is `[0, 1024]`. - fn instr_call_per_local(_l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_497_000 picoseconds. - Weight::from_parts(5_981_231, 0) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_730_000 picoseconds. - Weight::from_parts(5_851_529, 0) - // Standard Error: 2_642 - .saturating_add(Weight::from_parts(392_869, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_837_000 picoseconds. - Weight::from_parts(4_473_635, 0) - // Standard Error: 5_210 - .saturating_add(Weight::from_parts(1_003_312, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_tee(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_802_000 picoseconds. - Weight::from_parts(2_153_776, 0) - // Standard Error: 11_517 - .saturating_add(Weight::from_parts(1_186_032, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_375_000 picoseconds. - Weight::from_parts(3_754_449, 0) - // Standard Error: 5_686 - .saturating_add(Weight::from_parts(763_597, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_475_000 picoseconds. - Weight::from_parts(266_670, 0) - // Standard Error: 10_193 - .saturating_add(Weight::from_parts(1_552_777, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_memory_current(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_887_000 picoseconds. - Weight::from_parts(4_333_544, 0) - // Standard Error: 10_173 - .saturating_add(Weight::from_parts(6_952_830, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_267_000 picoseconds. - Weight::from_parts(2_351_000, 0) - // Standard Error: 5_280 - .saturating_add(Weight::from_parts(3_360_413, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_357_000, 0) - // Standard Error: 4_452 - .saturating_add(Weight::from_parts(3_099_489, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_328_000 picoseconds. - Weight::from_parts(2_417_000, 0) - // Standard Error: 5_054 - .saturating_add(Weight::from_parts(3_106_996, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_230_000 picoseconds. - Weight::from_parts(2_296_000, 0) - // Standard Error: 3_924 - .saturating_add(Weight::from_parts(2_681_831, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_294_000 picoseconds. - Weight::from_parts(2_438_000, 0) - // Standard Error: 4_198 - .saturating_add(Weight::from_parts(603_106, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_257_000 picoseconds. - Weight::from_parts(2_121_941, 0) - // Standard Error: 3_525 - .saturating_add(Weight::from_parts(401_578, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_224_000 picoseconds. - Weight::from_parts(2_291_000, 0) - // Standard Error: 9_436 - .saturating_add(Weight::from_parts(1_891_725, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_273_000 picoseconds. - Weight::from_parts(2_417_000, 0) - // Standard Error: 8_255 - .saturating_add(Weight::from_parts(1_289_311, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32extend8s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_276_000 picoseconds. - Weight::from_parts(1_306_236, 0) - // Standard Error: 5_275 - .saturating_add(Weight::from_parts(426_430, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32extend16s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_341_000 picoseconds. - Weight::from_parts(1_669_540, 0) - // Standard Error: 4_902 - .saturating_add(Weight::from_parts(405_099, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend8s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_244_000 picoseconds. - Weight::from_parts(2_317_000, 0) - // Standard Error: 3_916 - .saturating_add(Weight::from_parts(552_354, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend16s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_316_000 picoseconds. - Weight::from_parts(2_395_000, 0) - // Standard Error: 5_375 - .saturating_add(Weight::from_parts(589_608, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend32s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_258_000 picoseconds. - Weight::from_parts(98_911, 0) - // Standard Error: 7_257 - .saturating_add(Weight::from_parts(581_834, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendsi32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_293_000 picoseconds. - Weight::from_parts(1_730_402, 0) - // Standard Error: 4_194 - .saturating_add(Weight::from_parts(357_287, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendui32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_580_000 picoseconds. - Weight::from_parts(2_927_247, 0) - // Standard Error: 2_012 - .saturating_add(Weight::from_parts(181_106, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32wrapi64(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_308_000 picoseconds. - Weight::from_parts(2_742_236, 0) - // Standard Error: 2_482 - .saturating_add(Weight::from_parts(187_830, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_324_000 picoseconds. - Weight::from_parts(2_385_000, 0) - // Standard Error: 9_154 - .saturating_add(Weight::from_parts(1_858_617, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_237_000 picoseconds. - Weight::from_parts(2_302_000, 0) - // Standard Error: 7_801 - .saturating_add(Weight::from_parts(1_226_411, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_265_000 picoseconds. - Weight::from_parts(2_358_000, 0) - // Standard Error: 9_102 - .saturating_add(Weight::from_parts(1_866_723, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_267_000 picoseconds. - Weight::from_parts(2_381_000, 0) - // Standard Error: 8_629 - .saturating_add(Weight::from_parts(1_209_968, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_274_000 picoseconds. - Weight::from_parts(2_330_000, 0) - // Standard Error: 9_193 - .saturating_add(Weight::from_parts(1_895_140, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_306_000 picoseconds. - Weight::from_parts(2_394_000, 0) - // Standard Error: 7_780 - .saturating_add(Weight::from_parts(1_209_776, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_273_000 picoseconds. - Weight::from_parts(2_395_000, 0) - // Standard Error: 8_868 - .saturating_add(Weight::from_parts(1_845_417, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_280_000 picoseconds. - Weight::from_parts(2_360_000, 0) - // Standard Error: 8_139 - .saturating_add(Weight::from_parts(1_208_611, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_299_000 picoseconds. - Weight::from_parts(2_335_000, 0) - // Standard Error: 8_008 - .saturating_add(Weight::from_parts(1_833_636, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_222_000 picoseconds. - Weight::from_parts(2_376_000, 0) - // Standard Error: 7_996 - .saturating_add(Weight::from_parts(1_224_203, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_371_000 picoseconds. - Weight::from_parts(2_421_000, 0) - // Standard Error: 9_119 - .saturating_add(Weight::from_parts(1_821_158, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_305_000 picoseconds. - Weight::from_parts(2_418_000, 0) - // Standard Error: 7_441 - .saturating_add(Weight::from_parts(1_186_995, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_340_000 picoseconds. - Weight::from_parts(2_362_000, 0) - // Standard Error: 8_788 - .saturating_add(Weight::from_parts(1_811_701, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_352_000 picoseconds. - Weight::from_parts(2_431_000, 0) - // Standard Error: 6_620 - .saturating_add(Weight::from_parts(1_171_906, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_352_000 picoseconds. - Weight::from_parts(2_380_000, 0) - // Standard Error: 8_554 - .saturating_add(Weight::from_parts(1_821_955, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_299_000 picoseconds. - Weight::from_parts(2_389_000, 0) - // Standard Error: 7_710 - .saturating_add(Weight::from_parts(1_188_722, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_325_000 picoseconds. - Weight::from_parts(2_387_000, 0) - // Standard Error: 10_150 - .saturating_add(Weight::from_parts(1_912_877, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_377_000 picoseconds. - Weight::from_parts(2_423_000, 0) - // Standard Error: 6_824 - .saturating_add(Weight::from_parts(1_181_831, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_292_000 picoseconds. - Weight::from_parts(2_384_000, 0) - // Standard Error: 9_214 - .saturating_add(Weight::from_parts(1_842_825, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_344_000, 0) - // Standard Error: 7_145 - .saturating_add(Weight::from_parts(1_216_207, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_232_000 picoseconds. - Weight::from_parts(2_391_000, 0) - // Standard Error: 9_159 - .saturating_add(Weight::from_parts(1_360_135, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_279_000 picoseconds. - Weight::from_parts(2_379_000, 0) - // Standard Error: 5_400 - .saturating_add(Weight::from_parts(704_012, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_355_000 picoseconds. - Weight::from_parts(2_402_000, 0) - // Standard Error: 8_632 - .saturating_add(Weight::from_parts(1_358_130, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_365_000 picoseconds. - Weight::from_parts(2_389_000, 0) - // Standard Error: 4_840 - .saturating_add(Weight::from_parts(658_882, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_209_000 picoseconds. - Weight::from_parts(2_324_000, 0) - // Standard Error: 8_679 - .saturating_add(Weight::from_parts(1_840_263, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_258_000 picoseconds. - Weight::from_parts(2_382_000, 0) - // Standard Error: 7_484 - .saturating_add(Weight::from_parts(1_255_185, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_369_000 picoseconds. - Weight::from_parts(6_412_885, 0) - // Standard Error: 22_130 - .saturating_add(Weight::from_parts(2_376_785, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_266_000 picoseconds. - Weight::from_parts(2_981_330, 0) - // Standard Error: 11_996 - .saturating_add(Weight::from_parts(2_322_763, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_240_000 picoseconds. - Weight::from_parts(7_628_007, 0) - // Standard Error: 29_510 - .saturating_add(Weight::from_parts(2_483_957, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_387_000 picoseconds. - Weight::from_parts(4_910_027, 0) - // Standard Error: 23_548 - .saturating_add(Weight::from_parts(2_233_487, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_297_000 picoseconds. - Weight::from_parts(16_240_633, 0) - // Standard Error: 67_100 - .saturating_add(Weight::from_parts(8_506_720, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_234_000 picoseconds. - Weight::from_parts(2_498_693, 0) - // Standard Error: 48_996 - .saturating_add(Weight::from_parts(7_513_162, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_221_000 picoseconds. - Weight::from_parts(5_074_264, 0) - // Standard Error: 23_109 - .saturating_add(Weight::from_parts(2_727_269, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_057_554, 0) - // Standard Error: 15_404 - .saturating_add(Weight::from_parts(2_428_553, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_250_000 picoseconds. - Weight::from_parts(2_359_000, 0) - // Standard Error: 8_133 - .saturating_add(Weight::from_parts(1_333_125, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_251_000 picoseconds. - Weight::from_parts(2_372_000, 0) - // Standard Error: 4_205 - .saturating_add(Weight::from_parts(671_074, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_257_000 picoseconds. - Weight::from_parts(2_323_000, 0) - // Standard Error: 7_098 - .saturating_add(Weight::from_parts(1_323_703, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_247_000 picoseconds. - Weight::from_parts(2_372_000, 0) - // Standard Error: 6_649 - .saturating_add(Weight::from_parts(695_117, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_293_000 picoseconds. - Weight::from_parts(2_347_000, 0) - // Standard Error: 7_359 - .saturating_add(Weight::from_parts(1_355_885, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_239_000 picoseconds. - Weight::from_parts(2_335_000, 0) - // Standard Error: 4_076 - .saturating_add(Weight::from_parts(658_834, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_376_000 picoseconds. - Weight::from_parts(2_444_000, 0) - // Standard Error: 6_850 - .saturating_add(Weight::from_parts(1_191_253, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_240_000 picoseconds. - Weight::from_parts(2_310_000, 0) - // Standard Error: 4_398 - .saturating_add(Weight::from_parts(597_162, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_338_000 picoseconds. - Weight::from_parts(2_421_000, 0) - // Standard Error: 8_320 - .saturating_add(Weight::from_parts(1_163_071, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_376_000 picoseconds. - Weight::from_parts(2_464_000, 0) - // Standard Error: 5_750 - .saturating_add(Weight::from_parts(613_283, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_338_000 picoseconds. - Weight::from_parts(2_378_000, 0) - // Standard Error: 7_893 - .saturating_add(Weight::from_parts(1_161_655, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_260_000 picoseconds. - Weight::from_parts(2_351_000, 0) - // Standard Error: 3_972 - .saturating_add(Weight::from_parts(605_013, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_324_000 picoseconds. - Weight::from_parts(2_375_000, 0) - // Standard Error: 7_329 - .saturating_add(Weight::from_parts(1_108_542, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_342_000 picoseconds. - Weight::from_parts(2_465_000, 0) - // Standard Error: 5_553 - .saturating_add(Weight::from_parts(617_389, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_260_000 picoseconds. - Weight::from_parts(2_419_000, 0) - // Standard Error: 8_448 - .saturating_add(Weight::from_parts(1_105_239, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_255_000 picoseconds. - Weight::from_parts(2_321_000, 0) - // Standard Error: 5_862 - .saturating_add(Weight::from_parts(626_497, 0).saturating_mul(r.into())) - } - fn tasks_remove_resume_session() -> Weight { - // Proof Size summary in bytes: - // Measured: `352` - // Estimated: `4169` - // Minimum execution time: 5_780_000 picoseconds. - Weight::from_parts(6_083_000, 4169) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - fn tasks_remove_gas_reservation() -> Weight { - // Proof Size summary in bytes: - // Measured: `1039` - // Estimated: `23781` - // Minimum execution time: 62_100_000 picoseconds. - Weight::from_parts(64_771_000, 23781) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - fn tasks_send_user_message_to_mailbox() -> Weight { - // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `21750` - // Minimum execution time: 47_415_000 picoseconds. - Weight::from_parts(48_906_000, 21750) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - fn tasks_send_user_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `942` - // Estimated: `34143` - // Minimum execution time: 76_882_000 picoseconds. - Weight::from_parts(79_728_000, 34143) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - fn tasks_send_dispatch() -> Weight { - // Proof Size summary in bytes: - // Measured: `627` - // Estimated: `20101` - // Minimum execution time: 32_342_000 picoseconds. - Weight::from_parts(33_851_000, 20101) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - fn tasks_wake_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `908` - // Estimated: `26160` - // Minimum execution time: 50_697_000 picoseconds. - Weight::from_parts(53_632_000, 26160) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) - } - fn tasks_wake_message_no_wake() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3545` - // Minimum execution time: 3_467_000 picoseconds. - Weight::from_parts(3_690_000, 3545) - .saturating_add(T::DbWeight::get().reads(1_u64)) - } - fn tasks_remove_from_waitlist() -> Weight { - // Proof Size summary in bytes: - // Measured: `1558` - // Estimated: `57552` - // Minimum execution time: 111_822_000 picoseconds. - Weight::from_parts(115_245_000, 57552) - .saturating_add(T::DbWeight::get().reads(16_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) - } - fn tasks_remove_from_mailbox() -> Weight { - // Proof Size summary in bytes: - // Measured: `1264` - // Estimated: `46350` - // Minimum execution time: 92_407_000 picoseconds. - Weight::from_parts(95_840_000, 46350) - .saturating_add(T::DbWeight::get().reads(14_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) - } - /// The range of component `c` is `[0, 2044]`. - fn tasks_pause_program(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2236 + c * (16400 ±0)` - // Estimated: `19543 + c * (84480 ±0)` - // Minimum execution time: 29_880_000 picoseconds. - Weight::from_parts(30_555_000, 19543) - // Standard Error: 65_806 - .saturating_add(Weight::from_parts(39_128_234, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 84480).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 2044]`. - fn tasks_pause_program_uninited(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `3061 + c * (42 ±0)` - // Estimated: `59827 + c * (2947 ±0)` - // Minimum execution time: 89_781_000 picoseconds. - Weight::from_parts(109_193_287, 59827) - // Standard Error: 2_877 - .saturating_add(Weight::from_parts(1_067_792, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes(9_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2947).saturating_mul(c.into())) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// The range of component `r` is `[0, 1]`. - fn gr_reply(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_792_000 picoseconds. - Weight::from_parts(103_063_604, 0) - // Standard Error: 103_375 - .saturating_add(Weight::from_parts(18_929_072, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_154_000 picoseconds. - Weight::from_parts(107_249_232, 0) - // Standard Error: 99_969 - .saturating_add(Weight::from_parts(19_062_846, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 98_701_000 picoseconds. - Weight::from_parts(109_478_842, 0) - // Standard Error: 104_175 - .saturating_add(Weight::from_parts(10_887_124, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_commit_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 102_910_000 picoseconds. - Weight::from_parts(109_181_566, 0) - // Standard Error: 81_801 - .saturating_add(Weight::from_parts(12_077_508, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 719_481_000 picoseconds. - Weight::from_parts(765_485_196, 0) - // Standard Error: 676_170 - .saturating_add(Weight::from_parts(17_778_524, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reply_input_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 720_914_000 picoseconds. - Weight::from_parts(776_554_516, 0) - // Standard Error: 1_018_495 - .saturating_add(Weight::from_parts(38_306_948, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reservation_reply(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 105_823_000 picoseconds. - Weight::from_parts(112_820_586, 0) - // Standard Error: 82_530 - .saturating_add(Weight::from_parts(14_370_506, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_reservation_reply_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 102_415_000 picoseconds. - Weight::from_parts(110_005_402, 0) - // Standard Error: 87_514 - .saturating_add(Weight::from_parts(6_578_880, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_exit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_593_000 picoseconds. - Weight::from_parts(104_873_732, 0) - // Standard Error: 2_095_391 - .saturating_add(Weight::from_parts(193_359_282, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_leave(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_619_000 picoseconds. - Weight::from_parts(99_623_244, 0) - // Standard Error: 1_945_328 - .saturating_add(Weight::from_parts(179_784_494, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 92_936_000 picoseconds. - Weight::from_parts(100_139_452, 0) - // Standard Error: 1_753_555 - .saturating_add(Weight::from_parts(132_465_876, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait_for(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_955_000 picoseconds. - Weight::from_parts(100_650_632, 0) - // Standard Error: 2_018_388 - .saturating_add(Weight::from_parts(178_916_382, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn gr_wait_up_to(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_467_000 picoseconds. - Weight::from_parts(102_532_790, 0) - // Standard Error: 2_065_180 - .saturating_add(Weight::from_parts(187_152_790, 0).saturating_mul(r.into())) - } - fn allocation_cost() -> Weight { - // To be changed with the proper value. - RocksDbWeight::get().writes(1) - } - fn grow_cost() -> Weight { - // To be changed with the proper value. - RocksDbWeight::get().writes(1) - } - fn initial_cost() -> Weight { - RocksDbWeight::get().writes(1) - } - fn load_cost() -> Weight { - RocksDbWeight::get().reads(1) - } - /// The range of component `c` is `[0, 512]`. - fn db_write_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_040_000 picoseconds. - Weight::from_parts(1_087_000, 0) - // Standard Error: 940 - .saturating_add(Weight::from_parts(251_751, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// The range of component `c` is `[0, 512]`. - fn db_read_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `79 + c * (1024 ±0)` - // Estimated: `3543 + c * (1024 ±0)` - // Minimum execution time: 3_333_000 picoseconds. - Weight::from_parts(3_463_000, 3543) - // Standard Error: 966 - .saturating_add(Weight::from_parts(678_430, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(Weight::from_parts(0, 1024).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 512]`. - fn instantiate_module_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 61_586_000 picoseconds. - Weight::from_parts(95_956_778, 0) - // Standard Error: 5_472 - .saturating_add(Weight::from_parts(2_353_352, 0).saturating_mul(c.into())) - } - fn claim_value() -> Weight { - // Proof Size summary in bytes: - // Measured: `1304` - // Estimated: `51293` - // Minimum execution time: 105_420_000 picoseconds. - Weight::from_parts(109_120_000, 51293) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(12_u64)) - } - fn pay_program_rent() -> Weight { - // Proof Size summary in bytes: - // Measured: `923` - // Estimated: `21372` - // Minimum execution time: 54_290_000 picoseconds. - Weight::from_parts(55_929_000, 21372) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } - fn resume_session_init() -> Weight { - // Proof Size summary in bytes: - // Measured: `570` - // Estimated: `17214` - // Minimum execution time: 29_539_000 picoseconds. - Weight::from_parts(30_515_000, 17214) - .saturating_add(RocksDbWeight::get().reads(6_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// The range of component `c` is `[0, 64]`. - fn resume_session_push(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `355` - // Estimated: `7640` - // Minimum execution time: 8_426_000 picoseconds. - Weight::from_parts(5_984_423, 7640) - // Standard Error: 33_789 - .saturating_add(Weight::from_parts(13_895_151, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// The range of component `c` is `[0, 2044]`. - fn resume_session_commit(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1457 + c * (16389 ±0)` - // Estimated: `42178 + c * (131112 ±0)` - // Minimum execution time: 71_198_000 picoseconds. - Weight::from_parts(72_033_000, 42178) - // Standard Error: 159_543 - .saturating_add(Weight::from_parts(54_764_270, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(9_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 131112).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 250]`. - fn upload_code(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `46` - // Estimated: `5134` - // Minimum execution time: 77_259_000 picoseconds. - Weight::from_parts(52_968_469, 5134) - // Standard Error: 43_186 - .saturating_add(Weight::from_parts(59_988_588, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// The range of component `s` is `[0, 4194304]`. - fn create_program(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1043` - // Estimated: `49852` - // Minimum execution time: 96_734_000 picoseconds. - Weight::from_parts(136_364_170, 49852) - // Standard Error: 0 - .saturating_add(Weight::from_parts(2_592, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(12_u64)) - } - /// The range of component `c` is `[0, 250]`. - /// The range of component `s` is `[0, 4194304]`. - fn upload_program(c: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `453` - // Estimated: `44268` - // Minimum execution time: 11_047_048_000 picoseconds. - Weight::from_parts(211_012_859, 44268) - // Standard Error: 157_221 - .saturating_add(Weight::from_parts(59_860_835, 0).saturating_mul(c.into())) - // Standard Error: 9 - .saturating_add(Weight::from_parts(2_554, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(16_u64)) - } - /// The range of component `p` is `[0, 2097152]`. - fn send_message(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `530` - // Estimated: `31259` - // Minimum execution time: 73_682_000 picoseconds. - Weight::from_parts(48_414_295, 31259) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_040, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(10_u64)) - } - /// The range of component `p` is `[0, 2097152]`. - fn send_reply(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1303` - // Estimated: `53823` - // Minimum execution time: 122_837_000 picoseconds. - Weight::from_parts(97_209_014, 53823) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_068, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(16_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) - } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `979` - // Estimated: `89393` - // Minimum execution time: 354_207_000 picoseconds. - Weight::from_parts(374_297_966, 89393) - .saturating_add(RocksDbWeight::get().reads(31_u64)) - .saturating_add(RocksDbWeight::get().writes(24_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `979` - // Estimated: `89133` - // Minimum execution time: 368_424_000 picoseconds. - Weight::from_parts(387_073_481, 89133) - // Standard Error: 1_472 - .saturating_add(Weight::from_parts(4_343, 0).saturating_mul(q.into())) - .saturating_add(RocksDbWeight::get().reads(31_u64)) - .saturating_add(RocksDbWeight::get().writes(24_u64)) - } - /// The range of component `c` is `[0, 512]`. - fn reinstrument_per_kb(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `211 + c * (1075 ±0)` - // Estimated: `3899 + c * (2150 ±0)` - // Minimum execution time: 58_209_000 picoseconds. - Weight::from_parts(58_498_000, 3899) - // Standard Error: 35_860 - .saturating_add(Weight::from_parts(58_109_594, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 2150).saturating_mul(c.into())) - } - /// The range of component `r` is `[0, 20]`. - fn alloc(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 92_645_000 picoseconds. - Weight::from_parts(95_763_000, 0) - // Standard Error: 3_691_564 - .saturating_add(Weight::from_parts(713_537_659, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[1, 512]`. - fn alloc_per_page(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 495_006_000 picoseconds. - Weight::from_parts(421_459_793, 0) - // Standard Error: 9_156 - .saturating_add(Weight::from_parts(29_070_022, 0).saturating_mul(p.into())) - } - /// The range of component `r` is `[0, 20]`. - fn free(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 219_414_000 picoseconds. - Weight::from_parts(206_118_379, 0) - // Standard Error: 320_555 - .saturating_add(Weight::from_parts(64_665_141, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 256]`. - fn gr_reserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_871_000 picoseconds. - Weight::from_parts(104_318_392, 0) - // Standard Error: 4_224 - .saturating_add(Weight::from_parts(2_443_618, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 256]`. - fn gr_unreserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 152_658_000 picoseconds. - Weight::from_parts(218_177_774, 0) - // Standard Error: 23_640 - .saturating_add(Weight::from_parts(2_186_094, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_system_reserve_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_532_000 picoseconds. - Weight::from_parts(112_244_990, 0) - // Standard Error: 370_435 - .saturating_add(Weight::from_parts(102_977_688, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_message_id(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_116_000 picoseconds. - Weight::from_parts(85_754_801, 0) - // Standard Error: 322_936 - .saturating_add(Weight::from_parts(85_646_040, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_program_id(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_226_000 picoseconds. - Weight::from_parts(96_400_189, 0) - // Standard Error: 308_975 - .saturating_add(Weight::from_parts(84_400_658, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_source(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_667_000 picoseconds. - Weight::from_parts(95_221_535, 0) - // Standard Error: 320_528 - .saturating_add(Weight::from_parts(85_320_330, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_value(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_400_000 picoseconds. - Weight::from_parts(83_830_464, 0) - // Standard Error: 333_677 - .saturating_add(Weight::from_parts(86_153_462, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_value_available(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 98_322_000 picoseconds. - Weight::from_parts(88_780_011, 0) - // Standard Error: 365_736 - .saturating_add(Weight::from_parts(86_373_607, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_gas_available(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_234_000 picoseconds. - Weight::from_parts(93_394_916, 0) - // Standard Error: 310_495 - .saturating_add(Weight::from_parts(85_678_300, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_size(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_316_000 picoseconds. - Weight::from_parts(88_012_950, 0) - // Standard Error: 309_598 - .saturating_add(Weight::from_parts(85_813_369, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_read(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 715_150_000 picoseconds. - Weight::from_parts(769_593_524, 0) - // Standard Error: 493_525 - .saturating_add(Weight::from_parts(140_935_499, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_read_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 844_162_000 picoseconds. - Weight::from_parts(851_053_000, 0) - // Standard Error: 50_294 - .saturating_add(Weight::from_parts(13_068_816, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_block_height(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_243_000 picoseconds. - Weight::from_parts(87_583_955, 0) - // Standard Error: 343_578 - .saturating_add(Weight::from_parts(84_267_053, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_block_timestamp(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_559_000 picoseconds. - Weight::from_parts(92_460_596, 0) - // Standard Error: 340_344 - .saturating_add(Weight::from_parts(85_006_110, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 20]`. - fn gr_random(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_023_000 picoseconds. - Weight::from_parts(113_045_564, 0) - // Standard Error: 350_542 - .saturating_add(Weight::from_parts(169_289_972, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_deposit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_407_000 picoseconds. - Weight::from_parts(99_094_000, 0) - // Standard Error: 3_585_438 - .saturating_add(Weight::from_parts(776_362_449, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_709_000 picoseconds. - Weight::from_parts(153_262_764, 0) - // Standard Error: 391_637 - .saturating_add(Weight::from_parts(256_389_022, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 341_633_000 picoseconds. - Weight::from_parts(345_693_000, 0) - // Standard Error: 61_029 - .saturating_add(Weight::from_parts(21_298_548, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_817_000 picoseconds. - Weight::from_parts(172_033_153, 0) - // Standard Error: 412_230 - .saturating_add(Weight::from_parts(260_826_119, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_wgas_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 353_433_000 picoseconds. - Weight::from_parts(359_185_000, 0) - // Standard Error: 60_153 - .saturating_add(Weight::from_parts(21_224_949, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 716_180_000 picoseconds. - Weight::from_parts(782_890_839, 0) - // Standard Error: 547_225 - .saturating_add(Weight::from_parts(273_570_636, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_input_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 719_827_000 picoseconds. - Weight::from_parts(805_763_844, 0) - // Standard Error: 503_245 - .saturating_add(Weight::from_parts(278_200_889, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_init(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_518_000 picoseconds. - Weight::from_parts(82_218_173, 0) - // Standard Error: 358_867 - .saturating_add(Weight::from_parts(92_408_337, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_push(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_829_368_000 picoseconds. - Weight::from_parts(1_976_758_302, 0) - // Standard Error: 349_703 - .saturating_add(Weight::from_parts(163_038_781, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_push_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 315_829_000 picoseconds. - Weight::from_parts(318_464_000, 0) - // Standard Error: 54_637 - .saturating_add(Weight::from_parts(31_280_567, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_818_937_000 picoseconds. - Weight::from_parts(1_941_969_566, 0) - // Standard Error: 412_244 - .saturating_add(Weight::from_parts(220_650_756, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_commit_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_815_762_000 picoseconds. - Weight::from_parts(1_958_182_203, 0) - // Standard Error: 374_381 - .saturating_add(Weight::from_parts(229_106_637, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reservation_send(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 259_040_000 picoseconds. - Weight::from_parts(345_586_401, 0) - // Standard Error: 402_258 - .saturating_add(Weight::from_parts(274_866_021, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_send_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 523_014_000 picoseconds. - Weight::from_parts(525_681_000, 0) - // Standard Error: 56_470 - .saturating_add(Weight::from_parts(21_443_571, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reservation_send_commit(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_967_181_000 picoseconds. - Weight::from_parts(2_076_078_781, 0) - // Standard Error: 455_370 - .saturating_add(Weight::from_parts(246_494_683, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 114_790_000 picoseconds. - Weight::from_parts(106_908_278, 0) - // Standard Error: 1_274 - .saturating_add(Weight::from_parts(430_785, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_wgas_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 115_541_000 picoseconds. - Weight::from_parts(101_956_035, 0) - // Standard Error: 3_603 - .saturating_add(Weight::from_parts(442_387, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_push(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 94_082_000 picoseconds. - Weight::from_parts(138_243_307, 0) - // Standard Error: 409_163 - .saturating_add(Weight::from_parts(154_758_505, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 8192]`. - fn gr_reply_push_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 111_536_000 picoseconds. - Weight::from_parts(114_497_000, 0) - // Standard Error: 2_599 - .saturating_add(Weight::from_parts(656_994, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_reply_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 114_322_000 picoseconds. - Weight::from_parts(113_131_028, 0) - // Standard Error: 3_727 - .saturating_add(Weight::from_parts(436_168, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reservation_reply_commit_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 117_751_000 picoseconds. - Weight::from_parts(161_418_174, 0) - // Standard Error: 6_635 - .saturating_add(Weight::from_parts(405_229, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_to(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 93_524_000 picoseconds. - Weight::from_parts(89_332_032, 0) - // Standard Error: 294_566 - .saturating_add(Weight::from_parts(86_798_759, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_signal_code(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_216_000 picoseconds. - Weight::from_parts(83_424_786, 0) - // Standard Error: 316_301 - .saturating_add(Weight::from_parts(84_774_296, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_signal_from(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_461_000 picoseconds. - Weight::from_parts(97_636_300, 0) - // Standard Error: 278_297 - .saturating_add(Weight::from_parts(86_743_159, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_push_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 724_902_000 picoseconds. - Weight::from_parts(784_128_285, 0) - // Standard Error: 444_406 - .saturating_add(Weight::from_parts(105_223_470, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_reply_push_input_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 737_666_000 picoseconds. - Weight::from_parts(758_797_216, 0) - // Standard Error: 1_260 - .saturating_add(Weight::from_parts(154_837, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_send_push_input(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_498_871_000 picoseconds. - Weight::from_parts(2_688_516_696, 0) - // Standard Error: 531_545 - .saturating_add(Weight::from_parts(131_060_314, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_send_push_input_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_657_855_000 picoseconds. - Weight::from_parts(2_746_003_287, 0) - // Standard Error: 12_743 - .saturating_add(Weight::from_parts(13_716_214, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_debug(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 96_990_000 picoseconds. - Weight::from_parts(110_812_744, 0) - // Standard Error: 347_035 - .saturating_add(Weight::from_parts(120_462_128, 0).saturating_mul(r.into())) - } - /// The range of component `n` is `[0, 2048]`. - fn gr_debug_per_kb(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 170_244_000 picoseconds. - Weight::from_parts(175_502_000, 0) - // Standard Error: 56_203 - .saturating_add(Weight::from_parts(25_870_902, 0).saturating_mul(n.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_reply_code(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 97_676_000 picoseconds. - Weight::from_parts(91_226_383, 0) - // Standard Error: 320_296 - .saturating_add(Weight::from_parts(82_761_490, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_wake(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 149_319_000 picoseconds. - Weight::from_parts(230_971_562, 0) - // Standard Error: 338_138 - .saturating_add(Weight::from_parts(157_262_608, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_create_program(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 108_167_000 picoseconds. - Weight::from_parts(178_994_489, 0) - // Standard Error: 404_012 - .saturating_add(Weight::from_parts(348_487_075, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 2048]`. - /// The range of component `s` is `[1, 2048]`. - fn gr_create_program_per_kb(p: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 43_645_119_000 picoseconds. - Weight::from_parts(43_811_648_000, 0) - // Standard Error: 262_276 - .saturating_add(Weight::from_parts(7_776_587, 0).saturating_mul(p.into())) - // Standard Error: 262_263 - .saturating_add(Weight::from_parts(178_958_075, 0).saturating_mul(s.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_create_program_wgas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 104_639_000 picoseconds. - Weight::from_parts(169_517_206, 0) - // Standard Error: 363_225 - .saturating_add(Weight::from_parts(357_078_703, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 2048]`. - /// The range of component `s` is `[1, 2048]`. - fn gr_create_program_wgas_per_kb(p: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 46_491_851_000 picoseconds. - Weight::from_parts(46_603_783_000, 0) - // Standard Error: 280_431 - .saturating_add(Weight::from_parts(7_250_257, 0).saturating_mul(p.into())) - // Standard Error: 280_417 - .saturating_add(Weight::from_parts(177_722_888, 0).saturating_mul(s.into())) - } - /// The range of component `r` is `[0, 20]`. - fn gr_pay_program_rent(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 95_721_000 picoseconds. - Weight::from_parts(114_995_832, 0) - // Standard Error: 36_809 - .saturating_add(Weight::from_parts(1_873_016, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 97_655_000 picoseconds. - Weight::from_parts(138_058_498, 1131) - // Standard Error: 18_813 - .saturating_add(Weight::from_parts(16_311_194, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_write(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 96_083_000 picoseconds. - Weight::from_parts(98_597_000, 1131) - // Standard Error: 43_515 - .saturating_add(Weight::from_parts(42_632_421, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_signal_write_after_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `5069931` - // Minimum execution time: 8_196_422_000 picoseconds. - Weight::from_parts(8_474_214_520, 5069931) - // Standard Error: 71_564 - .saturating_add(Weight::from_parts(41_738_666, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(2048_u64)) - } - /// The range of component `p` is `[0, 512]`. - fn lazy_pages_load_page_storage_data(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1813 + p * (65580 ±0)` - // Estimated: `1939 + p * (75482 ±0)` - // Minimum execution time: 93_446_000 picoseconds. - Weight::from_parts(96_664_000, 1939) - // Standard Error: 46_722 - .saturating_add(Weight::from_parts(55_567_620, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 75482).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1131 + p * (9900 ±0)` - // Minimum execution time: 106_137_000 picoseconds. - Weight::from_parts(107_751_954, 1131) - // Standard Error: 71_200 - .saturating_add(Weight::from_parts(41_236_505, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9900).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_write(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `1496 + p * (9883 ±2)` - // Minimum execution time: 758_237_000 picoseconds. - Weight::from_parts(760_351_083, 1496) - // Standard Error: 319_479 - .saturating_add(Weight::from_parts(53_277_303, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 9883).saturating_mul(p.into())) - } - /// The range of component `p` is `[0, 32]`. - fn lazy_pages_host_func_write_after_read(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `317931` - // Minimum execution time: 1_299_071_000 picoseconds. - Weight::from_parts(1_320_542_278, 317931) - // Standard Error: 364_770 - .saturating_add(Weight::from_parts(53_225_083, 0).saturating_mul(p.into())) - .saturating_add(RocksDbWeight::get().reads(128_u64)) - } - /// The range of component `r` is `[0, 20]`. - fn mem_grow(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_118_000 picoseconds. - Weight::from_parts(7_418_987, 0) - // Standard Error: 299_976 - .saturating_add(Weight::from_parts(77_036_564, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i64load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_461_228_000 picoseconds. - Weight::from_parts(4_172_544_233, 0) - // Standard Error: 108_717 - .saturating_add(Weight::from_parts(5_492_504, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i32load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_440_105_000 picoseconds. - Weight::from_parts(4_189_326_223, 0) - // Standard Error: 94_884 - .saturating_add(Weight::from_parts(5_283_060, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i64store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_389_557_000 picoseconds. - Weight::from_parts(11_860_510_711, 0) - // Standard Error: 156_021 - .saturating_add(Weight::from_parts(9_199_358, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[50, 500]`. - fn instr_i32store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_497_103_000 picoseconds. - Weight::from_parts(11_330_880_436, 0) - // Standard Error: 132_247 - .saturating_add(Weight::from_parts(10_016_516, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_select(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_381_000 picoseconds. - Weight::from_parts(2_444_000, 0) - // Standard Error: 7_402 - .saturating_add(Weight::from_parts(3_876_295, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_405_000 picoseconds. - Weight::from_parts(481_308, 0) - // Standard Error: 8_161 - .saturating_add(Weight::from_parts(3_159_957, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_371_000 picoseconds. - Weight::from_parts(3_249_787, 0) - // Standard Error: 1_586 - .saturating_add(Weight::from_parts(1_582_965, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_216_000 picoseconds. - Weight::from_parts(2_300_000, 0) - // Standard Error: 6_757 - .saturating_add(Weight::from_parts(2_971_649, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_table(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_259_000 picoseconds. - Weight::from_parts(2_872_259, 0) - // Standard Error: 19_834 - .saturating_add(Weight::from_parts(5_176_111, 0).saturating_mul(r.into())) - } - /// The range of component `e` is `[1, 256]`. - fn instr_br_table_per_entry(e: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_999_000 picoseconds. - Weight::from_parts(6_015_140, 0) - // Standard Error: 1_903 - .saturating_add(Weight::from_parts(170_143, 0).saturating_mul(e.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call_const(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_308_000 picoseconds. - Weight::from_parts(5_881_148, 0) - // Standard Error: 9_069 - .saturating_add(Weight::from_parts(2_574_099, 0).saturating_mul(r.into())) - } - fn instr_i64const(r: u32, ) -> Weight { - Weight::from_parts(0, 0) - .saturating_add(Weight::from_parts(2_574_099 - - 2_423_093, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_337_000 picoseconds. - Weight::from_parts(5_123_036, 0) - // Standard Error: 12_143 - .saturating_add(Weight::from_parts(2_423_093, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call_indirect(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_736_000 picoseconds. - Weight::from_parts(16_600_828, 0) - // Standard Error: 30_025 - .saturating_add(Weight::from_parts(10_214_913, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 128]`. - fn instr_call_indirect_per_param(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 12_483_000 picoseconds. - Weight::from_parts(1_416_669, 0) - // Standard Error: 5_995 - .saturating_add(Weight::from_parts(1_336_453, 0).saturating_mul(p.into())) - } - /// The range of component `l` is `[0, 1024]`. - fn instr_call_per_local(_l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_497_000 picoseconds. - Weight::from_parts(5_981_231, 0) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_730_000 picoseconds. - Weight::from_parts(5_851_529, 0) - // Standard Error: 2_642 - .saturating_add(Weight::from_parts(392_869, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_837_000 picoseconds. - Weight::from_parts(4_473_635, 0) - // Standard Error: 5_210 - .saturating_add(Weight::from_parts(1_003_312, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_tee(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_802_000 picoseconds. - Weight::from_parts(2_153_776, 0) - // Standard Error: 11_517 - .saturating_add(Weight::from_parts(1_186_032, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_375_000 picoseconds. - Weight::from_parts(3_754_449, 0) - // Standard Error: 5_686 - .saturating_add(Weight::from_parts(763_597, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_475_000 picoseconds. - Weight::from_parts(266_670, 0) - // Standard Error: 10_193 - .saturating_add(Weight::from_parts(1_552_777, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_memory_current(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_887_000 picoseconds. - Weight::from_parts(4_333_544, 0) - // Standard Error: 10_173 - .saturating_add(Weight::from_parts(6_952_830, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_267_000 picoseconds. - Weight::from_parts(2_351_000, 0) - // Standard Error: 5_280 - .saturating_add(Weight::from_parts(3_360_413, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_357_000, 0) - // Standard Error: 4_452 - .saturating_add(Weight::from_parts(3_099_489, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_328_000 picoseconds. - Weight::from_parts(2_417_000, 0) - // Standard Error: 5_054 - .saturating_add(Weight::from_parts(3_106_996, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_230_000 picoseconds. - Weight::from_parts(2_296_000, 0) - // Standard Error: 3_924 - .saturating_add(Weight::from_parts(2_681_831, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_294_000 picoseconds. - Weight::from_parts(2_438_000, 0) - // Standard Error: 4_198 - .saturating_add(Weight::from_parts(603_106, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_257_000 picoseconds. - Weight::from_parts(2_121_941, 0) - // Standard Error: 3_525 - .saturating_add(Weight::from_parts(401_578, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_224_000 picoseconds. - Weight::from_parts(2_291_000, 0) - // Standard Error: 9_436 - .saturating_add(Weight::from_parts(1_891_725, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_273_000 picoseconds. - Weight::from_parts(2_417_000, 0) - // Standard Error: 8_255 - .saturating_add(Weight::from_parts(1_289_311, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32extend8s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_276_000 picoseconds. - Weight::from_parts(1_306_236, 0) - // Standard Error: 5_275 - .saturating_add(Weight::from_parts(426_430, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32extend16s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_341_000 picoseconds. - Weight::from_parts(1_669_540, 0) - // Standard Error: 4_902 - .saturating_add(Weight::from_parts(405_099, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend8s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_244_000 picoseconds. - Weight::from_parts(2_317_000, 0) - // Standard Error: 3_916 - .saturating_add(Weight::from_parts(552_354, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend16s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_316_000 picoseconds. - Weight::from_parts(2_395_000, 0) - // Standard Error: 5_375 - .saturating_add(Weight::from_parts(589_608, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extend32s(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_258_000 picoseconds. - Weight::from_parts(98_911, 0) - // Standard Error: 7_257 - .saturating_add(Weight::from_parts(581_834, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendsi32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_293_000 picoseconds. - Weight::from_parts(1_730_402, 0) - // Standard Error: 4_194 - .saturating_add(Weight::from_parts(357_287, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendui32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_580_000 picoseconds. - Weight::from_parts(2_927_247, 0) - // Standard Error: 2_012 - .saturating_add(Weight::from_parts(181_106, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32wrapi64(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_308_000 picoseconds. - Weight::from_parts(2_742_236, 0) - // Standard Error: 2_482 - .saturating_add(Weight::from_parts(187_830, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_324_000 picoseconds. - Weight::from_parts(2_385_000, 0) - // Standard Error: 9_154 - .saturating_add(Weight::from_parts(1_858_617, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_237_000 picoseconds. - Weight::from_parts(2_302_000, 0) - // Standard Error: 7_801 - .saturating_add(Weight::from_parts(1_226_411, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_265_000 picoseconds. - Weight::from_parts(2_358_000, 0) - // Standard Error: 9_102 - .saturating_add(Weight::from_parts(1_866_723, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_267_000 picoseconds. - Weight::from_parts(2_381_000, 0) - // Standard Error: 8_629 - .saturating_add(Weight::from_parts(1_209_968, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_274_000 picoseconds. - Weight::from_parts(2_330_000, 0) - // Standard Error: 9_193 - .saturating_add(Weight::from_parts(1_895_140, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_306_000 picoseconds. - Weight::from_parts(2_394_000, 0) - // Standard Error: 7_780 - .saturating_add(Weight::from_parts(1_209_776, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_273_000 picoseconds. - Weight::from_parts(2_395_000, 0) - // Standard Error: 8_868 - .saturating_add(Weight::from_parts(1_845_417, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_280_000 picoseconds. - Weight::from_parts(2_360_000, 0) - // Standard Error: 8_139 - .saturating_add(Weight::from_parts(1_208_611, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_299_000 picoseconds. - Weight::from_parts(2_335_000, 0) - // Standard Error: 8_008 - .saturating_add(Weight::from_parts(1_833_636, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_222_000 picoseconds. - Weight::from_parts(2_376_000, 0) - // Standard Error: 7_996 - .saturating_add(Weight::from_parts(1_224_203, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_371_000 picoseconds. - Weight::from_parts(2_421_000, 0) - // Standard Error: 9_119 - .saturating_add(Weight::from_parts(1_821_158, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_305_000 picoseconds. - Weight::from_parts(2_418_000, 0) - // Standard Error: 7_441 - .saturating_add(Weight::from_parts(1_186_995, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_340_000 picoseconds. - Weight::from_parts(2_362_000, 0) - // Standard Error: 8_788 - .saturating_add(Weight::from_parts(1_811_701, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_352_000 picoseconds. - Weight::from_parts(2_431_000, 0) - // Standard Error: 6_620 - .saturating_add(Weight::from_parts(1_171_906, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_352_000 picoseconds. - Weight::from_parts(2_380_000, 0) - // Standard Error: 8_554 - .saturating_add(Weight::from_parts(1_821_955, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_299_000 picoseconds. - Weight::from_parts(2_389_000, 0) - // Standard Error: 7_710 - .saturating_add(Weight::from_parts(1_188_722, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_325_000 picoseconds. - Weight::from_parts(2_387_000, 0) - // Standard Error: 10_150 - .saturating_add(Weight::from_parts(1_912_877, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_377_000 picoseconds. - Weight::from_parts(2_423_000, 0) - // Standard Error: 6_824 - .saturating_add(Weight::from_parts(1_181_831, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_292_000 picoseconds. - Weight::from_parts(2_384_000, 0) - // Standard Error: 9_214 - .saturating_add(Weight::from_parts(1_842_825, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_344_000, 0) - // Standard Error: 7_145 - .saturating_add(Weight::from_parts(1_216_207, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_232_000 picoseconds. - Weight::from_parts(2_391_000, 0) - // Standard Error: 9_159 - .saturating_add(Weight::from_parts(1_360_135, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_279_000 picoseconds. - Weight::from_parts(2_379_000, 0) - // Standard Error: 5_400 - .saturating_add(Weight::from_parts(704_012, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_355_000 picoseconds. - Weight::from_parts(2_402_000, 0) - // Standard Error: 8_632 - .saturating_add(Weight::from_parts(1_358_130, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_365_000 picoseconds. - Weight::from_parts(2_389_000, 0) - // Standard Error: 4_840 - .saturating_add(Weight::from_parts(658_882, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_209_000 picoseconds. - Weight::from_parts(2_324_000, 0) - // Standard Error: 8_679 - .saturating_add(Weight::from_parts(1_840_263, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_258_000 picoseconds. - Weight::from_parts(2_382_000, 0) - // Standard Error: 7_484 - .saturating_add(Weight::from_parts(1_255_185, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_369_000 picoseconds. - Weight::from_parts(6_412_885, 0) - // Standard Error: 22_130 - .saturating_add(Weight::from_parts(2_376_785, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_266_000 picoseconds. - Weight::from_parts(2_981_330, 0) - // Standard Error: 11_996 - .saturating_add(Weight::from_parts(2_322_763, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_240_000 picoseconds. - Weight::from_parts(7_628_007, 0) - // Standard Error: 29_510 - .saturating_add(Weight::from_parts(2_483_957, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_387_000 picoseconds. - Weight::from_parts(4_910_027, 0) - // Standard Error: 23_548 - .saturating_add(Weight::from_parts(2_233_487, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_297_000 picoseconds. - Weight::from_parts(16_240_633, 0) - // Standard Error: 67_100 - .saturating_add(Weight::from_parts(8_506_720, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_234_000 picoseconds. - Weight::from_parts(2_498_693, 0) - // Standard Error: 48_996 - .saturating_add(Weight::from_parts(7_513_162, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_221_000 picoseconds. - Weight::from_parts(5_074_264, 0) - // Standard Error: 23_109 - .saturating_add(Weight::from_parts(2_727_269, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_283_000 picoseconds. - Weight::from_parts(2_057_554, 0) - // Standard Error: 15_404 - .saturating_add(Weight::from_parts(2_428_553, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_250_000 picoseconds. - Weight::from_parts(2_359_000, 0) - // Standard Error: 8_133 - .saturating_add(Weight::from_parts(1_333_125, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_251_000 picoseconds. - Weight::from_parts(2_372_000, 0) - // Standard Error: 4_205 - .saturating_add(Weight::from_parts(671_074, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_257_000 picoseconds. - Weight::from_parts(2_323_000, 0) - // Standard Error: 7_098 - .saturating_add(Weight::from_parts(1_323_703, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_247_000 picoseconds. - Weight::from_parts(2_372_000, 0) - // Standard Error: 6_649 - .saturating_add(Weight::from_parts(695_117, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_293_000 picoseconds. - Weight::from_parts(2_347_000, 0) - // Standard Error: 7_359 - .saturating_add(Weight::from_parts(1_355_885, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_239_000 picoseconds. - Weight::from_parts(2_335_000, 0) - // Standard Error: 4_076 - .saturating_add(Weight::from_parts(658_834, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_376_000 picoseconds. - Weight::from_parts(2_444_000, 0) - // Standard Error: 6_850 - .saturating_add(Weight::from_parts(1_191_253, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_240_000 picoseconds. - Weight::from_parts(2_310_000, 0) - // Standard Error: 4_398 - .saturating_add(Weight::from_parts(597_162, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_338_000 picoseconds. - Weight::from_parts(2_421_000, 0) - // Standard Error: 8_320 - .saturating_add(Weight::from_parts(1_163_071, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_376_000 picoseconds. - Weight::from_parts(2_464_000, 0) - // Standard Error: 5_750 - .saturating_add(Weight::from_parts(613_283, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_338_000 picoseconds. - Weight::from_parts(2_378_000, 0) - // Standard Error: 7_893 - .saturating_add(Weight::from_parts(1_161_655, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_260_000 picoseconds. - Weight::from_parts(2_351_000, 0) - // Standard Error: 3_972 - .saturating_add(Weight::from_parts(605_013, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_324_000 picoseconds. - Weight::from_parts(2_375_000, 0) - // Standard Error: 7_329 - .saturating_add(Weight::from_parts(1_108_542, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_342_000 picoseconds. - Weight::from_parts(2_465_000, 0) - // Standard Error: 5_553 - .saturating_add(Weight::from_parts(617_389, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_260_000 picoseconds. - Weight::from_parts(2_419_000, 0) - // Standard Error: 8_448 - .saturating_add(Weight::from_parts(1_105_239, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_255_000 picoseconds. - Weight::from_parts(2_321_000, 0) - // Standard Error: 5_862 - .saturating_add(Weight::from_parts(626_497, 0).saturating_mul(r.into())) - } - fn tasks_remove_resume_session() -> Weight { - // Proof Size summary in bytes: - // Measured: `352` - // Estimated: `4169` - // Minimum execution time: 5_780_000 picoseconds. - Weight::from_parts(6_083_000, 4169) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - fn tasks_remove_gas_reservation() -> Weight { - // Proof Size summary in bytes: - // Measured: `1039` - // Estimated: `23781` - // Minimum execution time: 62_100_000 picoseconds. - Weight::from_parts(64_771_000, 23781) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } - fn tasks_send_user_message_to_mailbox() -> Weight { - // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `21750` - // Minimum execution time: 47_415_000 picoseconds. - Weight::from_parts(48_906_000, 21750) - .saturating_add(RocksDbWeight::get().reads(6_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) - } - fn tasks_send_user_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `942` - // Estimated: `34143` - // Minimum execution time: 76_882_000 picoseconds. - Weight::from_parts(79_728_000, 34143) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(10_u64)) - } - fn tasks_send_dispatch() -> Weight { - // Proof Size summary in bytes: - // Measured: `627` - // Estimated: `20101` - // Minimum execution time: 32_342_000 picoseconds. - Weight::from_parts(33_851_000, 20101) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } - fn tasks_wake_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `908` - // Estimated: `26160` - // Minimum execution time: 50_697_000 picoseconds. - Weight::from_parts(53_632_000, 26160) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } - fn tasks_wake_message_no_wake() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3545` - // Minimum execution time: 3_467_000 picoseconds. - Weight::from_parts(3_690_000, 3545) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - } - fn tasks_remove_from_waitlist() -> Weight { - // Proof Size summary in bytes: - // Measured: `1558` - // Estimated: `57552` - // Minimum execution time: 111_822_000 picoseconds. - Weight::from_parts(115_245_000, 57552) - .saturating_add(RocksDbWeight::get().reads(16_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) - } - fn tasks_remove_from_mailbox() -> Weight { - // Proof Size summary in bytes: - // Measured: `1264` - // Estimated: `46350` - // Minimum execution time: 92_407_000 picoseconds. - Weight::from_parts(95_840_000, 46350) - .saturating_add(RocksDbWeight::get().reads(14_u64)) - .saturating_add(RocksDbWeight::get().writes(13_u64)) - } - /// The range of component `c` is `[0, 2044]`. - fn tasks_pause_program(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2236 + c * (16400 ±0)` - // Estimated: `19543 + c * (84480 ±0)` - // Minimum execution time: 29_880_000 picoseconds. - Weight::from_parts(30_555_000, 19543) - // Standard Error: 65_806 - .saturating_add(Weight::from_parts(39_128_234, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 84480).saturating_mul(c.into())) - } - /// The range of component `c` is `[0, 2044]`. - fn tasks_pause_program_uninited(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `3061 + c * (42 ±0)` - // Estimated: `59827 + c * (2947 ±0)` - // Minimum execution time: 89_781_000 picoseconds. - Weight::from_parts(109_193_287, 59827) - // Standard Error: 2_877 - .saturating_add(Weight::from_parts(1_067_792, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(13_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(RocksDbWeight::get().writes(9_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2947).saturating_mul(c.into())) - } -} diff --git a/runtime/gear/src/weights/pallet_gear_voucher.rs b/runtime/gear/src/weights/pallet_gear_voucher.rs deleted file mode 100644 index faa61af8320..00000000000 --- a/runtime/gear/src/weights/pallet_gear_voucher.rs +++ /dev/null @@ -1,68 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for pallet_gear_voucher -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=pallet_gear_voucher --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear_voucher.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_gear_voucher. -pub trait WeightInfo { - fn issue() -> Weight; -} - -/// Weights for pallet_gear_voucher using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl pallet_gear_voucher::WeightInfo for SubstrateWeight { - fn issue() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6196` - // Minimum execution time: 26_404_000 picoseconds. - Weight::from_parts(27_288_000, 6196) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn issue() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6196` - // Minimum execution time: 26_404_000 picoseconds. - Weight::from_parts(27_288_000, 6196) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } -} diff --git a/runtime/gear/src/weights/pallet_timestamp.rs b/runtime/gear/src/weights/pallet_timestamp.rs deleted file mode 100644 index 10108dcc046..00000000000 --- a/runtime/gear/src/weights/pallet_timestamp.rs +++ /dev/null @@ -1,83 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for pallet_timestamp -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_timestamp.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_timestamp. -pub trait WeightInfo { - fn set() -> Weight; - fn on_finalize() -> Weight; -} - -/// Weights for pallet_timestamp using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl pallet_timestamp::WeightInfo for SubstrateWeight { - fn set() -> Weight { - // Proof Size summary in bytes: - // Measured: `211` - // Estimated: `2986` - // Minimum execution time: 9_212_000 picoseconds. - Weight::from_parts(9_792_000, 2986) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - fn on_finalize() -> Weight { - // Proof Size summary in bytes: - // Measured: `94` - // Estimated: `0` - // Minimum execution time: 3_665_000 picoseconds. - Weight::from_parts(3_818_000, 0) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn set() -> Weight { - // Proof Size summary in bytes: - // Measured: `211` - // Estimated: `2986` - // Minimum execution time: 9_212_000 picoseconds. - Weight::from_parts(9_792_000, 2986) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - fn on_finalize() -> Weight { - // Proof Size summary in bytes: - // Measured: `94` - // Estimated: `0` - // Minimum execution time: 3_665_000 picoseconds. - Weight::from_parts(3_818_000, 0) - } -} diff --git a/runtime/gear/src/weights/pallet_utility.rs b/runtime/gear/src/weights/pallet_utility.rs deleted file mode 100644 index 54156d38f3b..00000000000 --- a/runtime/gear/src/weights/pallet_utility.rs +++ /dev/null @@ -1,142 +0,0 @@ -// This file is part of Gear. - -// Copyright (C) 2022-2023 Gear Technologies Inc. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Autogenerated weights for pallet_utility -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gear-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/production/gear benchmark pallet --chain=gear-dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_utility.rs --template=.maintain/frame-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_utility. -pub trait WeightInfo { - fn batch(c: u32, ) -> Weight; - fn as_derivative() -> Weight; - fn batch_all(c: u32, ) -> Weight; - fn dispatch_as() -> Weight; - fn force_batch(c: u32, ) -> Weight; -} - -/// Weights for pallet_utility using the Gear node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl pallet_utility::WeightInfo for SubstrateWeight { - /// The range of component `c` is `[0, 1000]`. - fn batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_345_000 picoseconds. - Weight::from_parts(4_423_143, 0) - // Standard Error: 4_589 - .saturating_add(Weight::from_parts(3_947_978, 0).saturating_mul(c.into())) - } - fn as_derivative() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_645_000 picoseconds. - Weight::from_parts(3_825_000, 0) - } - /// The range of component `c` is `[0, 1000]`. - fn batch_all(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_397_000 picoseconds. - Weight::from_parts(10_424_905, 0) - // Standard Error: 3_521 - .saturating_add(Weight::from_parts(4_132_846, 0).saturating_mul(c.into())) - } - fn dispatch_as() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_073_000 picoseconds. - Weight::from_parts(7_382_000, 0) - } - /// The range of component `c` is `[0, 1000]`. - fn force_batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_389_000 picoseconds. - Weight::from_parts(12_202_657, 0) - // Standard Error: 2_744 - .saturating_add(Weight::from_parts(3_910_883, 0).saturating_mul(c.into())) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// The range of component `c` is `[0, 1000]`. - fn batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_345_000 picoseconds. - Weight::from_parts(4_423_143, 0) - // Standard Error: 4_589 - .saturating_add(Weight::from_parts(3_947_978, 0).saturating_mul(c.into())) - } - fn as_derivative() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_645_000 picoseconds. - Weight::from_parts(3_825_000, 0) - } - /// The range of component `c` is `[0, 1000]`. - fn batch_all(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_397_000 picoseconds. - Weight::from_parts(10_424_905, 0) - // Standard Error: 3_521 - .saturating_add(Weight::from_parts(4_132_846, 0).saturating_mul(c.into())) - } - fn dispatch_as() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_073_000 picoseconds. - Weight::from_parts(7_382_000, 0) - } - /// The range of component `c` is `[0, 1000]`. - fn force_batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_389_000 picoseconds. - Weight::from_parts(12_202_657, 0) - // Standard Error: 2_744 - .saturating_add(Weight::from_parts(3_910_883, 0).saturating_mul(c.into())) - } -} diff --git a/runtime/vara/Cargo.toml b/runtime/vara/Cargo.toml index c9178dd02c7..1c5d1b19d73 100644 --- a/runtime/vara/Cargo.toml +++ b/runtime/vara/Cargo.toml @@ -259,6 +259,11 @@ try-runtime = [ "pallet-bags-list/try-runtime", "runtime-common/try-runtime", ] +fuzz = [ + "common/fuzz", + "pallet-gear/fuzz", + "pallet-gear-gas/fuzz" +] dev = [ "pallet-gear-debug", "pallet-sudo", diff --git a/runtime/vara/build.rs b/runtime/vara/build.rs index 189ececba9b..07778f95f5c 100644 --- a/runtime/vara/build.rs +++ b/runtime/vara/build.rs @@ -18,7 +18,7 @@ fn main() { substrate_build_script_utils::generate_cargo_keys(); - #[cfg(feature = "std")] + #[cfg(all(feature = "std", not(feature = "fuzz")))] { substrate_wasm_builder::WasmBuilder::new() .with_current_project() diff --git a/runtime/vara/src/lib.rs b/runtime/vara/src/lib.rs index 29f2e6e60da..8d11bc83579 100644 --- a/runtime/vara/src/lib.rs +++ b/runtime/vara/src/lib.rs @@ -21,7 +21,7 @@ #![recursion_limit = "256"] // Make the WASM binary available. -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(feature = "fuzz")))] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use common::storage::{Mailbox, Messenger}; @@ -126,6 +126,13 @@ use governance::{pallet_custom_origins, GeneralAdmin, Treasurer, TreasurySpender mod migrations; +// By this we assert if runtime compiled with "dev" feature. +#[cfg_attr( + all(target_arch = "wasm32", target_os = "unknown", feature = "dev"), + link_section = "dev_runtime" +)] +static _DEV_RUNTIME: u8 = 0; + // By this we inject compile time version including commit hash // (https://github.com/paritytech/substrate/blob/297b3948f4a0f7f6504d4b654e16cb5d9201e523/utils/build-script-utils/src/version.rs#L44) // into the WASM runtime blob. This is used by the `runtime_wasmBlobVersion` RPC call. diff --git a/scripts/check-spec.sh b/scripts/check-spec.sh index 3615a4b2f4e..c4e951062d2 100755 --- a/scripts/check-spec.sh +++ b/scripts/check-spec.sh @@ -39,11 +39,10 @@ check_spec() { PACKAGES_REQUIRE_BUMP_SPEC="common core core-backend core-processor node pallets runtime-interface" SPEC_ON_MASTER="$(git diff origin/master | sed -n -r "s/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p")" -ACTUAL_SPEC_GEAR="$(cat $ROOT_DIR/runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" ACTUAL_SPEC_VARA="$(cat $ROOT_DIR/runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" if [ -z "$SPEC_ON_MASTER" ]; then - SPEC_ON_MASTER=$ACTUAL_SPEC_GEAR + SPEC_ON_MASTER=$ACTUAL_SPEC_VARA fi for package in $(git diff --name-only origin/master | grep ".rs$" | cut -d "/" -f1 | uniq); do @@ -54,9 +53,6 @@ done EXIT_CODE=0 -header "Checking spec for Gear runtime" -check_spec "$SPEC_ON_MASTER" "$ACTUAL_SPEC_GEAR" "$CHANGES" - header "Checking spec for Vara runtime" check_spec "$SPEC_ON_MASTER" "$ACTUAL_SPEC_VARA" "$CHANGES" diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh deleted file mode 100755 index e78dbe6c55c..00000000000 --- a/scripts/ci_build.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -# Totally reproduces `CI::build` job locally. - -set -e - -SELF="$0" -ROOT_DIR="$(cd "$(dirname "$SELF")"/.. && pwd)" - -cd "$ROOT_DIR" - -echo "Show: Versioning" - ./scripts/gear.sh show - -echo "Build: Gear" - ./scripts/gear.sh build gear --locked --release - -echo "Build fuzzer" - ./scripts/gear.sh build fuzz --locked --release - -echo "Check: Gear runtime imports" - ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/gear-runtime/gear_runtime.compact.wasm - -echo "Check: Vara runtime imports" - ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/vara-runtime/vara_runtime.compact.wasm - -echo "Test: Gear workspace" - ./scripts/gear.sh test gear --exclude gclient --exclude gcli --release --locked - -echo "Test: `gcli`" - ./scripts/gear.sh test gcli --release --locked --retries 3 - -echo "Test: Client tests" - ./scripts/gear.sh test client --release - -echo "Test: gsdk tests" - ./scripts/gear.sh test gsdk --release - -echo "Test: Runtime benchmarks and benchmark tests work" - cargo build -p gear-cli --release --features=runtime-benchmarks,runtime-benchmarks-checkers - ./target/release/gear benchmark pallet --chain=dev --pallet=pallet_gear --steps=20 --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 - ./target/release/gear benchmark pallet --chain=dev --pallet=pallet_gear --extrinsic="check_all" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --extra - ./target/release/gear benchmark pallet --chain=dev --pallet=pallet_gear --extrinsic="check_lazy_pages_all" --execution=native --heap-pages=4096 --extra - -echo "Test: Sys-calls Wasmi integrity" - ./scripts/gear.sh test syscalls --release - -echo "Test: `try-runtime` feature tests" - cargo test -p "pallet-*" --features try-runtime --release --locked - -echo "Test: Try runtime migrations" - cargo build -p gear-cli --features try-runtime --release --locked - ./target/release/gear try-runtime --runtime ./target/release/wbuild/gear-runtime/gear_runtime.wasm on-runtime-upgrade --checks live --uri wss://rpc-private-testnet.gear-tech.io:443 diff --git a/scripts/src/check.sh b/scripts/src/check.sh index e8a13ae8a2b..97eb1ffd868 100755 --- a/scripts/src/check.sh +++ b/scripts/src/check.sh @@ -21,7 +21,7 @@ EOF gear_check() { echo " >> Check workspace without crates that use runtime with 'fuzz' feature" - __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_GEAR_RUNTIME_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo check --workspace "$@" --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz + __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo check --workspace "$@" --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz echo " >> Check crates that use runtime with 'fuzz' feature" cargo check "$@" -p runtime-fuzzer -p runtime-fuzzer-fuzz @@ -32,11 +32,6 @@ runtime_imports() { cargo build -p wasm-proc fi - if [ ! -f target/debug/wbuild/gear-runtime/gear_runtime.compact.wasm ]; then - cargo build -p gear-runtime - fi - ./target/debug/wasm-proc --check-runtime-imports target/debug/wbuild/gear-runtime/gear_runtime.compact.wasm - if [ ! -f target/debug/wbuild/vara-runtime/vara_runtime.compact.wasm ]; then cargo build -p vara-runtime fi diff --git a/scripts/src/clippy.sh b/scripts/src/clippy.sh index 7856e3ac00e..b70925273ea 100755 --- a/scripts/src/clippy.sh +++ b/scripts/src/clippy.sh @@ -20,13 +20,13 @@ EOF } gear_clippy() { - EXCLUDE_PACKAGES="--exclude gear-runtime --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz" - INCLUDE_PACKAGES="-p gear-runtime -p runtime-fuzzer -p runtime-fuzzer-fuzz" + EXCLUDE_PACKAGES="--exclude vara-runtime --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz" + INCLUDE_PACKAGES="-p vara-runtime -p runtime-fuzzer -p runtime-fuzzer-fuzz" - __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_GEAR_RUNTIME_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy --workspace "$@" $EXCLUDE_PACKAGES -- --no-deps -D warnings - __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_GEAR_RUNTIME_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy $INCLUDE_PACKAGES --all-features -- --no-deps -D warnings + __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy --workspace "$@" $EXCLUDE_PACKAGES -- --no-deps -D warnings + __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy $INCLUDE_PACKAGES --all-features -- --no-deps -D warnings } examples_clippy() { - __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_GEAR_RUNTIME_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy -p "demo-*" -p test-syscalls --no-default-features "$@" -- --no-deps -D warnings + __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 cargo clippy -p "demo-*" -p test-syscalls --no-default-features "$@" -- --no-deps -D warnings } diff --git a/scripts/src/test.sh b/scripts/src/test.sh index fbb0d801029..19a637876d3 100755 --- a/scripts/src/test.sh +++ b/scripts/src/test.sh @@ -42,20 +42,16 @@ workspace_test() { gsdk_test() { if [ "$CARGO" = "cargo xwin" ]; then $CARGO test -p gsdk --no-fail-fast "$@" - $CARGO test -p gsdk --no-fail-fast --features vara-testing "$@" else cargo nextest run -p gsdk --profile ci --no-fail-fast "$@" - cargo nextest run -p gsdk --features vara-testing --profile ci --no-fail-fast "$@" fi } gcli_test() { if [ "$CARGO" = "cargo xwin" ]; then $CARGO test -p gcli --no-fail-fast "$@" - $CARGO test -p gcli --features vara-testing --no-fail-fast "$@" else cargo nextest run -p gcli --profile ci --no-fail-fast "$@" - cargo nextest run -p gcli --features vara-testing --profile ci --no-fail-fast "$@" fi } @@ -112,7 +108,7 @@ doc_test() { MANIFEST="$1" shift - __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_GEAR_RUNTIME_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 $CARGO test --doc --workspace --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz --manifest-path="$MANIFEST" --no-fail-fast "$@" + __GEAR_WASM_BUILDER_NO_BUILD=1 SKIP_WASM_BUILD=1 SKIP_VARA_RUNTIME_WASM_BUILD=1 $CARGO test --doc --workspace --exclude runtime-fuzzer --exclude runtime-fuzzer-fuzz --manifest-path="$MANIFEST" --no-fail-fast "$@" } time_consuming_tests() { diff --git a/scripts/unpack-weights.sh b/scripts/unpack-weights.sh index 215068ed852..8dd734cf529 100755 --- a/scripts/unpack-weights.sh +++ b/scripts/unpack-weights.sh @@ -30,19 +30,17 @@ need() { # Dependencies need unzip -GEAR_RUNTIME="weights-gear.zip" VARA_RUNTIME="weights-vara.zip" -if [[ ! -f $GEAR_RUNTIME ]] || [[ ! -f $VARA_RUNTIME ]]; then - echo "You need to download artifacts with weights before unpacking: $GEAR_RUNTIME, $VARA_RUNTIME" +if [[ ! -f $VARA_RUNTIME ]]; then + echo "You need to download artifacts with weights before unpacking: $VARA_RUNTIME" echo "Please follow the link: https://github.com/gear-tech/gear/actions/workflows/benchmarks.yml" exit 1 fi # extract artifacts to the correct directories -unzip -o $GEAR_RUNTIME -d runtime/gear/src/weights/ && rm $GEAR_RUNTIME unzip -o $VARA_RUNTIME -d runtime/vara/src/weights/ && rm $VARA_RUNTIME # apply some patches for `pallets/gear/src/weights.rs` -cp runtime/gear/src/weights/pallet_gear.rs pallets/gear/src/weights.rs +cp runtime/vara/src/weights/pallet_gear.rs pallets/gear/src/weights.rs sed -i -E 's/\w+::WeightInfo for SubstrateWeight/WeightInfo for SubstrateWeight/' pallets/gear/src/weights.rs diff --git a/scripts/weight-diff.sh b/scripts/weight-diff.sh index 11a1baed4db..813da03b7ea 100755 --- a/scripts/weight-diff.sh +++ b/scripts/weight-diff.sh @@ -12,7 +12,7 @@ USAGE: ./weight-diff.sh [FLAGS] EXAMPLES: - ./weight-diff.sh master $(git branch --show-current) gear --display-units + ./weight-diff.sh master $(git branch --show-current) vara --display-units FLAGS: --display-units if present, displays the value in units @@ -20,7 +20,7 @@ FLAGS: ARGUMENTS: branch #1 from where to get the weights branch #2 from where to get the weights - what runtime to compare? [possible values: gear, vara] + what runtime to compare? [possible values: vara] EOF } diff --git a/utils/gear-replay-cli/Cargo.toml b/utils/gear-replay-cli/Cargo.toml index f4134a9d004..43d706388e7 100644 --- a/utils/gear-replay-cli/Cargo.toml +++ b/utils/gear-replay-cli/Cargo.toml @@ -9,7 +9,6 @@ license.workspace = true # Internal gear-runtime-interface.workspace = true runtime-primitives.workspace = true -gear-runtime = { workspace = true, optional = true, features = ["dev"] } vara-runtime = { workspace = true, optional = true, features = ["dev"] } service = { workspace = true, optional = true } @@ -54,7 +53,6 @@ std = [ "sc-executor/std", "frame-system/std", "gear-runtime-interface/std", - "gear-runtime?/std", "vara-runtime?/std", ] always-wasm = [] @@ -62,12 +60,7 @@ vara-native = [ "vara-runtime", "service/vara-native", ] -gear-native = [ - "gear-runtime", - "service/gear-native", -] try-runtime = [ - "gear-runtime?/try-runtime", "vara-runtime?/try-runtime", "service/try-runtime", ] diff --git a/utils/gear-replay-cli/README.md b/utils/gear-replay-cli/README.md index 67be521ba3f..e6e59291ece 100644 --- a/utils/gear-replay-cli/README.md +++ b/utils/gear-replay-cli/README.md @@ -107,7 +107,7 @@ In order to use the native runtime build make sure the node is built with the Ru General command format and available subcommand are: ```bash - gear-replay-cli -h + gear-replay-cli -h Commands of `gear-replay` CLI Usage: gear-replay-cli [OPTIONS] @@ -149,7 +149,7 @@ Currently supported cases include: The `gear-replay-cli` CLI tools provides means to enable execution of a downloaded block both against the on-chain WASM Runtime as well as the native local Runtime, provided the version of the latter matches the on-chain Runtime version. This can be useful for debugging. -The `wasm-only` version which runs the downloaded Runtime is lighter-weight (the executable is about 40% smaller as it doesn't include the `vara`- or `gear-runtime` as a dependency), and it works with both Gear testnet and the Vara chain (provided the user supplies the correct WebSocket connection uri). +The `wasm-only` version which runs the downloaded Runtime is lighter-weight (the executable is about 40% smaller as it doesn't include the `vara-runtime` as a dependency), and it works with both Gear testnet and the Vara chain (provided the user supplies the correct WebSocket connection uri). This is the default way of building the tool: ```bash @@ -166,14 +166,12 @@ In order to enable native runtime, use one of the following: ```bash make gear-replay-vara-native -make gear-replay-gear-native ``` or ```bash ./scripts/gear.sh build gear-replay --release --no-default-features --features=vara-native -./scripts/gear.sh build gear-replay --release --no-default-features --features=gear-native ``` The `--uri` parameter must match the native runtime you've built the tool with, while the Runtime version should be the same as the on-chain one. If it does not, the Wasm executor will be used as a fallback. diff --git a/utils/gear-replay-cli/src/cmd/gear_run.rs b/utils/gear-replay-cli/src/cmd/gear_run.rs index 1a946886978..93c5b5d5643 100644 --- a/utils/gear-replay-cli/src/cmd/gear_run.rs +++ b/utils/gear-replay-cli/src/cmd/gear_run.rs @@ -23,8 +23,6 @@ use clap::Parser; use codec::{Decode, Encode, Joiner}; #[cfg(feature = "always-wasm")] use sc_executor::sp_wasm_interface::ExtendedHostFunctions; -#[cfg(all(not(feature = "always-wasm"), feature = "gear-native"))] -use service::GearExecutorDispatch; #[cfg(all(not(feature = "always-wasm"), feature = "vara-native"))] use service::VaraExecutorDispatch; use sp_runtime::{ @@ -113,8 +111,6 @@ where // Create executor, suitable for usage in conjunction with the preferred execution strategy. #[cfg(all(not(feature = "always-wasm"), feature = "vara-native"))] let executor = build_executor::(); - #[cfg(all(not(feature = "always-wasm"), feature = "gear-native"))] - let executor = build_executor::(); #[cfg(feature = "always-wasm")] let executor = build_executor::< ExtendedHostFunctions< diff --git a/utils/gear-replay-cli/src/cmd/replay_block.rs b/utils/gear-replay-cli/src/cmd/replay_block.rs index 7be6ede95bc..4851f467f9a 100644 --- a/utils/gear-replay-cli/src/cmd/replay_block.rs +++ b/utils/gear-replay-cli/src/cmd/replay_block.rs @@ -23,8 +23,6 @@ use clap::Parser; use codec::{Decode, Encode}; #[cfg(feature = "always-wasm")] use sc_executor::sp_wasm_interface::ExtendedHostFunctions; -#[cfg(all(not(feature = "always-wasm"), feature = "gear-native"))] -use service::GearExecutorDispatch; #[cfg(all(not(feature = "always-wasm"), feature = "vara-native"))] use service::VaraExecutorDispatch; use sp_runtime::{ @@ -159,8 +157,6 @@ where // Create executor, suitable for usage in conjunction with the preferred execution strategy. #[cfg(all(not(feature = "always-wasm"), feature = "vara-native"))] let executor = build_executor::(); - #[cfg(all(not(feature = "always-wasm"), feature = "gear-native"))] - let executor = build_executor::(); #[cfg(feature = "always-wasm")] let executor = build_executor::< ExtendedHostFunctions< diff --git a/utils/node-loader/src/batch_pool.rs b/utils/node-loader/src/batch_pool.rs index e83d93d683c..5610bc2c5ed 100644 --- a/utils/node-loader/src/batch_pool.rs +++ b/utils/node-loader/src/batch_pool.rs @@ -264,7 +264,7 @@ async fn process_events( // States what amount of blocks we should wait for taking all the events about successful `messages` execution let wait_for_events_blocks = 30; // Multiply on five to be 100% sure if no events occurred, then node is crashed - let wait_for_events_millisec = api.expected_block_time()? as usize * wait_for_events_blocks * 5; + let wait_for_events_millisec = api.expected_block_time()? * wait_for_events_blocks * 5; let mut mailbox_added = BTreeSet::new(); @@ -274,15 +274,13 @@ async fn process_events( // Wait with a timeout until the `EventsReceiver` receives the expected block hash. while events.block_hash() != block_hash { tokio::time::sleep(Duration::new(0, 500)).await; - events = tokio::time::timeout( - Duration::from_millis(wait_for_events_millisec as u64), - rx.recv(), - ) - .await - .map_err(|_| { - tracing::debug!("Timeout is reached while waiting for events"); - anyhow!(utils::EVENTS_TIMEOUT_ERR_STR) - })??; + events = + tokio::time::timeout(Duration::from_millis(wait_for_events_millisec), rx.recv()) + .await + .map_err(|_| { + tracing::debug!("Timeout is reached while waiting for events"); + anyhow!(utils::EVENTS_TIMEOUT_ERR_STR) + })??; } // Wait for next n blocks and push new events. @@ -299,15 +297,13 @@ async fn process_events( v.push(event); } tokio::time::sleep(Duration::new(0, 100)).await; - events = tokio::time::timeout( - Duration::from_millis(wait_for_events_millisec as u64), - rx.recv(), - ) - .await - .map_err(|_| { - tracing::debug!("Timeout is reached while waiting for events"); - anyhow!(utils::EVENTS_TIMEOUT_ERR_STR) - })??; + events = + tokio::time::timeout(Duration::from_millis(wait_for_events_millisec), rx.recv()) + .await + .map_err(|_| { + tracing::debug!("Timeout is reached while waiting for events"); + anyhow!(utils::EVENTS_TIMEOUT_ERR_STR) + })??; } let mut mailbox_from_events = utils::capture_mailbox_messages(&api, &mut v) @@ -354,7 +350,7 @@ async fn inspect_crash_events(mut rx: EventsReceiver) -> Result<()> { // Error means either event is not found and can't be found // in the listener, or some other error during event // parsing occurred. - while let Ok(events) = tokio::time::timeout(Duration::from_secs(30), rx.recv()).await? { + while let Ok(events) = tokio::time::timeout(Duration::from_secs(90), rx.recv()).await? { let bh = events.block_hash(); for event in events.iter() { let event = event?.as_root_event::()?; diff --git a/utils/regression-analysis/Cargo.toml b/utils/regression-analysis/Cargo.toml index b4864c95a95..84ef81ba25f 100644 --- a/utils/regression-analysis/Cargo.toml +++ b/utils/regression-analysis/Cargo.toml @@ -14,6 +14,6 @@ serde = { workspace = true, features = ["derive"] } serde_json.workspace = true thousands.workspace = true -gear-runtime.workspace = true +vara-runtime.workspace = true pallet-gear.workspace = true frame-support.workspace = true diff --git a/utils/regression-analysis/src/main.rs b/utils/regression-analysis/src/main.rs index 9f52ad593f4..1922036db22 100644 --- a/utils/regression-analysis/src/main.rs +++ b/utils/regression-analysis/src/main.rs @@ -266,7 +266,7 @@ fn weights(kind: WeightsKind, input_file: PathBuf, output_file: PathBuf) { } ) => {{ // check field is exist - let $name:: { + let $name:: { $( $field: _, )+ } = Default::default(); @@ -476,7 +476,7 @@ fn weights(kind: WeightsKind, input_file: PathBuf, output_file: PathBuf) { } } WeightsKind::Extrinsic => { - let extrinsics = pallet_gear::pallet::Call::::get_call_names(); + let extrinsics = pallet_gear::pallet::Call::::get_call_names(); benches.extend( extrinsics .iter() diff --git a/utils/runtime-fuzzer/Cargo.toml b/utils/runtime-fuzzer/Cargo.toml index 3de635c06e4..ff5195265ae 100644 --- a/utils/runtime-fuzzer/Cargo.toml +++ b/utils/runtime-fuzzer/Cargo.toml @@ -26,7 +26,7 @@ runtime-primitives.workspace = true gear-common.workspace = true gear-core.workspace = true gear-utils.workspace = true -gear-runtime = { workspace = true, features = ["std", "dev", "fuzz"] } +vara-runtime = { workspace = true, features = ["std", "dev", "fuzz"] } pallet-gear.workspace = true pallet-gear-bank.workspace = true @@ -40,6 +40,8 @@ pallet-balances.workspace = true sp-consensus-slots = { workspace = true } sp-consensus-babe.workspace = true sp-consensus-grandpa.workspace = true +pallet-im-online.workspace = true +sp-authority-discovery.workspace = true pallet-authorship.workspace = true [dev-dependencies] diff --git a/utils/runtime-fuzzer/src/lib.rs b/utils/runtime-fuzzer/src/lib.rs index e241451cc32..a877e90f29b 100644 --- a/utils/runtime-fuzzer/src/lib.rs +++ b/utils/runtime-fuzzer/src/lib.rs @@ -29,12 +29,12 @@ use frame_support::pallet_prelude::DispatchResultWithPostInfo; use gear_call_gen::{ClaimValueArgs, GearCall, SendMessageArgs, SendReplyArgs, UploadProgramArgs}; use gear_calls::GearCalls; use gear_core::ids::ProgramId; -use gear_runtime::{AccountId, Gear, Runtime, RuntimeOrigin}; use pallet_balances::Pallet as BalancesPallet; use runtime::*; use sha1::*; use std::fmt::Debug; use utils::default_generator_set; +use vara_runtime::{AccountId, Gear, Runtime, RuntimeOrigin}; /// This is a wrapper over random bytes provided from fuzzer. /// diff --git a/utils/runtime-fuzzer/src/runtime/account.rs b/utils/runtime-fuzzer/src/runtime/account.rs index 918bf71aadd..bef5d161ead 100644 --- a/utils/runtime-fuzzer/src/runtime/account.rs +++ b/utils/runtime-fuzzer/src/runtime/account.rs @@ -17,13 +17,15 @@ // along with this program. If not, see . use gear_common::Origin; -use gear_runtime::Runtime; use pallet_gear::BlockGasLimitOf; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use runtime_primitives::{AccountId, AccountPublic, Balance}; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519::Public, Pair, Public as TPublic}; use sp_runtime::{app_crypto::UncheckedFrom, traits::IdentifyAccount}; +use vara_runtime::Runtime; pub fn alice() -> AccountId { sp_keyring::Sr25519Keyring::Alice.to_account_id() @@ -36,11 +38,21 @@ pub fn account(v: T) -> AccountId { // TODO #2307 BabeId and GrandpaId are not needed at first? /// Generate authority keys. -pub fn authority_keys_from_seed(s: &str) -> (AccountId, BabeId, GrandpaId) { +pub fn authority_keys_from_seed( + s: &str, +) -> ( + AccountId, + BabeId, + GrandpaId, + ImOnlineId, + AuthorityDiscoveryId, +) { ( get_acc_id_from_seed::(s), get_pub_key_from_seed::(s), get_pub_key_from_seed::(s), + get_pub_key_from_seed::(s), + get_pub_key_from_seed::(s), ) } diff --git a/utils/runtime-fuzzer/src/runtime/block.rs b/utils/runtime-fuzzer/src/runtime/block.rs index 293d6eac2ff..47b7c568079 100644 --- a/utils/runtime-fuzzer/src/runtime/block.rs +++ b/utils/runtime-fuzzer/src/runtime/block.rs @@ -20,7 +20,6 @@ use codec::Encode; use frame_support::traits::{OnFinalize, OnInitialize}; use frame_system::pallet_prelude::BlockNumberFor; use gear_common::QueueRunner; -use gear_runtime::{Authorship, BlockGasLimit, Gear, GearGas, GearMessenger, Runtime, System}; use pallet_gear::BlockGasLimitOf; use sp_consensus_babe::{ digests::{PreDigest, SecondaryPlainPreDigest}, @@ -28,6 +27,7 @@ use sp_consensus_babe::{ }; use sp_consensus_slots::Slot; use sp_runtime::{Digest, DigestItem, Perbill}; +use vara_runtime::{Authorship, BlockGasLimit, Gear, GearGas, GearMessenger, Runtime, System}; /// This is not set to `BlockGasLimitOf::::get`, because of the /// known possible dead-lock for the message in the queue, when it's valid gas diff --git a/utils/runtime-fuzzer/src/runtime/mailbox.rs b/utils/runtime-fuzzer/src/runtime/mailbox.rs index d7376a1431d..87beb9555d1 100644 --- a/utils/runtime-fuzzer/src/runtime/mailbox.rs +++ b/utils/runtime-fuzzer/src/runtime/mailbox.rs @@ -1,7 +1,7 @@ use gear_common::storage::{IterableByKeyMap, Messenger}; use gear_core::ids::MessageId; -use gear_runtime::{AccountId, Runtime}; use pallet_gear::Config; +use vara_runtime::{AccountId, Runtime}; pub fn get_mailbox_messages(sender: &AccountId) -> Vec { <::Messenger as Messenger>::Mailbox::iter_key(sender.clone()) diff --git a/utils/runtime-fuzzer/src/runtime/mod.rs b/utils/runtime-fuzzer/src/runtime/mod.rs index bef5bfe726e..cebf312c3a7 100644 --- a/utils/runtime-fuzzer/src/runtime/mod.rs +++ b/utils/runtime-fuzzer/src/runtime/mod.rs @@ -23,12 +23,12 @@ use frame_support::{ traits::{Currency, GenesisBuild}, }; use frame_system::GenesisConfig as SystemConfig; -use gear_runtime::{ - AccountId, Balances, BankAddress, Runtime, RuntimeOrigin, SessionConfig, SessionKeys, -}; use pallet_balances::{GenesisConfig as BalancesConfig, Pallet as BalancesPallet}; use pallet_gear_bank::Config as GearBankConfig; use sp_io::TestExternalities; +use vara_runtime::{ + AccountId, Balances, BankAddress, Runtime, RuntimeOrigin, SessionConfig, SessionKeys, +}; pub use account::{account, alice}; pub use block::{default_gas_limit, run_to_block, run_to_next_block}; @@ -67,13 +67,15 @@ pub fn new_test_ext() -> TestExternalities { SessionConfig { keys: authorities .into_iter() - .map(|(account, babe_id, grandpa_id)| { + .map(|(account, babe, grandpa, im_online, authority_discovery)| { ( account.clone(), account, SessionKeys { - babe: babe_id, - grandpa: grandpa_id, + babe, + grandpa, + im_online, + authority_discovery, }, ) }) diff --git a/utils/runtime-fuzzer/src/utils.rs b/utils/runtime-fuzzer/src/utils.rs index 033a9e38cc5..812b3e34a9b 100644 --- a/utils/runtime-fuzzer/src/utils.rs +++ b/utils/runtime-fuzzer/src/utils.rs @@ -24,7 +24,7 @@ use crate::{ runtime::{self, default_gas_limit, get_mailbox_messages}, }; use gear_core::ids::MessageId; -use gear_runtime::AccountId; +use vara_runtime::AccountId; #[cfg(test)] pub fn min_unstructured_input_size() -> usize { diff --git a/utils/wasm-builder/src/lib.rs b/utils/wasm-builder/src/lib.rs index 2ec7221d3db..aac5416ee39 100644 --- a/utils/wasm-builder/src/lib.rs +++ b/utils/wasm-builder/src/lib.rs @@ -152,7 +152,7 @@ impl WasmBuilder { } // It may turn out that crate with a build script is built as a dependency of - // another crate with build script in the same process (gear-runtime -> pallet-gear -> examples). + // another crate with build script in the same process (runtime -> pallet-gear -> examples). // In that case, all the CARGO_FEATURE_ environment variables are propagated down to // the dependent crate which might not have the corresponding features at all. // In such situation, we just warn about unmatched features for diagnostic purposes and ignore them diff --git a/utils/wasm-proc/src/main.rs b/utils/wasm-proc/src/main.rs index a2585655fcf..3cc4b0d7892 100644 --- a/utils/wasm-proc/src/main.rs +++ b/utils/wasm-proc/src/main.rs @@ -119,6 +119,10 @@ struct Args { #[arg(long)] check_runtime_imports: bool, + /// Check runtime is built with dev feature or not + #[arg(long)] + check_runtime_is_dev: Option, + /// Verbose output #[arg(short, long)] verbose: bool, @@ -128,6 +132,19 @@ struct Args { path: Vec, } +fn check_rt_is_dev(path_to_wasm: &str, expected_to_be_dev: bool) -> Result<(), String> { + let module = parity_wasm::deserialize_file(path_to_wasm) + .map_err(|e| format!("Deserialization error: {e}"))?; + + let is_dev = module.custom_sections().any(|v| v.name() == "dev_runtime"); + + match (expected_to_be_dev, is_dev) { + (true, false) => Err(String::from("Runtime expected to be DEV, but it's NOT DEV")), + (false, true) => Err(String::from("Runtime expected to be NOT DEV, but it's DEV")), + _ => Ok(()), + } +} + fn check_rt_imports(path_to_wasm: &str, allowed_imports: &HashSet<&str>) -> Result<(), String> { let module = parity_wasm::deserialize_file(path_to_wasm) .map_err(|e| format!("Deserialization error: {e}"))?; @@ -163,6 +180,7 @@ fn main() -> Result<(), Box> { assembly_script, strip_custom_sections, check_runtime_imports, + check_runtime_is_dev, verbose, } = Args::parse(); @@ -187,6 +205,16 @@ fn main() -> Result<(), Box> { if check_runtime_imports { check_rt_imports(file, &rt_allowed_imports) .map_err(|e| format!("Error with `{file}`: {e}"))?; + + if check_runtime_is_dev.is_none() { + continue; + } + } + + if let Some(expected_to_be_dev) = check_runtime_is_dev { + check_rt_is_dev(file, expected_to_be_dev) + .map_err(|e| format!("Error with `{file}`: {e}"))?; + continue; } diff --git a/utils/weight-diff/Cargo.toml b/utils/weight-diff/Cargo.toml index 32dbd38e848..a9bd4c21aa2 100644 --- a/utils/weight-diff/Cargo.toml +++ b/utils/weight-diff/Cargo.toml @@ -15,5 +15,4 @@ tabled.workspace = true pallet-gear.workspace = true frame-support.workspace = true -gear-runtime.workspace = true vara-runtime.workspace = true diff --git a/utils/weight-diff/src/main.rs b/utils/weight-diff/src/main.rs index a40f85b1090..ae852cf1d50 100644 --- a/utils/weight-diff/src/main.rs +++ b/utils/weight-diff/src/main.rs @@ -68,7 +68,6 @@ enum Commands { #[derive(Debug, Copy, Clone, ValueEnum)] enum Runtime { - Gear, Vara, } @@ -81,7 +80,6 @@ enum WeightsKind { #[derive(Debug, Serialize)] struct SerializableDump { - gear_schedule: Schedule, vara_schedule: Schedule, #[serde(skip_serializing_if = "Option::is_none")] label: Option, @@ -89,7 +87,6 @@ struct SerializableDump { #[derive(Debug, Deserialize)] struct DeserializableDump { - gear_schedule: DeserializableSchedule, vara_schedule: DeserializableSchedule, label: Option, } @@ -197,7 +194,6 @@ fn main() { serde_json::to_writer_pretty( writer, &SerializableDump { - gear_schedule: Default::default(), vara_schedule: Default::default(), label, }, @@ -218,7 +214,6 @@ fn main() { serde_json::from_str(&fs::read_to_string(output_path2).unwrap()).unwrap(); let (schedule1, schedule2) = match runtime { - Runtime::Gear => (dump1.gear_schedule, dump2.gear_schedule), Runtime::Vara => (dump1.vara_schedule, dump2.vara_schedule), };