diff --git a/.github/workflows/runtimes-matrix.json b/.github/workflows/runtimes-matrix.json index ffe99af042..bda9899ec7 100644 --- a/.github/workflows/runtimes-matrix.json +++ b/.github/workflows/runtimes-matrix.json @@ -53,5 +53,12 @@ "path": "system-parachains/collectives/collectives-polkadot", "uri": "wss://polkadot-collectives-rpc.polkadot.io:443", "is_relay": false + }, + { + "name": "encointer-kusama", + "package": "encointer-kusama-runtime", + "path": "system-parachains/encointer", + "uri": "wss://kusama.api.encointer.org:443", + "is_relay": false } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index d093250bae..d28e030feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Added +- Add [Encointer](https://encointer.org) system parachain runtime, completing [RFC22](https://github.com/polkadot-fellows/RFCs/blob/main/text/0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80)) + ## [1.1.0] 10.01.2024 ### Changed diff --git a/Cargo.lock b/Cargo.lock index 9069eaf411..f51de76060 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -348,7 +348,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version", + "rustc_version 0.4.0", "zeroize", ] @@ -2307,15 +2307,30 @@ dependencies = [ "wasmtime-types", ] +[[package]] +name = "crc" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +dependencies = [ + "crc-catalog 1.1.1", +] + [[package]] name = "crc" version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ - "crc-catalog", + "crc-catalog 2.2.0", ] +[[package]] +name = "crc-catalog" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" + [[package]] name = "crc-catalog" version = "2.2.0" @@ -2653,6 +2668,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "cumulus-primitives-timestamp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771ef4a34f7bcd4e8782f73d8dbd0df031b1c1c82e54b06af69f88df2cddc316" +dependencies = [ + "cumulus-primitives-core", + "futures", + "parity-scale-codec", + "sp-inherents", + "sp-std", + "sp-timestamp", +] + [[package]] name = "cumulus-primitives-utility" version = "0.4.0" @@ -2746,7 +2775,7 @@ dependencies = [ "digest 0.10.7", "fiat-crypto", "platforms", - "rustc_version", + "rustc_version 0.4.0", "subtle 2.4.1", "zeroize", ] @@ -2984,7 +3013,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.0", "syn 1.0.109", ] @@ -3260,6 +3289,154 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "encointer-balances-tx-payment" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "574a256785661fe0353b6664a896b03eaac804e01de3b7146a1e68bea23823c6" +dependencies = [ + "encointer-primitives", + "frame-support", + "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-encointer-balances", + "pallet-encointer-ceremonies", + "pallet-transaction-payment", + "sp-runtime", +] + +[[package]] +name = "encointer-balances-tx-payment-rpc-runtime-api" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc19094858c453d1622fee74cd5ac4aeafc5afcc1695c442361528604f3a3cd" +dependencies = [ + "encointer-primitives", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-std", +] + +[[package]] +name = "encointer-ceremonies-assignment" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0e915dfb90455b04de86863d5e8c28727b88a5e79035d1592f5340befc2d31a" +dependencies = [ + "encointer-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "encointer-kusama-runtime" +version = "1.0.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "encointer-balances-tx-payment", + "encointer-balances-tx-payment-rpc-runtime-api", + "encointer-primitives", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-asset-tx-payment", + "pallet-aura", + "pallet-balances", + "pallet-collective", + "pallet-encointer-balances", + "pallet-encointer-bazaar", + "pallet-encointer-bazaar-rpc-runtime-api", + "pallet-encointer-ceremonies", + "pallet-encointer-ceremonies-rpc-runtime-api", + "pallet-encointer-communities", + "pallet-encointer-communities-rpc-runtime-api", + "pallet-encointer-faucet", + "pallet-encointer-reputation-commitments", + "pallet-encointer-scheduler", + "pallet-insecure-randomness-collective-flip", + "pallet-membership", + "pallet-proxy", + "pallet-scheduler", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "scale-info", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "encointer-meetup-validation" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bef78af8c5897da00bb93d7d77573ad7d4e6169f3daac2a36ba450760611c94" +dependencies = [ + "encointer-primitives", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "encointer-primitives" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306cf10a0e74f42080c064fdc1d827b5c3fd6e0c40ee5f4e36bb2f5ee76c51dc" +dependencies = [ + "bs58 0.4.0", + "crc 2.1.0", + "ep-core", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "substrate-geohash", +] + [[package]] name = "enum-as-inner" version = "0.5.1" @@ -3322,6 +3499,24 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "ep-core" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfa4c3869cba69547a6cf0b80faf892822cee70027f86439ea7d145286fc6ba" +dependencies = [ + "array-bytes 6.1.0", + "impl-serde", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", + "substrate-fixed", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -6915,6 +7110,189 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-encointer-balances" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2ea2b74c36582daf64b632064b3525da8aa2cdced57581272264ebd811a7a" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-bazaar" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0858d85b205d1026ccfc7e617d0028357efcfdaa9918e6ad4896f93eda3bc960" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-communities", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-std", +] + +[[package]] +name = "pallet-encointer-bazaar-rpc-runtime-api" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471fa29e940363ff8090bb620ad82564286f955bfaa33a15147190438542aa6" +dependencies = [ + "encointer-primitives", + "frame-support", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-ceremonies" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a35401aa2ffbae97ba5f981542c20ca4c8609c115078a2a84835336921d5208" +dependencies = [ + "encointer-ceremonies-assignment", + "encointer-meetup-validation", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-balances", + "pallet-encointer-communities", + "pallet-encointer-scheduler", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-ceremonies-rpc-runtime-api" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af85c19a7b83a255348a95ee0b691810088320c36319eb4446eb527f0e854a04" +dependencies = [ + "encointer-primitives", + "frame-support", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-communities" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b78031c09e3adc31ba279bb18186e379222a7b54a14d59288040dc205621e49" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-balances", + "pallet-encointer-scheduler", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-communities-rpc-runtime-api" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1808d7908167315f12204db923a35f4af851e7c53b73351ed7d1b9e53a8c948d" +dependencies = [ + "encointer-primitives", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-faucet" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fdd1b8885dfb83e249af6a8914a38e3d5ea5f01d196ae35ec1420e502a54ef" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-communities", + "pallet-encointer-reputation-commitments", + "pallet-treasury", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-reputation-commitments" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27da548ae6f6070797c3270160cc0c76d4ddc20575d63e5a615d6f28d99c7cb5" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-ceremonies", + "pallet-encointer-communities", + "pallet-encointer-scheduler", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-scheduler" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffe4e1efc5084466c4c0ae1d835651a29ab3ee8fc68933ae14df00d0875441b" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-fast-unstake" version = "24.0.0" @@ -7034,6 +7412,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-insecure-randomness-collective-flip" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df4d7fab2948940925d4c0076ec542b2c67b37a5332449f102241993d31a8b41" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "safe-mix", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-membership" version = "25.0.0" @@ -9418,6 +9811,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.4.0" @@ -9578,6 +9980,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "safe-mix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +dependencies = [ + "rustc_version 0.2.3", +] + [[package]] name = "safe_arch" version = "0.7.1" @@ -10594,6 +11005,15 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.18" @@ -10840,7 +11260,7 @@ dependencies = [ "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", - "rustc_version", + "rustc_version 0.4.0", "sha2 0.10.7", "subtle 2.4.1", ] @@ -11993,7 +12413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" dependencies = [ "base64 0.13.1", - "crc", + "crc 3.0.1", "lazy_static", "md-5", "rand 0.8.5", @@ -12018,6 +12438,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-fixed" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e83ba2b4f68f12ec6b0f55bac0a23a5bcaaf2676f1109c7a5ead6121c7f0622" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "substrate-typenum", +] + +[[package]] +name = "substrate-geohash" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2aad67d4ac1b37d97338ab6fd18fd5ec79c35a24112028e6feda0d67142e9a" +dependencies = [ + "parity-scale-codec", + "scale-info", + "substrate-fixed", +] + [[package]] name = "substrate-prometheus-endpoint" version = "0.16.0" @@ -12045,6 +12488,16 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "substrate-typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f0091e93c2c75b233ae39424c52cb8a662c0811fb68add149e20e5d7e8a788" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "substrate-wasm-builder" version = "14.0.0" @@ -13465,7 +13918,7 @@ checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" dependencies = [ "arc-swap", "async-trait", - "crc", + "crc 3.0.1", "log", "rand 0.8.5", "serde", @@ -13516,7 +13969,7 @@ dependencies = [ "arc-swap", "async-trait", "bytes", - "crc", + "crc 3.0.1", "log", "rand 0.8.5", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 60818e781e..ffa140147d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ members = [ "system-parachains/bridge-hubs/bridge-hub-polkadot/primitives", "system-parachains/collectives/collectives-polkadot", "system-parachains/constants", + "system-parachains/encointer", "system-parachains/gluttons/glutton-kusama", "integration-tests/emulated/assets/asset-hub-kusama", "integration-tests/emulated/assets/asset-hub-polkadot", diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml new file mode 100644 index 0000000000..5c1c40b5b2 --- /dev/null +++ b/system-parachains/encointer/Cargo.toml @@ -0,0 +1,223 @@ +[package] +authors = ["Encointer "] +description = "Runtime for Encointer Network (kusama system chain)" +edition.workspace = true +homepage = "https://encointer.org" +license.workspace = true +name = 'encointer-kusama-runtime' +repository.workspace = true +version.workspace = true + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ + "derive", +] } +hex-literal = { version = "0.4.1", optional = true } +log = { version = "0.4.20", default-features = false } +scale-info = { version = "2.10.0", default-features = false, features = [ + "derive", +] } + +# encointer deps +encointer-balances-tx-payment = { default-features = false, version = "3.0.2" } +encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "3.0.2" } +encointer-primitives = { default-features = false, version = "3.0.2" } +pallet-encointer-balances = { default-features = false, version = "3.0.2" } +pallet-encointer-bazaar = { default-features = false, version = "3.0.2" } +pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "3.0.2" } +pallet-encointer-ceremonies = { default-features = false, version = "3.0.2" } +pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "3.0.2" } +pallet-encointer-communities = { default-features = false, version = "3.0.2" } +pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "3.0.2" } +pallet-encointer-faucet = { default-features = false, version = "3.0.2" } +pallet-encointer-reputation-commitments = { default-features = false, version = "3.0.2" } +pallet-encointer-scheduler = { default-features = false, version = "3.0.2" } + +# Substrate +frame-benchmarking = { default-features = false, optional = true, version = "25.0.0" } +frame-executive = { default-features = false, version = "25.0.0" } +frame-support = { default-features = false, version = "25.0.0" } +frame-system = { default-features = false, version = "25.0.0" } +frame-system-benchmarking = { default-features = false, optional = true, version = "25.0.0" } +frame-system-rpc-runtime-api = { default-features = false, version = "23.0.0" } +frame-try-runtime = { default-features = false, optional = true, version = "0.31.0" } +pallet-asset-tx-payment = { default-features = false, version = "25.0.0" } +pallet-aura = { default-features = false, version = "24.0.0" } +pallet-balances = { default-features = false, version = "25.0.0" } +pallet-collective = { default-features = false, version = "25.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, version = "13.0.0" } +pallet-membership = { default-features = false, version = "25.0.0" } +pallet-proxy = { default-features = false, version = "25.0.0" } +pallet-scheduler = { default-features = false, version = "26.0.0" } +pallet-timestamp = { default-features = false, version = "24.0.0" } +pallet-transaction-payment = { default-features = false, version = "25.0.0" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = "25.0.0" } +pallet-treasury = { default-features = false, version = "24.0.0" } +pallet-utility = { default-features = false, version = "25.0.0" } +sp-api = { default-features = false, version = "23.0.0" } +sp-block-builder = { default-features = false, version = "23.0.0" } +sp-consensus-aura = { default-features = false, version = "0.29.0" } +sp-core = { default-features = false, version = "25.0.0" } +sp-inherents = { default-features = false, version = "23.0.0" } +sp-offchain = { default-features = false, version = "23.0.0" } +sp-runtime = { default-features = false, version = "28.0.0" } +sp-session = { default-features = false, version = "24.0.0" } +sp-std = { default-features = false, version = "12.0.0" } +sp-transaction-pool = { default-features = false, version = "23.0.0" } +sp-version = { default-features = false, version = "26.0.0" } + +# Polkadot dependencies +pallet-xcm = { default-features = false, version = "4.0.0" } +polkadot-parachain-primitives = { default-features = false, version = "3.0.0" } +polkadot-runtime-common = { default-features = false, version = "4.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" } +xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" } +xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" } + +# Cumulus dependencies +cumulus-pallet-aura-ext = { default-features = false, version = "0.4.0" } +cumulus-pallet-dmp-queue = { default-features = false, version = "0.4.0" } +cumulus-pallet-parachain-system = { default-features = false, features = [ + "parameterized-consensus-hook", +], version = "0.4.0" } +cumulus-pallet-xcm = { default-features = false, version = "0.4.0" } +cumulus-pallet-xcmp-queue = { default-features = false, version = "0.4.0" } +cumulus-primitives-core = { default-features = false, version = "0.4.0" } +cumulus-primitives-timestamp = { default-features = false, version = "0.4.0" } +cumulus-primitives-utility = { default-features = false, version = "0.4.0" } +parachain-info = { package = "staging-parachain-info", default-features = false, version = "0.4.0" } +parachains-common = { default-features = false, version = "4.0.0" } + +# Used for runtime benchmarking + + +[build-dependencies] +substrate-wasm-builder = { optional = true, version = "14.0.0" } + +[features] +default = ["std"] +runtime-benchmarks = [ + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-encointer-balances/runtime-benchmarks", + "pallet-encointer-bazaar/runtime-benchmarks", + "pallet-encointer-ceremonies/runtime-benchmarks", + "pallet-encointer-communities/runtime-benchmarks", + "pallet-encointer-faucet/runtime-benchmarks", + "pallet-encointer-reputation-commitments/runtime-benchmarks", + "pallet-encointer-scheduler/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] +std = [ + "codec/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "encointer-balances-tx-payment-rpc-runtime-api/std", + "encointer-balances-tx-payment/std", + "encointer-primitives/serde_derive", + "encointer-primitives/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime/std", + "log/std", + "pallet-asset-tx-payment/std", + "pallet-aura/std", + "pallet-balances/std", + "pallet-collective/std", + "pallet-encointer-balances/std", + "pallet-encointer-bazaar-rpc-runtime-api/std", + "pallet-encointer-bazaar/std", + "pallet-encointer-ceremonies-rpc-runtime-api/std", + "pallet-encointer-ceremonies/std", + "pallet-encointer-communities-rpc-runtime-api/std", + "pallet-encointer-communities/std", + "pallet-encointer-faucet/std", + "pallet-encointer-reputation-commitments/std", + "pallet-encointer-scheduler/std", + "pallet-insecure-randomness-collective-flip/std", + "pallet-membership/std", + "pallet-proxy/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-utility/std", + "pallet-xcm/std", + "parachain-info/std", + "parachains-common/std", + "scale-info/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/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", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] + + +try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime/try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-aura/try-runtime", + "pallet-balances/try-runtime", + "pallet-collective/try-runtime", + "pallet-encointer-balances/try-runtime", + "pallet-encointer-bazaar/try-runtime", + "pallet-encointer-ceremonies/try-runtime", + "pallet-encointer-communities/try-runtime", + "pallet-encointer-faucet/try-runtime", + "pallet-encointer-reputation-commitments/try-runtime", + "pallet-encointer-scheduler/try-runtime", + "pallet-insecure-randomness-collective-flip/try-runtime", + "pallet-membership/try-runtime", + "pallet-proxy/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", +] + +experimental = ["pallet-aura/experimental"] diff --git a/system-parachains/encointer/build.rs b/system-parachains/encointer/build.rs new file mode 100644 index 0000000000..256e9fb765 --- /dev/null +++ b/system-parachains/encointer/build.rs @@ -0,0 +1,27 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Substrate 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. + +// Substrate 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 Cumulus. If not, see . + +#[cfg(feature = "std")] +fn main() { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build() +} + +#[cfg(not(feature = "std"))] +fn main() {} diff --git a/system-parachains/encointer/src/deal_with_fees.rs b/system-parachains/encointer/src/deal_with_fees.rs new file mode 100644 index 0000000000..3abe942713 --- /dev/null +++ b/system-parachains/encointer/src/deal_with_fees.rs @@ -0,0 +1,45 @@ +// Copyright (c) 2023 Encointer Association +// This file is part of Encointer +// +// Encointer 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. +// +// Encointer 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 Encointer. If not, see . + +use frame_support::traits::{Currency, Imbalance, OnUnbalanced}; +use sp_runtime::sp_std::marker::PhantomData; + +/// Type alias to conveniently refer to the `Currency::NegativeImbalance` associated type. +pub type NegativeImbalance = as Currency< + ::AccountId, +>>::NegativeImbalance; + +/// Moves all the fees to the treasury. +/// +/// This does only handle the native currency. The community currencies are managed by the +/// `pallet-asset-tx-payment`. +pub struct FeesToTreasury(PhantomData); + +impl OnUnbalanced> for FeesToTreasury +where + Runtime: pallet_balances::Config + pallet_treasury::Config, +{ + fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { + if let Some(mut fees) = fees_then_tips.next() { + // no burning, add all fees and tips to the treasury + + if let Some(tips) = fees_then_tips.next() { + tips.merge_into(&mut fees); + } + as OnUnbalanced<_>>::on_unbalanced(fees); + } + } +} diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs new file mode 100644 index 0000000000..e3ee4e891d --- /dev/null +++ b/system-parachains/encointer/src/lib.rs @@ -0,0 +1,1005 @@ +// Copyright (c) 2023 Encointer Association +// This file is part of Encointer +// +// Encointer 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. +// +// Encointer 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 Encointer. If not, see . + +//! # Encointer Parachain Runtime +//! +//! Encointer runtime containing all the specific logic to: +//! * perform ceremonies and receive a community income +//! * pay fees in the respective community currency +//! +//! The configuration (especially XCM) is almost identical to `asset-hub`. Therefore, upstream +//! updates should always check the diff to see if there are some configuration updates. + +#![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(feature = "std")] +include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); + +mod deal_with_fees; +mod migrations_fix; +mod weights; +pub mod xcm_config; +use codec::{Decode, Encode, MaxEncodedLen}; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; +use deal_with_fees::FeesToTreasury; +use encointer_balances_tx_payment::{AssetBalanceOf, AssetIdOf, BalanceToCommunityBalance}; +pub use encointer_primitives::{ + balances::{BalanceEntry, BalanceType, Demurrage}, + bazaar::{BusinessData, BusinessIdentifier, OfferingData}, + ceremonies::{AggregatedAccountData, CeremonyIndexType, CeremonyInfo, CommunityReputation}, + common::PalletString, + communities::{CommunityIdentifier, Location}, + scheduler::CeremonyPhaseType, +}; +use frame_support::{ + construct_runtime, + dispatch::DispatchClass, + parameter_types, + traits::{ + tokens::{pay::PayFromAccount, ConversionFromAssetBalance, ConversionToAssetBalance}, + ConstBool, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, + }, + weights::{ConstantMultiplier, Weight}, + PalletId, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; +pub use pallet_encointer_balances::Call as EncointerBalancesCall; +pub use pallet_encointer_bazaar::Call as EncointerBazaarCall; +pub use pallet_encointer_ceremonies::Call as EncointerCeremoniesCall; +pub use pallet_encointer_communities::Call as EncointerCommunitiesCall; +pub use pallet_encointer_faucet::Call as EncointerFaucetCall; +pub use pallet_encointer_reputation_commitments::Call as EncointerReputationCommitmentsCall; +pub use pallet_encointer_scheduler::Call as EncointerSchedulerCall; +use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; +pub use parachains_common as common; +use parachains_common::{ + kusama::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::*, fee::WeightToFee}, + AuraId, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, +}; +use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; +use sp_api::impl_runtime_apis; +use sp_core::{crypto::KeyTypeId, ConstU32, OpaqueMetadata}; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentityLookup, Verify}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, Perbill, Permill, RuntimeDebug, +}; +use sp_std::prelude::*; +#[cfg(feature = "std")] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; +use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; +use xcm::{ + latest::{BodyId, InteriorMultiLocation, Junction::PalletInstance}, + v3::AssetId as XcmAssetId, +}; + +use xcm_config::{KsmLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_executor::XcmExecutor; + +/// A type to hold UTC unix epoch [ms] +pub type Moment = u64; +pub const ONE_DAY: Moment = 86_400_000; + +/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included +/// into the relay chain. +const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; +/// How many parachain blocks are processed by the relay chain per parent. Limits the +/// number of blocks authored per slot. +const BLOCK_PROCESSING_VELOCITY: u32 = 1; +/// This determines the average expected block time that we are targeting. +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. +/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked +/// up by `pallet_aura` to implement `fn slot_duration()`. +/// +/// Change this to adjust the block time. +pub const MILLISECS_PER_BLOCK: u64 = 12000; +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + +pub type AssetId = AssetIdOf; +pub type AssetBalance = AssetBalanceOf; + +impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } +} + +/// This runtime version. +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("encointer-parachain"), + impl_name: create_runtime_str!("encointer-parachain"), + authoring_version: 1, + spec_version: 1_001_000, + impl_version: 1, + apis: RUNTIME_API_VERSIONS, + transaction_version: 3, + state_version: 0, +}; + +/// 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! { + // One storage item; key size 32, value size 8; . + pub const ProxyDepositBase: Balance = deposit(1, 40); + // Additional storage item size of 33 bytes. + pub const ProxyDepositFactor: Balance = deposit(0, 33); + pub const MaxProxies: u16 = 32; + // One storage item; key size 32, value size 16 + pub const AnnouncementDepositBase: Balance = deposit(1, 48); + pub const AnnouncementDepositFactor: Balance = deposit(0, 66); + pub const MaxPending: u16 = 32; +} + +/// The type used to represent the kinds of proxying allowed. +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + scale_info::TypeInfo, + MaxEncodedLen, +)] +pub enum ProxyType { + Any, + NonTransfer, + BazaarEdit, +} + +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::EncointerBalances { .. }), + ProxyType::BazaarEdit => matches!( + c, + RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) | + RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) | + RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) + ), + } + } + + fn is_superset(&self, o: &Self) -> bool { + match (self, o) { + (x, y) if x == y => true, + (ProxyType::Any, _) => true, + (_, ProxyType::Any) => false, + (ProxyType::NonTransfer, ProxyType::BazaarEdit) => 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 = MaxProxies; + type WeightInfo = weights::pallet_proxy::WeightInfo; + type MaxPending = MaxPending; + type CallHasher = BlakeTwo256; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; +} + +parameter_types! { + pub const Version: RuntimeVersion = VERSION; + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); + pub const SS58Prefix: u8 = 2; +} + +pub struct BaseFilter; +impl Contains for BaseFilter { + fn contains(_c: &RuntimeCall) -> bool { + true + } +} + +// Configure FRAME pallets to include in runtime. +impl frame_system::Config for Runtime { + type BaseCallFilter = BaseFilter; + // The block type. + type Block = generic::Block; + type BlockWeights = RuntimeBlockWeights; + type BlockLength = RuntimeBlockLength; + type AccountId = AccountId; + type RuntimeCall = RuntimeCall; + type Lookup = AccountIdLookup; + type Nonce = Nonce; + type Hash = Hash; + type Hashing = BlakeTwo256; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type BlockHashCount = BlockHashCount; + type DbWeight = RocksDbWeight; + type Version = Version; + type PalletInfo = PalletInfo; + type OnNewAccount = (); + type OnKilledAccount = (); + type AccountData = pallet_balances::AccountData; + type SystemWeightInfo = weights::frame_system::WeightInfo; + type SS58Prefix = SS58Prefix; + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} + +impl pallet_timestamp::Config for Runtime { + /// A timestamp: milliseconds since the unix epoch. + type Moment = Moment; + type OnTimestampSet = EncointerScheduler; + type MinimumPeriod = MinimumPeriod; + type WeightInfo = weights::pallet_timestamp::WeightInfo; +} + +parameter_types! { + pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + /// The type for recording an account's balance. + type Balance = Balance; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = weights::pallet_balances::WeightInfo; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type RuntimeHoldReason = (); + type RuntimeFreezeReason = RuntimeFreezeReason; + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; +} + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10, same as statemine + pub const TransactionByteFee: Balance = MILLICENTS; + pub const OperationalFeeMultiplier: u8 = 5; +} + +impl pallet_transaction_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // `FeesToTreasury is an encointer adaptation. + type OnChargeTransaction = + pallet_transaction_payment::CurrencyAdapter>; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = OperationalFeeMultiplier; +} + +pub const ENCOINTER_TREASURY_PALLET_ID: u8 = 43; + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: Balance = 100 * MILLICENTS; + pub const ProposalBondMaximum: Balance = 500 * CENTS; + pub const SpendPeriod: BlockNumber = 6 * DAYS; + pub const Burn: Permill = Permill::from_percent(1); + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const PayoutSpendPeriod: BlockNumber = 30 * DAYS; + // The asset's interior location for the paying account. This is the Treasury + // pallet instance (which sits at index 18). + pub TreasuryInteriorLocation: InteriorMultiLocation = PalletInstance(ENCOINTER_TREASURY_PALLET_ID).into(); + pub const MaxApprovals: u32 = 10; + pub TreasuryAccount: AccountId = Treasury::account_id(); +} + +pub struct NoConversion; +impl ConversionFromAssetBalance for NoConversion { + type Error = (); + fn from_asset_balance(balance: Balance, _asset_id: ()) -> Result { + return Ok(balance) + } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(_: ()) {} +} + +impl pallet_treasury::Config for Runtime { + type PalletId = TreasuryPalletId; + type Currency = pallet_balances::Pallet; + type ApproveOrigin = MoreThanHalfCouncil; + type RejectOrigin = MoreThanHalfCouncil; + type RuntimeEvent = RuntimeEvent; + type OnSlash = (); //No proposal + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type ProposalBondMaximum = ProposalBondMaximum; + type SpendPeriod = SpendPeriod; //Cannot be 0: Error: Thread 'tokio-runtime-worker' panicked at 'attempt to calculate the + // remainder with a divisor of zero + type Burn = (); //No burn + type BurnDestination = (); //No burn + type SpendFunds = (); //No spend, no bounty + type MaxApprovals = MaxApprovals; + type WeightInfo = weights::pallet_treasury::WeightInfo; + type SpendOrigin = frame_support::traits::NeverEnsureOrigin; //No spend, no bounty + type AssetKind = (); + type Beneficiary = AccountId; + type BeneficiaryLookup = IdentityLookup; + type Paymaster = PayFromAccount; + type BalanceConverter = NoConversion; + type PayoutPeriod = PayoutSpendPeriod; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); +} + +impl pallet_utility::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = weights::pallet_utility::WeightInfo; +} + +parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * + RuntimeBlockWeights::get().max_block; + pub const MaxScheduledPerBlock: u32 = 50; +} + +impl pallet_scheduler::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type PalletsOrigin = OriginCaller; + type RuntimeCall = RuntimeCall; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = MoreThanHalfCouncil; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = pallet_scheduler::weights::SubstrateWeight; + type OriginPrivilegeCmp = EqualPrivilegeOnly; + type Preimages = (); +} + +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type OutboundXcmpMessageSource = XcmpQueue; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, + >; +} + +impl pallet_insecure_randomness_collective_flip::Config for Runtime {} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + +parameter_types! { + pub const ExecutiveBody: BodyId = BodyId::Executive; + /// The asset ID for the asset that we use to pay for message delivery fees. + pub FeeAssetId: XcmAssetId = XcmAssetId::Concrete(xcm_config::KsmLocation::get()); + /// The base fee for the message delivery fees. + pub const ToSiblingBaseDeliveryFee: u128 = CENTS.saturating_mul(3); + pub const ToParentBaseDeliveryFee: u128 = CENTS.saturating_mul(3); +} + +pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< + FeeAssetId, + ToSiblingBaseDeliveryFee, + TransactionByteFee, + XcmpQueue, +>; + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = PolkadotXcm; + type ExecuteOverweightOrigin = EnsureRoot; + type ControllerOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, + >; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; + type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRoot; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; + pub const MaxAuthorities: u32 = 100_000; +} + +parameter_types! { + pub const MomentsPerDay: Moment = 86_400_000; // [ms/d] + pub const DefaultDemurrage: Demurrage = Demurrage::from_bits(0x0000000000000000000001E3F0A8A973_i128); + pub const EncointerExistentialDeposit: BalanceType = BalanceType::from_bits(0x0000000000000000000053e2d6238da4_u128); + pub const MeetupSizeTarget: u64 = 10; + pub const MeetupMinSize: u64 = 3; + pub const MeetupNewbieLimitDivider: u64 = 2; // 2 means 1/3 of participants may be newbies + pub const FaucetPalletId: PalletId = PalletId(*b"ectrfct0"); +} + +impl pallet_encointer_scheduler::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnCeremonyPhaseChange = EncointerCeremonies; + type MomentsPerDay = MomentsPerDay; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_scheduler::WeightInfo; +} + +impl pallet_encointer_ceremonies::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Public = ::Signer; + type Signature = Signature; + type RandomnessSource = RandomnessCollectiveFlip; + type MeetupSizeTarget = MeetupSizeTarget; + type MeetupMinSize = MeetupMinSize; + type MeetupNewbieLimitDivider = MeetupNewbieLimitDivider; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_ceremonies::WeightInfo; + type MaxAttestations = ConstU32<100>; +} + +impl pallet_encointer_communities::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CommunityMaster = MoreThanHalfCouncil; + type TrustableForNonDestructiveAction = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_communities::WeightInfo; + type MaxCommunityIdentifiers = ConstU32<10000>; + type MaxBootstrappers = ConstU32<10000>; + type MaxLocationsPerGeohash = ConstU32<10000>; + type MaxCommunityIdentifiersPerGeohash = ConstU32<10000>; +} + +impl pallet_encointer_balances::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type DefaultDemurrage = DefaultDemurrage; + type ExistentialDeposit = EncointerExistentialDeposit; + type CeremonyMaster = MoreThanHalfCouncil; + type WeightInfo = weights::pallet_encointer_balances::WeightInfo; +} + +impl pallet_encointer_bazaar::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_encointer_bazaar::WeightInfo; +} + +impl pallet_encointer_reputation_commitments::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_encointer_reputation_commitments::WeightInfo; +} + +impl pallet_encointer_faucet::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ControllerOrigin = EnsureRoot; + type Currency = Balances; + type PalletId = FaucetPalletId; + type WeightInfo = weights::pallet_encointer_faucet::WeightInfo; +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = ConstBool; + #[cfg(feature = "experimental")] + type SlotDuration = ConstU64; +} + +parameter_types! { + pub const CouncilMotionDuration: BlockNumber = 7 * DAYS; + pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; + pub MaxProposalWeight: Weight = sp_runtime::Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; +} + +type MoreThanHalfCouncil = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionMoreThan, +>; + +pub type CouncilCollective = pallet_collective::Instance1; +impl pallet_collective::Config for Runtime { + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type MotionDuration = CouncilMotionDuration; + type MaxProposals = CouncilMaxProposals; + type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxMembers = CouncilMaxMembers; + type WeightInfo = weights::pallet_collective::WeightInfo; + type SetMembersOrigin = MoreThanHalfCouncil; + type MaxProposalWeight = MaxProposalWeight; +} + +// support for collective pallet +impl pallet_membership::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type AddOrigin = MoreThanHalfCouncil; + type RemoveOrigin = MoreThanHalfCouncil; + type SwapOrigin = MoreThanHalfCouncil; + type ResetOrigin = MoreThanHalfCouncil; + type PrimeOrigin = MoreThanHalfCouncil; + type MembershipInitialized = Collective; + type MembershipChanged = Collective; + type MaxMembers = CouncilMaxMembers; + type WeightInfo = weights::pallet_membership::WeightInfo; +} + +// Allow fee payment in community currency +impl pallet_asset_tx_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Fungibles = pallet_encointer_balances::Pallet; + type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter< + encointer_balances_tx_payment::BalanceToCommunityBalance, + encointer_balances_tx_payment::BurnCredit, + >; +} + +construct_runtime! { + pub enum Runtime { + // System support stuff. + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + ParachainSystem: cumulus_pallet_parachain_system::{ + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + } = 1, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + + // Monetary stuff. + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + AssetTxPayment: pallet_asset_tx_payment::{Pallet, Storage, Event} = 12, + + Aura: pallet_aura::{Pallet, Storage, Config} = 23, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, + + // Handy utilities. + Utility: pallet_utility::{Pallet, Call, Event} = 40, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 43, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 44, + Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 48, + + // Encointer council. + Collective: pallet_collective::::{Pallet, Call, Storage, Origin, Config, Event } = 50, + Membership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 51, + + EncointerScheduler: pallet_encointer_scheduler::{Pallet, Call, Storage, Config, Event} = 60, + EncointerCeremonies: pallet_encointer_ceremonies::{Pallet, Call, Storage, Config, Event} = 61, + EncointerCommunities: pallet_encointer_communities::{Pallet, Call, Storage, Config, Event} = 62, + EncointerBalances: pallet_encointer_balances::{Pallet, Call, Storage, Config, Event} = 63, + EncointerBazaar: pallet_encointer_bazaar::{Pallet, Call, Storage, Event} = 64, + EncointerReputationCommitments: pallet_encointer_reputation_commitments::{Pallet, Call, Storage, Event} = 65, + EncointerFaucet: pallet_encointer_faucet::{Pallet, Call, Storage, Config, Event} = 66, + } +} + +/// `parachains_common` is an upstream crate, where they are started to define common types. +/// +/// The re-export is added by encointer. +pub use parachains_common::{AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature}; + +/// The address format for describing accounts. +pub type Address = sp_runtime::MultiAddress; +/// Block type as expected by this runtime. +pub type Block = generic::Block; +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; +/// 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, + pallet_asset_tx_payment::ChargeAssetTxPayment, +); +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// Migrations to apply on runtime upgrade. +pub type Migrations = ( + // fixing the scheduler with a local migration is necessary because we have missed intermediate + // migrations. the safest migration is, therefore, to clear all storage and bump StorageVersion + migrations_fix::scheduler::v4::MigrateToV4, + // also here we're actually too late with applying the migration. however, the migration does + // work as-is. + pallet_xcm::migration::v1::VersionUncheckedMigrateToV1, + // balances are more tricky. We missed to do the migration to V1 and now we have inconsistent + // state which can't be decoded to V0, yet the StorageVersion is V0. + // the strategy is to: just pretend we're on V1 + migrations_fix::balances::v1::BruteForceToV1, + // then reset to V0 + pallet_balances::migration::ResetInactive, + //then apply the proper migration as we should have done earlier + pallet_balances::migration::MigrateToTrackInactive, +); + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, + Migrations, +>; + +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_collective, Collective] + [pallet_membership, Membership] + [pallet_timestamp, Timestamp] + [pallet_treasury, Treasury] + [pallet_utility, Utility] + [pallet_proxy, Proxy] + [pallet_encointer_balances, EncointerBalances] + [pallet_encointer_bazaar, EncointerBazaar] + [pallet_encointer_ceremonies, EncointerCeremonies] + [pallet_encointer_communities, EncointerCommunities] + [pallet_encointer_faucet, EncointerFaucet] + [pallet_encointer_reputation_commitments, EncointerReputationCommitments] + [pallet_encointer_scheduler, EncointerScheduler] + [cumulus_pallet_xcmp_queue, XcmpQueue] + ); +} + +impl_runtime_apis! { + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) + } + + fn authorities() -> Vec { + Aura::authorities().into_inner() + } + } + + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block) + } + + fn initialize_block(header: &::Header) { + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + Executive::finalize_block() + } + + fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { + data.create_extrinsics() + } + + fn check_inherents( + block: Block, + data: sp_inherents::InherentData, + ) -> sp_inherents::CheckInherentsResult { + data.check_extrinsics(&block) + } + } + + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + tx: ::Extrinsic, + block_hash: ::Hash, + ) -> TransactionValidity { + Executive::validate_transaction(source, tx, block_hash) + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + Executive::offchain_worker(header) + } + } + + impl sp_session::SessionKeys for Runtime { + fn generate_session_keys(seed: Option>) -> Vec { + SessionKeys::generate(seed) + } + + fn decode_session_keys( + encoded: Vec, + ) -> Option, KeyTypeId)>> { + SessionKeys::decode_into_raw_public_keys(&encoded) + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { + System::account_nonce(account) + } + } + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { + fn query_info( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + + impl cumulus_primitives_core::CollectCollationInfo for Runtime { + fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { + ParachainSystem::collect_collation_info(header) + } + } + + impl pallet_encointer_ceremonies_rpc_runtime_api::CeremoniesApi for Runtime { + fn get_reputations(account: &AccountId) -> Vec<(CeremonyIndexType, CommunityReputation)> { + EncointerCeremonies::get_reputations(account) + } + fn get_aggregated_account_data(cid:CommunityIdentifier, account: &AccountId) -> AggregatedAccountData { + EncointerCeremonies::get_aggregated_account_data(cid, account) + } + fn get_ceremony_info() -> CeremonyInfo { + EncointerCeremonies::get_ceremony_info() + } + } + + impl pallet_encointer_communities_rpc_runtime_api::CommunitiesApi for Runtime { + fn get_all_balances(account: &AccountId) -> Vec<(CommunityIdentifier, BalanceEntry)> { + EncointerCommunities::get_all_balances(account) + } + + fn get_cids() -> Vec { + EncointerCommunities::get_cids() + } + + fn get_name(cid: &CommunityIdentifier) -> Option { + EncointerCommunities::get_name(cid) + } + + fn get_locations(cid: &CommunityIdentifier) -> Vec { + EncointerCommunities::get_locations(cid) + } + } + + impl pallet_encointer_bazaar_rpc_runtime_api::BazaarApi for Runtime { + fn get_offerings(business: &BusinessIdentifier) -> Vec{ + EncointerBazaar::get_offerings(business) + } + + fn get_businesses(community: &CommunityIdentifier) -> Vec<(AccountId, BusinessData)>{ + EncointerBazaar::get_businesses(community) + } + } + + impl encointer_balances_tx_payment_rpc_runtime_api::BalancesTxPaymentApi for Runtime { + fn balance_to_asset_balance(amount: Balance, asset_id: AssetId) -> Result { + BalanceToCommunityBalance::::to_asset_balance(amount, asset_id).map_err(|_e| + encointer_balances_tx_payment_rpc_runtime_api::Error::RuntimeError + ) + } + } + + #[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 { + // 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).expect("execute-block failed") + } + } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn benchmark_metadata(extra: bool) -> ( + Vec, + Vec, + ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; + use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + + let mut list = Vec::::new(); + list_benchmarks!(list, extra); + + let storage_info = AllPalletsWithSystem::storage_info(); + return (list, storage_info) + } + + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; + + use frame_system_benchmarking::Pallet as SystemBench; + impl frame_system_benchmarking::Config for Runtime {} + + let whitelist: Vec = vec![ + // Block Number + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), + // Total Issuance + hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), + // Execution Phase + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), + // Event Count + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), + // System Events + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + // Treasury Account + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec().into(), + ]; + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + add_benchmarks!(params, batches); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } +} + +cumulus_pallet_parachain_system::register_validate_block! { + Runtime = Runtime, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, +} + +#[cfg(test)] +mod multiplier_tests { + use super::*; + use frame_support::pallet_prelude::PalletInfoAccess; + + #[test] + fn treasury_pallet_index_is_correct() { + assert_eq!(ENCOINTER_TREASURY_PALLET_ID, ::index() as u8); + } +} diff --git a/system-parachains/encointer/src/migrations_fix.rs b/system-parachains/encointer/src/migrations_fix.rs new file mode 100644 index 0000000000..5b8de3611b --- /dev/null +++ b/system-parachains/encointer/src/migrations_fix.rs @@ -0,0 +1,190 @@ +// Copyright (c) 2023 Encointer Association +// This file is part of Encointer +// +// Encointer 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. +// +// Encointer 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 Encointer. If not, see . + +// the following are temporary local migration fixes to solve inconsistencies caused by not +// migrating Storage at the time of migrating runtime code + +pub mod balances { + use frame_support::traits::OnRuntimeUpgrade; + use pallet_balances::*; + #[cfg(feature = "try-runtime")] + use sp_runtime::TryRuntimeError; + use sp_std::vec::Vec; + + /// The log target. + const TARGET: &'static str = "runtime::fix::balances::migration"; + pub mod v1 { + use super::*; + use frame_support::pallet_prelude::*; + pub struct BruteForceToV1(sp_std::marker::PhantomData); + + impl OnRuntimeUpgrade for BruteForceToV1 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + Ok(().encode()) + } + + fn on_runtime_upgrade() -> Weight { + let onchain_version = Pallet::::on_chain_storage_version(); + if onchain_version >= 1 { + log::warn!( + target: TARGET, + "skipping bruteforce to v1 migration: executed on wrong storage version." + ); + return T::DbWeight::get().reads(1) + } + log::info!(target: TARGET, "bruteforcing from {:?} to 1", onchain_version); + StorageVersion::new(1).put::>(); + + T::DbWeight::get().reads_writes(1, 1) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + ensure!(StorageVersion::get::>() == 1, "Must upgrade"); + Ok(()) + } + } + } +} +pub mod scheduler { + // this is necessary because migrations from v0 to v3 are no longer available in the scheduler + // pallet code and migrating is only possible from v3. The strategy here is to empty the agenda + // (has been empty since genesis) + use frame_support::traits::OnRuntimeUpgrade; + use frame_system::pallet_prelude::BlockNumberFor; + use pallet_scheduler::*; + use sp_std::vec::Vec; + + #[cfg(feature = "try-runtime")] + use sp_runtime::TryRuntimeError; + + /// The log target. + const TARGET: &'static str = "runtime::fix::scheduler::migration"; + + pub mod v1 { + use super::*; + use frame_support::{pallet_prelude::*, traits::schedule}; + + #[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))] + #[derive(Clone, RuntimeDebug, Encode, Decode)] + pub(crate) struct ScheduledV1 { + maybe_id: Option>, + priority: schedule::Priority, + call: Call, + maybe_periodic: Option>, + } + + #[frame_support::storage_alias] + pub(crate) type Agenda = StorageMap< + Pallet, + Twox64Concat, + BlockNumberFor, + Vec::RuntimeCall, BlockNumberFor>>>, + ValueQuery, + >; + + #[frame_support::storage_alias] + pub(crate) type Lookup = + StorageMap, Twox64Concat, Vec, TaskAddress>>; + } + + pub mod v3 { + use super::*; + use frame_support::pallet_prelude::*; + + #[frame_support::storage_alias] + pub(crate) type Agenda = StorageMap< + Pallet, + Twox64Concat, + BlockNumberFor, + Vec>>, + ValueQuery, + >; + + #[frame_support::storage_alias] + pub(crate) type Lookup = + StorageMap, Twox64Concat, Vec, TaskAddress>>; + } + + pub mod v4 { + use super::*; + use frame_support::pallet_prelude::*; + + #[frame_support::storage_alias] + pub type Agenda = StorageMap< + Pallet, + Twox64Concat, + BlockNumberFor, + BoundedVec< + Option>, + ::MaxScheduledPerBlock, + >, + ValueQuery, + >; + + pub(crate) type TaskName = [u8; 32]; + + #[frame_support::storage_alias] + pub(crate) type Lookup = + StorageMap, Twox64Concat, TaskName, TaskAddress>>; + + /// Migrate the scheduler pallet from V0 to V4 by brute-force emptying the agenda. + pub struct MigrateToV4(sp_std::marker::PhantomData); + + impl OnRuntimeUpgrade for MigrateToV4 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + let agendas = v1::Agenda::::iter_keys().count() as u32; + let lookups = v1::Lookup::::iter_keys().count() as u32; + log::info!(target: TARGET, "agendas present which will be dropped: {}/{}...", agendas, lookups); + Ok((agendas, lookups).encode()) + } + + fn on_runtime_upgrade() -> Weight { + let onchain_version = Pallet::::on_chain_storage_version(); + if onchain_version >= 3 { + log::warn!( + target: TARGET, + "skipping v0 to v4 migration: executed on wrong storage version.\ + Expected version < 3, found {:?}", + onchain_version, + ); + return T::DbWeight::get().reads(1) + } + log::info!(target: TARGET, "migrating from {:?} to 4", onchain_version); + let purged_agendas = v1::Agenda::::clear(u32::MAX, None).unique as u64; + let purged_lookups = v1::Lookup::::clear(u32::MAX, None).unique as u64; + StorageVersion::new(4).put::>(); + + T::DbWeight::get() + .reads_writes(purged_agendas + purged_lookups, purged_agendas + purged_lookups) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + ensure!(StorageVersion::get::>() == 4, "Must upgrade"); + + let agendas = Agenda::::iter_keys().count() as u32; + ensure!(agendas == 0, "agenda must be empty after now"); + let lookups = Lookup::::iter_keys().count() as u32; + ensure!(lookups == 0, "agenda must be empty after now"); + + Ok(()) + } + } + } +} diff --git a/system-parachains/encointer/src/weights/block_weights.rs b/system-parachains/encointer/src/weights/block_weights.rs new file mode 100644 index 0000000000..e7fdb2aae2 --- /dev/null +++ b/system-parachains/encointer/src/weights/block_weights.rs @@ -0,0 +1,53 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, Weight}, + }; + + parameter_types! { + /// Importing a block with 0 Extrinsics. + pub const BlockExecutionWeight: Weight = + Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000), 0); + } + + #[cfg(test)] + mod test_weights { + use frame_support::weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::constants::BlockExecutionWeight::get(); + + // At least 100 µs. + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 100 µs." + ); + // At most 50 ms. + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 50 ms." + ); + } + } +} diff --git a/system-parachains/encointer/src/weights/cumulus_pallet_xcmp_queue.rs b/system-parachains/encointer/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 0000000000..f10766cb91 --- /dev/null +++ b/system-parachains/encointer/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,59 @@ + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/cumulus_pallet_xcmp_queue.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_xcmp_queue`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { + /// Storage: XcmpQueue QueueConfig (r:1 w:1) + /// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured) + fn set_config_with_u32() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `1527` + // Minimum execution time: 4_338_000 picoseconds. + Weight::from_parts(4_474_000, 0) + .saturating_add(Weight::from_parts(0, 1527)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: XcmpQueue QueueConfig (r:1 w:1) + /// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured) + fn set_config_with_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `1527` + // Minimum execution time: 4_285_000 picoseconds. + Weight::from_parts(4_439_000, 0) + .saturating_add(Weight::from_parts(0, 1527)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/extrinsic_weights.rs b/system-parachains/encointer/src/weights/extrinsic_weights.rs new file mode 100644 index 0000000000..1a4adb968b --- /dev/null +++ b/system-parachains/encointer/src/weights/extrinsic_weights.rs @@ -0,0 +1,53 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, Weight}, + }; + + parameter_types! { + /// Executing a NO-OP `System::remarks` Extrinsic. + pub const ExtrinsicBaseWeight: Weight = + Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); + } + + #[cfg(test)] + mod test_weights { + use frame_support::weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::constants::ExtrinsicBaseWeight::get(); + + // At least 10 µs. + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 10 µs." + ); + // At most 1 ms. + assert!( + w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 1 ms." + ); + } + } +} diff --git a/system-parachains/encointer/src/weights/frame_system.rs b/system-parachains/encointer/src/weights/frame_system.rs new file mode 100644 index 0000000000..ee7995b4ac --- /dev/null +++ b/system-parachains/encointer/src/weights/frame_system.rs @@ -0,0 +1,150 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. 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-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `a3dce7bd4066`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("spec-asset-hub-kusama.json")`, DB CACHE: 1024 + +// Executed Command: +// /builds/polkadot-sdk/target/production/polkadot-parachain +// benchmark +// pallet +// --chain=spec-asset-hub-kusama.json +// --pallet=frame_system +// --extrinsic= +// --output=/builds/runtimes/system-parachains/asset-hubs/asset-hub-kusama/src/weights +// --header=/builds/bench/header.txt +// --no-median-slopes +// --no-min-squares + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `frame_system`. +pub struct WeightInfo(PhantomData); +impl frame_system::WeightInfo for WeightInfo { + /// The range of component `b` is `[0, 3932160]`. + fn remark(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_815_000 picoseconds. + Weight::from_parts(1_241_063, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 0 + .saturating_add(Weight::from_parts(387, 0).saturating_mul(b.into())) + } + /// The range of component `b` is `[0, 3932160]`. + fn remark_with_event(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_962_000 picoseconds. + Weight::from_parts(128_782_669, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 10 + .saturating_add(Weight::from_parts(1_587, 0).saturating_mul(b.into())) + } + /// Storage: `System::Digest` (r:1 w:1) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) + /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) + fn set_heap_pages() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `1485` + // Minimum execution time: 3_517_000 picoseconds. + Weight::from_parts(3_750_000, 0) + .saturating_add(Weight::from_parts(0, 1485)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0) + /// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1) + /// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1) + /// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1) + /// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn set_code() -> Weight { + // Proof Size summary in bytes: + // Measured: `164` + // Estimated: `1649` + // Minimum execution time: 97_863_204_000 picoseconds. + Weight::from_parts(101_385_669_000, 0) + .saturating_add(Weight::from_parts(0, 1649)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// 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_919_000 picoseconds. + Weight::from_parts(2_055_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 2_130 + .saturating_add(Weight::from_parts(718_734, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// 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_943_000 picoseconds. + Weight::from_parts(2_123_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 931 + .saturating_add(Weight::from_parts(541_111, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `p` is `[0, 1000]`. + fn kill_prefix(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `83 + p * (69 ±0)` + // Estimated: `86 + p * (70 ±0)` + // Minimum execution time: 3_533_000 picoseconds. + Weight::from_parts(3_617_000, 0) + .saturating_add(Weight::from_parts(0, 86)) + // Standard Error: 1_337 + .saturating_add(Weight::from_parts(1_236_860, 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())) + } +} diff --git a/system-parachains/encointer/src/weights/mod.rs b/system-parachains/encointer/src/weights/mod.rs new file mode 100644 index 0000000000..b0f75efdc0 --- /dev/null +++ b/system-parachains/encointer/src/weights/mod.rs @@ -0,0 +1,45 @@ +// Copyright (c) 2019 Alain Brenzikofer +// This file is part of Encointer +// +// Encointer 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. +// +// Encointer 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 Encointer. If not, see . + +//! The weights used in the encointer-parachain-runtime + +// the generated files do not pass clippy +#![allow(clippy::all)] + +pub mod block_weights; +pub mod cumulus_pallet_xcmp_queue; +pub mod extrinsic_weights; +pub mod frame_system; +pub mod pallet_balances; +pub mod pallet_collective; +pub mod pallet_encointer_balances; +pub mod pallet_encointer_bazaar; +pub mod pallet_encointer_ceremonies; +pub mod pallet_encointer_communities; +pub mod pallet_encointer_faucet; +pub mod pallet_encointer_reputation_commitments; +pub mod pallet_encointer_scheduler; +pub mod pallet_membership; +pub mod pallet_proxy; +pub mod pallet_timestamp; +pub mod pallet_treasury; +pub mod pallet_utility; +pub mod paritydb_weights; +pub mod rocksdb_weights; + +pub use block_weights::constants::BlockExecutionWeight; +pub use extrinsic_weights::constants::ExtrinsicBaseWeight; +pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/system-parachains/encointer/src/weights/pallet_balances.rs b/system-parachains/encointer/src/weights/pallet_balances.rs new file mode 100644 index 0000000000..449621b5aa --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_balances.rs @@ -0,0 +1,135 @@ + +//! Autogenerated weights for `pallet_balances` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_balances +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_balances.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_balances`. +pub struct WeightInfo(PhantomData); +impl pallet_balances::WeightInfo for WeightInfo { + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_allow_death() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 51_062_000 picoseconds. + Weight::from_parts(52_242_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_keep_alive() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 38_442_000 picoseconds. + Weight::from_parts(38_796_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn force_set_balance_creating() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `3593` + // Minimum execution time: 12_980_000 picoseconds. + Weight::from_parts(13_172_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn force_set_balance_killing() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `3593` + // Minimum execution time: 19_468_000 picoseconds. + Weight::from_parts(19_763_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn force_transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 51_765_000 picoseconds. + Weight::from_parts(52_610_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 47_586_000 picoseconds. + Weight::from_parts(48_295_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn force_unreserve() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `3593` + // Minimum execution time: 15_891_000 picoseconds. + Weight::from_parts(16_204_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: System Account (r:999 w:999) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `u` is `[1, 1000]`. + fn upgrade_accounts(u: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + u * (135 ±0)` + // Estimated: `990 + u * (2603 ±0)` + // Minimum execution time: 15_647_000 picoseconds. + Weight::from_parts(15_952_000, 0) + .saturating_add(Weight::from_parts(0, 990)) + // Standard Error: 99_031 + .saturating_add(Weight::from_parts(15_553_741, 0).saturating_mul(u.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) + .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_collective.rs b/system-parachains/encointer/src/weights/pallet_collective.rs new file mode 100644 index 0000000000..2587a89de3 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_collective.rs @@ -0,0 +1,287 @@ + +//! Autogenerated weights for `pallet_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_collective +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_collective.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_collective::WeightInfo for WeightInfo { + /// Storage: Collective Members (r:1 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Voting (r:100 w:100) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + /// The range of component `p` is `[0, 100]`. + fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` + // Estimated: `15728 + m * (1967 ±24) + p * (4332 ±24)` + // Minimum execution time: 12_612_000 picoseconds. + Weight::from_parts(12_817_000, 0) + .saturating_add(Weight::from_parts(0, 15728)) + // Standard Error: 54_992 + .saturating_add(Weight::from_parts(4_313_092, 0).saturating_mul(m.into())) + // Standard Error: 54_992 + .saturating_add(Weight::from_parts(6_586_060, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) + } + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `69 + m * (32 ±0)` + // Estimated: `1555 + m * (32 ±0)` + // Minimum execution time: 13_615_000 picoseconds. + Weight::from_parts(13_294_322, 0) + .saturating_add(Weight::from_parts(0, 1555)) + // Standard Error: 24 + .saturating_add(Weight::from_parts(1_137, 0).saturating_mul(b.into())) + // Standard Error: 250 + .saturating_add(Weight::from_parts(9_446, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:1 w:0) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[1, 100]`. + fn propose_execute(b: u32, m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `69 + m * (32 ±0)` + // Estimated: `3535 + m * (32 ±0)` + // Minimum execution time: 16_050_000 picoseconds. + Weight::from_parts(15_173_364, 0) + .saturating_add(Weight::from_parts(0, 3535)) + // Standard Error: 43 + .saturating_add(Weight::from_parts(1_403, 0).saturating_mul(b.into())) + // Standard Error: 453 + .saturating_add(Weight::from_parts(18_210, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:1 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalCount (r:1 w:1) + /// Proof Skipped: Collective ProposalCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Voting (r:0 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[2, 100]`. + /// The range of component `p` is `[1, 100]`. + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `359 + m * (32 ±0) + p * (36 ±0)` + // Estimated: `3751 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 22_203_000 picoseconds. + Weight::from_parts(22_610_277, 0) + .saturating_add(Weight::from_parts(0, 3751)) + // Standard Error: 95 + .saturating_add(Weight::from_parts(2_707, 0).saturating_mul(b.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_parts(23_109, 0).saturating_mul(m.into())) + // Standard Error: 988 + .saturating_add(Weight::from_parts(189_590, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Voting (r:1 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[5, 100]`. + fn vote(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `808 + m * (64 ±0)` + // Estimated: `4272 + m * (64 ±0)` + // Minimum execution time: 22_632_000 picoseconds. + Weight::from_parts(23_889_147, 0) + .saturating_add(Weight::from_parts(0, 4272)) + // Standard Error: 1_170 + .saturating_add(Weight::from_parts(34_147, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Collective Voting (r:1 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:0 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `397 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3842 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 25_176_000 picoseconds. + Weight::from_parts(26_526_585, 0) + .saturating_add(Weight::from_parts(0, 3842)) + // Standard Error: 1_143 + .saturating_add(Weight::from_parts(19_843, 0).saturating_mul(m.into())) + // Standard Error: 1_114 + .saturating_add(Weight::from_parts(185_128, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Collective Voting (r:1 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:1 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `699 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4016 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 35_905_000 picoseconds. + Weight::from_parts(37_097_894, 0) + .saturating_add(Weight::from_parts(0, 4016)) + // Standard Error: 155 + .saturating_add(Weight::from_parts(2_460, 0).saturating_mul(b.into())) + // Standard Error: 1_638 + .saturating_add(Weight::from_parts(25_075, 0).saturating_mul(m.into())) + // Standard Error: 1_597 + .saturating_add(Weight::from_parts(220_820, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Collective Voting (r:1 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:1 w:0) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:0 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_disapproved(m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417 + m * (64 ±0) + p * (36 ±0)` + // Estimated: `3862 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 27_232_000 picoseconds. + Weight::from_parts(28_648_248, 0) + .saturating_add(Weight::from_parts(0, 3862)) + // Standard Error: 921 + .saturating_add(Weight::from_parts(27_951, 0).saturating_mul(m.into())) + // Standard Error: 898 + .saturating_add(Weight::from_parts(183_334, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) + } + /// Storage: Collective Voting (r:1 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Members (r:1 w:0) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:1 w:0) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:1 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `b` is `[2, 1024]`. + /// The range of component `m` is `[4, 100]`. + /// The range of component `p` is `[1, 100]`. + fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `719 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` + // Estimated: `4036 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 37_906_000 picoseconds. + Weight::from_parts(41_399_461, 0) + .saturating_add(Weight::from_parts(0, 4036)) + // Standard Error: 124 + .saturating_add(Weight::from_parts(1_721, 0).saturating_mul(b.into())) + // Standard Error: 1_311 + .saturating_add(Weight::from_parts(22_182, 0).saturating_mul(m.into())) + // Standard Error: 1_278 + .saturating_add(Weight::from_parts(214_365, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) + } + /// Storage: Collective Proposals (r:1 w:1) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Voting (r:0 w:1) + /// Proof Skipped: Collective Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: Collective ProposalOf (r:0 w:1) + /// Proof Skipped: Collective ProposalOf (max_values: None, max_size: None, mode: Measured) + /// The range of component `p` is `[1, 100]`. + fn disapprove_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `226 + p * (32 ±0)` + // Estimated: `1711 + p * (32 ±0)` + // Minimum execution time: 13_796_000 picoseconds. + Weight::from_parts(15_669_737, 0) + .saturating_add(Weight::from_parts(0, 1711)) + // Standard Error: 1_075 + .saturating_add(Weight::from_parts(172_017, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_balances.rs b/system-parachains/encointer/src/weights/pallet_encointer_balances.rs new file mode 100644 index 0000000000..e8c813ba4c --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_balances.rs @@ -0,0 +1,72 @@ + +//! Autogenerated weights for `pallet_encointer_balances` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_balances +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_balances.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_balances`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_balances::WeightInfo for WeightInfo { + /// Storage: EncointerBalances Balance (r:2 w:2) + /// Proof: EncointerBalances Balance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `235` + // Estimated: `6126` + // Minimum execution time: 83_473_000 picoseconds. + Weight::from_parts(84_889_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: EncointerBalances Balance (r:2 w:2) + /// Proof: EncointerBalances Balance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `235` + // Estimated: `6196` + // Minimum execution time: 117_542_000 picoseconds. + Weight::from_parts(119_322_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + fn set_fee_conversion_factor() -> Weight { + Weight::from_parts(6_000_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_bazaar.rs b/system-parachains/encointer/src/weights/pallet_encointer_bazaar.rs new file mode 100644 index 0000000000..2bbab53783 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_bazaar.rs @@ -0,0 +1,111 @@ + +//! Autogenerated weights for `pallet_encointer_bazaar` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_bazaar +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_bazaar.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_bazaar`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_bazaar::WeightInfo for WeightInfo { + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerBazaar BusinessRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar BusinessRegistry (max_values: None, max_size: None, mode: Measured) + fn create_business() -> Weight { + // Proof Size summary in bytes: + // Measured: `263` + // Estimated: `91487` + // Minimum execution time: 28_826_000 picoseconds. + Weight::from_parts(31_307_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerBazaar BusinessRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar BusinessRegistry (max_values: None, max_size: None, mode: Measured) + fn update_business() -> Weight { + // Proof Size summary in bytes: + // Measured: `162` + // Estimated: `3627` + // Minimum execution time: 24_215_000 picoseconds. + Weight::from_parts(26_309_000, 0) + .saturating_add(Weight::from_parts(0, 3627)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerBazaar BusinessRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar BusinessRegistry (max_values: None, max_size: None, mode: Measured) + fn delete_business() -> Weight { + // Proof Size summary in bytes: + // Measured: `162` + // Estimated: `3627` + // Minimum execution time: 27_141_000 picoseconds. + Weight::from_parts(28_669_000, 0) + .saturating_add(Weight::from_parts(0, 3627)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerBazaar BusinessRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar BusinessRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerBazaar OfferingRegistry (r:0 w:1) + /// Proof Skipped: EncointerBazaar OfferingRegistry (max_values: None, max_size: None, mode: Measured) + fn create_offering() -> Weight { + // Proof Size summary in bytes: + // Measured: `162` + // Estimated: `3627` + // Minimum execution time: 29_322_000 picoseconds. + Weight::from_parts(30_740_000, 0) + .saturating_add(Weight::from_parts(0, 3627)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: EncointerBazaar OfferingRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar OfferingRegistry (max_values: None, max_size: None, mode: Measured) + fn update_offering() -> Weight { + // Proof Size summary in bytes: + // Measured: `196` + // Estimated: `3661` + // Minimum execution time: 21_668_000 picoseconds. + Weight::from_parts(22_897_000, 0) + .saturating_add(Weight::from_parts(0, 3661)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerBazaar OfferingRegistry (r:1 w:1) + /// Proof Skipped: EncointerBazaar OfferingRegistry (max_values: None, max_size: None, mode: Measured) + fn delete_offering() -> Weight { + // Proof Size summary in bytes: + // Measured: `196` + // Estimated: `3661` + // Minimum execution time: 19_727_000 picoseconds. + Weight::from_parts(20_387_000, 0) + .saturating_add(Weight::from_parts(0, 3661)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_ceremonies.rs b/system-parachains/encointer/src/weights/pallet_encointer_ceremonies.rs new file mode 100644 index 0000000000..94370b838c --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_ceremonies.rs @@ -0,0 +1,401 @@ + +//! Autogenerated weights for `pallet_encointer_ceremonies` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_ceremonies +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_ceremonies.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_ceremonies`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_ceremonies::WeightInfo for WeightInfo { + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseeIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies EndorseeIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies NewbieIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputationLifetime (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:2) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCommunities Bootstrappers (r:1 w:0) + /// Proof: EncointerCommunities Bootstrappers (max_values: None, max_size: Some(320027), added: 322502, mode: MaxEncodedLen) + /// Storage: EncointerBalances TotalIssuance (r:1 w:0) + /// Proof: EncointerBalances TotalIssuance (max_values: None, max_size: Some(45), added: 2520, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ReputableCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableRegistry (r:0 w:1) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + fn register_participant() -> Weight { + // Proof Size summary in bytes: + // Measured: `862` + // Estimated: `323492` + // Minimum execution time: 141_377_000 picoseconds. + Weight::from_parts(150_107_000, 0) + .saturating_add(Weight::from_parts(0, 323492)) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseeIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies EndorseeIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieRegistry (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputationLifetime (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:2) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCommunities Bootstrappers (r:1 w:0) + /// Proof: EncointerCommunities Bootstrappers (max_values: None, max_size: Some(320027), added: 322502, mode: MaxEncodedLen) + /// Storage: EncointerBalances TotalIssuance (r:1 w:0) + /// Proof: EncointerBalances TotalIssuance (max_values: None, max_size: Some(45), added: 2520, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ReputableCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableRegistry (r:0 w:1) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + fn upgrade_registration() -> Weight { + // Proof Size summary in bytes: + // Measured: `1140` + // Estimated: `323492` + // Minimum execution time: 170_801_000 picoseconds. + Weight::from_parts(177_027_000, 0) + .saturating_add(Weight::from_parts(0, 323492)) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(8)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputationLifetime (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:2) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableRegistry (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + fn unregister_participant() -> Weight { + // Proof Size summary in bytes: + // Measured: `943` + // Estimated: `91487` + // Minimum execution time: 62_897_000 picoseconds. + Weight::from_parts(65_129_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies MeetupCount (r:1 w:0) + /// Proof Skipped: EncointerCeremonies MeetupCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AssignmentCounts (r:1 w:0) + /// Proof Skipped: EncointerCeremonies AssignmentCounts (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies Assignments (r:1 w:0) + /// Proof Skipped: EncointerCeremonies Assignments (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableRegistry (r:8 w:0) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieRegistry (r:2 w:0) + /// Proof Skipped: EncointerCeremonies NewbieRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCommunities Locations (r:2 w:0) + /// Proof: EncointerCommunities Locations (max_values: None, max_size: Some(320032), added: 322507, mode: MaxEncodedLen) + /// Storage: EncointerScheduler PhaseDurations (r:1 w:0) + /// Proof: EncointerScheduler PhaseDurations (max_values: None, max_size: Some(25), added: 2500, mode: MaxEncodedLen) + /// Storage: EncointerScheduler NextPhaseTimestamp (r:1 w:0) + /// Proof: EncointerScheduler NextPhaseTimestamp (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies MeetupTimeOffset (r:1 w:0) + /// Proof Skipped: EncointerCeremonies MeetupTimeOffset (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies AttestationCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies AttestationIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies MeetupParticipantCountVote (r:0 w:1) + /// Proof Skipped: EncointerCeremonies MeetupParticipantCountVote (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationRegistry (r:0 w:1) + /// Proof Skipped: EncointerCeremonies AttestationRegistry (max_values: None, max_size: None, mode: Measured) + fn attest_attendees() -> Weight { + // Proof Size summary in bytes: + // Measured: `2137` + // Estimated: `646004` + // Minimum execution time: 123_019_000 picoseconds. + Weight::from_parts(126_476_000, 0) + .saturating_add(Weight::from_parts(0, 646004)) + .saturating_add(T::DbWeight::get().reads(25)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ReputationLifetime (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies Endorsees (r:2 w:1) + /// Proof Skipped: EncointerCeremonies Endorsees (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ParticipantReputation (r:2 w:0) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies BurnedReputableNewbieTickets (r:1 w:1) + /// Proof Skipped: EncointerCeremonies BurnedReputableNewbieTickets (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorsementTicketsPerReputable (r:1 w:0) + /// Proof Skipped: EncointerCeremonies EndorsementTicketsPerReputable (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseeCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies EndorseeCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseeIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies EndorseeIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieCount (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieRegistry (r:1 w:1) + /// Proof Skipped: EncointerCeremonies NewbieRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCommunities Bootstrappers (r:1 w:0) + /// Proof: EncointerCommunities Bootstrappers (max_values: None, max_size: Some(320027), added: 322502, mode: MaxEncodedLen) + /// Storage: EncointerBalances TotalIssuance (r:1 w:0) + /// Proof: EncointerBalances TotalIssuance (max_values: None, max_size: Some(45), added: 2520, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies EndorseeRegistry (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorseeRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseesCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorseesCount (max_values: None, max_size: None, mode: Measured) + fn endorse_newcomer() -> Weight { + // Proof Size summary in bytes: + // Measured: `1130` + // Estimated: `323492` + // Minimum execution time: 116_739_000 picoseconds. + Weight::from_parts(119_393_000, 0) + .saturating_add(Weight::from_parts(0, 323492)) + .saturating_add(T::DbWeight::get().reads(20)) + .saturating_add(T::DbWeight::get().writes(9)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies MeetupCount (r:1 w:0) + /// Proof Skipped: EncointerCeremonies MeetupCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AssignmentCounts (r:1 w:0) + /// Proof Skipped: EncointerCeremonies AssignmentCounts (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies Assignments (r:1 w:0) + /// Proof Skipped: EncointerCeremonies Assignments (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies BootstrapperIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies BootstrapperIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies IssuedRewards (r:1 w:1) + /// Proof Skipped: EncointerCeremonies IssuedRewards (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableRegistry (r:8 w:0) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieRegistry (r:2 w:0) + /// Proof Skipped: EncointerCeremonies NewbieRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationIndex (r:10 w:0) + /// Proof Skipped: EncointerCeremonies AttestationIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationRegistry (r:10 w:0) + /// Proof Skipped: EncointerCeremonies AttestationRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies MeetupParticipantCountVote (r:10 w:0) + /// Proof Skipped: EncointerCeremonies MeetupParticipantCountVote (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCommunities NominalIncome (r:1 w:0) + /// Proof: EncointerCommunities NominalIncome (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies CeremonyReward (r:1 w:0) + /// Proof Skipped: EncointerCeremonies CeremonyReward (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EncointerBalances Balance (r:10 w:10) + /// Proof: EncointerBalances Balance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:1 w:0) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerBalances TotalIssuance (r:1 w:1) + /// Proof: EncointerBalances TotalIssuance (max_values: None, max_size: Some(45), added: 2520, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ParticipantReputation (r:0 w:10) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + fn claim_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `7649` + // Estimated: `33389` + // Minimum execution time: 441_163_000 picoseconds. + Weight::from_parts(455_147_000, 0) + .saturating_add(Weight::from_parts(0, 33389)) + .saturating_add(T::DbWeight::get().reads(62)) + .saturating_add(T::DbWeight::get().writes(22)) + } + /// Storage: EncointerCeremonies InactivityTimeout (r:0 w:1) + /// Proof Skipped: EncointerCeremonies InactivityTimeout (max_values: Some(1), max_size: None, mode: Measured) + fn set_inactivity_timeout() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_151_000 picoseconds. + Weight::from_parts(8_366_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies MeetupTimeOffset (r:0 w:1) + /// Proof Skipped: EncointerCeremonies MeetupTimeOffset (max_values: Some(1), max_size: None, mode: Measured) + fn set_meetup_time_offset() -> Weight { + // Proof Size summary in bytes: + // Measured: `73` + // Estimated: `1486` + // Minimum execution time: 10_374_000 picoseconds. + Weight::from_parts(10_844_000, 0) + .saturating_add(Weight::from_parts(0, 1486)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies ReputationLifetime (r:0 w:1) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + fn set_reputation_lifetime() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_514_000 picoseconds. + Weight::from_parts(8_789_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies EndorsementTicketsPerBootstrapper (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorsementTicketsPerBootstrapper (max_values: Some(1), max_size: None, mode: Measured) + fn set_endorsement_tickets_per_bootstrapper() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_173_000 picoseconds. + Weight::from_parts(8_489_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies EndorsementTicketsPerReputable (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorsementTicketsPerReputable (max_values: Some(1), max_size: None, mode: Measured) + fn set_endorsement_tickets_per_reputable() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_431_000 picoseconds. + Weight::from_parts(8_612_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies TimeTolerance (r:0 w:1) + /// Proof Skipped: EncointerCeremonies TimeTolerance (max_values: Some(1), max_size: None, mode: Measured) + fn set_time_tolerance() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_506_000 picoseconds. + Weight::from_parts(8_655_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies LocationTolerance (r:0 w:1) + /// Proof Skipped: EncointerCeremonies LocationTolerance (max_values: Some(1), max_size: None, mode: Measured) + fn set_location_tolerance() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_300_000 picoseconds. + Weight::from_parts(8_793_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCeremonies ReputableRegistry (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableRegistry (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableIndex (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ReputableIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:1) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies Assignments (r:0 w:1) + /// Proof Skipped: EncointerCeremonies Assignments (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies MeetupCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies MeetupCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies NewbieCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies NewbieCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies ReputableCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies ReputableCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AssignmentCounts (r:0 w:1) + /// Proof Skipped: EncointerCeremonies AssignmentCounts (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies BootstrapperCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies BootstrapperCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies AttestationCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies AttestationCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseeCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorseeCount (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerCeremonies EndorseesCount (r:0 w:1) + /// Proof Skipped: EncointerCeremonies EndorseesCount (max_values: None, max_size: None, mode: Measured) + fn purge_community_ceremony() -> Weight { + // Proof Size summary in bytes: + // Measured: `641` + // Estimated: `4106` + // Minimum execution time: 74_214_000 picoseconds. + Weight::from_parts(76_621_000, 0) + .saturating_add(Weight::from_parts(0, 4106)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(12)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_communities.rs b/system-parachains/encointer/src/weights/pallet_encointer_communities.rs new file mode 100644 index 0000000000..da64e97970 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_communities.rs @@ -0,0 +1,187 @@ + +//! Autogenerated weights for `pallet_encointer_communities` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_communities +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_communities.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_communities`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_communities::WeightInfo for WeightInfo { + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:1) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities MaxSpeedMps (r:1 w:0) + /// Proof: EncointerCommunities MaxSpeedMps (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCommunities MinSolarTripTimeS (r:1 w:0) + /// Proof: EncointerCommunities MinSolarTripTimeS (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiersByGeohash (r:1 w:1) + /// Proof: EncointerCommunities CommunityIdentifiersByGeohash (max_values: None, max_size: Some(90007), added: 92482, mode: MaxEncodedLen) + /// Storage: EncointerCommunities Locations (r:1 w:1) + /// Proof: EncointerCommunities Locations (max_values: None, max_size: Some(320032), added: 322507, mode: MaxEncodedLen) + /// Storage: EncointerCommunities NominalIncome (r:0 w:1) + /// Proof: EncointerCommunities NominalIncome (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityMetadata (r:0 w:1) + /// Proof: EncointerCommunities CommunityMetadata (max_values: None, max_size: Some(1352), added: 3827, mode: MaxEncodedLen) + /// Storage: EncointerCommunities Bootstrappers (r:0 w:1) + /// Proof: EncointerCommunities Bootstrappers (max_values: None, max_size: Some(320027), added: 322502, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:0 w:1) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + fn new_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `6448` + // Estimated: `323497` + // Minimum execution time: 5_643_876_000 picoseconds. + Weight::from_parts(5_676_264_000, 0) + .saturating_add(Weight::from_parts(0, 323497)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities MaxSpeedMps (r:1 w:0) + /// Proof: EncointerCommunities MaxSpeedMps (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCommunities MinSolarTripTimeS (r:1 w:0) + /// Proof: EncointerCommunities MinSolarTripTimeS (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiersByGeohash (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiersByGeohash (max_values: None, max_size: Some(90007), added: 92482, mode: MaxEncodedLen) + /// Storage: EncointerCommunities Locations (r:1 w:1) + /// Proof: EncointerCommunities Locations (max_values: None, max_size: Some(320032), added: 322507, mode: MaxEncodedLen) + fn add_location() -> Weight { + // Proof Size summary in bytes: + // Measured: `6521` + // Estimated: `323497` + // Minimum execution time: 5_627_080_000 picoseconds. + Weight::from_parts(5_682_831_000, 0) + .saturating_add(Weight::from_parts(0, 323497)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerScheduler CurrentPhase (r:1 w:0) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities Locations (r:1 w:1) + /// Proof: EncointerCommunities Locations (max_values: None, max_size: Some(320032), added: 322507, mode: MaxEncodedLen) + fn remove_location() -> Weight { + // Proof Size summary in bytes: + // Measured: `6500` + // Estimated: `323497` + // Minimum execution time: 37_629_000 picoseconds. + Weight::from_parts(39_837_000, 0) + .saturating_add(Weight::from_parts(0, 323497)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityMetadata (r:0 w:1) + /// Proof: EncointerCommunities CommunityMetadata (max_values: None, max_size: Some(1352), added: 3827, mode: MaxEncodedLen) + fn update_community_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `221` + // Estimated: `91487` + // Minimum execution time: 16_765_000 picoseconds. + Weight::from_parts(17_226_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerBalances DemurragePerBlock (r:0 w:1) + /// Proof: EncointerBalances DemurragePerBlock (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + fn update_demurrage() -> Weight { + // Proof Size summary in bytes: + // Measured: `221` + // Estimated: `91487` + // Minimum execution time: 14_259_000 picoseconds. + Weight::from_parts(14_985_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities NominalIncome (r:0 w:1) + /// Proof: EncointerCommunities NominalIncome (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + fn update_nominal_income() -> Weight { + // Proof Size summary in bytes: + // Measured: `221` + // Estimated: `91487` + // Minimum execution time: 14_959_000 picoseconds. + Weight::from_parts(15_675_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities MinSolarTripTimeS (r:0 w:1) + /// Proof: EncointerCommunities MinSolarTripTimeS (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_min_solar_trip_time_s() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_071_000 picoseconds. + Weight::from_parts(8_746_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities MaxSpeedMps (r:0 w:1) + /// Proof: EncointerCommunities MaxSpeedMps (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_max_speed_mps() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_080_000 picoseconds. + Weight::from_parts(8_636_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerCommunities Locations (r:2 w:1) + /// Proof: EncointerCommunities Locations (max_values: None, max_size: Some(320032), added: 322507, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiersByGeohash (r:1 w:1) + /// Proof: EncointerCommunities CommunityIdentifiersByGeohash (max_values: None, max_size: Some(90007), added: 92482, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:1) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerCommunities NominalIncome (r:0 w:1) + /// Proof: EncointerCommunities NominalIncome (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) + /// Storage: EncointerCommunities CommunityMetadata (r:0 w:1) + /// Proof: EncointerCommunities CommunityMetadata (max_values: None, max_size: Some(1352), added: 3827, mode: MaxEncodedLen) + /// Storage: EncointerCommunities Bootstrappers (r:0 w:1) + /// Proof: EncointerCommunities Bootstrappers (max_values: None, max_size: Some(320027), added: 322502, mode: MaxEncodedLen) + fn purge_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `482` + // Estimated: `646004` + // Minimum execution time: 45_935_000 picoseconds. + Weight::from_parts(47_790_000, 0) + .saturating_add(Weight::from_parts(0, 646004)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_faucet.rs b/system-parachains/encointer/src/weights/pallet_encointer_faucet.rs new file mode 100644 index 0000000000..1567e28046 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_faucet.rs @@ -0,0 +1,122 @@ + +//! Autogenerated weights for `pallet_encointer_faucet` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_faucet +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_faucet.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_faucet`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_faucet::WeightInfo for WeightInfo { + /// Storage: EncointerCommunities CommunityIdentifiers (r:1 w:0) + /// Proof: EncointerCommunities CommunityIdentifiers (max_values: Some(1), max_size: Some(90002), added: 90497, mode: MaxEncodedLen) + /// Storage: EncointerFaucet Faucets (r:1 w:1) + /// Proof: EncointerFaucet Faucets (max_values: None, max_size: Some(9373), added: 11848, mode: MaxEncodedLen) + /// Storage: EncointerFaucet ReserveAmount (r:1 w:0) + /// Proof: EncointerFaucet ReserveAmount (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Balances Reserves (r:1 w:1) + /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: EncointerReputationCommitments CurrentPurposeId (r:1 w:1) + /// Proof: EncointerReputationCommitments CurrentPurposeId (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerReputationCommitments Purposes (r:0 w:1) + /// Proof: EncointerReputationCommitments Purposes (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + fn create_faucet() -> Weight { + // Proof Size summary in bytes: + // Measured: `371` + // Estimated: `91487` + // Minimum execution time: 94_701_000 picoseconds. + Weight::from_parts(97_700_000, 0) + .saturating_add(Weight::from_parts(0, 91487)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: EncointerFaucet Faucets (r:1 w:0) + /// Proof: EncointerFaucet Faucets (max_values: None, max_size: Some(9373), added: 11848, mode: MaxEncodedLen) + /// Storage: EncointerReputationCommitments Purposes (r:1 w:0) + /// Proof: EncointerReputationCommitments Purposes (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerReputationCommitments Commitments (r:1 w:1) + /// Proof: EncointerReputationCommitments Commitments (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn drip() -> Weight { + // Proof Size summary in bytes: + // Measured: `680` + // Estimated: `12838` + // Minimum execution time: 72_829_000 picoseconds. + Weight::from_parts(76_945_000, 0) + .saturating_add(Weight::from_parts(0, 12838)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: EncointerFaucet Faucets (r:1 w:1) + /// Proof: EncointerFaucet Faucets (max_values: None, max_size: Some(9373), added: 11848, mode: MaxEncodedLen) + /// Storage: Balances Reserves (r:1 w:1) + /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: System Account (r:3 w:3) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn dissolve_faucet() -> Weight { + // Proof Size summary in bytes: + // Measured: `507` + // Estimated: `12838` + // Minimum execution time: 78_329_000 picoseconds. + Weight::from_parts(80_171_000, 0) + .saturating_add(Weight::from_parts(0, 12838)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: EncointerFaucet Faucets (r:1 w:1) + /// Proof: EncointerFaucet Faucets (max_values: None, max_size: Some(9373), added: 11848, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Reserves (r:1 w:1) + /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + fn close_faucet() -> Weight { + // Proof Size summary in bytes: + // Measured: `507` + // Estimated: `12838` + // Minimum execution time: 72_776_000 picoseconds. + Weight::from_parts(74_301_000, 0) + .saturating_add(Weight::from_parts(0, 12838)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: EncointerFaucet ReserveAmount (r:0 w:1) + /// Proof: EncointerFaucet ReserveAmount (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + fn set_reserve_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_612_000 picoseconds. + Weight::from_parts(8_143_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_reputation_commitments.rs b/system-parachains/encointer/src/weights/pallet_encointer_reputation_commitments.rs new file mode 100644 index 0000000000..c85a0c5395 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_reputation_commitments.rs @@ -0,0 +1,65 @@ + +//! Autogenerated weights for `pallet_encointer_reputation_commitments` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_reputation_commitments +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_reputation_commitments.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_reputation_commitments`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_reputation_commitments::WeightInfo for WeightInfo { + /// Storage: EncointerReputationCommitments CurrentPurposeId (r:1 w:1) + /// Proof: EncointerReputationCommitments CurrentPurposeId (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerReputationCommitments Purposes (r:0 w:1) + /// Proof: EncointerReputationCommitments Purposes (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + fn register_purpose() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1493` + // Minimum execution time: 21_094_000 picoseconds. + Weight::from_parts(22_125_000, 0) + .saturating_add(Weight::from_parts(0, 1493)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: EncointerReputationCommitments Purposes (r:1 w:0) + /// Proof: EncointerReputationCommitments Purposes (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ParticipantReputation (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ParticipantReputation (max_values: None, max_size: None, mode: Measured) + /// Storage: EncointerReputationCommitments Commitments (r:1 w:1) + /// Proof: EncointerReputationCommitments Commitments (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + fn commit_reputation() -> Weight { + // Proof Size summary in bytes: + // Measured: `329` + // Estimated: `3794` + // Minimum execution time: 36_854_000 picoseconds. + Weight::from_parts(39_205_000, 0) + .saturating_add(Weight::from_parts(0, 3794)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_encointer_scheduler.rs b/system-parachains/encointer/src/weights/pallet_encointer_scheduler.rs new file mode 100644 index 0000000000..8fc6dd741e --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_encointer_scheduler.rs @@ -0,0 +1,91 @@ + +//! Autogenerated weights for `pallet_encointer_scheduler` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_encointer_scheduler +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_encointer_scheduler.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_encointer_scheduler`. +pub struct WeightInfo(PhantomData); +impl pallet_encointer_scheduler::WeightInfo for WeightInfo { + /// Storage: EncointerScheduler CurrentPhase (r:1 w:1) + /// Proof: EncointerScheduler CurrentPhase (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:1) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerScheduler NextPhaseTimestamp (r:1 w:1) + /// Proof: EncointerScheduler NextPhaseTimestamp (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerScheduler PhaseDurations (r:3 w:0) + /// Proof: EncointerScheduler PhaseDurations (max_values: None, max_size: Some(25), added: 2500, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerCeremonies ReputationLifetime (r:1 w:0) + /// Proof Skipped: EncointerCeremonies ReputationLifetime (max_values: Some(1), max_size: None, mode: Measured) + fn next_phase() -> Weight { + // Proof Size summary in bytes: + // Measured: `409` + // Estimated: `8490` + // Minimum execution time: 61_397_000 picoseconds. + Weight::from_parts(63_823_000, 0) + .saturating_add(Weight::from_parts(0, 8490)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: EncointerScheduler NextPhaseTimestamp (r:1 w:1) + /// Proof: EncointerScheduler NextPhaseTimestamp (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn push_by_one_day() -> Weight { + // Proof Size summary in bytes: + // Measured: `73` + // Estimated: `1493` + // Minimum execution time: 14_946_000 picoseconds. + Weight::from_parts(15_438_000, 0) + .saturating_add(Weight::from_parts(0, 1493)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerScheduler PhaseDurations (r:0 w:1) + /// Proof: EncointerScheduler PhaseDurations (max_values: None, max_size: Some(25), added: 2500, mode: MaxEncodedLen) + fn set_phase_duration() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_814_000 picoseconds. + Weight::from_parts(6_076_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: EncointerScheduler NextPhaseTimestamp (r:0 w:1) + /// Proof: EncointerScheduler NextPhaseTimestamp (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn set_next_phase_timestamp() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_283_000 picoseconds. + Weight::from_parts(4_476_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_membership.rs b/system-parachains/encointer/src/weights/pallet_membership.rs new file mode 100644 index 0000000000..844851fda8 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_membership.rs @@ -0,0 +1,185 @@ + +//! Autogenerated weights for `pallet_membership` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_membership +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_membership.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_membership`. +pub struct WeightInfo(PhantomData); +impl pallet_membership::WeightInfo for WeightInfo { + /// Storage: Membership Members (r:1 w:1) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Members (r:0 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 99]`. + fn add_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `102 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 16_503_000 picoseconds. + Weight::from_parts(22_233_968, 0) + .saturating_add(Weight::from_parts(0, 4687)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Membership Members (r:1 w:1) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Membership Prime (r:1 w:0) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Members (r:0 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn remove_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `206 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 16_035_000 picoseconds. + Weight::from_parts(16_899_394, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 569 + .saturating_add(Weight::from_parts(26_212, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Membership Members (r:1 w:1) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Membership Prime (r:1 w:0) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Members (r:0 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[2, 100]`. + fn swap_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `206 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 15_874_000 picoseconds. + Weight::from_parts(16_897_269, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 463 + .saturating_add(Weight::from_parts(37_531, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Membership Members (r:1 w:1) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Membership Prime (r:1 w:0) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Members (r:0 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn reset_member(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `206 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 15_407_000 picoseconds. + Weight::from_parts(17_311_131, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 892 + .saturating_add(Weight::from_parts(118_312, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Membership Members (r:1 w:1) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Collective Proposals (r:1 w:0) + /// Proof Skipped: Collective Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Membership Prime (r:1 w:1) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Members (r:0 w:1) + /// Proof Skipped: Collective Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn change_key(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `206 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 16_110_000 picoseconds. + Weight::from_parts(17_298_112, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 705 + .saturating_add(Weight::from_parts(37_102, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + } + /// Storage: Membership Members (r:1 w:0) + /// Proof: Membership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) + /// Storage: Membership Prime (r:0 w:1) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn set_prime(m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `32 + m * (32 ±0)` + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 5_906_000 picoseconds. + Weight::from_parts(6_230_458, 0) + .saturating_add(Weight::from_parts(0, 4687)) + // Standard Error: 230 + .saturating_add(Weight::from_parts(7_792, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + } + /// Storage: Membership Prime (r:0 w:1) + /// Proof: Membership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Collective Prime (r:0 w:1) + /// Proof Skipped: Collective Prime (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `m` is `[1, 100]`. + fn clear_prime(_m: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_695_000 picoseconds. + Weight::from_parts(2_946_268, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_proxy.rs b/system-parachains/encointer/src/weights/pallet_proxy.rs new file mode 100644 index 0000000000..c28ce0c236 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_proxy.rs @@ -0,0 +1,208 @@ + +//! Autogenerated weights for `pallet_proxy` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_proxy +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_proxy.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_proxy`. +pub struct WeightInfo(PhantomData); +impl pallet_proxy::WeightInfo for WeightInfo { + /// Storage: Proxy Proxies (r:1 w:0) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 31]`. + fn proxy(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `127 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 12_149_000 picoseconds. + Weight::from_parts(12_734_566, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 1_902 + .saturating_add(Weight::from_parts(28_028, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: Proxy Proxies (r:1 w:0) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// Storage: Proxy Announcements (r:1 w:1) + /// Proof: Proxy Announcements (max_values: None, max_size: Some(2233), added: 4708, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn proxy_announced(a: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 31_507_000 picoseconds. + Weight::from_parts(31_594_293, 0) + .saturating_add(Weight::from_parts(0, 5698)) + // Standard Error: 4_810 + .saturating_add(Weight::from_parts(180_418, 0).saturating_mul(a.into())) + // Standard Error: 4_969 + .saturating_add(Weight::from_parts(39_603, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Proxy Announcements (r:1 w:1) + /// Proof: Proxy Announcements (max_values: None, max_size: Some(2233), added: 4708, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn remove_announcement(a: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `332 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 20_284_000 picoseconds. + Weight::from_parts(20_722_105, 0) + .saturating_add(Weight::from_parts(0, 5698)) + // Standard Error: 2_298 + .saturating_add(Weight::from_parts(169_410, 0).saturating_mul(a.into())) + // Standard Error: 2_374 + .saturating_add(Weight::from_parts(10_908, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Proxy Announcements (r:1 w:1) + /// Proof: Proxy Announcements (max_values: None, max_size: Some(2233), added: 4708, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn reject_announcement(a: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `332 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 20_140_000 picoseconds. + Weight::from_parts(20_848_925, 0) + .saturating_add(Weight::from_parts(0, 5698)) + // Standard Error: 1_778 + .saturating_add(Weight::from_parts(165_375, 0).saturating_mul(a.into())) + // Standard Error: 1_838 + .saturating_add(Weight::from_parts(5_838, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Proxy Proxies (r:1 w:0) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// Storage: Proxy Announcements (r:1 w:1) + /// Proof: Proxy Announcements (max_values: None, max_size: Some(2233), added: 4708, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[0, 31]`. + /// The range of component `p` is `[1, 31]`. + fn announce(a: u32, p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `349 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 28_744_000 picoseconds. + Weight::from_parts(29_073_555, 0) + .saturating_add(Weight::from_parts(0, 5698)) + // Standard Error: 3_689 + .saturating_add(Weight::from_parts(157_914, 0).saturating_mul(a.into())) + // Standard Error: 3_812 + .saturating_add(Weight::from_parts(17_443, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Proxy Proxies (r:1 w:1) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 31]`. + fn add_proxy(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `127 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 21_558_000 picoseconds. + Weight::from_parts(22_491_797, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 4_992 + .saturating_add(Weight::from_parts(46_402, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Proxy Proxies (r:1 w:1) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 31]`. + fn remove_proxy(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `127 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 21_541_000 picoseconds. + Weight::from_parts(22_387_406, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 4_158 + .saturating_add(Weight::from_parts(53_564, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Proxy Proxies (r:1 w:1) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 31]`. + fn remove_proxies(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `127 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 18_742_000 picoseconds. + Weight::from_parts(19_693_746, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 2_662 + .saturating_add(Weight::from_parts(21_173, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Proxy Proxies (r:1 w:1) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[1, 31]`. + fn create_pure(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `4706` + // Minimum execution time: 23_280_000 picoseconds. + Weight::from_parts(23_905_541, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 1_045 + .saturating_add(Weight::from_parts(16_212, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Proxy Proxies (r:1 w:1) + /// Proof: Proxy Proxies (max_values: None, max_size: Some(1241), added: 3716, mode: MaxEncodedLen) + /// The range of component `p` is `[0, 30]`. + fn kill_pure(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `164 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 19_541_000 picoseconds. + Weight::from_parts(20_085_014, 0) + .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 3_921 + .saturating_add(Weight::from_parts(58_923, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_timestamp.rs b/system-parachains/encointer/src/weights/pallet_timestamp.rs new file mode 100644 index 0000000000..81a5511734 --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_timestamp.rs @@ -0,0 +1,61 @@ + +//! Autogenerated weights for `pallet_timestamp` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_timestamp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_timestamp.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_timestamp`. +pub struct WeightInfo(PhantomData); +impl pallet_timestamp::WeightInfo for WeightInfo { + /// Storage: Timestamp Now (r:1 w:1) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerScheduler NextPhaseTimestamp (r:1 w:1) + /// Proof: EncointerScheduler NextPhaseTimestamp (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: EncointerScheduler CurrentCeremonyIndex (r:1 w:0) + /// Proof: EncointerScheduler CurrentCeremonyIndex (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EncointerScheduler PhaseDurations (r:3 w:0) + /// Proof: EncointerScheduler PhaseDurations (max_values: None, max_size: Some(25), added: 2500, mode: MaxEncodedLen) + fn set() -> Weight { + // Proof Size summary in bytes: + // Measured: `201` + // Estimated: `8490` + // Minimum execution time: 37_112_000 picoseconds. + Weight::from_parts(38_652_000, 0) + .saturating_add(Weight::from_parts(0, 8490)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + fn on_finalize() -> Weight { + // Proof Size summary in bytes: + // Measured: `94` + // Estimated: `0` + // Minimum execution time: 5_720_000 picoseconds. + Weight::from_parts(6_127_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_treasury.rs b/system-parachains/encointer/src/weights/pallet_treasury.rs new file mode 100644 index 0000000000..52b59a25cd --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_treasury.rs @@ -0,0 +1,211 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Autogenerated weights for `pallet_treasury` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `a3dce7bd4066`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("spec-kusama.json")`, DB CACHE: 1024 + +// Executed Command: +// /builds/polkadot-sdk/target/production/polkadot +// benchmark +// pallet +// --chain=spec-kusama.json +// --pallet=pallet_treasury +// --extrinsic= +// --output=/builds/runtimes/relay/kusama/src/weights +// --header=/builds/bench/header.txt +// --no-median-slopes +// --no-min-squares + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_treasury`. +pub struct WeightInfo(PhantomData); +impl pallet_treasury::WeightInfo for WeightInfo { + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn spend_local() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1887` + // Minimum execution time: 7_563_000 picoseconds. + Weight::from_parts(7_868_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn propose_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `107` + // Estimated: `1489` + // Minimum execution time: 16_827_000 picoseconds. + Weight::from_parts(17_262_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Proposals` (r:1 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reject_proposal() -> Weight { + // Proof Size summary in bytes: + // Measured: `265` + // Estimated: `3593` + // Minimum execution time: 25_789_000 picoseconds. + Weight::from_parts(26_398_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Proposals` (r:1 w:0) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. + fn approve_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `433 + p * (8 ±0)` + // Estimated: `3573` + // Minimum execution time: 5_353_000 picoseconds. + Weight::from_parts(8_423_989, 0) + .saturating_add(Weight::from_parts(0, 3573)) + // Standard Error: 1_120 + .saturating_add(Weight::from_parts(45_883, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + fn remove_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `90` + // Estimated: `1887` + // Minimum execution time: 4_075_000 picoseconds. + Weight::from_parts(4_286_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Treasury::Deactivated` (r:1 w:1) + /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:99 w:99) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:199 w:199) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. + fn on_initialize_proposals(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `294 + p * (251 ±0)` + // Estimated: `3593 + p * (5206 ±0)` + // Minimum execution time: 34_895_000 picoseconds. + Weight::from_parts(40_046_318, 0) + .saturating_add(Weight::from_parts(0, 3593)) + // Standard Error: 6_188 + .saturating_add(Weight::from_parts(25_772_314, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into())) + } + /// Storage: `Treasury::SpendCount` (r:1 w:1) + /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Spends` (r:0 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1489` + // Minimum execution time: 8_598_000 picoseconds. + Weight::from_parts(8_937_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) + /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) + /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::Queries` (r:0 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `251` + // Estimated: `5318` + // Minimum execution time: 29_981_000 picoseconds. + Weight::from_parts(30_787_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::Queries` (r:1 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `5318` + // Minimum execution time: 15_985_000 picoseconds. + Weight::from_parts(16_431_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn void_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `5318` + // Minimum execution time: 8_515_000 picoseconds. + Weight::from_parts(8_795_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/encointer/src/weights/pallet_utility.rs b/system-parachains/encointer/src/weights/pallet_utility.rs new file mode 100644 index 0000000000..879b30c82c --- /dev/null +++ b/system-parachains/encointer/src/weights/pallet_utility.rs @@ -0,0 +1,84 @@ + +//! Autogenerated weights for `pallet_utility` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `caribe`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("encointer-rococo-local-dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/encointer-collator +// benchmark +// pallet +// --chain=encointer-rococo-local-dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_utility +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=polkadot-parachains/encointer-runtime/src/weights/pallet_utility.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_utility`. +pub struct WeightInfo(PhantomData); +impl pallet_utility::WeightInfo for WeightInfo { + /// 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: 10_709_000 picoseconds. + Weight::from_parts(94_666_060, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 7_075 + .saturating_add(Weight::from_parts(4_763_921, 0).saturating_mul(c.into())) + } + fn as_derivative() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_625_000 picoseconds. + Weight::from_parts(4_855_000, 0) + .saturating_add(Weight::from_parts(0, 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: 6_014_000 picoseconds. + Weight::from_parts(10_865_846, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 4_092 + .saturating_add(Weight::from_parts(5_138_384, 0).saturating_mul(c.into())) + } + fn dispatch_as() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_101_000 picoseconds. + Weight::from_parts(8_401_000, 0) + .saturating_add(Weight::from_parts(0, 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_996_000 picoseconds. + Weight::from_parts(4_430_678, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 2_835 + .saturating_add(Weight::from_parts(4_874_052, 0).saturating_mul(c.into())) + } +} diff --git a/system-parachains/encointer/src/weights/paritydb_weights.rs b/system-parachains/encointer/src/weights/paritydb_weights.rs new file mode 100644 index 0000000000..2567970383 --- /dev/null +++ b/system-parachains/encointer/src/weights/paritydb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights + /// are available for brave runtime engineers who may want to try this out as default. + pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::ParityDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/system-parachains/encointer/src/weights/rocksdb_weights.rs b/system-parachains/encointer/src/weights/rocksdb_weights.rs new file mode 100644 index 0000000000..3dd817aa6f --- /dev/null +++ b/system-parachains/encointer/src/weights/rocksdb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout + /// the runtime. + pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::RocksDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs new file mode 100644 index 0000000000..0a1b57b07b --- /dev/null +++ b/system-parachains/encointer/src/xcm_config.rs @@ -0,0 +1,237 @@ +// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Almost identical to ../asset-hubs/asset-hub-kusama + +use super::{ + AccountId, Balances, FeesToTreasury, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, +}; +use frame_support::{ + match_types, parameter_types, + traits::{Everything, Nothing}, + weights::Weight, +}; +use frame_system::EnsureRoot; +use pallet_xcm::XcmPassthrough; +use parachains_common::xcm_config::ConcreteAssetFromSystem; +use polkadot_parachain_primitives::primitives::Sibling; + +use sp_core::ConstU32; + +use xcm::latest::prelude::*; +use xcm_builder::{ + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + DenyReserveTransferToRelayChain, DenyThenTry, DescribeTerminus, EnsureXcmOrigin, + FixedWeightBounds, HashedDescription, IsConcrete, NativeAsset, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, +}; +use xcm_executor::XcmExecutor; + +parameter_types! { + pub const KsmLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Kusama; + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); +} + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the parent `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, + // Here/local root location to `AccountId`. + HashedDescription, +); + +/// Means for transacting the native currency on this chain. +pub type CurrencyTransactor = CurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports of `Balances`. + (), +>; + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when + // recognised. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognised. + SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 0); + pub const MaxInstructions: u32 = 100; +} + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; +} + +pub type Barrier = TrailingSetTopicAsId< + DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + >, +>; +pub struct SafeCallFilter; +impl frame_support::traits::Contains for SafeCallFilter { + fn contains(_call: &RuntimeCall) -> bool { + // This is safe, as we prevent arbitrary xcm-transact executions. + // For rationale, see:https://github.com/paritytech/polkadot/blob/19fdd197aff085f7f66e54942999fd536e7df475/runtime/kusama/src/xcm_config.rs#L171 + true + } +} + +parameter_types! { + pub const MaxAssetsIntoHolding: u32 = 64; + pub const RelayLocation: MultiLocation = MultiLocation::parent(); +} +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = XcmRouter; + type AssetTransactor = CurrencyTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = NativeAsset; + /// Only allow teleportation of KSM with other system locations. + type IsTeleporter = ConcreteAssetFromSystem; + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + // `FeesToTreasury` is an encointer adaptation + type Trader = + UsingComponents>; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; + type PalletInstancesInfo = crate::AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = SafeCallFilter; + type Aliasers = Nothing; +} + +/// Converts a local signed origin into an XCM multilocation. +/// Forms the basis for local origins sending/executing XCMs. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} + +impl pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // We want to disallow users sending (arbitrary) XCMs from this chain. + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + // We support local origins dispatching XCM executions in principle... + type ExecuteXcmOrigin = EnsureXcmOrigin; + // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are + // allowed. + type XcmExecuteFilter = Nothing; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; + type UniversalLocation = UniversalLocation; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +}