diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee16301e1d50e2fbfa9825806c7663e47fdd09f9..1f6419deccb52bd46de702b57f48b4abadf7c427 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,10 +79,8 @@ fmt_and_clippy: - cargo clippy --features runtime-benchmarks --all --tests -- -D warnings run_benchmarks: + extends: .env stage: tests - script: - - echo podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS . - - podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS . rules: - <<: *is_network_branch when: never @@ -92,13 +90,11 @@ run_benchmarks: when: never - if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"' - when: manual - variables: - IMAGE_NAME: "duniter/duniter-v2s-test" - IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA" - PODMAN_BUILD_OPTIONS: "--target build --build-arg benchmarks=1" - tags: - - podman - + script: + - cargo build --release --features runtime-benchmarks + - target/release/duniter benchmark storage --chain=dev --mul=2 --state-version=1 + - target/release/duniter benchmark overhead --chain=dev --wasm-execution=compiled --warmup=1 --repeat=100 + - target/release/duniter benchmark pallet --chain=dev --steps=5 --repeat=2 --pallet="*" --extrinsic="*" --wasm-execution=compiled # FIXME: "gtest_build" gdev_build: stage: build diff --git a/Cargo.lock b/Cargo.lock index b941ea064dd411f0008dc99bf7e863a2ce32ceef..ca7234185d83d9a9f5fe26418a3f294274f2ce04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.4.4", "cpufeatures", ] @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.12", "once_cell", @@ -84,11 +84,11 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getrandom 0.2.12", "once_cell", "version_check", @@ -131,7 +131,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -150,9 +150,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -194,7 +194,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] @@ -298,7 +298,7 @@ dependencies = [ "derivative", "hashbrown 0.13.2", "itertools 0.10.5", - "num-traits 0.2.17", + "num-traits 0.2.18", "rayon", "zeroize", ] @@ -367,7 +367,7 @@ dependencies = [ "digest 0.10.7", "itertools 0.10.5", "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.18", "paste", "rustc_version", "zeroize", @@ -390,7 +390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.18", "proc-macro2", "quote", "syn 1.0.109", @@ -480,8 +480,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ - "num-traits 0.2.17", - "rand 0.8.5", + "num-traits 0.2.18", + "rand", "rayon", ] @@ -553,7 +553,7 @@ dependencies = [ "asn1-rs-impl", "displaydoc", "nom", - "num-traits 0.2.17", + "num-traits 0.2.18", "rusticata-macros", "thiserror", "time", @@ -601,13 +601,13 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 4.0.3", - "event-listener-strategy", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite 0.2.13", ] @@ -628,9 +628,9 @@ dependencies = [ [[package]] name = "async-fs" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1f344136bad34df1f83a47f3fd7f2ab85d75cb8a940af4ccf6d482a84ea01b" +checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" dependencies = [ "async-lock 3.3.0", "blocking", @@ -644,7 +644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ "async-lock 3.3.0", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "futures-io", "futures-lite", @@ -672,7 +672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy", + "event-listener-strategy 0.4.0", "pin-project-lite 0.2.13", ] @@ -693,12 +693,12 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c1cd5d253ecac3d3cf15e390fd96bd92a13b1d14497d81abf077304794fb04" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-io", "async-lock 3.3.0", "async-signal", "blocking", - "cfg-if 1.0.0", + "cfg-if", "event-listener 4.0.3", "futures-lite", "rustix 0.38.31", @@ -714,7 +714,7 @@ dependencies = [ "async-io", "async-lock 2.8.0", "atomic-waker", - "cfg-if 1.0.0", + "cfg-if", "futures-core", "futures-io", "rustix 0.38.31", @@ -765,17 +765,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi 0.3.9", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -790,7 +779,7 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line 0.21.0", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object 0.32.2", @@ -811,7 +800,7 @@ dependencies = [ "dleq_vrf", "fflonk", "merlin 3.0.0", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", "ring 0.1.0", "sha2 0.10.8", @@ -850,12 +839,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64ct" version = "1.6.0" @@ -908,7 +891,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", - "rand 0.8.5", + "rand", "rand_core 0.6.4", "serde", "unicode-normalization", @@ -1021,7 +1004,7 @@ dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq 0.3.0", ] @@ -1070,7 +1053,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-lock 3.3.0", "async-task", "fastrand", @@ -1152,9 +1135,9 @@ checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" [[package]] name = "byteorder" @@ -1200,9 +1183,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -1242,19 +1225,13 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.6" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" dependencies = [ "smallvec", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -1283,7 +1260,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.4.4", "cpufeatures", ] @@ -1303,27 +1280,18 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits 0.2.17", + "num-traits 0.2.18", "wasm-bindgen", "windows-targets 0.52.0", ] -[[package]] -name = "ci_info" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f638c70e8c5753795cc9a8c07c44da91554a09e4cf11a7326e8161b0a3c45e" -dependencies = [ - "envmnt", -] - [[package]] name = "cid" version = "0.9.0" @@ -1370,71 +1338,41 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive 3.2.25", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "once_cell", - "strsim", - "termcolor", - "textwrap 0.16.0", -] - -[[package]] -name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", - "clap_derive 4.4.7", + "clap_derive", ] [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim", + "clap_lex", + "strsim 0.11.0", "terminal_size", ] [[package]] name = "clap_complete" -version = "4.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb745187d7f4d76267b37485a65e0149edd0e91a4cfcdd3f27524ad86cee9f3" -dependencies = [ - "clap 4.4.18", -] - -[[package]] -name = "clap_derive" -version = "3.2.25" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "299353be8209bd133b049bf1c63582d184a8b39fd9c04f15fe65f50f88bdfe6c" dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "clap", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -1444,18 +1382,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cmake" @@ -1482,16 +1411,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - [[package]] name = "combine" version = "3.8.1" @@ -1529,7 +1448,7 @@ dependencies = [ "fflonk", "getrandom_or_panic", "merlin 3.0.0", - "rand_chacha 0.3.1", + "rand_chacha", ] [[package]] @@ -1540,14 +1459,13 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "common-runtime" -version = "0.8.0-dev" +version = "1.0.0" dependencies = [ "duniter-primitives", "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", - "node-primitives", "pallet-authority-members", "pallet-babe", "pallet-balances", @@ -1555,7 +1473,6 @@ dependencies = [ "pallet-collective", "pallet-distance", "pallet-duniter-account", - "pallet-duniter-wot", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -1711,7 +1628,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1823,11 +1740,20 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if 1.0.0", + "crossbeam-utils", ] [[package]] @@ -1923,16 +1849,6 @@ dependencies = [ "subtle 2.5.0", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ctr" version = "0.9.2" @@ -1954,56 +1870,62 @@ dependencies = [ [[package]] name = "cucumber" -version = "0.11.3" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c2113609da80892316eeacd21e63c359536814b07146d4caa17ad7676e0db3" +checksum = "8e5063d8cf24f4998ad01cac265da468a15ca682a8f4f826d50e661964e8d9b8" dependencies = [ + "anyhow", "async-trait", - "atty", - "clap 3.2.25", + "clap", "console", "cucumber-codegen", "cucumber-expressions", "derive_more", + "drain_filter_polyfill", "either", "futures 0.3.30", "gherkin", "globwalk", + "humantime", "inventory", - "itertools 0.10.5", + "itertools 0.12.1", + "lazy-regex", "linked-hash-map", "once_cell", + "pin-project", "regex", - "sealed 0.4.0", + "sealed", + "smart-default", ] [[package]] name = "cucumber-codegen" -version = "0.11.3" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57569af2742cb38e213e8cc686fffc76e0ee4119cad3a122753c27107dc26e58" +checksum = "01091e28d1f566c8b31b67948399d2efd6c0a8f6228a9785519ed7b73f7f0aef" dependencies = [ "cucumber-expressions", "inflections", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", "regex", - "syn 1.0.109", + "syn 2.0.48", "synthez", ] [[package]] name = "cucumber-expressions" -version = "0.1.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a512c03bf9dbe0abcd486181027bddf2cc2153b8cb258b3b27e29dee621daa" +checksum = "d794fed319eea24246fb5f57632f7ae38d61195817b7eb659455aa5bdd7c1810" dependencies = [ "derive_more", "either", "nom", "nom_locate", "regex", + "regex-syntax 0.7.5", ] [[package]] @@ -2034,11 +1956,11 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -2062,9 +1984,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc" +checksum = "8aff472b83efd22bfc0176aa8ba34617dd5c17364670eb201a5f06d339b8abf7" dependencies = [ "cc", "cxxbridge-flags", @@ -2074,9 +1996,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a71e1e631fa2f2f5f92e8b0d860a00c198c6771623a6cefcc863e3554f0d8d6" +checksum = "bcf6e7a52c19013a9a0ec421c7d9c2d1125faf333551227e0a017288d71b47c3" dependencies = [ "cc", "codespan-reporting", @@ -2089,15 +2011,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c" +checksum = "589e83d02fc1d4fb78f5ad56ca08835341e23499d086d2821315869426d618dc" [[package]] name = "cxxbridge-macro" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e" +checksum = "e2cb1fd8ffae4230c7cfbbaf3698dbeaf750fa8c5dadf7ed897df581b9b572a5" dependencies = [ "proc-macro2", "quote", @@ -2134,7 +2056,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] @@ -2148,7 +2070,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 2.0.48", ] @@ -2237,7 +2159,7 @@ dependencies = [ "displaydoc", "nom", "num-bigint", - "num-traits 0.2.17", + "num-traits 0.2.18", "rusticata-macros", ] @@ -2336,7 +2258,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -2360,7 +2282,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2379,13 +2301,13 @@ name = "distance-oracle" version = "0.1.0" dependencies = [ "bincode", - "clap 4.4.18", + "clap", "dubp-wot", "flate2", "fnv", "hex", "log", - "num-traits 0.2.17", + "num-traits 0.2.18", "parity-scale-codec", "rayon", "simple_logger", @@ -2393,8 +2315,6 @@ dependencies = [ "sp-distance", "sp-runtime", "subxt", - "time", - "time-macros", "tokio", ] @@ -2437,7 +2357,7 @@ dependencies = [ "regex", "syn 2.0.48", "termcolor", - "toml 0.8.9", + "toml 0.8.10", "walkdir", ] @@ -2453,6 +2373,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "drain_filter_polyfill" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" + [[package]] name = "dtoa" version = "1.0.9" @@ -2478,12 +2404,11 @@ version = "0.8.0" dependencies = [ "async-io", "bs58 0.5.0", - "clap 4.4.18", + "clap", "clap_complete", "common-runtime", "dc-distance", "distance-oracle", - "enum-as-inner", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", @@ -2493,21 +2418,15 @@ dependencies = [ "gtest-runtime", "hex", "jsonrpsee 0.16.3", - "lazy_static", "log", - "maplit", "memmap2 0.9.4", "num-format", - "pallet-certification", "pallet-grandpa", "pallet-im-online", - "pallet-oneshot-account", "pallet-transaction-payment", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", - "reqwest 0.12.5", - "rusty-hook", "sc-basic-authorship", "sc-chain-spec", "sc-cli", @@ -2521,7 +2440,6 @@ dependencies = [ "sc-executor", "sc-keystore", "sc-network", - "sc-network-common", "sc-offchain", "sc-rpc-api", "sc-service", @@ -2555,23 +2473,22 @@ dependencies = [ "sp-trie", "substrate-build-script-utils", "substrate-frame-rpc-system", - "tracing-core", "try-runtime-cli", ] [[package]] name = "duniter-end2end-tests" -version = "3.0.0" +version = "1.0.0" dependencies = [ "anyhow", - "async-trait", - "clap 3.2.25", + "clap", "ctrlc", "cucumber", "distance-oracle", - "env_logger 0.9.3", + "env_logger 0.11.1", "hex", "notify", + "notify-debouncer-mini", "parity-scale-codec", "portpicker", "serde_json", @@ -2585,7 +2502,7 @@ dependencies = [ [[package]] name = "duniter-live-tests" -version = "3.0.0" +version = "1.0.0" dependencies = [ "anyhow", "countmap", @@ -2599,14 +2516,7 @@ dependencies = [ [[package]] name = "duniter-primitives" -version = "3.0.0" -dependencies = [ - "frame-support", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 8.0.0", -] +version = "1.0.0" [[package]] name = "dyn-clonable" @@ -2661,11 +2571,11 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "ed25519", "rand_core 0.6.4", "serde", @@ -2694,7 +2604,7 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "ed25519", "hashbrown 0.14.3", "hex", @@ -2705,9 +2615,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -2740,7 +2650,7 @@ version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2756,16 +2666,12 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.9.3" +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ - "atty", - "humantime", "log", - "regex", - "termcolor", ] [[package]] @@ -2782,20 +2688,20 @@ dependencies = [ ] [[package]] -name = "environmental" -version = "1.1.4" +name = "env_logger" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +dependencies = [ + "env_filter", + "log", +] [[package]] -name = "envmnt" -version = "0.8.4" +name = "environmental" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d328fc287c61314c4a61af7cfdcbd7e678e39778488c7cb13ec133ce0f4059" -dependencies = [ - "fsio", - "indexmap 1.9.3", -] +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" @@ -2830,6 +2736,17 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "event-listener" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.13", +] + [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -2840,6 +2757,16 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.0.0", + "pin-project-lite 0.2.13", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -2967,7 +2894,7 @@ version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.4.1", "windows-sys 0.52.0", @@ -2983,7 +2910,7 @@ dependencies = [ "futures 0.3.30", "futures-timer", "log", - "num-traits 0.2.17", + "num-traits 0.2.18", "parity-scale-codec", "parking_lot 0.12.1", "scale-info", @@ -2996,7 +2923,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -3024,7 +2951,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] @@ -3033,21 +2960,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "fork-tree" version = "3.0.0" @@ -3104,7 +3016,7 @@ dependencies = [ "Inflector", "array-bytes 6.2.2", "chrono", - "clap 4.4.18", + "clap", "comfy-table", "frame-benchmarking", "frame-support", @@ -3116,7 +3028,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "rand 0.8.5", + "rand", "rand_pcg", "sc-block-builder", "sc-cli", @@ -3168,7 +3080,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", ] @@ -3179,7 +3091,7 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -3293,7 +3205,7 @@ name = "frame-system" version = "4.0.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "docify", "frame-support", "log", @@ -3360,54 +3272,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ "libc", - "winapi 0.3.9", -] - -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags 1.3.2", - "fsevent-sys", + "winapi", ] [[package]] name = "fsevent-sys" -version = "2.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] -[[package]] -name = "fsio" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3" -dependencies = [ - "rand 0.7.3", - "users", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags 1.3.2", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -3552,7 +3428,7 @@ dependencies = [ [[package]] name = "g1-runtime" -version = "3.0.0" +version = "1.0.0" dependencies = [ "common-runtime", "frame-benchmarking", @@ -3561,7 +3437,6 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", - "frame-try-runtime", "hex-literal", "log", "node-primitives", @@ -3575,7 +3450,6 @@ dependencies = [ "pallet-collective", "pallet-distance", "pallet-duniter-account", - "pallet-duniter-test-parameters", "pallet-duniter-wot", "pallet-grandpa", "pallet-identity", @@ -3612,8 +3486,8 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-distance", + "sp-genesis-builder", "sp-inherents", - "sp-keyring", "sp-membership", "sp-offchain", "sp-runtime", @@ -3627,7 +3501,7 @@ dependencies = [ [[package]] name = "gdev-runtime" -version = "3.0.0" +version = "1.0.0" dependencies = [ "common-runtime", "frame-benchmarking", @@ -3636,7 +3510,6 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", - "frame-try-runtime", "hex-literal", "log", "node-primitives", @@ -3687,6 +3560,7 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-distance", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keyring", @@ -3728,16 +3602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" dependencies = [ "libc", - "winapi 0.3.9", -] - -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width", + "winapi", ] [[package]] @@ -3746,7 +3611,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -3757,7 +3622,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -3770,7 +3635,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand 0.8.5", + "rand", "rand_core 0.6.4", ] @@ -3786,32 +3651,21 @@ dependencies = [ [[package]] name = "gherkin" -version = "0.11.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7916b3cc60fa87903b2d62fbe7fd9c346fb9f8d4cb8d1717c482b37605016ad" +checksum = "20b79820c0df536d1f3a089a2fa958f61cb96ce9e0f3f8f507f5a31179567755" dependencies = [ - "heck 0.3.3", + "heck 0.4.1", "peg", "quote", "serde", "serde_json", - "syn 1.0.109", - "textwrap 0.12.1", + "syn 2.0.48", + "textwrap", "thiserror", "typed-builder", ] -[[package]] -name = "ghost" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e085ded9f1267c32176b40921b9754c474f7dd96f7e808d4a982e48aa1e854" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "gimli" version = "0.27.3" @@ -3950,7 +3804,7 @@ dependencies = [ [[package]] name = "gtest-runtime" -version = "3.0.0" +version = "1.0.0" dependencies = [ "common-runtime", "frame-benchmarking", @@ -3973,7 +3827,6 @@ dependencies = [ "pallet-collective", "pallet-distance", "pallet-duniter-account", - "pallet-duniter-test-parameters", "pallet-duniter-wot", "pallet-grandpa", "pallet-identity", @@ -4010,8 +3863,8 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-distance", + "sp-genesis-builder", "sp-inherents", - "sp-keyring", "sp-membership", "sp-offchain", "sp-runtime", @@ -4034,8 +3887,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.2.2", + "http", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -4077,7 +3930,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -4086,7 +3939,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", ] [[package]] @@ -4095,7 +3948,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "allocator-api2", "serde", ] @@ -4126,18 +3979,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -4217,7 +4061,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ "libc", "match_cfg", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4232,47 +4076,13 @@ dependencies = [ ] [[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" +name = "http-body" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", - "pin-project-lite 0.2.13", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", "pin-project-lite 0.2.13", ] @@ -4311,8 +4121,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", - "http-body 0.4.6", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -4324,25 +4134,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "itoa", - "pin-project-lite 0.2.13", - "smallvec", - "tokio", - "want", -] - [[package]] name = "hyper-rustls" version = "0.24.2" @@ -4350,8 +4141,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", - "hyper 0.14.28", + "http", + "hyper", "log", "rustls 0.21.10", "rustls-native-certs 0.6.3", @@ -4360,57 +4151,6 @@ dependencies = [ "webpki-roots 0.25.4", ] -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "rustls 0.23.7", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", - "webpki-roots 0.26.3", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.28", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", - "pin-project-lite 0.2.13", - "socket2 0.5.5", - "tokio", - "tower", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.60" @@ -4567,9 +4307,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -4583,9 +4323,9 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "indicatif" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", @@ -4602,9 +4342,9 @@ checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" [[package]] name = "inotify" -version = "0.7.1" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ "bitflags 1.3.2", "inotify-sys", @@ -4635,7 +4375,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -4644,18 +4384,14 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] name = "inventory" -version = "0.2.3" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84344c6e0b90a9e2b6f3f9abe5cc74402684e348df7b32adca28747e0cef091a" -dependencies = [ - "ctor", - "ghost", -] +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" [[package]] name = "io-lifetimes" @@ -4663,20 +4399,11 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ip_network" version = "0.4.1" @@ -4692,7 +4419,7 @@ dependencies = [ "socket2 0.5.5", "widestring", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] @@ -4703,12 +4430,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.4", - "rustix 0.38.31", + "hermit-abi", + "libc", "windows-sys 0.52.0", ] @@ -4738,18 +4465,18 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -4788,7 +4515,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", - "http 0.2.11", + "http", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", "pin-project", @@ -4809,7 +4536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" dependencies = [ "futures-util", - "http 0.2.11", + "http", "jsonrpsee-core 0.21.0", "pin-project", "rustls-native-certs 0.7.0", @@ -4838,10 +4565,10 @@ dependencies = [ "futures-timer", "futures-util", "globset", - "hyper 0.14.28", + "hyper", "jsonrpsee-types 0.16.3", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rustc-hash", "serde", "serde_json", @@ -4863,7 +4590,7 @@ dependencies = [ "beef", "futures-timer", "futures-util", - "hyper 0.14.28", + "hyper", "jsonrpsee-types 0.21.0", "pin-project", "rustc-hash", @@ -4882,8 +4609,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", - "hyper 0.14.28", - "hyper-rustls 0.24.2", + "hyper", + "hyper-rustls", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", "rustc-hash", @@ -4901,8 +4628,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572" dependencies = [ "async-trait", - "hyper 0.14.28", - "hyper-rustls 0.24.2", + "hyper", + "hyper-rustls", "jsonrpsee-core 0.21.0", "jsonrpsee-types 0.21.0", "serde", @@ -4935,8 +4662,8 @@ checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", - "http 0.2.11", - "hyper 0.14.28", + "http", + "hyper", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", "serde", @@ -4982,7 +4709,7 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ - "http 0.2.11", + "http", "jsonrpsee-client-transport 0.16.3", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", @@ -4994,7 +4721,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "once_cell", @@ -5011,20 +4738,30 @@ dependencies = [ ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "keystream" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" + +[[package]] +name = "kqueue" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "kqueue-sys", + "libc", ] [[package]] -name = "keystream" -version = "1.0.0" +name = "kqueue-sys" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] [[package]] name = "kvdb" @@ -5059,6 +4796,29 @@ dependencies = [ "smallvec", ] +[[package]] +name = "lazy-regex" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d12be4595afdf58bd19e4a9f4e24187da2a66700786ff660a418e9059937a4c" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bcd58e6c97a7fcbaffcdc95728b393b8d98933bfadad49ed4097845b57ef0b" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -5083,7 +4843,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -5170,7 +4930,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand", "rw-stream-sink", "smallvec", "thiserror", @@ -5226,7 +4986,7 @@ dependencies = [ "multiaddr", "multihash", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "thiserror", "zeroize", @@ -5251,7 +5011,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "smallvec", "thiserror", @@ -5273,7 +5033,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.10", "tokio", @@ -5309,7 +5069,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "snow", "static_assertions", @@ -5331,7 +5091,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "void", ] @@ -5350,8 +5110,8 @@ dependencies = [ "libp2p-tls", "log", "parking_lot 0.12.1", - "quinn-proto 0.9.6", - "rand 0.8.5", + "quinn-proto", + "rand", "rustls 0.20.9", "thiserror", "tokio", @@ -5369,7 +5129,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand", "smallvec", ] @@ -5388,7 +5148,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand 0.8.5", + "rand", "smallvec", "tokio", "void", @@ -5525,7 +5285,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -5883,25 +5643,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.8.10" @@ -5909,34 +5650,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - [[package]] name = "mixnet" version = "0.7.0" @@ -5948,14 +5666,14 @@ dependencies = [ "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "either", "hashlink", "lioness", "log", "parking_lot 0.12.1", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_distr", "subtle 2.5.0", "thiserror", @@ -5968,7 +5686,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "lazy_static", @@ -5983,7 +5701,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2", "quote", "syn 1.0.109", @@ -6081,7 +5799,7 @@ dependencies = [ "nalgebra-macros", "num-complex", "num-rational", - "num-traits 0.2.17", + "num-traits 0.2.18", "simba", "typenum", ] @@ -6103,36 +5821,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "rand 0.8.5", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "net2" -version = "0.2.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "rand", ] [[package]] @@ -6201,12 +5890,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "nias" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0" - [[package]] name = "nix" version = "0.24.3" @@ -6214,7 +5897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", ] @@ -6225,7 +5908,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ "bitflags 2.4.2", - "cfg-if 1.0.0", + "cfg-if", "libc", ] @@ -6285,20 +5968,31 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "notify" -version = "4.0.17" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", + "crossbeam-channel", "filetime", - "fsevent", "fsevent-sys", "inotify", + "kqueue", "libc", - "mio 0.6.23", - "mio-extras", + "log", + "mio", "walkdir", - "winapi 0.3.9", + "windows-sys 0.48.0", +] + +[[package]] +name = "notify-debouncer-mini" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" +dependencies = [ + "log", + "notify", ] [[package]] @@ -6309,16 +6003,16 @@ checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] @@ -6339,12 +6033,11 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] @@ -6356,7 +6049,7 @@ dependencies = [ "autocfg", "num-bigint", "num-integer", - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] @@ -6365,14 +6058,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.17", + "num-traits 0.2.18", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -6384,36 +6077,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ + "hermit-abi", "libc", ] @@ -6458,9 +6122,6 @@ name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -dependencies = [ - "parking_lot_core 0.9.9", -] [[package]] name = "opaque-debug" @@ -6474,62 +6135,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "pallet-atomic-swap" version = "4.0.0-dev" @@ -6563,13 +6180,12 @@ dependencies = [ [[package]] name = "pallet-authority-members" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "maplit", "pallet-offences", "pallet-session", "parity-scale-codec", @@ -6638,7 +6254,7 @@ dependencies = [ [[package]] name = "pallet-certification" -version = "3.0.0" +version = "1.0.0" dependencies = [ "duniter-primitives", "frame-benchmarking", @@ -6649,6 +6265,7 @@ dependencies = [ "scale-info", "sp-core", "sp-io", + "sp-keystore", "sp-runtime", "sp-std 8.0.0", ] @@ -6682,7 +6299,6 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-identity", - "pallet-membership", "pallet-session", "parity-scale-codec", "scale-info", @@ -6698,13 +6314,12 @@ dependencies = [ [[package]] name = "pallet-duniter-account" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "maplit", "pallet-balances", "pallet-identity", "pallet-quota", @@ -6721,7 +6336,7 @@ dependencies = [ [[package]] name = "pallet-duniter-test-parameters" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6730,6 +6345,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std 8.0.0", @@ -6737,9 +6353,8 @@ dependencies = [ [[package]] name = "pallet-duniter-test-parameters-macro" -version = "3.0.0" +version = "1.0.0" dependencies = [ - "num_enum", "proc-macro2", "quote", "syn 2.0.48", @@ -6747,7 +6362,7 @@ dependencies = [ [[package]] name = "pallet-duniter-wot" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6791,7 +6406,7 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "3.0.0" +version = "1.0.0" dependencies = [ "duniter-primitives", "frame-benchmarking", @@ -6832,7 +6447,7 @@ dependencies = [ [[package]] name = "pallet-membership" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6865,12 +6480,11 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-support", "frame-system", "log", - "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", @@ -6882,7 +6496,7 @@ dependencies = [ [[package]] name = "pallet-oneshot-account" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6917,7 +6531,7 @@ dependencies = [ [[package]] name = "pallet-provide-randomness" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6948,7 +6562,7 @@ dependencies = [ [[package]] name = "pallet-quota" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -7005,27 +6619,19 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" -version = "4.0.0-dev" +version = "1.0.0" dependencies = [ "frame-benchmarking", - "frame-support", "frame-system", - "pallet-authority-members", - "pallet-balances", "pallet-session", - "pallet-timestamp", "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", "sp-runtime", - "sp-session", "sp-std 8.0.0", ] [[package]] name = "pallet-smith-members" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -7033,7 +6639,6 @@ dependencies = [ "log", "maplit", "pallet-authority-members", - "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", @@ -7144,7 +6749,7 @@ dependencies = [ [[package]] name = "pallet-universal-dividend" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -7163,15 +6768,17 @@ dependencies = [ [[package]] name = "pallet-upgrade-origin" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "sp-core", "sp-io", "sp-runtime", + "sp-staking", "sp-std 8.0.0", ] @@ -7206,10 +6813,10 @@ dependencies = [ "lz4", "memmap2 0.5.10", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "siphasher 0.3.11", "snap", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -7284,12 +6891,12 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall 0.2.16", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -7298,7 +6905,7 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.4.1", "smallvec", @@ -7435,7 +7042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.2", + "indexmap 2.2.3", ] [[package]] @@ -7558,11 +7165,11 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.2" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "pin-project-lite 0.2.13", "rustix 0.38.31", @@ -7587,7 +7194,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug 0.3.0", "universal-hash", @@ -7605,7 +7212,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -7761,7 +7368,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -7894,69 +7501,22 @@ dependencies = [ "pin-project-lite 0.1.12", ] -[[package]] -name = "quinn" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" -dependencies = [ - "bytes", - "pin-project-lite 0.2.13", - "quinn-proto 0.11.3", - "quinn-udp", - "rustc-hash", - "rustls 0.23.7", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.20.9", - "slab", - "thiserror", - "tinyvec", - "tracing", - "webpki", -] - [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "rand 0.8.5", - "ring 0.17.7", + "rand", + "ring 0.16.20", "rustc-hash", - "rustls 0.23.7", + "rustls 0.20.9", "slab", "thiserror", "tinyvec", "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" -dependencies = [ - "libc", - "once_cell", - "socket2 0.5.5", - "tracing", - "windows-sys 0.52.0", + "webpki", ] [[package]] @@ -7974,19 +7534,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -7994,20 +7541,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -8042,17 +7579,8 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ - "num-traits 0.2.17", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "num-traits 0.2.18", + "rand", ] [[package]] @@ -8201,6 +7729,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -8219,74 +7753,28 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-tls", + "http", + "http-body", + "hyper", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite 0.2.13", - "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper", "system-configuration", "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.27.2", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite 0.2.13", - "quinn", - "rustls 0.23.7", - "rustls-pemfile 2.0.0", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tokio-rustls 0.26.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.3", - "winreg 0.52.0", + "winreg", ] [[package]] @@ -8337,7 +7825,7 @@ dependencies = [ "spin 0.5.2", "untrusted 0.7.1", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -8400,15 +7888,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "run_script" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f5efb6762d8cafcab5b2a5545dad239d896989b15304e7d1a03cc6cf1aa626" -dependencies = [ - "fsio", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -8510,20 +7989,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls" -version = "0.23.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" -dependencies = [ - "once_cell", - "ring 0.17.7", - "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle 2.5.0", - "zeroize", -] - [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -8601,18 +8066,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" -[[package]] -name = "rusty-hook" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cee9be61be7e1cbadd851e58ed7449c29c620f00b23df937cb9cbc04ac21a3" -dependencies = [ - "ci_info", - "getopts", - "nias", - "toml 0.5.11", -] - [[package]] name = "ruzstd" version = "0.5.0" @@ -8751,7 +8204,7 @@ dependencies = [ "array-bytes 6.2.2", "bip39", "chrono", - "clap 4.4.18", + "clap", "fdlimit", "futures 0.3.30", "itertools 0.10.5", @@ -8759,7 +8212,7 @@ dependencies = [ "log", "names", "parity-scale-codec", - "rand 0.8.5", + "rand", "regex", "rpassword", "sc-client-api", @@ -8902,7 +8355,7 @@ dependencies = [ "log", "num-bigint", "num-rational", - "num-traits 0.2.17", + "num-traits 0.2.18", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -8966,7 +8419,7 @@ name = "sc-consensus-grandpa" version = "0.10.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "array-bytes 6.2.2", "async-trait", "dyn-clone", @@ -8977,7 +8430,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -9101,7 +8554,7 @@ version = "0.10.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ "anyhow", - "cfg-if 1.0.0", + "cfg-if", "libc", "log", "parking_lot 0.12.1", @@ -9196,7 +8649,7 @@ dependencies = [ "parking_lot 0.12.1", "partial_sort", "pin-project", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network-common", "sc-utils", @@ -9258,7 +8711,7 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "futures 0.3.30", "futures-timer", "libp2p", @@ -9358,15 +8811,15 @@ dependencies = [ "fnv", "futures 0.3.30", "futures-timer", - "hyper 0.14.28", - "hyper-rustls 0.24.2", + "hyper", + "hyper-rustls", "libp2p", "log", "num_cpus", "once_cell", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network", "sc-network-common", @@ -9448,7 +8901,7 @@ name = "sc-rpc-server" version = "4.0.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "http 0.2.11", + "http", "jsonrpsee 0.16.3", "log", "serde_json", @@ -9502,7 +8955,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -9570,7 +9023,7 @@ dependencies = [ "futures 0.3.30", "libc", "log", - "rand 0.8.5", + "rand", "rand_pcg", "regex", "sc-telemetry", @@ -9592,7 +9045,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "sc-utils", "serde", "serde_json", @@ -9772,7 +9225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -9839,8 +9292,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.7", - "cfg-if 1.0.0", + "ahash 0.8.8", + "cfg-if", "hashbrown 0.13.2", ] @@ -9869,7 +9322,7 @@ dependencies = [ "aead", "arrayref", "arrayvec 0.7.4", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "getrandom_or_panic", "merlin 3.0.0", "rand_core 0.6.4", @@ -9903,26 +9356,14 @@ dependencies = [ [[package]] name = "sealed" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636b9882a0f4cc2039488df89a10eb4b7976d4b6c1917fc0518f3f0f5e2c72ca" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "sealed" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5e421024b5e5edfbaa8e60ecf90bda9dbffc602dbb230e6028763f85f0c68c" +checksum = "f4a8caec23b7800fb97971a1c6ae365b6239aaeddfb934d6265f8505e795699d" dependencies = [ - "heck 0.3.3", + "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -10080,7 +9521,7 @@ version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -10094,7 +9535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -10119,7 +9560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -10131,7 +9572,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -10188,7 +9629,7 @@ checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", "num-complex", - "num-traits 0.2.17", + "num-traits 0.2.18", "paste", "wide", ] @@ -10204,9 +9645,7 @@ version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e7e46c8c90251d47d08b28b8a419ffb4aede0f87c2eea95e17d1d5bacbf3ef1" dependencies = [ - "colored", "log", - "time", "windows-sys 0.48.0", ] @@ -10243,13 +9682,30 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "smol" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e635339259e51ef85ac7aa29a1cd991b957047507288697a690e80ab97d07cad" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-executor", "async-fs", "async-io", @@ -10293,12 +9749,12 @@ dependencies = [ "nom", "num-bigint", "num-rational", - "num-traits 0.2.17", + "num-traits 0.2.18", "pbkdf2 0.12.2", "pin-project", "poly1305", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "ruzstd", "schnorrkel 0.11.4", "serde", @@ -10311,7 +9767,7 @@ dependencies = [ "soketto", "twox-hash", "wasmi", - "x25519-dalek 2.0.0", + "x25519-dalek 2.0.1", "zeroize", ] @@ -10321,7 +9777,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" dependencies = [ - "async-channel 2.1.1", + "async-channel 2.2.0", "async-lock 3.3.0", "base64 0.21.7", "blake2-rfc", @@ -10340,8 +9796,8 @@ dependencies = [ "no-std-net", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "serde", "serde_json", "siphasher 1.0.0", @@ -10366,7 +9822,7 @@ dependencies = [ "aes-gcm", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", "ring 0.17.7", "rustc_version", @@ -10381,7 +9837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -10404,10 +9860,10 @@ dependencies = [ "bytes", "flate2", "futures 0.3.30", - "http 0.2.11", + "http", "httparse", "log", - "rand 0.8.5", + "rand", "sha-1", ] @@ -10465,7 +9921,7 @@ version = "16.0.0" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ "integer-sqrt", - "num-traits 0.2.17", + "num-traits 0.2.18", "parity-scale-codec", "scale-info", "serde", @@ -10640,7 +10096,7 @@ dependencies = [ "parking_lot 0.12.1", "paste", "primitive-types", - "rand 0.8.5", + "rand", "scale-info", "schnorrkel 0.11.4", "secp256k1", @@ -10686,7 +10142,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -10726,7 +10182,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "proc-macro2", "quote", @@ -10735,7 +10191,7 @@ dependencies = [ [[package]] name = "sp-distance" -version = "3.0.0" +version = "1.0.0" dependencies = [ "async-trait", "frame-support", @@ -10762,7 +10218,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "environmental", "parity-scale-codec", @@ -10852,7 +10308,7 @@ dependencies = [ [[package]] name = "sp-membership" -version = "3.0.0" +version = "1.0.0" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -10928,7 +10384,7 @@ dependencies = [ "log", "parity-scale-codec", "paste", - "rand 0.8.5", + "rand", "scale-info", "serde", "simple-mermaid", @@ -10961,7 +10417,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10993,7 +10449,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "Inflector", "expander", @@ -11041,7 +10497,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "smallvec", "sp-core", "sp-externalities 0.19.0", @@ -11059,11 +10515,11 @@ version = "4.0.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ "aes-gcm", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "ed25519-dalek", "hkdf", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "sha2 0.10.8", "sp-api", @@ -11074,7 +10530,7 @@ dependencies = [ "sp-runtime-interface 17.0.0", "sp-std 8.0.0", "thiserror", - "x25519-dalek 2.0.0", + "x25519-dalek 2.0.1", ] [[package]] @@ -11085,7 +10541,7 @@ source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-sub [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" [[package]] name = "sp-storage" @@ -11103,7 +10559,7 @@ dependencies = [ [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11141,7 +10597,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "parity-scale-codec", "sp-std 14.0.0", @@ -11179,14 +10635,14 @@ name = "sp-trie" version = "22.0.0" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.8", "hash-db", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "scale-info", "schnellru", "sp-core", @@ -11242,7 +10698,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#53f615de503c8936c2639f51b99019c64eab1018" +source = "git+https://github.com/paritytech/polkadot-sdk#4c96dca661654ca7511a11f7626d0b677256d3a7" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -11339,7 +10795,7 @@ dependencies = [ "parking_lot 0.11.2", "parking_lot_core 0.8.6", "static_init_macro", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -11361,6 +10817,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.24.1" @@ -11444,7 +10906,7 @@ name = "substrate-prometheus-endpoint" version = "0.10.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ - "hyper 0.14.28", + "hyper", "log", "prometheus", "thiserror", @@ -11477,7 +10939,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.9", + "toml 0.8.10", "walkdir", "wasm-opt", ] @@ -11500,7 +10962,7 @@ version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee5751d8385836e91a9b7c613e1e7e11f97a4c8a867d6f45f556497d2cfb53c1" dependencies = [ - "clap 4.4.18", + "clap", "fancy-regex", "git-version", "glob", @@ -11640,12 +11102,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - [[package]] name = "synstructure" version = "0.12.6" @@ -11660,35 +11116,35 @@ dependencies = [ [[package]] name = "synthez" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033178d0acccffc5490021657006e6a8dd586ee9dc6f7c24e7608b125e568cb1" +checksum = "a3d2c2202510a1e186e63e596d9318c91a8cbe85cd1a56a7be0c333e5f59ec8d" dependencies = [ - "syn 1.0.109", + "syn 2.0.48", "synthez-codegen", "synthez-core", ] [[package]] name = "synthez-codegen" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69263462a40e46960f070618e20094ce69e783a41f86e54bc75545136afd597a" +checksum = "f724aa6d44b7162f3158a57bccd871a77b39a4aef737e01bcdff41f4772c7746" dependencies = [ - "syn 1.0.109", + "syn 2.0.48", "synthez-core", ] [[package]] name = "synthez-core" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8b5a4089fe1723279f06302afda64a5dacaa11a82bcbb4d08759590d4389d9" +checksum = "78bfa6ec52465e2425fd43ce5bbbe0f0b623964f7c63feb6b10980e816c654ea" dependencies = [ "proc-macro2", "quote", - "sealed 0.3.0", - "syn 1.0.109", + "sealed", + "syn 2.0.48", ] [[package]] @@ -11726,13 +11182,12 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", - "redox_syscall 0.4.1", "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -11780,33 +11235,29 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "textwrap" -version = "0.12.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" dependencies = [ + "smawk", + "unicode-linebreak", "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -11825,7 +11276,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -11856,9 +11307,7 @@ checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", - "libc", "num-conv", - "num_threads", "powerfmt", "serde", "time-core", @@ -11914,7 +11363,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 0.8.10", + "mio", "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.13", @@ -11935,16 +11384,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-retry" version = "0.3.0" @@ -11952,7 +11391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" dependencies = [ "pin-project", - "rand 0.8.5", + "rand", "tokio", ] @@ -11977,17 +11416,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls 0.23.7", - "rustls-pki-types", - "tokio", -] - [[package]] name = "tokio-stream" version = "0.1.14" @@ -12026,14 +11454,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.4", ] [[package]] @@ -12051,7 +11479,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", "toml_datetime", "winnow", ] @@ -12062,7 +11490,18 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", @@ -12079,7 +11518,6 @@ dependencies = [ "futures-util", "pin-project", "pin-project-lite 0.2.13", - "tokio", "tower-layer", "tower-service", "tracing", @@ -12095,8 +11533,8 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.11", - "http-body 0.4.6", + "http", + "http-body", "http-range-header", "pin-project-lite 0.2.13", "tower-layer", @@ -12231,7 +11669,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", - "cfg-if 1.0.0", + "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", @@ -12240,7 +11678,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.10", "thiserror", @@ -12256,7 +11694,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "futures-util", "ipconfig", "lazy_static", @@ -12282,8 +11720,9 @@ version = "0.10.0-dev" source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f" dependencies = [ "async-trait", - "clap 4.4.18", + "clap", "frame-remote-externalities", + "frame-try-runtime", "hex", "log", "parity-scale-codec", @@ -12323,21 +11762,30 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.7", - "rand 0.8.5", + "rand", "static_assertions", ] [[package]] name = "typed-builder" -version = "0.7.1" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe83c85a85875e8c4cb9ce4a890f05b23d38cd0d47647db7895d3d2a79566d2" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85f4270f4f449a3f2c0cf2aecc8415e388a597aeacc7d55fc749c5c968c8533" +checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -12426,6 +11874,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-normalization" version = "0.1.22" @@ -12437,9 +11891,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" @@ -12513,16 +11967,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "users" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4227e95324a443c9fcb06e03d4d85e91aabe9a5a02aa818688b6918b6af486" -dependencies = [ - "libc", - "log", -] - [[package]] name = "utf8parse" version = "0.2.1" @@ -12541,12 +11985,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version-compare" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" - [[package]] name = "version_check" version = "0.9.4" @@ -12574,8 +12012,8 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_core 0.6.4", "sha2 0.10.8", "sha3", @@ -12616,19 +12054,19 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -12641,11 +12079,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -12653,9 +12091,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12663,9 +12101,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -12676,9 +12114,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-instrument" @@ -12771,7 +12209,7 @@ checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", "libm", - "num-traits 0.2.17", + "num-traits 0.2.18", "paste", ] @@ -12802,7 +12240,7 @@ checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -12828,7 +12266,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -12916,7 +12354,7 @@ dependencies = [ "addr2line 0.19.0", "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "cpp_demangle", "gimli 0.27.3", "log", @@ -12948,7 +12386,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "windows-sys 0.45.0", ] @@ -12961,7 +12399,7 @@ checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -12969,7 +12407,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand 0.8.5", + "rand", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", @@ -12991,9 +12429,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -13024,18 +12462,9 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" -[[package]] -name = "webpki-roots" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "weight-analyzer" -version = "0.0.0" +version = "1.0.0" dependencies = [ "convert_case 0.6.0", "glob", @@ -13071,12 +12500,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -13087,12 +12510,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -13105,7 +12522,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -13342,9 +12759,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -13355,30 +12772,10 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "wyz" version = "0.5.1" @@ -13401,11 +12798,11 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", "serde", "zeroize", @@ -13434,22 +12831,20 @@ name = "xtask" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.4.18", + "clap", "frame-metadata 16.0.0", "graphql_client", "hex", - "memmap2 0.5.10", + "memmap2 0.9.4", "parity-scale-codec", "placeholder", - "reqwest 0.11.24", - "run_script", + "reqwest", "scale-info", "scale-value", "serde", "serde_json", "tera", "tokio", - "version-compare", "version_check", "weight-analyzer", ] @@ -13464,7 +12859,7 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 54b9c46ec6c1df1aed15101ae189c93971b18eec..4909e8d86aab1a8894ab8f7edf89d28746faaf2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,155 +1,3 @@ -[package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -build = 'node/build.rs' -description = 'Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'duniter' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '0.8.0' - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] - -[[bin]] -bench = false -name = 'duniter' -path = "node/src/main.rs" - -[features] -default = ["gdev", "distance-oracle"] -gdev = ["gdev-runtime"] # gdev feature enables gdev runtime and gdev command line options -g1 = ["g1-runtime"] -constant-fees = [ -"common-runtime/constant-fees", -"g1-runtime/constant-fees", -"gdev-runtime/constant-fees", -"gtest-runtime/constant-fees", -] # Activate constant fees model, 1 extrinsic = 2 cG -gtest = ["gtest-runtime"] -embed = [] # embed feature enables embedding raw chainspecs that must be in ./specs/gdev-raw.json -runtime-benchmarks = [ - 'common-runtime/runtime-benchmarks', - 'g1-runtime/runtime-benchmarks', - 'gdev-runtime/runtime-benchmarks', - 'gtest-runtime/runtime-benchmarks', - 'sc-client-db/runtime-benchmarks', -] -try-runtime = [ - "common-runtime/try-runtime", - "g1-runtime/try-runtime", - "gdev-runtime/try-runtime", - "gtest-runtime/try-runtime", - "try-runtime-cli", -] -std = [ - "common-runtime/std", - "g1-runtime/std", - "gdev-runtime/std", - "gtest-runtime/std", -] - -[build-dependencies] -clap = { version = "4.4.18" } -#clap_complete = { version = "4.0" } -substrate-build-script-utils = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0' } - -[dev-dependencies] -rusty-hook = "^0.11.2" -reqwest = { version = "0.12.0", default-features = false, features = ["rustls-tls"] } - -# Dependencies for specific targets -[target.'cfg(any(target_arch="x86_64", target_arch="aarch64"))'.dependencies] -sc-cli = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-service = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-trie = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0" } - -[dependencies] - -# crates.io dependencies -async-io = { version = "2.3.0", default-features = false } -bs58 = "0.5.0" -clap = { version = "4.4.18", default-features = false, features = ["derive"] } -clap_complete = { version = "4.4.8", default-features = false } -# local dependencies -common-runtime = { path = 'runtime/common', default-features = false } -dc-distance = { path = 'client/distance' } -distance-oracle = { path = 'distance-oracle', default-features = false, optional = true } -enum-as-inner = { version = "=0.5.1", default-features = false } #https://github.com/bluejekyll/trust-dns/issues/1946 - -# substrate dependencies -frame-benchmarking = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -frame-system = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -futures = { version = "0.3.28", default-features = false, features = ["compat"] } -g1-runtime = { path = 'runtime/g1', optional = true } -gdev-runtime = { path = 'runtime/gdev', optional = true } -gtest-runtime = { path = 'runtime/gtest', optional = true } -hex = { version = "0.4.3", default-features = false } -jsonrpsee = { version = "0.16.2", default-features = false, features = ["server"] } -lazy_static = { version = "1.4.0", default-features = false } -log = { version = "0.4.20", default-features = false } -maplit = { version = '1.0.2', default-features = false } -memmap2 = { version = "0.9.3", default-features = false } -num-format = "0.4.4" -pallet-certification = { path = 'pallets/certification' } -pallet-grandpa = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -pallet-im-online = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -pallet-oneshot-account = { path = 'pallets/oneshot-account' } -pallet-transaction-payment = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -pallet-treasury = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-basic-authorship = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-chain-spec = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-cli = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-client-api = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-client-db = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-consensus = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-consensus-babe = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-consensus-babe-rpc = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sc-consensus-manual-seal = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-executor = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-keystore = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-network = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-network-common = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-rpc-api = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-service = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-telemetry = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-transaction-pool = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-transaction-pool-api = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -serde = { version = "1.0.195", default-features = false } -serde_json = { version = "1.0.64", default-features = false } -serde_yaml = { version = "0.9.27", default-features = false } -sp-api = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-authority-discovery = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-block-builder = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-blockchain = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-consensus = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-consensus-babe = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-core = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-distance = { path = 'primitives/distance' } -sp-inherents = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-io = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-keyring = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-keystore = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-membership = { path = 'primitives/membership' } -sp-offchain = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sc-offchain = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-runtime = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-session = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-storage = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-timestamp = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-transaction-pool = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-transaction-storage-proof = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-trie = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -substrate-frame-rpc-system = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -tracing-core = { version = "0.1.28", default-features = false } -try-runtime-cli = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", optional = true, default-features = false } - [workspace] resolver = "2" @@ -158,6 +6,7 @@ members = [ 'distance-oracle', 'end2end-tests', 'live-tests', + 'node', 'pallets/authority-members', 'pallets/certification', 'pallets/distance', @@ -176,8 +25,198 @@ members = [ 'resources/weight_analyzer', 'runtime/common', 'runtime/gdev', - 'xtask' + 'xtask', +] + +[workspace.package] +authors = [ + 'librelois <c@elo.tf>', + 'tuxmain <tuxmain@zettascript.org>', + 'c-geek <https://forum.duniter.org/u/cgeek>', + 'HugoTrentesaux <https://trentesaux.fr>', + 'bgallois <benjamin@gallois.cc>', + 'Duniter Developers <https://duniter.org>', + 'Axiom-Team Developers <https://axiom-team.fr>', ] +description = 'Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency' +edition = '2021' +homepage = 'https://duniter.org' +license = 'AGPL-3.0' +repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' +version = '1.0.0' + +[workspace.dependencies] +# crates.io dependencies +anyhow = { version = "1.0.79", default-features = false } +countmap = { version = "0.2.0", default-features = false } +ctrlc = { version = "3.4.2", default-features = false } +cucumber = { version = "0.20.2", default-features = false } +env_logger = { version = "0.11.1", default-features = false } +notify = { version = "6.1.1", default-features = false } +portpicker = { version = "0.1.1", default-features = false } +notify-debouncer-mini = { version = "0.4.1", default-features = false } +async-io = { version = "2.3.1", default-features = false } +async-trait = { version = "0.1.77", default-features = false } +thiserror = { version = "1.0.56", default-features = false } +frame-metadata = { version = "16.0.0", default-features = false } +graphql_client = { version = "0.10.0" } +bs58 = { version = "0.5.0", default-features = false } +placeholder = { version = "1.1.3", default-features = false } +getrandom = { version = "0.2.12", default-features = false } +impl-trait-for-tuples = { version = "0.2.2", default-features = false } +clap = { version = "4.4.18" } +clap_complete = { version = "4.4.10" } +reqwest = { version = "0.12.0", default-features = false, features = ["rustls-tls"] } +glob = { version = "0.3.1", default-features = false } +convert_case = { version = "0.6.0", default-features = false } +subweight-core = { version = "3.3.1", default-features = false } +version_check = { version = "0.9.2", default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false } +enum-as-inner = { version = "=0.5.1", default-features = false } #https://github.com/bluejekyll/trust-dns/issues/1946 +futures = { version = "0.3.30", default-features = false } +tera = { version = "1", default-features = false } +hex = { version = "0.4.3", default-features = false } +jsonrpsee = { version = "0.16.2", default-features = false } +lazy_static = { version = "1.4.0", default-features = false } +log = { version = "0.4.20", default-features = false } +maplit = { version = '1.0.2', default-features = false } +proc-macro2 = { version = '1.0.76', default-features = false } +quote = { version = '1.0.35', default-features = false } +syn = { version = '2.0.48', default-features = false } +memmap2 = { version = "0.9.4", default-features = false } +num-format = { version = "0.4.4", default-features = false } +smallvec = { version = "1.13.1", default-features = false } +hex-literal = { version = '0.4.1', default-features = false } +scale-info = { version = "2.10.0", default-features = false } +scale-value = { version = "0.13.0", default-features = false } +serde = { version = "1.0.196", default-features = false } +serde_derive = { version = "1.0.196", default-features = false } +serde_yaml = { version = "0.9.27", default-features = false } +serde_json = { version = "1.0.64", default-features = false } +fnv = { version = "1.0.7", default-features = false } +tokio = { version = "1.35.1", default-features = false } +time = { version = "0.3.31", default-features = false } +time-macros = { version = "0.2.16", default-features = false } +num-traits = { version = "0.2.17", default-features = false } +rayon = { version = "1.8.1", default-features = false } +simple_logger = { version = "4.3.3", default-features = false } +bincode = { version = "1.3.3", default-features = false } +dubp-wot = { version = "0.11.1", default-features = false } +flate2 = { version = "1.0.28", default-features = false } + +# Subxt +subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.34.0-duniter-substrate-v1.6.0', default-features = false } + +# local dependencies +weight-analyzer = { path = "resources/weight_analyzer", default-features = false } +common-runtime = { path = 'runtime/common', default-features = false } +dc-distance = { path = 'client/distance', default-features = false } +distance-oracle = { path = 'distance-oracle', default-features = false } +g1-runtime = { path = 'runtime/g1', default-features = false } +gdev-runtime = { path = 'runtime/gdev', default-features = false } +gtest-runtime = { path = 'runtime/gtest', default-features = false } +pallet-authority-members = { path = 'pallets/authority-members', default-features = false } +pallet-certification = { path = 'pallets/certification', default-features = false } +pallet-distance = { path = "pallets/distance", default-features = false } +pallet-duniter-account = { path = 'pallets/duniter-account', default-features = false } +pallet-duniter-test-parameters = { path = 'pallets/duniter-test-parameters', default-features = false } +pallet-duniter-test-parameters-macro = { path = 'pallets/duniter-test-parameters/macro', default-features = false } +duniter-primitives = { path = 'primitives/duniter', default-features = false } +pallet-duniter-wot = { path = 'pallets/duniter-wot', default-features = false } +pallet-identity = { path = 'pallets/identity', default-features = false } +pallet-membership = { path = 'pallets/membership', default-features = false } +pallet-offences = { path = 'pallets/offences', default-features = false } +pallet-oneshot-account = { path = 'pallets/oneshot-account', default-features = false } +pallet-provide-randomness = { path = 'pallets/provide-randomness', default-features = false } +pallet-quota = { path = 'pallets/quota', default-features = false } +pallet-session-benchmarking = { path = 'pallets/session-benchmarking', default-features = false } +pallet-smith-members = { path = 'pallets/smith-members', default-features = false } +pallet-universal-dividend = { path = 'pallets/universal-dividend', default-features = false } +pallet-upgrade-origin = { path = 'pallets/upgrade-origin', default-features = false } +sp-distance = { path = 'primitives/distance', default-features = false } +sp-membership = { path = 'primitives/membership', default-features = false } + +# substrate dependencies +pallet-transaction-payment-rpc = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-executive = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-system-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-try-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-atomic-swap = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-authorship = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-collective = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-im-online = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-multisig = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-preimage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-proxy = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-scheduler = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-sudo = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-transaction-payment = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-treasury = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +pallet-utility = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-arithmetic = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-block-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-client-db = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-client-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-consensus-babe-rpc = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-blockchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-offchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +try-runtime-cli = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-inherents = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-offchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-weights = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-transaction-pool = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-version = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-cli = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-service = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-trie = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-genesis-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-keyring = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-consensus = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-core-hashing = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-keystore = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-rpc-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +substrate-wasm-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +substrate-build-script-utils = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0' } +node-primitives = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +frame-benchmarking-cli = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-chain-spec = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-consensus = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-consensus-manual-seal = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-executor = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-telemetry = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-transaction-pool = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-basic-authorship = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-network = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-keystore = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-storage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-transaction-storage-proof = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sc-transaction-pool-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-state-machine = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +substrate-frame-rpc-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } # The list of dependencies below (which can be both direct and indirect dependencies) are crates # that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of @@ -235,84 +274,7 @@ yamux = { opt-level = 3 } zeroize = { opt-level = 3 } [profile.release] +# Link Time Optimization lto = "thin" # Substrate runtime requires unwinding. panic = "unwind" - -[patch.crates-io] - -# # the following patch can be useful to debug substrate dependency -# # added by tuxmain on 0.9.32 update -# # updated by hugo on 0.9.42 update (benjamin) -# [patch.'https://github.com/duniter/duniter-polkadot-sdk'] -# pallet-balances = {path = '../substrate/frame/balances'} -# fork-tree = { path = "../substrate/utils/fork-tree" } -# frame-support = { path = "../substrate/frame/support" } -# frame-support-procedural = { path = "../substrate/frame/support/procedural" } -# frame-support-procedural-tools = { path = "../substrate/frame/support/procedural/tools" } -# frame-system = { path = "../substrate/frame/system" } -# frame-benchmarking = { path = "../substrate/frame/benchmarking" } -# frame-benchmarking-cli = { path = "../substrate/utils/frame/benchmarking-cli" } -# sc-basic-authorship = { path = "../substrate/client/basic-authorship" } -# sc-block-builder = { path = "../substrate/client/block-builder" } -# sc-chain-spec = { path = "../substrate/client/chain-spec" } -# sc-cli = { path = "../substrate/client/cli" } -# sc-client-api = { path = "../substrate/client/api" } -# sc-client-db = { path = "../substrate/client/db" } -# sc-network-common = { path = "../substrate/client/network/common" } -# sc-consensus = { path = "../substrate/client/consensus/common" } -# sc-consensus-aura = { path = "../substrate/client/consensus/aura" } -# sc-consensus-babe = { path = "../substrate/client/consensus/babe" } -# sc-consensus-babe-rpc = { path = "../substrate/client/consensus/babe/rpc" } -# sc-consensus-manual-seal = { path = "../substrate/client/consensus/manual-seal" } -# sc-consensus-slots = { path = "../substrate/client/consensus/slots" } -# sc-executor = { path = "../substrate/client/executor" } -# sc-executor-common = { path = "../substrate/client/executor/common" } -# sc-executor-wasmi = { path = "../substrate/client/executor/wasmi" } -# sc-executor-wasmtime = { path = "../substrate/client/executor/wasmtime" } -# sc-keystore = { path = "../substrate/client/keystore" } -# sc-network = { path = "../substrate/client/network" } -# sc-rpc-api = { path = "../substrate/client/rpc-api" } -# sc-service = { path = "../substrate/client/service" } -# sc-utils = { path = "../substrate/client/utils" } -# sc-telemetry = { path = "../substrate/client/telemetry" } -# sc-transaction-pool = { path = "../substrate/client/transaction-pool" } -# sc-transaction-pool-api = { path = "../substrate/client/transaction-pool/api" } -# sc-peerset = { path = "../substrate/client/peerset" } -# sp-api = { path = "../substrate/primitives/api" } -# sp-application-crypto = { path = "../substrate/primitives/application-crypto" } -# sp-arithmetic = { path = "../substrate/primitives/arithmetic" } -# sp-authority-discovery = { path = "../substrate/primitives/authority-discovery" } -# sp-block-builder = { path = "../substrate/primitives/block-builder" } -# sp-blockchain = { path = "../substrate/primitives/blockchain" } -# sp-consensus = { path = "../substrate/primitives/consensus/common" } -# sp-consensus-babe = { path = "../substrate/primitives/consensus/babe" } -# sp-consensus-slots = { path = "../substrate/primitives/consensus/slots" } -# sp-core = { path = "../substrate/primitives/core" } -# sp-core-hashing = { path = "../substrate/primitives/core/hashing" } -# sp-core-hashing-proc-macro = { path = "../substrate/primitives/core/hashing/proc-macro" } -# sp-debug-derive = { path = "../substrate/primitives/debug-derive" } -# sp-externalities = { path = "../substrate/primitives/externalities" } -# sp-consensus-grandpa = { path = "../substrate/primitives/consensus/grandpa" } -# sp-inherents = { path = "../substrate/primitives/inherents" } -# sp-io = { path = "../substrate/primitives/io" } -# sp-keyring = { path = "../substrate/primitives/keyring" } -# sp-keystore = { path = "../substrate/primitives/keystore" } -# sp-maybe-compressed-blob = { path = "../substrate/primitives/maybe-compressed-blob" } -# sp-offchain = { path = "../substrate/primitives/offchain" } -# sp-panic-handler = { path = "../substrate/primitives/panic-handler" } -# sp-rpc = { path = "../substrate/primitives/rpc" } -# sp-runtime = { path = "../substrate/primitives/runtime" } -# sp-session = { path = "../substrate/primitives/session" } -# sp-staking = { path = "../substrate/primitives/staking" } -# sp-state-machine = { path = "../substrate/primitives/state-machine" } -# sp-std = { path = "../substrate/primitives/std" } -# sp-storage = { path = "../substrate/primitives/storage" } -# sp-timestamp = { path = "../substrate/primitives/timestamp" } -# sp-tracing = { path = "../substrate/primitives/tracing" } -# sp-transaction-pool = { path = "../substrate/primitives/transaction-pool" } -# sp-transaction-storage-proof = { path = "../substrate/primitives/transaction-storage-proof" } -# sp-trie = { path = "../substrate/primitives/trie" } -# sp-version = { path = "../substrate/primitives/version" } -# sp-weights = { path = "../substrate/primitives/weights" } -# substrate-prometheus-endpoint = { path = "../substrate/utils/prometheus" } diff --git a/README.md b/README.md index 844346cf0f7f527bd051e7e366db63d137dbdc73..e0f90e8b379a7cf4ffa0faef05677e90e4d97cae 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,7 @@ To go further, read [How to deploy a permanent mirror node on ĞDev network](./d ### Create your local blockchain -It can be useful to deploy your local blockchain, for instance to have a controlled environement -to develop/test an application that interacts with the blockchain. +It can be useful to deploy your local blockchain, for instance to have a controlled environment to develop/test an application that interacts with the blockchain. ```docker docker run -it -p9944:9944 duniter/duniter-v2s:v0.4.0 --tmp diff --git a/client/distance/Cargo.toml b/client/distance/Cargo.toml index 11a8f9d37c9e83393a3971384ed2bf7418bc36a6..96e1ea49288de9b155a5f0c196cc481e55bd6673 100644 --- a/client/distance/Cargo.toml +++ b/client/distance/Cargo.toml @@ -1,50 +1,49 @@ [package] -authors = ['tuxmain <tuxmain@zettascript.org>'] -description = 'Duniter client distance' -edition = '2021' -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'dc-distance' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '1.0.0' - -[dependencies] - -log = "0.4" - -pallet-distance = { path = "../../pallets/distance" } - -# substrate -scale-info = { version = "2.1.1", features = ["derive"] } -sp-distance = { path = "../../primitives/distance" } -thiserror = "1.0.30" - -[dependencies.codec] -features = ['derive'] -package = 'parity-scale-codec' -version = '3.1.5' - -[dependencies.frame-support] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sc-client-api] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-keystore] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### +edition.workspace = true +homepage.workspace = true +license.workspace = true +description = "Duniter client distance" +name = "dc-distance" +readme = "README.md" +version = "1.0.0" +repository.workspace = true [package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] + +[features] +std = [ + "codec/std", + "frame-support/std", + "log/std", + "pallet-distance/std", + "scale-info/std", + "sp-core/std", + "sp-distance/std", + "sp-keystore/std", + "sp-runtime/std", +] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] +try-runtime = [ + "frame-support/try-runtime", + "pallet-distance/try-runtime", + "sp-distance/try-runtime", + "sp-runtime/try-runtime", +] -[dependencies.sp-runtime] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-support = { workspace = true } +log = { workspace = true } +pallet-distance = { workspace = true } +sc-client-api = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-keystore = { workspace = true } +sp-runtime = { workspace = true } +thiserror = { workspace = true } diff --git a/distance-oracle/Cargo.toml b/distance-oracle/Cargo.toml index bc70ca786a89b8c33a97c98993c44bffbf13945f..3f7614e3e36e6ddd85b76bf55a5df00e11bd59c1 100644 --- a/distance-oracle/Cargo.toml +++ b/distance-oracle/Cargo.toml @@ -1,46 +1,54 @@ [package] name = "distance-oracle" version = "0.1.0" -authors = ["tuxmain <tuxmain@zettascript.org>"] -repository = "https://git.duniter.org/nodes/rust/duniter-v2s" -license = "AGPL-3.0-only" -edition = "2021" +authors.workspace = true +repository.workspace = true +license.workspace = true +edition.workspace = true -[dependencies] - -# standalone only -clap = { version = "4.4.18", features = ["derive"], optional = true } +[[bin]] +name = "distance-oracle" +required-features = ["standalone"] -codec = { package = "parity-scale-codec", version = "3.6.9" } -fnv = "1.0.7" -log = "0.4.20" -num-traits = "0.2.17" -rayon = "1.8.1" -simple_logger = "4.3.3" -hex = "0.4.3" +[features] +default = ["standalone", "std"] +standalone = ["clap", "tokio"] +std = [ + "codec/std", + "fnv/std", + "hex/std", + "log/std", + "num-traits/std", + "sp-core/std", + "sp-distance/std", + "sp-runtime/std", +] +try-runtime = ["sp-distance/try-runtime", "sp-runtime/try-runtime"] +runtime-benchmarks = [] -sp-core = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.6.0" } -sp-distance = { path = "../primitives/distance" } -sp-runtime = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.6.0" } -subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.34.0-duniter-substrate-v1.6.0', default-features = false, features = ["substrate-compat", "native", "jsonrpsee"] } -time = "0.3.31" -time-macros = "0.2.16" -tokio = { version = "1.35.1", features = [ +[dependencies] +clap = { workspace = true, features = ["derive"], optional = true } +codec = { workspace = true } +fnv = { workspace = true } +hex = { workspace = true } +log = { workspace = true } +num-traits = { workspace = true } +rayon = { workspace = true } +simple_logger = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-runtime = { workspace = true } +subxt = { workspace = true, features = [ + "substrate-compat", + "native", + "jsonrpsee", +] } +tokio = { workspace = true, features = [ "rt-multi-thread", "macros", ], optional = true } [dev-dependencies] -bincode = "1.3.3" -dubp-wot = "0.11.1" -flate2 = { version = "1.0.28", features = [ - "zlib-ng-compat", -], default-features = false } - -[features] -default = ["standalone"] -standalone = ["clap", "tokio"] - -[[bin]] -name = "distance-oracle" -required-features = ["standalone"] +bincode = { workspace = true } +dubp-wot = { workspace = true } +flate2 = { workspace = true, features = ["zlib-ng-compat"] } diff --git a/docker/Dockerfile b/docker/Dockerfile index 70d51ae6f49312264a646b78d362b41f3103dde0..62f423629f7fe37f117f0921f5f119843f633237 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,11 +33,6 @@ RUN if [ "$debug" = 0 ]; then \ echo "TARGET_FOLDER=debug" >>/root/dynenv; \ fi -ARG benchmarks=0 -RUN if [ "$benchmarks" != 0 ]; then \ - echo "BENCH_OPTIONS=--features\ runtime-benchmarks" >>/root/dynenv; \ - fi - # Configure cross-build environment if need be RUN set -x && \ if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ @@ -69,11 +64,6 @@ RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ mv cucumber_tests* ../../../build/duniter-cucumber; \ fi -# Run runtime benchmarks -RUN if [ "$benchmarks" != 0 ]; then \ - build/duniter benchmark pallet --chain dev --execution=wasm --wasm-execution=compiled --pallet "*" --extrinsic "*" --steps 2 --repeat 1; \ - fi - # ------------------------------------------------------------------------------ # Final Stage # ------------------------------------------------------------------------------ diff --git a/docs/dev/beginner-walkthrough.md b/docs/dev/beginner-walkthrough.md index 341be1e587b144e743e86b3aeffb4d2adcb1ffb1..fc1a8bed267b29537211c52d14c77ede638c93d2 100644 --- a/docs/dev/beginner-walkthrough.md +++ b/docs/dev/beginner-walkthrough.md @@ -2,7 +2,7 @@ This is a beginner tutorial for those who do not have a previous experience with Rust ecosystem or need guidance to get familiar with Duniter v2s project. You'll need a development machine with an internet connection, at least **20 GB of free storage**, and **an hour or two** depending on your computing power. -This walkthrough is based on the following video (french), don't hesitate to record an english voicecover if you feel so. +This walkthrough is based on the following video (french), don't hesitate to record an english voiceover if you feel so. [](https://tube.p2p.legal/w/n4TXxQ4SqxzpHPY4TNMXFu) diff --git a/docs/dev/verify-runtime-code.md b/docs/dev/verify-runtime-code.md index a00a8a55f41ce5b5d12f749eb56ca19293b20631..61653fd4d3581fcce901811bfbbaec40c91f7357 100644 --- a/docs/dev/verify-runtime-code.md +++ b/docs/dev/verify-runtime-code.md @@ -2,14 +2,18 @@ When voting for a runtime upgrade, you should check that the proposed hash actually corresponds to the published code you reviewed. Otherwise, a malicious runtime upgrade could be advertised as a legitimate one. -```docker +```sh +mkdir runtime/gdev/target +chmod o+w runtime/gdev/target +# Workaround see !239 +echo -e "[toolchain]\nchannel = \"1.74.0\"\ncomponents = [ \"rust-std\", \"rust-src\" ]" > runtime/gdev/rust-toolchain.toml docker run \ -i \ --rm \ -e PACKAGE=gdev-runtime \ -e RUNTIME_DIR=runtime/gdev \ -v $PWD:/build \ - paritytech/srtool:1.60.0 build --app --json -cM + paritytech/srtool:1.74.0-0.13.0 build --app --json -cM ``` Then, the runtime wasm bytecode is generated in this location: @@ -19,5 +23,6 @@ runtime/gdev/target/srtool/release/wbuild/gdev-runtime/gdev_runtime.compact.comp ``` To compare it to last official : + - download it here : https://git.duniter.org/nodes/rust/duniter-v2s/-/releases - compare `sha256sum` of it and of the one you've built diff --git a/docs/user/autocompletion.md b/docs/user/autocompletion.md index 6454542aeba79f7433f209b2c431933982a20a84..a0b70c5f2485b946f678ad61c8a3ca205207400a 100644 --- a/docs/user/autocompletion.md +++ b/docs/user/autocompletion.md @@ -1,6 +1,6 @@ # Autocompletion -One can generate autocompletion for its favorite shell using the following option: +You can generate autocompletion for your favorite shell using the following option: ```sh cargo run -- completion --generator <GENERATOR> diff --git a/end2end-tests/Cargo.toml b/end2end-tests/Cargo.toml index a59b3faaeb994da0125205b474d8cd6abefb53f9..d045afbb890d7429f99f0cb14e798b5ef738795a 100644 --- a/end2end-tests/Cargo.toml +++ b/end2end-tests/Cargo.toml @@ -1,33 +1,53 @@ [package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -description = 'duniter end2end tests.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'duniter-end2end-tests' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' - -[dev-dependencies] -anyhow = "1.0" -async-trait = "0.1.74" -clap = { version = "3.2.23", features = ["derive", "cargo"] } # end2end cli refactoring need to upgrade to 4 -ctrlc = "3.2.2" -cucumber = "0.11" -distance-oracle = { path = "../distance-oracle", default_features = false } -env_logger = "0.9.0" -hex = "0.4.3" -notify = "4.0" -parity-scale-codec = "3.4.0" -portpicker = "0.1.1" -serde_json = "1.0.96" -sp-core = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-core-hashing = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0", default-features = false } -sp-runtime = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0" } -sp-keyring = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0" } -subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.34.0-duniter-substrate-v1.6.0', default-features = false, features = ["substrate-compat", "native", "jsonrpsee"] } -tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"], default-features = false } +authors.workspace = true +description = "duniter end2end tests" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "duniter-end2end-tests" +repository.workspace = true +version.workspace = true [[test]] name = "cucumber_tests" harness = false # allows Cucumber to print output instead of libtest + +[features] +default = ["std"] +std = [ + "anyhow/std", + "codec/std", + "distance-oracle/std", + "hex/std", + "serde_json/std", + "sp-core-hashing/std", + "sp-core/std", + "sp-runtime/std", +] +standalone = ["distance-oracle/standalone"] +try-runtime = ["distance-oracle/try-runtime", "sp-runtime/try-runtime"] +runtime-benchmarks = [] + +[dev-dependencies] +anyhow = { workspace = true } +clap = { workspace = true, features = ["derive", "cargo"] } +codec = { workspace = true } +ctrlc = { workspace = true } +cucumber = { workspace = true, features = ["macros"] } +distance-oracle = { workspace = true } +env_logger = { workspace = true } +hex = { workspace = true } +notify = { workspace = true } +notify-debouncer-mini = { workspace = true } +portpicker = { workspace = true } +serde_json = { workspace = true } +sp-core = { workspace = true } +sp-core-hashing = { workspace = true } +sp-keyring = { workspace = true } +sp-runtime = { workspace = true } +subxt = { workspace = true, features = [ + "substrate-compat", + "native", + "jsonrpsee", +] } +tokio = { workspace = true, features = ["macros", "time", "rt-multi-thread"] } diff --git a/end2end-tests/README.md b/end2end-tests/README.md index 79da56e7fded4010bf8fd29abdc05109db261538..5e298eb7509e62817f3f6f86637ae0bb00faf3c4 100644 --- a/end2end-tests/README.md +++ b/end2end-tests/README.md @@ -134,7 +134,7 @@ To run all the scenarios (there are many) use the command: `cargo cucumber` You can filter the `.feature` files to run with the option `i`, for instance: ``` -cargo cucumber -i monetary* +cargo cucumber -i 'monetary*' ``` will only run `.feature` files that start with `"monetary"`. diff --git a/end2end-tests/tests/common/mod.rs b/end2end-tests/tests/common/mod.rs index 6b65e5ec757f6ba4085b04223ac4c7f1b62d4c2f..6e61a839878013481132b382521131d0f38e12d3 100644 --- a/end2end-tests/tests/common/mod.rs +++ b/end2end-tests/tests/common/mod.rs @@ -29,7 +29,8 @@ pub mod oneshot; pub mod gdev {} use anyhow::anyhow; -use parity_scale_codec::Encode; +use codec::Encode; +use notify_debouncer_mini::new_debouncer; use serde_json::Value; use sp_keyring::AccountKeyring; use std::io::prelude::*; @@ -274,16 +275,19 @@ fn wait_until_log_line(expected_log_line: &str, log_file_path: &str, timeout: Du } } else { let (tx, rx) = std::sync::mpsc::channel(); - let mut watcher = notify::watcher(tx, std::time::Duration::from_millis(100)).unwrap(); - use notify::Watcher as _; - watcher - .watch(log_file_path, notify::RecursiveMode::NonRecursive) + let mut debouncer = new_debouncer(std::time::Duration::from_millis(100), tx).unwrap(); + debouncer + .watcher() + .watch( + Path::new(log_file_path), + notify::RecursiveMode::NonRecursive, + ) .unwrap(); let mut pos = 0; loop { match rx.recv_timeout(timeout) { - Ok(notify::DebouncedEvent::Write(_)) => { + Ok(_) => { let mut file = std::fs::File::open(log_file_path).unwrap(); file.seek(std::io::SeekFrom::Start(pos)).unwrap(); pos = file.metadata().unwrap().len(); @@ -295,7 +299,6 @@ fn wait_until_log_line(expected_log_line: &str, log_file_path: &str, timeout: Du } } } - Ok(_) => {} Err(err) => { eprintln!("Error: {:?}", err); std::process::exit(1); diff --git a/end2end-tests/tests/cucumber_tests.rs b/end2end-tests/tests/cucumber_tests.rs index e63495dff01ad78930744ddb0c5747a7f3058d9a..5c174c954d817b8a5ec0751818e82f2bf7359060 100644 --- a/end2end-tests/tests/cucumber_tests.rs +++ b/end2end-tests/tests/cucumber_tests.rs @@ -16,11 +16,10 @@ mod common; -use async_trait::async_trait; use common::*; -use cucumber::{given, then, when, FailureWriter, World, WorldInit}; +use cucumber::StatsWriter; +use cucumber::{given, then, when, World}; use sp_keyring::AccountKeyring; -use std::convert::Infallible; use std::path::PathBuf; use std::str::FromStr; use std::sync::{ @@ -31,7 +30,7 @@ use subxt::backend::rpc::RpcClient; // ===== world ===== -#[derive(WorldInit)] +#[derive(cucumber::World, Default)] pub struct DuniterWorld { ignore_errors: bool, inner: Option<DuniterWorldInner>, @@ -130,19 +129,6 @@ impl std::fmt::Debug for DuniterWorld { } } -#[async_trait(?Send)] -impl World for DuniterWorld { - // We do require some error type. - type Error = Infallible; - - async fn new() -> std::result::Result<Self, Infallible> { - Ok(Self { - ignore_errors: false, - inner: None, - }) - } -} - struct DuniterWorldInner { client: FullClient, process: Option<Process>, @@ -594,19 +580,19 @@ async fn identity_status_should_be( #[derive(clap::Args)] struct CustomOpts { /// Keep running - #[clap(short, long)] + #[arg(short, long)] keep_running: bool, /// Do not spawn a node, reuse expected node on port 9944 - #[clap(long)] + #[arg(long)] no_spawn: bool, /// For compliance with Jetbrains IDE which pushes extra args. /// https://youtrack.jetbrains.com/issue/CPP-33071/cargo-test-adds-extra-options-which-conflict-with-Cucumber - #[clap(short, long)] + #[arg(short, long)] format: Option<String>, - #[clap(short, long = "show-output")] + #[arg(short, long = "show-output")] show_output: bool, - #[clap(short = 'Z', long)] + #[arg(short = 'Z', long)] z: Option<String>, } @@ -650,7 +636,7 @@ async fn main() { world.set_ignore_errors(ignore_errors(&scenario.tags)); Box::pin(world.init(Some(genesis_conf_file_path), no_spawn)) }) - .after(move |_feature, _rule, _scenario, maybe_world| { + .after(move |_feature, _rule, _scenario, _ev, maybe_world| { if keep_running { while running.load(Ordering::SeqCst) {} } diff --git a/live-tests/Cargo.toml b/live-tests/Cargo.toml index ab7efc7fdff404ad83b61851e716447c1d20b8b4..620bfd4b534cee4e3aa0fff458e2094ee59b4c55 100644 --- a/live-tests/Cargo.toml +++ b/live-tests/Cargo.toml @@ -1,19 +1,28 @@ [package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -description = 'duniter live tests.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'duniter-live-tests' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter live tests" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "duniter-live-tests" +repository.workspace = true +version.workspace = true [dev-dependencies] -anyhow = "1.0" -countmap = "0.2.0" -hex-literal = "0.4" -parity-scale-codec = "3.4.0" -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, features = ["std"] } # https://github.com/paritytech/subxt/issues/437 -subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.34.0-duniter-substrate-v1.6.0', default-features = false, features = ["substrate-compat", "native", "jsonrpsee"] } -tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"], default-features = false } +anyhow = { workspace = true } +codec = { workspace = true } +countmap = { workspace = true } +hex-literal = { workspace = true } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +subxt = { workspace = true, features = [ + "substrate-compat", + "native", + "jsonrpsee", +] } +tokio = { workspace = true, features = ["macros", "time", "rt-multi-thread"] } + +[features] +runtime-benchmarks = [] +std = [] +try-runtime = [] diff --git a/node/Cargo.toml b/node/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..35f856a5788f992ebb5d9b0be65171c2a5eb591a --- /dev/null +++ b/node/Cargo.toml @@ -0,0 +1,188 @@ +[package] +authors.workspace = true +build = "build.rs" +description = "Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "duniter" +repository.workspace = true +version = "0.8.0" +default-run = "duniter" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[[bin]] +bench = false +name = "duniter" +path = "src/main.rs" + +[features] +default = ["distance-oracle", "gdev"] +gdev = ["gdev-runtime", "std"] +g1 = ["g1-runtime", "std"] +constant-fees = [ + "common-runtime/constant-fees", + "g1-runtime/constant-fees", + "gdev-runtime/constant-fees", + "gtest-runtime/constant-fees", +] +gtest = ["gtest-runtime", "std"] +embed = [] +runtime-benchmarks = [ + "common-runtime/runtime-benchmarks", + "dc-distance/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "g1-runtime/runtime-benchmarks", + "gdev-runtime/runtime-benchmarks", + "gtest-runtime/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "sc-client-db/runtime-benchmarks", + "sc-service/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] +try-runtime = [ + "common-runtime/try-runtime", + "dc-distance/try-runtime", + "distance-oracle?/try-runtime", + "frame-system/try-runtime", + "g1-runtime/try-runtime", + "gdev-runtime/try-runtime", + "gtest-runtime/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-im-online/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "sp-distance/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", + "try-runtime-cli", + "try-runtime-cli?/try-runtime", +] +std = [ + "bs58/std", + "common-runtime/std", + "dc-distance/std", + "distance-oracle?/std", + "frame-benchmarking/std", + "frame-system/std", + "futures/std", + "g1-runtime/std", + "gdev-runtime/std", + "gtest-runtime/std", + "hex/std", + "log/std", + "num-format/std", + "pallet-grandpa/std", + "pallet-im-online/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "sc-executor/std", + "serde/std", + "serde_json/std", + "sp-api/std", + "sp-authority-discovery/std", + "sp-block-builder/std", + "sp-consensus-babe/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-distance/std", + "sp-inherents/std", + "sp-io/std", + "sp-keystore/std", + "sp-membership/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-storage/std", + "sp-timestamp/std", + "sp-transaction-pool/std", + "sp-transaction-storage-proof/std", + "sp-trie/std", +] +standalone = ["distance-oracle?/standalone"] + +[dependencies] +async-io = { workspace = true } +bs58 = { workspace = true } +clap = { workspace = true, features = ["derive"] } +clap_complete = { workspace = true } +common-runtime = { workspace = true } +dc-distance = { workspace = true } +distance-oracle = { workspace = true, optional = true } +frame-benchmarking = { workspace = true } +frame-benchmarking-cli = { workspace = true } +frame-system = { workspace = true } +futures = { workspace = true, features = ["compat"] } +g1-runtime = { workspace = true, optional = true } +gdev-runtime = { workspace = true, optional = true } +gtest-runtime = { workspace = true, optional = true } +hex = { workspace = true } +jsonrpsee = { workspace = true, features = ["server"] } +log = { workspace = true } +memmap2 = { workspace = true } +num-format = { workspace = true } +pallet-grandpa = { workspace = true } +pallet-im-online = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +sc-basic-authorship = { workspace = true } +sc-chain-spec = { workspace = true } +sc-client-api = { workspace = true } +sc-client-db = { workspace = true } +sc-consensus = { workspace = true } +sc-consensus-babe = { workspace = true } +sc-consensus-babe-rpc = { workspace = true } +sc-consensus-grandpa = { workspace = true } +sc-consensus-manual-seal = { workspace = true } +sc-executor = { workspace = true } +sc-keystore = { workspace = true } +sc-network = { workspace = true } +sc-offchain = { workspace = true } +sc-rpc-api = { workspace = true } +sc-telemetry = { workspace = true } +sc-transaction-pool = { workspace = true } +sc-transaction-pool-api = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_yaml = { workspace = true } +sp-api = { workspace = true } +sp-authority-discovery = { workspace = true } +sp-block-builder = { workspace = true } +sp-blockchain = { workspace = true } +sp-consensus = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-grandpa = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-keyring = { workspace = true } +sp-keystore = { workspace = true } +sp-membership = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-storage = { workspace = true } +sp-timestamp = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-transaction-storage-proof = { workspace = true } +substrate-frame-rpc-system = { workspace = true } +try-runtime-cli = { workspace = true, optional = true } + +[build-dependencies] +substrate-build-script-utils = { workspace = true } + +# Dependencies for specific targets +[target.'cfg(any(target_arch="x86_64", target_arch="aarch64"))'.dependencies] +sc-cli = { workspace = true } +sc-service = { workspace = true } +sp-trie = { workspace = true } diff --git a/node/src/chain_spec/gdev.rs b/node/src/chain_spec/gdev.rs index f43332a4c5dfcfd488992c34115506779a3de16b..45a6f051423d9cc5e3e5d774389f7bc7941e3413 100644 --- a/node/src/chain_spec/gdev.rs +++ b/node/src/chain_spec/gdev.rs @@ -14,20 +14,17 @@ // You should have received a copy of the GNU Affero General Public License // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. -#![allow(deprecated)] - use super::*; use crate::chain_spec::gen_genesis_data::{ AuthorityKeys, CommonParameters, GenesisIdentity, SessionKeysProvider, }; use common_runtime::constants::*; use common_runtime::entities::IdtyData; -use common_runtime::*; +use common_runtime::GenesisIdty; +use common_runtime::IdtyStatus; use gdev_runtime::{ - opaque::SessionKeys, pallet_universal_dividend, parameters, AccountConfig, - AuthorityMembersConfig, BabeConfig, BalancesConfig, CertificationConfig, IdentityConfig, - MembershipConfig, ParametersConfig, QuotaConfig, Runtime, RuntimeGenesisConfig, SessionConfig, - SmithMembersConfig, SudoConfig, TechnicalCommitteeConfig, UniversalDividendConfig, WASM_BINARY, + opaque::SessionKeys, pallet_universal_dividend, parameters, Runtime, RuntimeGenesisConfig, + WASM_BINARY, }; use jsonrpsee::core::JsonValue; use sc_network::config::MultiaddrWithPeerId; @@ -108,48 +105,32 @@ fn get_parameters(parameters_from_file: &Option<GenesisParameters>) -> CommonPar /// generate development chainspec with Alice validator pub fn gdev_development_chain_spec(config_file_path: String) -> Result<ChainSpec, String> { - let wasm_binary = - get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - // Name - "Development", - // ID - "gdev", - // chain type - sc_service::ChainType::Development, - // constructor - move || { - let genesis_data = - gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GDevSKP>( - config_file_path.clone(), - get_parameters, - Some("Alice".to_owned()), - ) - .expect("Genesis Data must be buildable"); - genesis_data_to_gdev_genesis_conf(genesis_data) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - //Fork ID + Ok(ChainSpec::builder( + &get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?, None, - // Properties - Some( - serde_json::json!({ - "tokenDecimals": TOKEN_DECIMALS, - "tokenSymbol": TOKEN_SYMBOL, - }) - .as_object() - .expect("must be a map") - .clone(), - ), - // Extensions - None, - &wasm_binary.to_vec().clone(), // TODO upgrade to builder - )) + ) + .with_name("Development") + .with_id("gdev") + .with_chain_type(ChainType::Development) + .with_genesis_config_patch({ + let genesis_data = gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GDevSKP>( + config_file_path.clone(), + get_parameters, + Some("Alice".to_owned()), + ) + .expect("Genesis Data must be buildable"); + genesis_data_to_gdev_genesis_conf(genesis_data) + }) + .with_properties( + serde_json::json!({ + "tokenDecimals": TOKEN_DECIMALS, + "tokenSymbol": TOKEN_SYMBOL, + }) + .as_object() + .expect("must be a map") + .clone(), + ) + .build()) } // === client specifications === @@ -177,38 +158,26 @@ pub fn gen_live_conf( client_spec: ClientSpec, config_file_path: String, ) -> Result<ChainSpec, String> { - let wasm_binary = get_wasm_binary().ok_or_else(|| "wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - // Name - client_spec.name.as_str(), - // ID - client_spec.id.as_str(), - // chain type - client_spec.chain_type, - move || { - let genesis_data = - gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GDevSKP>( - config_file_path.clone(), - get_parameters, - None, - ) - .expect("Genesis Data must be buildable"); - genesis_data_to_gdev_genesis_conf(genesis_data) - }, - // Bootnodes - client_spec.boot_nodes, - // Telemetry (by default, enable telemetry, can be disabled with argument) - client_spec.telemetry_endpoints, - // Protocol ID - Some("gdev2"), - //Fork ID - None, - // Properties - client_spec.properties, - // Extensions + Ok(ChainSpec::builder( + &get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?, None, - &wasm_binary.clone(), // TODO upgrade to builder - )) + ) + .with_name(client_spec.name.as_str()) + .with_id(client_spec.id.as_str()) + .with_chain_type(client_spec.chain_type) + .with_genesis_config_patch({ + let genesis_data = gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GDevSKP>( + config_file_path.clone(), + get_parameters, + None, + ) + .expect("Genesis Data must be buildable"); + genesis_data_to_gdev_genesis_conf(genesis_data) + }) + .with_telemetry_endpoints(client_spec.telemetry_endpoints.unwrap()) + .with_properties(client_spec.properties.unwrap()) + .with_boot_nodes(client_spec.boot_nodes) + .build()) } /// generate local network chainspects @@ -217,21 +186,16 @@ pub fn local_testnet_config( initial_smiths_len: usize, initial_identities_len: usize, ) -> Result<ChainSpec, String> { - let wasm_binary = get_wasm_binary().ok_or_else(|| "wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - // Name - "Ğdev Local Testnet", - // ID - "gdev_local", - ChainType::Local, - // constructor - move || { - let genesis_data = gen_genesis_data::generate_genesis_data_for_local_chain::< - _, - _, - SessionKeys, - GDevSKP, - >( + Ok(ChainSpec::builder( + &get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?, + None, + ) + .with_name("Ğdev Local Testnet") + .with_id("gdev_local") + .with_chain_type(ChainType::Local) + .with_genesis_config_patch({ + let genesis_data = + gen_genesis_data::generate_genesis_data_for_local_chain::<_, _, SessionKeys, GDevSKP>( // Initial authorities len initial_authorities_len, // Initial smiths len, @@ -245,36 +209,24 @@ pub fn local_testnet_config( get_parameters, ) .expect("Genesis Data must be buildable"); - genesis_data_to_gdev_genesis_conf(genesis_data) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - //Fork ID - None, - // Properties - Some( - serde_json::json!({ - "tokenDecimals": TOKEN_DECIMALS, - "tokenSymbol": TOKEN_SYMBOL, - }) - .as_object() - .expect("must be a map") - .clone(), - ), - // Extensions - None, - &wasm_binary.clone(), // TODO upgrade to builder - )) + genesis_data_to_gdev_genesis_conf(genesis_data) + }) + .with_properties( + serde_json::json!({ + "tokenDecimals": TOKEN_DECIMALS, + "tokenSymbol": TOKEN_SYMBOL, + }) + .as_object() + .expect("must be a map") + .clone(), + ) + .build()) } /// custom genesis fn genesis_data_to_gdev_genesis_conf( genesis_data: super::gen_genesis_data::GenesisData<GenesisParameters, SessionKeys>, -) -> gdev_runtime::RuntimeGenesisConfig { +) -> serde_json::Value { let super::gen_genesis_data::GenesisData { accounts, treasury_balance, @@ -294,45 +246,38 @@ fn genesis_data_to_gdev_genesis_conf( ud, } = genesis_data; - gdev_runtime::RuntimeGenesisConfig { - system: Default::default(), - account: AccountConfig { - accounts, - treasury_balance, + serde_json::json!({ + "account": { + "accounts": accounts, + "treasuryBalance": treasury_balance, }, - parameters: ParametersConfig { - parameters: parameters.expect("mandatory for GDev"), + "parameters": { + "parameters": parameters.expect("mandatory for GDev"), }, - authority_discovery: Default::default(), - authority_members: AuthorityMembersConfig { - initial_authorities, + "authorityMembers": { + "initialAuthorities": initial_authorities, }, - balances: BalancesConfig { - total_issuance: initial_monetary_mass, + "balances": { + "totalIssuance": initial_monetary_mass, }, - babe: BabeConfig { - authorities: Vec::with_capacity(0), - epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG), - _config: Default::default(), + "babe": { + "epochConfig": Some(BABE_GENESIS_EPOCH_CONFIG), }, - grandpa: Default::default(), - im_online: Default::default(), - session: SessionConfig { - keys: session_keys_map + "session": { + "keys": session_keys_map .into_iter() .map(|(account_id, session_keys)| (account_id.clone(), account_id, session_keys)) .collect::<Vec<_>>(), }, - sudo: SudoConfig { key: sudo_key }, - technical_committee: TechnicalCommitteeConfig { - members: technical_committee_members, - ..Default::default() + "sudo": { "key": sudo_key }, + "technicalCommittee": { + "members": technical_committee_members, }, - quota: QuotaConfig { - identities: identities.iter().map(|i| i.idty_index).collect(), + "quota": { + "identities": identities.iter().map(|i| i.idty_index).collect::<Vec<_>>(), }, - identity: IdentityConfig { - identities: identities + "identity": { + "identities": identities .into_iter() .map( |GenesisIdentity { @@ -364,23 +309,21 @@ fn genesis_data_to_gdev_genesis_conf( }, }, ) - .collect(), + .collect::<Vec<GenesisIdty<gdev_runtime::Runtime>>>(), }, - certification: CertificationConfig { - apply_cert_period_at_genesis: false, - certs_by_receiver, + "certification": { + "applyCertPeriodAtGenesis": false, + "certsByReceiver": certs_by_receiver, }, - membership: MembershipConfig { memberships }, - smith_members: SmithMembersConfig { initial_smiths }, - universal_dividend: UniversalDividendConfig { - first_reeval: first_ud_reeval, - first_ud, - initial_monetary_mass, - ud, + "membership": { "memberships": memberships }, + "smithMembers": { "initialSmiths": initial_smiths}, + "universalDividend": { + "firstReeval": first_ud_reeval, + "firstUd": first_ud, + "initialMonetaryMass": initial_monetary_mass, + "ud": ud, }, - treasury: Default::default(), - transaction_payment: Default::default(), - } + }) } fn get_local_chain_parameters() -> Option<GenesisParameters> { diff --git a/node/src/chain_spec/gtest.rs b/node/src/chain_spec/gtest.rs index b4c37dbe6ffee3d30aba933a0d32c37d500010ef..018b130b0254e9fdf1074db8b69517657a6e9de3 100644 --- a/node/src/chain_spec/gtest.rs +++ b/node/src/chain_spec/gtest.rs @@ -14,19 +14,16 @@ // You should have received a copy of the GNU Affero General Public License // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. -#![allow(deprecated)] - use super::*; use crate::chain_spec::gen_genesis_data::{CommonParameters, GenesisIdentity, SessionKeysProvider}; use common_runtime::constants::*; use common_runtime::entities::IdtyData; -use common_runtime::*; -use gtest_runtime::SmithMembersConfig; +use common_runtime::GenesisIdty; +use common_runtime::IdtyStatus; +use gtest_runtime::ImOnlineId; use gtest_runtime::{ - opaque::SessionKeys, pallet_universal_dividend, parameters, AccountConfig, AccountId, - AuthorityMembersConfig, BabeConfig, BalancesConfig, CertificationConfig, GenesisConfig, - IdentityConfig, ImOnlineId, MembershipConfig, Perbill, QuotaConfig, Runtime, SessionConfig, - SudoConfig, TechnicalCommitteeConfig, UniversalDividendConfig, WASM_BINARY, + opaque::SessionKeys, pallet_universal_dividend, parameters, AccountId, Perbill, Runtime, + RuntimeGenesisConfig, WASM_BINARY, }; use jsonrpsee::core::JsonValue; use sc_consensus_grandpa::AuthorityId as GrandpaId; @@ -39,7 +36,7 @@ use sp_consensus_babe::AuthorityId as BabeId; use sp_core::Get; use std::{env, fs}; -pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>; +pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig>; pub type AuthorityKeys = ( AccountId, GrandpaId, @@ -134,47 +131,32 @@ pub struct ClientSpec { /// generate development chainspec with Alice validator // there is some code duplication because we can not use ClientSpec pub fn development_chainspecs(config_file_path: String) -> Result<ChainSpec, String> { - let wasm_binary = get_wasm_binary().ok_or_else(|| "wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - // Name - "ĞTest Development", - // ID - "gtest_dev", - // chain type - sc_service::ChainType::Development, - // constructor - move || { - let genesis_data = - gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>( - config_file_path.clone(), - get_parameters, - Some("Alice".to_owned()), - ) - .expect("Genesis Data must be buildable"); - genesis_data_to_gtest_genesis_conf(genesis_data) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - //Fork ID - None, - // Properties - Some( - serde_json::json!({ - "tokenDecimals": TOKEN_DECIMALS, - "tokenSymbol": TOKEN_SYMBOL, - }) - .as_object() - .expect("must be a map") - .clone(), - ), - // Extensions + Ok(ChainSpec::builder( + &get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?, None, - &wasm_binary.clone(), // TODO upgrade to builder - )) + ) + .with_name("ĞTest Development") + .with_id("gtest_dev") + .with_chain_type(ChainType::Development) + .with_genesis_config_patch({ + let genesis_data = gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>( + config_file_path.clone(), + get_parameters, + Some("Alice".to_owned()), + ) + .expect("Genesis Data must be buildable"); + genesis_data_to_gtest_genesis_conf(genesis_data) + }) + .with_properties( + serde_json::json!({ + "tokenDecimals": TOKEN_DECIMALS, + "tokenSymbol": TOKEN_SYMBOL, + }) + .as_object() + .expect("must be a map") + .clone(), + ) + .build()) } // === live chainspecs === @@ -185,45 +167,32 @@ pub fn live_chainspecs( client_spec: ClientSpec, config_file_path: String, ) -> Result<ChainSpec, String> { - let wasm_binary = get_wasm_binary().ok_or_else(|| "wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - // Name - client_spec.name.as_str(), - // ID - client_spec.id.as_str(), - // chain type - client_spec.chain_type, - // genesis config constructor - move || { - let genesis_data = - gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>( - config_file_path.clone(), - get_parameters, - None, - ) - .expect("Genesis Data must be buildable"); - genesis_data_to_gtest_genesis_conf(genesis_data) - }, - // Bootnodes - client_spec.boot_nodes, - // Telemetry (by default, enable telemetry, can be disabled with argument) - client_spec.telemetry_endpoints, - // Protocol ID - None, - // Fork ID + Ok(ChainSpec::builder( + &get_wasm_binary().ok_or_else(|| "Development wasm not available".to_string())?, None, - // Properties - client_spec.properties, - // Extensions - None, - &wasm_binary.clone(), // TODO upgrade to builder - )) + ) + .with_name(client_spec.name.as_str()) + .with_id(client_spec.id.as_str()) + .with_chain_type(client_spec.chain_type) + .with_genesis_config_patch({ + let genesis_data = gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>( + config_file_path.clone(), + get_parameters, + None, + ) + .expect("Genesis Data must be buildable"); + genesis_data_to_gtest_genesis_conf(genesis_data) + }) + .with_telemetry_endpoints(client_spec.telemetry_endpoints.unwrap()) + .with_properties(client_spec.properties.unwrap()) + .with_boot_nodes(client_spec.boot_nodes) + .build()) } /// custom genesis fn genesis_data_to_gtest_genesis_conf( genesis_data: super::gen_genesis_data::GenesisData<GenesisParameters, SessionKeys>, -) -> gtest_runtime::GenesisConfig { +) -> serde_json::Value { let super::gen_genesis_data::GenesisData { accounts, treasury_balance, @@ -243,43 +212,35 @@ fn genesis_data_to_gtest_genesis_conf( ud, } = genesis_data; - gtest_runtime::GenesisConfig { - system: Default::default(), - account: AccountConfig { - accounts, - treasury_balance, + serde_json::json!({ + "account": { + "accounts": accounts, + "treasuryBalance": treasury_balance, }, - authority_discovery: Default::default(), - authority_members: AuthorityMembersConfig { - initial_authorities, + "authorityMembers": { + "initialAuthorities": initial_authorities, }, - // Necessary to initialize TotalIssuence - balances: BalancesConfig { - total_issuance: initial_monetary_mass, + "balances": { + "totalIssuance": initial_monetary_mass, }, - babe: BabeConfig { - authorities: Vec::with_capacity(0), - epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG), - _config: Default::default(), + "babe": { + "epochConfig": Some(BABE_GENESIS_EPOCH_CONFIG), }, - grandpa: Default::default(), - im_online: Default::default(), - session: SessionConfig { - keys: session_keys_map + "session": { + "keys": session_keys_map .into_iter() .map(|(account_id, session_keys)| (account_id.clone(), account_id, session_keys)) .collect::<Vec<_>>(), }, - sudo: SudoConfig { key: sudo_key }, - technical_committee: TechnicalCommitteeConfig { - members: technical_committee_members, - ..Default::default() + "sudo": { "key": sudo_key }, + "technicalCommittee": { + "members": technical_committee_members, }, - quota: QuotaConfig { - identities: identities.iter().map(|i| i.idty_index).collect(), + "quota": { + "identities": identities.iter().map(|i| i.idty_index).collect::<Vec<_>>(), }, - identity: IdentityConfig { - identities: identities + "identity": { + "identities": identities .into_iter() .map( |GenesisIdentity { @@ -311,25 +272,21 @@ fn genesis_data_to_gtest_genesis_conf( }, }, ) - .collect(), + .collect::<Vec<GenesisIdty<gtest_runtime::Runtime>>>(), }, - certification: CertificationConfig { - apply_cert_period_at_genesis: true, - certs_by_receiver, + "certification": { + "applyCertPeriodAtGenesis": false, + "certsByReceiver": certs_by_receiver, }, - membership: MembershipConfig { memberships }, - smith_members: SmithMembersConfig { initial_smiths }, - universal_dividend: UniversalDividendConfig { - first_reeval: first_ud_reeval, - first_ud, - initial_monetary_mass, - ud, - #[cfg(test)] - initial_members: vec![], + "membership": { "memberships": memberships }, + "smithMembers": { "initialSmiths": initial_smiths}, + "universalDividend": { + "firstReeval": first_ud_reeval, + "firstUd": first_ud, + "initialMonetaryMass": initial_monetary_mass, + "ud": ud, }, - treasury: Default::default(), - transaction_payment: Default::default(), - } + }) } /// Get the WASM bytes either from filesytem (`WASM_FILE` env variable giving the path to the wasm blob) diff --git a/node/src/command.rs b/node/src/command.rs index 14825ec7978b0bf741dc42274c529d78c13eabf6..0173cf03f01b23283029739cdfbeab1b96b2a1c7 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -15,6 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![allow(unused_imports)] + pub mod key; pub mod utils; @@ -24,10 +26,8 @@ use crate::cli::{Cli, Subcommand}; #[cfg(feature = "g1")] use crate::service::g1_executor::G1Executor; #[cfg(feature = "gdev")] -#[cfg(feature = "runtime-benchmarks")] use crate::service::gdev_executor::GDevExecutor; #[cfg(feature = "gtest")] -#[cfg(feature = "runtime-benchmarks")] use crate::service::gtest_executor::GTestExecutor; use crate::service::{IdentifyRuntimeType, RuntimeType}; use crate::{chain_spec, service}; @@ -96,7 +96,7 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> { Ok(match id { // === GDEV === - // developement chainspec with generated genesis and Alice validator + // development chainspec with generated genesis and Alice validator #[cfg(feature = "gdev")] "dev" => Box::new(chain_spec::gdev::local_testnet_config(1, 3, 4)?), // local testnet with g1 data, gdev configuration (parameters & smiths) and Alice validator diff --git a/node/src/service.rs b/node/src/service.rs index 35768f20485af832830b9ed79517fc80e3373243..134e7e49e1ca0596d56cc6ab06897cb2ad246c8e 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -48,6 +48,7 @@ type FullClient<RuntimeApi> = type FullBackend = sc_service::TFullBackend<Block>; type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>; +#[allow(dead_code)] #[cfg(feature = "gdev")] pub mod gdev_executor { pub use gdev_runtime; @@ -66,6 +67,7 @@ pub mod gdev_executor { } } +#[allow(dead_code)] #[cfg(feature = "g1")] pub mod g1_executor { pub use g1_runtime; @@ -84,6 +86,7 @@ pub mod g1_executor { } } +#[allow(dead_code)] #[cfg(feature = "gtest")] pub mod gtest_executor { pub use gtest_runtime; diff --git a/pallets/authority-members/Cargo.toml b/pallets/authority-members/Cargo.toml index 92333b0c15b171b6c5b7472ed7f334226784255e..2e3aa3a14701a2d6e84086fe6ef47f4b73575ccb 100644 --- a/pallets/authority-members/Cargo.toml +++ b/pallets/authority-members/Cargo.toml @@ -1,120 +1,67 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet authority members.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-authority-members' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet authority members" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-authority-members" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'pallet-session/std', - 'pallet-offences/std', - 'serde/std', - 'scale-info/std', - 'sp-core/std', - 'sp-runtime/std', - 'sp-staking/std', - 'sp-std/std', - 'sp-io/std', - 'sp-state-machine/std', - 'log/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "log/std", + "pallet-offences/std", + "pallet-session/std", + "scale-info/std", + "serde/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-staking/std", + "sp-state-machine/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', - 'pallet-session/try-runtime', - 'pallet-offences/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-offences/try-runtime", + "pallet-session/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] - -# crates.io -log = { version = "0.4.20", default-features = false } -# local -pallet-offences = { path = "../offences", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -# substrate -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-session] -default-features = false -features = ["historical"] -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.serde] -optional = true -default-features = false -version = "1.0.195" -features = ["derive"] - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-staking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - [package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.maplit] -default-features = false -version = '1.0.2' - -[dev-dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.sp-state-machine] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +log = { workspace = true } +pallet-offences = { workspace = true } +pallet-session = { workspace = true, features = ["historical"] } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } + +[dev-dependencies] +sp-io = { workspace = true } +sp-state-machine = { workspace = true } diff --git a/pallets/authority-members/src/benchmarking.rs b/pallets/authority-members/src/benchmarking.rs index 893d89ba867bb56f5d9f209536f2df6fccb428e4..808ea5865cee6ab763bcdf1be40adcc66ff08051 100644 --- a/pallets/authority-members/src/benchmarking.rs +++ b/pallets/authority-members/src/benchmarking.rs @@ -17,70 +17,83 @@ #![cfg(feature = "runtime-benchmarks")] use super::*; - -use frame_benchmarking::benchmarks; -use frame_system::RawOrigin; - use crate::Pallet; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} +use frame_benchmarking::v2::*; +use frame_system::RawOrigin; -benchmarks! { - where_clause { +#[benchmarks( where - T::MemberId: From<u32>, + <T as Config>::MemberId: From<u32>, +)] +mod benchmarks { + use super::*; + + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - go_offline { + + #[benchmark] + fn go_offline() { let id: T::MemberId = OnlineAuthorities::<T>::get()[0]; let caller: T::AccountId = Members::<T>::get(id).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - }: _<T::RuntimeOrigin>(caller_origin) - verify { - assert_has_event::<T>(Event::<T>::MemberGoOffline{member: id}.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller)); + + assert_has_event::<T>(Event::<T>::MemberGoOffline { member: id }.into()); } - go_online { + + #[benchmark] + fn go_online() { let id: T::MemberId = OnlineAuthorities::<T>::get()[0]; let caller: T::AccountId = Members::<T>::get(id).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); OnlineAuthorities::<T>::mutate(|ids| { ids.retain(|&x| x != id); }); OutgoingAuthorities::<T>::mutate(|ids| { ids.retain(|&x| x != id); }); - }: _<T::RuntimeOrigin>(caller_origin) - verify { - assert_has_event::<T>(Event::<T>::MemberGoOnline{member: id}.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller)); + + assert_has_event::<T>(Event::<T>::MemberGoOnline { member: id }.into()); } - set_session_keys { + + #[benchmark] + fn set_session_keys() { let id: T::MemberId = OnlineAuthorities::<T>::get()[0]; let caller: T::AccountId = Members::<T>::get(id).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let validator_id = T::ValidatorIdOf::convert(caller.clone()).unwrap(); - let session_keys: T::Keys = pallet_session::NextKeys::<T>::get(validator_id).unwrap(); - }: _<T::RuntimeOrigin>(caller_origin, session_keys) - remove_member { + let validator_id = T::ValidatorIdOf::convert(caller.clone()).unwrap(); + let session_keys: T::Keys = pallet_session::NextKeys::<T>::get(validator_id).unwrap(); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), session_keys); + } + + #[benchmark] + fn remove_member() { let id: T::MemberId = OnlineAuthorities::<T>::get()[0]; - let caller_origin = RawOrigin::Root.into(); - }: _<T::RuntimeOrigin>(caller_origin, id) - verify { - assert_has_event::<T>(Event::<T>::MemberRemoved{member: id}.into()); + + #[extrinsic_call] + _(RawOrigin::Root, id); + + assert_has_event::<T>(Event::<T>::MemberRemoved { member: id }.into()); } - remove_member_from_blacklist { + + #[benchmark] + fn remove_member_from_blacklist() { let id: T::MemberId = OnlineAuthorities::<T>::get()[0]; Blacklist::<T>::mutate(|blacklist| { blacklist.push(id); }); - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), id) - verify { - assert_has_event::<T>(Event::<T>::MemberRemovedFromBlacklist{member: id}.into()); + + #[extrinsic_call] + _(RawOrigin::Root, id); + + assert_has_event::<T>(Event::<T>::MemberRemovedFromBlacklist { member: id }.into()); } - impl_benchmark_test_suite!( - Pallet, - crate::mock::new_test_ext(2), - crate::mock::Test - ); + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(2), crate::mock::Test); } diff --git a/pallets/certification/Cargo.toml b/pallets/certification/Cargo.toml index 8ed57c30a521829c4cbc2f411f061d65b2f6ea54..eff126ff965729be10b2f487ec5ffa34b6b54ac3 100644 --- a/pallets/certification/Cargo.toml +++ b/pallets/certification/Cargo.toml @@ -1,92 +1,58 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet certification.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-certification' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet certification" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-certification" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'scale-info/std', - 'sp-core/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-io/std', + "codec/std", + "duniter-primitives/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-keystore/std", + "sp-runtime/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', + "duniter-primitives/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] -duniter-primitives = { path = "../../primitives/duniter", default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.maplit] -default-features = false -version = '1.0.2' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +targets = ["x86_64-unknown-linux-gnu"] -[dev-dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +duniter-primitives = { workspace = true } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[dev-dependencies] +maplit = { workspace = true } +sp-io = { workspace = true } +sp-keystore = { workspace = true } diff --git a/pallets/certification/src/benchmarking.rs b/pallets/certification/src/benchmarking.rs index 5aa67fdf40a170cd4d629e99ebdf6abbdb26c9d6..7fa0534d5afa95819aacb5b1d522a83d8f20fe4b 100644 --- a/pallets/certification/src/benchmarking.rs +++ b/pallets/certification/src/benchmarking.rs @@ -18,122 +18,160 @@ use super::*; -use frame_benchmarking::benchmarks; +use frame_benchmarking::v2::*; use frame_system::RawOrigin; use sp_runtime::traits::Zero; -#[cfg(test)] -use maplit::btreemap; - use crate::Pallet; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} +#[benchmarks( + where + T::IdtyIndex: From<u32>, +)] +mod benchmarks { + use super::*; -fn add_certs<T: Config>(i: u32, receiver: T::IdtyIndex) -> Result<(), &'static str> { - Pallet::<T>::remove_all_certs_received_by(RawOrigin::Root.into(), receiver)?; - for j in 1..i { - Pallet::<T>::do_add_cert_checked(j.into(), receiver, false)?; + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - assert!( - CertsByReceiver::<T>::get(receiver).len() as u32 == i - 1, - "Certs not added", - ); - Ok(()) -} -benchmarks! { - where_clause { - where - T::IdtyIndex: From<u32>, + fn add_certs<T: Config>(i: u32, receiver: T::IdtyIndex) -> Result<(), &'static str> { + Pallet::<T>::remove_all_certs_received_by(RawOrigin::Root.into(), receiver)?; + for j in 1..i { + Pallet::<T>::do_add_cert_checked(j.into(), receiver, false)?; + } + assert!( + CertsByReceiver::<T>::get(receiver).len() as u32 == i - 1, + "Certs not added", + ); + Ok(()) } - add_cert { + + #[benchmark] + fn add_cert() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); - let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap(); let receiver: T::IdtyIndex = 2.into(); Pallet::<T>::del_cert(RawOrigin::Root.into(), issuer, receiver)?; - let issuer_cert: u32 = StorageIdtyCertMeta::<T>::get(issuer).issued_count; - let receiver_cert: u32 = StorageIdtyCertMeta::<T>::get(receiver).received_count; frame_system::pallet::Pallet::<T>::set_block_number(T::CertPeriod::get()); - }: _<T::RuntimeOrigin>(caller_origin, receiver) - verify { - assert_has_event::<T>(Event::<T>::CertAdded{ issuer, receiver }.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver); + + assert_has_event::<T>(Event::<T>::CertAdded { issuer, receiver }.into()); + Ok(()) } - renew_cert { + #[benchmark] + fn renew_cert() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); - let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller: T::AccountId = T::IdtyAttr::owner_key(issuer).unwrap(); let receiver: T::IdtyIndex = 2.into(); Pallet::<T>::del_cert(RawOrigin::Root.into(), issuer, receiver)?; - let issuer_cert: u32 = StorageIdtyCertMeta::<T>::get(issuer).issued_count; - let receiver_cert: u32 = StorageIdtyCertMeta::<T>::get(receiver).received_count; frame_system::pallet::Pallet::<T>::set_block_number(T::CertPeriod::get()); - Pallet::<T>::add_cert(caller_origin.clone(), receiver)?; - frame_system::pallet::Pallet::<T>::set_block_number(T::CertPeriod::get() + T::CertPeriod::get()); - }: _<T::RuntimeOrigin>(caller_origin, receiver) - verify { - assert_has_event::<T>(Event::<T>::CertAdded{ issuer, receiver }.into()); + Pallet::<T>::add_cert(RawOrigin::Signed(caller.clone()).into(), receiver)?; + frame_system::pallet::Pallet::<T>::set_block_number( + T::CertPeriod::get() + T::CertPeriod::get(), + ); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver); + + assert_has_event::<T>(Event::<T>::CertAdded { issuer, receiver }.into()); + Ok(()) } - del_cert { + #[benchmark] + fn del_cert() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); let receiver: T::IdtyIndex = 2.into(); // try to add cert if missing, else ignore // this depends on initial data let _ = Pallet::<T>::do_add_cert_checked(issuer, receiver, false); - let receiver_cert: u32 = StorageIdtyCertMeta::<T>::get(receiver).received_count; - let issuer_cert: u32 = StorageIdtyCertMeta::<T>::get(issuer).issued_count; - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), issuer, receiver) - verify { - assert_has_event::<T>(Event::<T>::CertRemoved{ issuer, receiver, expiration: false }.into()); + + #[extrinsic_call] + _(RawOrigin::Root, issuer, receiver); + + assert_has_event::<T>( + Event::<T>::CertRemoved { + issuer, + receiver, + expiration: false, + } + .into(), + ); + Ok(()) } - remove_all_certs_received_by { + #[benchmark] + fn remove_all_certs_received_by(i: Linear<2, 1_000>) -> Result<(), BenchmarkError> { let receiver: T::IdtyIndex = 0.into(); - let i in 2..1000 => add_certs::<T>(i, receiver)?; - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), receiver) - verify { - assert!(CertsByReceiver::<T>::get(receiver).is_empty() ); + add_certs::<T>(i, receiver)?; + + #[extrinsic_call] + _(RawOrigin::Root, receiver); + + assert!(CertsByReceiver::<T>::get(receiver).is_empty()); + Ok(()) } - on_initialize { + #[benchmark] + fn on_initialize() { assert!(CertsRemovableOn::<T>::try_get(BlockNumberFor::<T>::zero()).is_err()); - }: {Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero());} - do_remove_cert_noop { - }: {Pallet::<T>::do_remove_cert(100.into(), 101.into(), Some(BlockNumberFor::<T>::zero()));} + #[block] + { + Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero()); + } + } + + #[benchmark] + fn do_remove_cert_noop() { + #[block] + { + Pallet::<T>::do_remove_cert(100.into(), 101.into(), Some(BlockNumberFor::<T>::zero())); + } + } - do_remove_cert { + #[benchmark] + fn do_remove_cert() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); let receiver: T::IdtyIndex = 0.into(); Pallet::<T>::do_remove_cert(issuer, receiver, None); Pallet::<T>::do_add_cert_checked(issuer, receiver, false)?; - let issuer_cert: u32 = StorageIdtyCertMeta::<T>::get(issuer).issued_count; - let receiver_cert: u32 = StorageIdtyCertMeta::<T>::get(receiver).received_count; let block_number = T::ValidityPeriod::get(); frame_system::pallet::Pallet::<T>::set_block_number(block_number); - }: {Pallet::<T>::do_remove_cert(issuer, receiver, Some(block_number));} - verify { - assert_has_event::<T>(Event::<T>::CertRemoved{ issuer, receiver, expiration: true }.into()); + + #[block] + { + Pallet::<T>::do_remove_cert(issuer, receiver, Some(block_number)); + } + + assert_has_event::<T>( + Event::<T>::CertRemoved { + issuer, + receiver, + expiration: true, + } + .into(), + ); + Ok(()) } impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext(crate::mock::DefaultCertificationConfig { - apply_cert_period_at_genesis: true, - certs_by_receiver: btreemap![ - 0 => btreemap![ + apply_cert_period_at_genesis: true, + certs_by_receiver: maplit::btreemap![ + 0 => maplit::btreemap![ 1 => Some(7), 2 => Some(9), ], - 1 => btreemap![ + 1 => maplit::btreemap![ 0 => Some(10), 2 => Some(3), ], - ] , + ], }), crate::mock::Test ); diff --git a/pallets/distance/Cargo.toml b/pallets/distance/Cargo.toml index f9ae014d79ee08c70c77adbcc05a6470827152a8..a878035017afde01f5de90b182930280123502fd 100644 --- a/pallets/distance/Cargo.toml +++ b/pallets/distance/Cargo.toml @@ -1,138 +1,81 @@ [package] -authors = ['tuxmain <tuxmain@zettascript.org>'] -description = 'FRAME pallet distance.' -edition = '2021' -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-distance' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '1.0.0' +authors.workspace = true +description = "duniter pallet distance" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-distance" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', - 'pallet-authority-members/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-authority-members/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'codec/std', - 'scale-info/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'pallet-authority-members/std', - 'pallet-authorship/std', - 'pallet-identity/std', - 'pallet-membership/std', - 'pallet-session/std', - 'pallet-balances/std', - 'sp-io/std', - 'sp-keystore/std', - 'sp-core/std', - 'sp-consensus-babe/std', - 'sp-inherents/std', - 'sp-distance/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-io/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "getrandom/std", + "pallet-authority-members/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-identity/std", + "pallet-session/std", + "scale-info/std", + "sp-consensus-babe/std", + "sp-core/std", + "sp-distance/std", + "sp-inherents/std", + "sp-io/std", + "sp-keystore/std", + "sp-runtime/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', - 'pallet-authority-members/try-runtime', - 'pallet-authorship/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-session/try-runtime', - 'pallet-balances/try-runtime', - 'sp-distance/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-authority-members/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-identity/try-runtime", + "pallet-session/try-runtime", + "sp-distance/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] -getrandom = { version = "0.2.12", features = ["js"], default-features = false } - -pallet-authority-members = { path = "../authority-members", default-features = false } - -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', optional = true, default-features = false } -pallet-identity = { path = "../identity", default-features = false } -pallet-membership = { path = "../membership", default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = [ - "derive", -] } -sp-distance = { path = "../../primitives/distance", default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = '3.6.9' - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-authorship] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-session] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-inherents] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-consensus-babe] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +getrandom = { workspace = true, features = ["js"] } +pallet-authority-members = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-identity = { workspace = true } +pallet-session = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-consensus-babe = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-inherents = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } [dev-dependencies] -sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-keystore = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-io = { workspace = true } +sp-keystore = { workspace = true } diff --git a/pallets/distance/src/benchmarking.rs b/pallets/distance/src/benchmarking.rs index 4b5fb9557650cbae9ec1dc1f758c6de36d3852ec..0e888c8264c180d1ee4f494675ad8a853b4180b6 100644 --- a/pallets/distance/src/benchmarking.rs +++ b/pallets/distance/src/benchmarking.rs @@ -19,7 +19,7 @@ use super::*; use codec::Encode; -use frame_benchmarking::benchmarks; +use frame_benchmarking::v2::*; use frame_support::traits::{Currency, OnFinalize}; use frame_system::pallet_prelude::BlockNumberFor; use frame_system::RawOrigin; @@ -29,92 +29,150 @@ use sp_runtime::Perbill; use crate::Pallet; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} - -fn populate_pool<T: Config>(i: u32) -> Result<(), &'static str> { - EvaluationPool0::<T>::mutate(|current_pool| -> Result<(), &'static str> { - for j in 0..i { - current_pool - .evaluations - .try_push((j, median::MedianAcc::new())) - .map_err(|_| Error::<T>::QueueFull)?; - } - Ok(()) - }) -} - -benchmarks! { - where_clause { +#[benchmarks( where - T: pallet_balances::Config, T::Balance: From<u64>, + T: pallet_balances::Config, + T::Balance: From<u64>, BlockNumberFor<T>: From<u32>, +)] +mod benchmarks { + use super::*; + + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - // request distance evaluation - request_distance_evaluation { + fn populate_pool<T: Config>(i: u32) -> Result<(), &'static str> { + EvaluationPool0::<T>::mutate(|current_pool| -> Result<(), &'static str> { + for j in 0..i { + current_pool + .evaluations + .try_push((j, median::MedianAcc::new())) + .map_err(|_| Error::<T>::QueueFull)?; + } + Ok(()) + }) + } + + #[benchmark] + fn request_distance_evaluation() { let idty = T::IdtyIndex::one(); - let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let _ = <Balances<T> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value()); - }: _<T::RuntimeOrigin>(caller_origin.clone()) - verify { - assert!(PendingEvaluationRequest::<T>::get(idty) == Some(caller.clone()), "Request not added"); - assert_has_event::<T>(Event::<T>::EvaluationRequested { idty_index: idty, who: caller }.into()); + let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty) + .unwrap() + .owner_key; + let _ = + <Balances<T> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone())); + + assert!( + PendingEvaluationRequest::<T>::get(idty) == Some(caller.clone()), + "Request not added" + ); + assert_has_event::<T>( + Event::<T>::EvaluationRequested { + idty_index: idty, + who: caller, + } + .into(), + ); } - // request distance evaluation for - request_distance_evaluation_for { + #[benchmark] + fn request_distance_evaluation_for() { let idty = T::IdtyIndex::one(); - let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let _ = <Balances<T> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value()); - let target = 2u32; + let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty) + .unwrap() + .owner_key; + <Balances<T> as Currency<_>>::make_free_balance_be(&caller, T::Balance::max_value()); + let target: T::IdtyIndex = 2u32; // set target status since targeted distance evaluation only allowed for unvalidated - pallet_identity::Identities::<T>::mutate(target, - |idty_val| idty_val.as_mut().unwrap().status = pallet_identity::IdtyStatus::Unvalidated); - }: _<T::RuntimeOrigin>(caller_origin.clone(), target) - verify { - assert!(PendingEvaluationRequest::<T>::get(target) == Some(caller.clone()), "Request not added"); - assert_has_event::<T>(Event::<T>::EvaluationRequested { idty_index: target, who: caller }.into()); + pallet_identity::Identities::<T>::mutate(target, |idty_val| { + idty_val.as_mut().unwrap().status = pallet_identity::IdtyStatus::Unvalidated + }); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), target); + + assert!( + PendingEvaluationRequest::<T>::get(target) == Some(caller.clone()), + "Request not added" + ); + assert_has_event::<T>( + Event::<T>::EvaluationRequested { + idty_index: target, + who: caller, + } + .into(), + ); } - // update evaluation - update_evaluation { + #[benchmark] + fn update_evaluation(i: Linear<1, MAX_EVALUATIONS_PER_SESSION>) -> Result<(), BenchmarkError> { let digest_data = sp_consensus_babe::digests::PreDigest::SecondaryPlain( - sp_consensus_babe::digests::SecondaryPlainPreDigest { authority_index: 0u32, slot: Default::default() }); + sp_consensus_babe::digests::SecondaryPlainPreDigest { + authority_index: 0u32, + slot: Default::default(), + }, + ); // A BABE digest item is needed to check authorship let digest = sp_runtime::DigestItem::PreRuntime(*b"BABE", digest_data.encode()); - let _ = <frame_system::Pallet<T>>::deposit_log(digest); + <frame_system::Pallet<T>>::deposit_log(digest); + populate_pool::<T>(i)?; + + #[extrinsic_call] + _( + RawOrigin::None, + ComputationResult { + distances: vec![Perbill::one(); i as usize], + }, + ); + + Ok(()) + } + + #[benchmark] + fn force_update_evaluation( + i: Linear<1, MAX_EVALUATIONS_PER_SESSION>, + ) -> Result<(), BenchmarkError> { let idty = T::IdtyIndex::one(); - let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let i in 1 .. MAX_EVALUATIONS_PER_SESSION => populate_pool::<T>(i)?; - }: _<T::RuntimeOrigin>(RawOrigin::None.into(), ComputationResult{distances: vec![Perbill::one(); i as usize]}) - - // force update evaluation - force_update_evaluation { - let idty = T::IdtyIndex::one(); - let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let i in 1 .. MAX_EVALUATIONS_PER_SESSION => populate_pool::<T>(i)?; - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), caller.clone(), ComputationResult{distances: vec![Perbill::one(); i as usize]}) - - // force valid distance status - force_valid_distance_status { + let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty) + .unwrap() + .owner_key; + populate_pool::<T>(i)?; + + #[extrinsic_call] + _( + RawOrigin::Root, + caller, + ComputationResult { + distances: vec![Perbill::one(); i as usize], + }, + ); + + Ok(()) + } + + #[benchmark] + fn force_valid_distance_status() { let idty = T::IdtyIndex::one(); - let caller: T::AccountId = pallet_identity::Identities::<T>::get(idty).unwrap().owner_key; - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), idty) - verify { + + #[extrinsic_call] + _(RawOrigin::Root, idty); + assert_has_event::<T>(Event::<T>::EvaluatedValid { idty_index: idty }.into()); } - // on finalize - on_finalize { + #[benchmark] + fn on_finalize() { DidUpdate::<T>::set(true); - }: { Pallet::<T>::on_finalize(Default::default()); } - verify { + + #[block] + { + Pallet::<T>::on_finalize(Default::default()); + } + assert!(!DidUpdate::<T>::get()); } diff --git a/pallets/distance/src/lib.rs b/pallets/distance/src/lib.rs index ddcff521833871062ddab62fe08951f7d37705c1..4860ff4b4f9e9b9a25a1bc0016500021200559dd 100644 --- a/pallets/distance/src/lib.rs +++ b/pallets/distance/src/lib.rs @@ -555,7 +555,7 @@ pub mod pallet { } Some(false) => { // negative result, slash and deposit event - T::Currency::slash_reserved( + let _ = T::Currency::slash_reserved( &requester, <T as Config>::EvaluationPrice::get(), ); diff --git a/pallets/duniter-account/Cargo.toml b/pallets/duniter-account/Cargo.toml index 304f5f33155b2751faf52c079df0c1cf5e05ccc9..6b0737d783019605791004815da0c68f28097bd4 100644 --- a/pallets/duniter-account/Cargo.toml +++ b/pallets/duniter-account/Cargo.toml @@ -1,130 +1,74 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet for account management' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-duniter-account' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet for account management" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-duniter-account" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-treasury/runtime-benchmarks', - 'pallet-quota/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-quota/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'pallet-balances/std', - 'pallet-transaction-payment/std', - 'pallet-identity/std', - 'pallet-treasury/std', - 'pallet-quota/std', - 'serde/std', - 'log/std', - 'scale-info/std', - 'sp-core/std', - 'sp-io/std', - 'sp-runtime/std', - 'sp-std/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "log/std", + "pallet-balances/std", + "pallet-identity/std", + "pallet-quota/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "scale-info/std", + "serde/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-treasury/try-runtime', - 'pallet-quota/try-runtime', - 'pallet-balances/try-runtime', - 'pallet-transaction-payment/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/try-runtime", + "pallet-identity/try-runtime", + "pallet-quota/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] -# local -pallet-quota = { path = "../quota", default-features = false } -pallet-identity = { path = "../identity", default-features = false } - -# crates.io -codec = { package = 'parity-scale-codec', version = "3.6.9", default-features = false, features = ["derive"] } -log = { version = "0.4.20", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -# substrate -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-balances] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-transaction-payment] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-treasury] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.serde] -default-features = false -version = "1.0.195" -features = ["derive"] - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -### DEV ### +targets = ["x86_64-unknown-linux-gnu"] -[dev-dependencies.maplit] -default-features = false -version = '1.0.2' +[dependencies] +# local +pallet-quota = { workspace = true } +pallet-identity = { workspace = true } +codec = { workspace = true, features = ["derive"] } +log = { workspace = true } +pallet-balances = { workspace = true } +pallet-treasury = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-std = { workspace = true } +sp-runtime = { workspace = true } +serde = { workspace = true, features = ["derive"] } +pallet-transaction-payment = { workspace = true } diff --git a/pallets/duniter-account/src/benchmarking.rs b/pallets/duniter-account/src/benchmarking.rs index 1ff3ec0305a30259a07a0700140db25e10ede3c9..f927742625e1dfb609818763dbd81d7b05cca762 100644 --- a/pallets/duniter-account/src/benchmarking.rs +++ b/pallets/duniter-account/src/benchmarking.rs @@ -18,13 +18,20 @@ use super::*; -use frame_benchmarking::{account, benchmarks}; +use frame_benchmarking::v2::*; +use frame_system::RawOrigin; use crate::Pallet; -benchmarks! { - unlink_identity { +#[benchmarks] +mod benchmarks { + use super::*; + + #[benchmark] + fn unlink_identity() { let account = account("Alice", 1, 1); - let origin = frame_system::RawOrigin::Signed(account); - }: _<T::RuntimeOrigin>(origin.into()) + + #[extrinsic_call] + _(RawOrigin::Signed(account)); + } } diff --git a/pallets/duniter-account/src/weights.rs b/pallets/duniter-account/src/weights.rs index d6e9cf5db9d12f5e8e5764b4e5a8c77f456e868c..6f9544f5b2b1e8c635a43b37ae1da87467754269 100644 --- a/pallets/duniter-account/src/weights.rs +++ b/pallets/duniter-account/src/weights.rs @@ -20,9 +20,6 @@ use frame_support::weights::{constants::RocksDbWeight, Weight}; /// Weight functions needed for pallet_universal_dividend. pub trait WeightInfo { - fn on_initialize_sufficient(i: u32) -> Weight; - fn on_initialize_with_balance(i: u32) -> Weight; - fn on_initialize_no_balance(i: u32) -> Weight; fn unlink_identity() -> Weight; } @@ -39,38 +36,4 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(0, 3591)) .saturating_add(RocksDbWeight::get().reads(1)) } - - // Storage: Babe EpochIndex (r:1 w:0) - /// The range of component `i` is `[0, 1]`. - fn on_initialize_sufficient(i: u32) -> Weight { - // Minimum execution time: 12_958 nanoseconds. - Weight::from_parts(14_907_902 as u64, 0) - // Standard Error: 550_025 - .saturating_add(Weight::from_parts(79_482_297 as u64, 0).saturating_mul(i as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().reads((6 as u64).saturating_mul(i as u64))) - .saturating_add(RocksDbWeight::get().writes((6 as u64).saturating_mul(i as u64))) - } - - // Storage: Babe EpochIndex (r:1 w:0) - /// The range of component `i` is `[0, 1]`. - fn on_initialize_with_balance(i: u32) -> Weight { - // Minimum execution time: 12_965 nanoseconds. - Weight::from_parts(16_754_718 as u64, 0) - // Standard Error: 1_790_537 - .saturating_add(Weight::from_parts(164_043_481 as u64, 0).saturating_mul(i as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().reads((6 as u64).saturating_mul(i as u64))) - .saturating_add(RocksDbWeight::get().writes((6 as u64).saturating_mul(i as u64))) - } - - /// The range of component `i` is `[0, 1]`. - fn on_initialize_no_balance(i: u32) -> Weight { - // Minimum execution time: 12_912 nanoseconds. - Weight::from_parts(13_846_469 as u64, 0) - // Standard Error: 115_598 - .saturating_add(Weight::from_parts(67_524_530 as u64, 0).saturating_mul(i as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(i as u64))) - } } diff --git a/pallets/duniter-test-parameters/Cargo.toml b/pallets/duniter-test-parameters/Cargo.toml index faf557e6a4443fce594363c57c007849d18efd87..735c973357204e65c0b1e327412f5c8a49360306 100644 --- a/pallets/duniter-test-parameters/Cargo.toml +++ b/pallets/duniter-test-parameters/Cargo.toml @@ -1,83 +1,52 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'Duniter test parameters.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-duniter-test-parameters' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet test parameters" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-duniter-test-parameters" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'scale-info/std', - 'serde/std', - 'codec/std', - 'frame-benchmarking?/std', - 'frame-support/std', - 'frame-system/std', - "sp-io/std", - "sp-runtime/std", - "sp-std/std", + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "serde/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] -pallet-duniter-test-parameters-macro = { path = "macro", default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", features = ["derive"], default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-duniter-test-parameters-macro = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } diff --git a/pallets/duniter-test-parameters/macro/Cargo.toml b/pallets/duniter-test-parameters/macro/Cargo.toml index a7d9b0701d1ab9037899d0cf1b100612a075c1f3..9598716a74d16c5fe0158cacb2c95e4e126f1cd3 100644 --- a/pallets/duniter-test-parameters/macro/Cargo.toml +++ b/pallets/duniter-test-parameters/macro/Cargo.toml @@ -1,18 +1,17 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'Duniter test parameters macro.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-duniter-test-parameters-macro' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter test parameters macro" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-duniter-test-parameters-macro" +repository.workspace = true +version.workspace = true [lib] proc-macro = true [dependencies] -num_enum = { version = "0.7.2", default-features = false } -proc-macro2 = { version = "1.0.76", default-features = false } -quote = { version = "1.0.35", default-features = false } -syn = { version = "2.0.48", features = [ "extra-traits", "fold", "full", "visit" ] } +proc-macro2 = { workspace = true, default-features = false } +quote = { workspace = true, default-features = false } +syn = { workspace = true, features = ["extra-traits", "fold", "full", "visit"] } diff --git a/pallets/duniter-wot/Cargo.toml b/pallets/duniter-wot/Cargo.toml index 7e17bd1271b436217c36260def0250f974ff4231..dd247896ebd67929680cdc85cc248b684023a654 100644 --- a/pallets/duniter-wot/Cargo.toml +++ b/pallets/duniter-wot/Cargo.toml @@ -1,115 +1,73 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet for web of trust.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-duniter-wot' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet for web of trust" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-duniter-wot" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-distance/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-certification/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-certification/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'pallet-certification/std', - 'pallet-distance/std', - 'pallet-identity/std', - 'pallet-membership/std', - 'scale-info/std', - 'sp-core/std', - 'sp-io/std', - 'sp-membership/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-state-machine/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "pallet-certification/std", + "pallet-distance/std", + "pallet-identity/std", + "pallet-membership/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-membership/std", + "sp-runtime/std", + "sp-state-machine/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', - 'sp-membership/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-certification/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-distance/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-certification/try-runtime", + "pallet-distance/try-runtime", + "pallet-identity/try-runtime", + "pallet-membership/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] -pallet-certification = { path = "../certification", default-features = false } -pallet-distance = { path = "../distance", default-features = false } -pallet-identity = { path = "../identity", default-features = false } -pallet-membership = { path = "../membership", default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = [ - "derive", -] } -sp-membership = { path = "../../primitives/membership", default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DEV ### +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-certification = { workspace = true } +pallet-distance = { workspace = true } +pallet-identity = { workspace = true } +pallet-membership = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-membership = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } -[dev-dependencies.sp-state-machine] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dev-dependencies] +sp-state-machine = { workspace = true } diff --git a/pallets/identity/Cargo.toml b/pallets/identity/Cargo.toml index 9a52d089679a833413c40423e020365998035bf6..4cbd9dab004bf0df6b07c598437d7024e83a2e91 100644 --- a/pallets/identity/Cargo.toml +++ b/pallets/identity/Cargo.toml @@ -1,96 +1,65 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet identity.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-identity' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet identity" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-identity" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'scale-info/std', - 'serde/std', - 'frame-benchmarking?/std', - 'frame-support/std', - 'frame-system/std', - 'sp-core/std', - 'sp-io/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-keystore/std', - 'sp-state-machine/std', + "codec/std", + "duniter-primitives/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "serde/std", + "sp-core/std", + "sp-io/std", + "sp-keystore/std", + "sp-runtime/std", + "sp-state-machine/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', + "duniter-primitives/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", ] [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] substrate-wasm-builder = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = "duniter-substrate-v1.6.0" } [dependencies] -duniter-primitives = { path = "../../primitives/duniter", default-features = false } - -# crates.io -codec = { package = 'parity-scale-codec', version = "3.6.9", features = ['derive'], default-features = false } -impl-trait-for-tuples = { version = "0.2.2", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", features = ["derive"], default-features = false } -# substrate - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +codec = { workspace = true, features = ["derive"] } +duniter-primitives = { workspace = true } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +impl-trait-for-tuples = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } [dev-dependencies] -sp-keystore = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-state-machine = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-keystore = { workspace = true } +sp-state-machine = { workspace = true } diff --git a/pallets/identity/src/benchmarking.rs b/pallets/identity/src/benchmarking.rs index 0d4fe93e42ccc159f6b6c438857d078fb553a798..e013a2ac4ce3a05ccea869cbcb3d882d7baff722 100644 --- a/pallets/identity/src/benchmarking.rs +++ b/pallets/identity/src/benchmarking.rs @@ -18,9 +18,9 @@ use super::*; -//use codec::Encode; use codec::Encode; -use frame_benchmarking::{account, benchmarks}; +use frame_benchmarking::account; +use frame_benchmarking::v2::*; use frame_support::traits::OnInitialize; use frame_system::pallet_prelude::BlockNumberFor; use frame_system::RawOrigin; @@ -30,128 +30,146 @@ use sp_runtime::{AccountId32, MultiSigner}; use crate::Pallet; -const SEED: u32 = 1; - -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} +#[benchmarks( + where + T::Signature: From<sp_core::sr25519::Signature>, + T::AccountId: From<AccountId32>, + T::IdtyIndex: From<u32>, +)] +mod benchmarks { + use super::*; -struct Account<T: Config> { - key: T::AccountId, - index: T::IdtyIndex, - origin: <T as frame_system::Config>::RuntimeOrigin, - // name: IdtyName, -} + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); + } -// Create and confirm one account using Alice authorized account. -// key, origin, name and index are returned. -// Alice next_creatable_identity_on is reinitialized at the end so several account can be -// created in a row. -fn create_one_identity<T: Config>(owner_key: T::AccountId) -> Result<Account<T>, &'static str> { - // get Alice account to create identity - let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::from(1u32)) - .unwrap() - .owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = - RawOrigin::Signed(caller.clone()).into(); - let owner_key_origin: <T as frame_system::Config>::RuntimeOrigin = - RawOrigin::Signed(owner_key.clone()).into(); - Pallet::<T>::create_identity(caller_origin.clone(), owner_key.clone())?; - let name = IdtyName("new_identity".into()); - Pallet::<T>::confirm_identity(owner_key_origin.clone(), name.clone())?; - let idty_index = IdentityIndexOf::<T>::get(&owner_key).unwrap(); - // make identity member - <Identities<T>>::mutate_exists(idty_index, |idty_val_opt| { - if let Some(ref mut idty_val) = idty_val_opt { - idty_val.status = IdtyStatus::Member; - } - }); - // Reset next_creatable_identity_on to add more identities with Alice - <Identities<T>>::mutate_exists(T::IdtyIndex::from(1u32), |idty_val_opt| { - if let Some(ref mut idty_val) = idty_val_opt { - idty_val.next_creatable_identity_on = BlockNumberFor::<T>::zero(); - } - }); - Ok(Account { - key: owner_key, - index: idty_index, - origin: owner_key_origin, - // name: name, - }) -} + struct Account<T: Config> { + key: T::AccountId, + index: T::IdtyIndex, + origin: <T as frame_system::Config>::RuntimeOrigin, + } -// Create a dummy identity bypassing all the checks. -fn create_dummy_identity<T: Config>(i: u32) -> Result<(), &'static str> { - let idty_index: T::IdtyIndex = i.into(); - let owner_key: T::AccountId = account("Bob", i, SEED); - let next_scheduled = BlockNumberFor::<T>::zero(); - let value = IdtyValue { - data: Default::default(), - next_creatable_identity_on: BlockNumberFor::<T>::zero(), - old_owner_key: None, - owner_key: owner_key.clone(), - next_scheduled, - status: IdtyStatus::Unvalidated, - }; - let name = i.to_le_bytes(); - let idty_name = IdtyName(name.into()); - <Identities<T>>::insert(idty_index, value); - IdentityChangeSchedule::<T>::append(next_scheduled, idty_index); - IdentityIndexOf::<T>::insert(owner_key.clone(), idty_index); - <IdentitiesNames<T>>::insert(idty_name.clone(), idty_index); - Ok(()) -} + // Create and confirm one account using Alice authorized account. + // key, origin, name and index are returned. + // Alice next_creatable_identity_on is reinitialized at the end so several account can be + // created in a row. + fn create_one_identity<T: Config>(owner_key: T::AccountId) -> Result<Account<T>, &'static str> { + // get Alice account to create identity + let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::from(1u32)) + .unwrap() + .owner_key; + let caller_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(caller.clone()).into(); + let owner_key_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(owner_key.clone()).into(); + Pallet::<T>::create_identity(caller_origin.clone(), owner_key.clone())?; + let name = IdtyName("new_identity".into()); + Pallet::<T>::confirm_identity(owner_key_origin.clone(), name.clone())?; + let idty_index = IdentityIndexOf::<T>::get(&owner_key).unwrap(); + // make identity member + <Identities<T>>::mutate_exists(idty_index, |idty_val_opt| { + if let Some(ref mut idty_val) = idty_val_opt { + idty_val.status = IdtyStatus::Member; + } + }); + // Reset next_creatable_identity_on to add more identities with Alice + <Identities<T>>::mutate_exists(T::IdtyIndex::from(1u32), |idty_val_opt| { + if let Some(ref mut idty_val) = idty_val_opt { + idty_val.next_creatable_identity_on = BlockNumberFor::<T>::zero(); + } + }); + Ok(Account { + key: owner_key, + index: idty_index, + origin: owner_key_origin, + // name: name, + }) + } -// Add `i` dummy identities. -fn create_identities<T: Config>(i: u32) -> Result<(), &'static str> { - let identities_count = Pallet::<T>::identities_count(); - for j in 0..i { - create_dummy_identity::<T>(j + identities_count + 1)?; + // Create a dummy identity bypassing all the checks. + fn create_dummy_identity<T: Config>(i: u32) -> Result<(), &'static str> { + let idty_index: T::IdtyIndex = i.into(); + let owner_key: T::AccountId = account("Bob", i, 1); + let next_scheduled = BlockNumberFor::<T>::zero(); + let value = IdtyValue { + data: Default::default(), + next_creatable_identity_on: BlockNumberFor::<T>::zero(), + old_owner_key: None, + owner_key: owner_key.clone(), + next_scheduled, + status: IdtyStatus::Unvalidated, + }; + let name = i.to_le_bytes(); + let idty_name = IdtyName(name.into()); + frame_system::Pallet::<T>::inc_sufficients(&owner_key); + <Identities<T>>::insert(idty_index, value); + IdentityChangeSchedule::<T>::append(next_scheduled, idty_index); + IdentityIndexOf::<T>::insert(owner_key.clone(), idty_index); + <IdentitiesNames<T>>::insert(idty_name.clone(), idty_index); + Ok(()) } - assert!( - identities_count + i == Pallet::<T>::identities_count(), - "Identities not created" - ); - Ok(()) -} -benchmarks! { - where_clause { - where - T::Signature: From<sp_core::sr25519::Signature>, - T::Signature: From<sp_core::sr25519::Signature>, - T::AccountId: From<AccountId32>, - T::IdtyIndex: From<u32>, + // Add `i` dummy identities. + fn create_identities<T: Config>(i: u32) -> Result<(), &'static str> { + let identities_count = Pallet::<T>::identities_count(); + for j in 0..i { + create_dummy_identity::<T>(j + identities_count + 1)?; + } + assert!( + identities_count + i == Pallet::<T>::identities_count(), + "Identities not created" + ); + Ok(()) } - // create identity - create_identity { - let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key; // Alice - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let owner_key: T::AccountId = account("new_identity", 2, SEED); - }: _<T::RuntimeOrigin>(caller_origin.clone(), owner_key.clone()) - verify { + #[benchmark] + fn create_identity() { + let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key; // Alice + let owner_key: T::AccountId = account("new_identity", 2, 1); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), owner_key.clone()); + let idty_index = IdentityIndexOf::<T>::get(&owner_key); assert!(idty_index.is_some(), "Identity not added"); - assert_has_event::<T>(Event::<T>::IdtyCreated { idty_index: idty_index.unwrap(), owner_key }.into()); + assert_has_event::<T>( + Event::<T>::IdtyCreated { + idty_index: idty_index.unwrap(), + owner_key, + } + .into(), + ); } - // confirm identity - confirm_identity { - let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key; - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - let owner_key: T::AccountId = account("new_identity", 2, SEED); - let owner_key_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(owner_key.clone()).into(); + #[benchmark] + fn confirm_identity() -> Result<(), BenchmarkError> { + let caller: T::AccountId = Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key; + let caller_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(caller.clone()).into(); + let owner_key: T::AccountId = account("new_identity", 2, 1); Pallet::<T>::create_identity(caller_origin.clone(), owner_key.clone())?; - }: _<T::RuntimeOrigin>(owner_key_origin.clone(), IdtyName("new_identity".into())) - verify { + + #[extrinsic_call] + _( + RawOrigin::Signed(owner_key.clone()), + IdtyName("new_identity".into()), + ); + let idty_index = IdentityIndexOf::<T>::get(&owner_key); - assert_has_event::<T>(Event::<T>::IdtyConfirmed { idty_index: idty_index.unwrap(), owner_key, name: IdtyName("new_identity".into()) }.into()); + assert_has_event::<T>( + Event::<T>::IdtyConfirmed { + idty_index: idty_index.unwrap(), + owner_key, + name: IdtyName("new_identity".into()), + } + .into(), + ); + Ok(()) } - // change owner key - change_owner_key { - let old_key: T::AccountId = account("new_identity", 2, SEED); + #[benchmark] + fn change_owner_key() -> Result<(), BenchmarkError> { + let old_key: T::AccountId = account("new_identity", 2, 1); let account: Account<T> = create_one_identity(old_key.clone())?; // Change key a first time to add an old-old key @@ -164,12 +182,14 @@ benchmarks! { let message = (NEW_OWNER_KEY_PAYLOAD_PREFIX, new_key_payload).encode(); let caller_public = sr25519_generate(0.into(), None); let caller: T::AccountId = MultiSigner::Sr25519(caller_public).into_account().into(); - let signature = sr25519_sign(0.into(), &caller_public, &message).unwrap().into(); + let signature = sr25519_sign(0.into(), &caller_public, &message) + .unwrap() + .into(); Pallet::<T>::change_owner_key(account.origin.clone(), caller.clone(), signature)?; // Change key a second time to benchmark // The sufficients for the old_old key will drop to 0 during benchmark - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller_origin = RawOrigin::Signed(caller.clone()); let genesis_hash = frame_system::Pallet::<T>::block_hash(BlockNumberFor::<T>::zero()); let new_key_payload = IdtyIndexAccountIdPayload { genesis_hash: &genesis_hash, @@ -179,17 +199,33 @@ benchmarks! { let message = (NEW_OWNER_KEY_PAYLOAD_PREFIX, new_key_payload).encode(); let caller_public = sr25519_generate(0.into(), None); let caller: T::AccountId = MultiSigner::Sr25519(caller_public).into_account().into(); - let signature = sr25519_sign(0.into(), &caller_public, &message).unwrap().into(); - <frame_system::Pallet<T>>::set_block_number(<frame_system::Pallet<T>>::block_number() + T::ChangeOwnerKeyPeriod::get()); - }: _<T::RuntimeOrigin>(caller_origin.clone(), caller.clone(), signature) - verify { - assert_has_event::<T>(Event::<T>::IdtyChangedOwnerKey { idty_index: account.index, new_owner_key: caller.clone() }.into()); - assert!(IdentityIndexOf::<T>::get(&caller).unwrap() == account.index, "Owner key not changed"); + let signature = sr25519_sign(0.into(), &caller_public, &message) + .unwrap() + .into(); + <frame_system::Pallet<T>>::set_block_number( + <frame_system::Pallet<T>>::block_number() + T::ChangeOwnerKeyPeriod::get(), + ); + + #[extrinsic_call] + _(caller_origin, caller.clone(), signature); + + assert_has_event::<T>( + Event::<T>::IdtyChangedOwnerKey { + idty_index: account.index, + new_owner_key: caller.clone(), + } + .into(), + ); + assert!( + IdentityIndexOf::<T>::get(&caller).unwrap() == account.index, + "Owner key not changed" + ); + Ok(()) } - // revoke identity - revoke_identity { - let old_key: T::AccountId = account("new_identity", 2, SEED); + #[benchmark] + fn revoke_identity() -> Result<(), BenchmarkError> { + let old_key: T::AccountId = account("new_identity", 2, 1); let account: Account<T> = create_one_identity(old_key.clone())?; // Change key @@ -203,7 +239,9 @@ benchmarks! { let message = (NEW_OWNER_KEY_PAYLOAD_PREFIX, new_key_payload).encode(); let caller_public = sr25519_generate(0.into(), None); let caller: T::AccountId = MultiSigner::Sr25519(caller_public).into_account().into(); - let signature = sr25519_sign(0.into(), &caller_public, &message).unwrap().into(); + let signature = sr25519_sign(0.into(), &caller_public, &message) + .unwrap() + .into(); Pallet::<T>::change_owner_key(account.origin.clone(), caller.clone(), signature)?; let genesis_hash = frame_system::Pallet::<T>::block_hash(BlockNumberFor::<T>::zero()); @@ -212,147 +250,253 @@ benchmarks! { idty_index: account.index, }; let message = (REVOCATION_PAYLOAD_PREFIX, revocation_payload).encode(); - let signature = sr25519_sign(0.into(), &caller_public, &message).unwrap().into(); - }: _<T::RuntimeOrigin>(account.origin, account.index, caller.clone(), signature) - verify { - assert_has_event::<T>(Event::<T>::IdtyRevoked { idty_index: account.index, reason: RevocationReason::User }.into()); - // revocation does not mean deletion anymore - // assert!(IdentityIndexOf::<T>::get(&account.key).is_none(), "Identity not revoked"); + let signature = sr25519_sign(0.into(), &caller_public, &message) + .unwrap() + .into(); + + #[extrinsic_call] + _( + RawOrigin::Signed(account.key), + account.index, + caller.clone(), + signature, + ); + + assert_has_event::<T>( + Event::<T>::IdtyRevoked { + idty_index: account.index, + reason: RevocationReason::User, + } + .into(), + ); + Ok(()) } - // The complexity depends on the number of identities to prune - prune_item_identities_names { + #[benchmark] + fn prune_item_identities_names(i: Linear<2, 1_000>) -> Result<(), BenchmarkError> { + // The complexity depends on the number of identities to prune // Populate identities let identities_count = Pallet::<T>::identities_count(); - let i in 1 .. 1000 => create_identities::<T>(i)?; + create_identities::<T>(i)?; let mut names = Vec::<IdtyName>::new(); for k in 1..i { let name: IdtyName = IdtyName((k + identities_count).to_le_bytes().into()); - assert!(IdentitiesNames::<T>::contains_key(&name), "Name not existing"); + assert!( + IdentitiesNames::<T>::contains_key(&name), + "Name not existing" + ); names.push(name); } - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), names.clone()) - verify { + + #[extrinsic_call] + _(RawOrigin::Root, names.clone()); + for name in names { assert!(!IdentitiesNames::<T>::contains_key(&name), "Name existing"); } + Ok(()) } - // fix sufficients identity - fix_sufficients { - let new_identity: T::AccountId = account("Bob", 2, SEED); + #[benchmark] + fn fix_sufficients() -> Result<(), BenchmarkError> { + let new_identity: T::AccountId = account("Bob", 2, 1); let account: Account<T> = create_one_identity(new_identity)?; let sufficient = frame_system::Pallet::<T>::sufficients(&account.key); - }: _<T::RuntimeOrigin>(RawOrigin::Root.into(), account.key.clone(), true) - verify { - assert!(sufficient < frame_system::Pallet::<T>::sufficients(&account.key), "Sufficient not incremented"); + + #[extrinsic_call] + _(RawOrigin::Root, account.key.clone(), true); + + assert!( + sufficient < frame_system::Pallet::<T>::sufficients(&account.key), + "Sufficient not incremented" + ); + Ok(()) } - // link account - link_account { - let alice_origin = RawOrigin::Signed(Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key); + #[benchmark] + fn link_account() -> Result<(), BenchmarkError> { + let alice_origin = + RawOrigin::Signed(Identities::<T>::get(T::IdtyIndex::one()).unwrap().owner_key); let bob_public = sr25519_generate(0.into(), None); let bob: T::AccountId = MultiSigner::Sr25519(bob_public).into_account().into(); frame_system::Pallet::<T>::inc_providers(&bob); let genesis_hash = frame_system::Pallet::<T>::block_hash(BlockNumberFor::<T>::zero()); let payload = ( - LINK_IDTY_PAYLOAD_PREFIX, genesis_hash, T::IdtyIndex::one(), bob.clone(), - ).encode(); - let signature = sr25519_sign(0.into(), &bob_public, &payload).unwrap().into(); - }: _<T::RuntimeOrigin>(alice_origin.into(), bob, signature) + LINK_IDTY_PAYLOAD_PREFIX, + genesis_hash, + T::IdtyIndex::one(), + bob.clone(), + ) + .encode(); + let signature = sr25519_sign(0.into(), &bob_public, &payload) + .unwrap() + .into(); - // Base weight of an empty initialize - on_initialize { - }: {Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero());} + #[extrinsic_call] + _(alice_origin, bob, signature); - // --- do revoke identity - do_revoke_identity_noop { + Ok(()) + } + + #[benchmark] + fn on_initialize() { + // Base weight of an empty initialize + #[block] + { + Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero()); + } + } + + #[benchmark] + fn do_revoke_identity_noop() { let idty_index: T::IdtyIndex = 0u32.into(); assert!(Identities::<T>::get(idty_index).is_none()); - }: {Pallet::<T>::do_revoke_identity(idty_index, RevocationReason::Root);} - do_revoke_identity { + + #[block] + { + Pallet::<T>::do_revoke_identity(idty_index, RevocationReason::Root); + } + } + + #[benchmark] + fn do_revoke_identity() { let idty_index: T::IdtyIndex = 1u32.into(); - let new_identity: T::AccountId = account("Bob", 2, SEED); + let new_identity: T::AccountId = account("Bob", 2, 1); assert!(Identities::<T>::get(idty_index).is_some()); - Identities::<T>::mutate( idty_index, |id| { + Identities::<T>::mutate(idty_index, |id| { if let Some(id) = id { id.old_owner_key = Some((new_identity, BlockNumberFor::<T>::zero())); } }); - assert!(Identities::<T>::get(idty_index).unwrap().old_owner_key.is_some()); - }: {Pallet::<T>::do_revoke_identity(idty_index, RevocationReason::Root);} - verify { - assert_has_event::<T>(Event::<T>::IdtyRevoked { idty_index, reason: RevocationReason::Root }.into()); + assert!(Identities::<T>::get(idty_index) + .unwrap() + .old_owner_key + .is_some()); + + #[block] + { + Pallet::<T>::do_revoke_identity(idty_index, RevocationReason::Root); + } + + assert_has_event::<T>( + Event::<T>::IdtyRevoked { + idty_index, + reason: RevocationReason::Root, + } + .into(), + ); } - // --- do remove identity - do_remove_identity_noop { + #[benchmark] + fn do_remove_identity_noop() { let idty_index: T::IdtyIndex = 0u32.into(); assert!(Identities::<T>::get(idty_index).is_none()); - }: {Pallet::<T>::do_remove_identity(idty_index, RemovalReason::Revoked);} - do_remove_identity { + + #[block] + { + Pallet::<T>::do_remove_identity(idty_index, RemovalReason::Revoked); + } + } + + #[benchmark] + fn do_remove_identity() { let idty_index: T::IdtyIndex = 1u32.into(); - let new_identity: T::AccountId = account("Bob", 2, SEED); + let new_identity: T::AccountId = account("Bob", 2, 1); assert!(Identities::<T>::get(idty_index).is_some()); - Identities::<T>::mutate( idty_index, |id| { + frame_system::Pallet::<T>::inc_sufficients(&new_identity); + Identities::<T>::mutate(idty_index, |id| { if let Some(id) = id { id.old_owner_key = Some((new_identity, BlockNumberFor::<T>::zero())); } }); - assert!(Identities::<T>::get(idty_index).unwrap().old_owner_key.is_some()); - }: {Pallet::<T>::do_remove_identity(idty_index, RemovalReason::Revoked);} - verify { - assert_has_event::<T>(Event::<T>::IdtyRemoved { idty_index, reason: RemovalReason::Revoked }.into()); + assert!(Identities::<T>::get(idty_index) + .unwrap() + .old_owner_key + .is_some()); + + #[block] + { + Pallet::<T>::do_remove_identity(idty_index, RemovalReason::Revoked); + } + + assert_has_event::<T>( + Event::<T>::IdtyRemoved { + idty_index, + reason: RemovalReason::Revoked, + } + .into(), + ); } - // --- prune identities - prune_identities_noop { + #[benchmark] + fn prune_identities_noop() { assert!(IdentityChangeSchedule::<T>::try_get(BlockNumberFor::<T>::zero()).is_err()); - }: {Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero());} - prune_identities_none { + #[block] + { + Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero()); + } + } + + #[benchmark] + fn prune_identities_none() { let idty_index: T::IdtyIndex = 100u32.into(); IdentityChangeSchedule::<T>::append(BlockNumberFor::<T>::zero(), idty_index); assert!(IdentityChangeSchedule::<T>::try_get(BlockNumberFor::<T>::zero()).is_ok()); assert!(<Identities<T>>::try_get(idty_index).is_err()); - }: {Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero());} - prune_identities_err { + #[block] + { + Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero()); + } + } + + #[benchmark] + fn prune_identities_err() -> Result<(), BenchmarkError> { let idty_index: T::IdtyIndex = 100u32.into(); create_dummy_identity::<T>(100u32)?; IdentityChangeSchedule::<T>::append(BlockNumberFor::<T>::zero(), idty_index); - }: {Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero());} + + #[block] + { + Pallet::<T>::prune_identities(BlockNumberFor::<T>::zero()); + } + + Ok(()) + } impl_benchmark_test_suite!( Pallet, // Create genesis identity Alice to test benchmark in mock - crate::mock::new_test_ext(crate::mock::IdentityConfig{ identities: vec![ - GenesisIdty { - index: 1, - name: IdtyName::from("Alice"), - value: IdtyValue { - data: (), - next_creatable_identity_on: 0, - old_owner_key: None, - owner_key: account("Alice", 1, SEED), - next_scheduled: 0, - status: crate::IdtyStatus::Member, + crate::mock::new_test_ext(crate::mock::IdentityConfig { + identities: vec![ + crate::GenesisIdty { + index: 1, + name: crate::IdtyName::from("Alice"), + value: crate::IdtyValue { + data: (), + next_creatable_identity_on: 0, + old_owner_key: None, + owner_key: frame_benchmarking::account("Alice", 1, 1), + next_scheduled: 0, + status: crate::IdtyStatus::Member, + }, }, - }, - GenesisIdty { - index: 2, - name: IdtyName::from("Bob"), - value: IdtyValue { - data: (), - next_creatable_identity_on: 0, - old_owner_key: None, - owner_key: account("Bob", 1, SEED), - next_scheduled: 0, - status: crate::IdtyStatus::Unconfirmed, + crate::GenesisIdty { + index: 2, + name: crate::IdtyName::from("Bob"), + value: crate::IdtyValue { + data: (), + next_creatable_identity_on: 0, + old_owner_key: None, + owner_key: frame_benchmarking::account("Bob", 1, 1), + next_scheduled: 0, + status: crate::IdtyStatus::Unconfirmed, + }, }, - }, - ]}), + ] + }), crate::mock::Test, ); } diff --git a/pallets/membership/Cargo.toml b/pallets/membership/Cargo.toml index ea0bc3465aaf2d1f8e60243cf157f80e4a640850..e33045ca98b3f71de1a1c0149e17eb3be9c215d3 100644 --- a/pallets/membership/Cargo.toml +++ b/pallets/membership/Cargo.toml @@ -1,94 +1,56 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet membership' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-membership' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet membership" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-membership" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] std = [ - 'scale-info/std', - 'sp-membership/std', - 'codec/std', - 'frame-benchmarking?/std', - 'frame-support/std', - 'frame-system/std', - 'sp-core/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-io/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-membership/std", + "sp-runtime/std", + "sp-std/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', - 'sp-membership/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] -[dependencies] - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -sp-membership = { path = "../../primitives/membership", default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -### DOC ### - [package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.maplit] -default-features = false -version = '1.0.2' - -[dev-dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-membership = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[dev-dependencies] +maplit = { workspace = true } +sp-io = { workspace = true } diff --git a/pallets/membership/src/benchmarking.rs b/pallets/membership/src/benchmarking.rs index a3475c7d031209aa5f8b2820e0e5a4536e139e88..0f2be6c80895b9548bc523acd5b1720e92b01fd7 100644 --- a/pallets/membership/src/benchmarking.rs +++ b/pallets/membership/src/benchmarking.rs @@ -18,58 +18,66 @@ use super::*; -use frame_benchmarking::benchmarks; +use frame_benchmarking::v2::*; use frame_system::pallet_prelude::BlockNumberFor; -#[cfg(test)] -use maplit::btreemap; - use crate::Pallet; -// fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { -// frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -// } - -benchmarks! { - where_clause { +#[benchmarks( where T::IdtyId: From<u32>, BlockNumberFor<T>: From<u32>, - } +)] +mod benchmarks { + use super::*; // TODO membership add and renewal should be included to distance on_new_session as worst case scenario - // Base weight of an empty initialize - on_initialize { - }: {Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero());} + #[benchmark] + fn on_initialize() { + // Base weight of an empty initialize + #[block] + { + Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero()); + } + } - expire_memberships { - let i in 0..3; // Limited by the number of validators + #[benchmark] + fn expire_memberships(i: Linear<0, 3>) { + // Limited by the number of validators // Arbitrarily high, to be in the worst case of wot instance, // this will overcount the weight in hooks see https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/167 - let block_number: BlockNumberFor::<T> = 10_000_000.into(); + let block_number: BlockNumberFor<T> = 10_000_000.into(); frame_system::pallet::Pallet::<T>::set_block_number(block_number); let mut idties: Vec<T::IdtyId> = Vec::new(); - for j in 1..i+1 { + for j in 1..i + 1 { let j: T::IdtyId = j.into(); Membership::<T>::insert(j, MembershipData::<BlockNumberFor<T>>::default()); idties.push(j); } MembershipsExpireOn::<T>::insert(block_number, idties); - assert_eq!(MembershipsExpireOn::<T>::get(block_number).len(), i as usize); - }: {Pallet::<T>::expire_memberships(block_number);} - verify { + assert_eq!( + MembershipsExpireOn::<T>::get(block_number).len(), + i as usize + ); + + #[block] + { + Pallet::<T>::expire_memberships(block_number); + } + assert_eq!(MembershipsExpireOn::<T>::get(block_number).len(), 0_usize); } impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext(crate::mock::MembershipConfig { - memberships: btreemap![ - 3 => MembershipData { - expire_on: 3, - }, - ],}), + memberships: maplit::btreemap![ + 3 => crate::MembershipData { + expire_on: 3, + }, + ], + }), crate::mock::Test ); } diff --git a/pallets/offences/Cargo.toml b/pallets/offences/Cargo.toml index fb7737eb17f8d327c4af81e702b38c6a6694e51c..ccc57523e523a7dd5c60aed1d4b82e2415483c77 100644 --- a/pallets/offences/Cargo.toml +++ b/pallets/offences/Cargo.toml @@ -1,31 +1,30 @@ [package] name = "pallet-offences" -authors = ["Parity Technologies <admin@parity.io>", "Axiom-Team Developers <https://axiom-team.fr>"] -description = 'duniter pallet to handle offences.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet to handle offences. fork from paritytechnologies offences pallet" +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true readme = "README.md" +version.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -log = { version = "0.4.20", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +codec = { workspace = true, features = ["derive"] } +log = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } [dev-dependencies] -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-core = { workspace = true } +sp-io = { workspace = true } [features] default = ["std"] @@ -34,24 +33,21 @@ std = [ "frame-support/std", "frame-system/std", "log/std", - "pallet-balances/std", "scale-info/std", + "sp-core/std", + "sp-io/std", "sp-runtime/std", "sp-staking/std", "sp-std/std", - "sp-io/std", - "sp-core/std", ] runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "sp-staking/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", ] diff --git a/pallets/oneshot-account/Cargo.toml b/pallets/oneshot-account/Cargo.toml index b3d33e6ff2fba1e35f7a984205b93a1a8d7424fe..d019ccef62160a32576c5be677050be6254143af 100644 --- a/pallets/oneshot-account/Cargo.toml +++ b/pallets/oneshot-account/Cargo.toml @@ -1,101 +1,63 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet oneshot account.' -edition = '2018' -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-oneshot-account' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet oneshot account" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-oneshot-account" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/runtime-benchmarks", + "pallet-balances/try-runtime", + "pallet-transaction-payment/try-runtime", + "sp-runtime/try-runtime", ] std = [ - 'codec/std', - 'log/std', - 'pallet-balances/std', - 'scale-info/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'sp-core/std', - 'sp-io/std', - 'sp-runtime/std', - 'sp-std/std', - 'pallet-transaction-payment/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "log/std", + "pallet-balances/std", + "pallet-transaction-payment/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] -[dependencies] -# crates.io -codec = { package = 'parity-scale-codec', version = "3.6.9", default-features = false, features = ["derive"] } -log = { version = "0.4.20", default-features = false } - -# benchmarks -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', optional = true, default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -# substrate -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-transaction-payment] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +targets = ["x86_64-unknown-linux-gnu"] -[dev-dependencies.pallet-balances] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +log = { workspace = true } +pallet-balances = { workspace = true } +pallet-transaction-payment = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[dev-dependencies] +pallet-balances = { workspace = true } diff --git a/pallets/oneshot-account/src/benchmarking.rs b/pallets/oneshot-account/src/benchmarking.rs index dcc72ff2ef144d8b1474d61aded1734d33a796f3..cf79d049413a018a17f12aa4561b09d383988259 100644 --- a/pallets/oneshot-account/src/benchmarking.rs +++ b/pallets/oneshot-account/src/benchmarking.rs @@ -18,7 +18,8 @@ use super::*; -use frame_benchmarking::{account, benchmarks, whitelisted_caller}; +use frame_benchmarking::v2::*; +use frame_benchmarking::{account, whitelisted_caller}; use frame_support::pallet_prelude::IsType; use frame_support::traits::Get; use frame_system::RawOrigin; @@ -26,90 +27,99 @@ use pallet_balances::Pallet as Balances; use crate::Pallet; -const SEED: u32 = 0; - -benchmarks! { - where_clause { +#[benchmarks( where T: pallet_balances::Config, T::Balance: From<u64>, <T::Currency as Currency<T::AccountId>>::Balance: IsType<T::Balance>+From<T::Balance> - } - create_oneshot_account { +)] +mod benchmarks { + use super::*; + + #[benchmark] + fn create_oneshot_account() { let existential_deposit = T::ExistentialDeposit::get(); let caller = whitelisted_caller(); - - // Give some multiple of the existential deposit let balance = existential_deposit.saturating_mul((2).into()); let _ = T::Currency::make_free_balance_be(&caller, balance.into()); - - let recipient: T::AccountId = account("recipient", 0, SEED); + let recipient: T::AccountId = account("recipient", 0, 1); let recipient_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient.clone()); let transfer_amount = existential_deposit; - }: _(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount.into()) - verify { + + #[extrinsic_call] + _( + RawOrigin::Signed(caller.clone()), + recipient_lookup, + transfer_amount.into(), + ); + assert_eq!(Balances::<T>::free_balance(&caller), transfer_amount); - assert_eq!(OneshotAccounts::<T>::get(&recipient), Some(transfer_amount.into())); + assert_eq!( + OneshotAccounts::<T>::get(&recipient), + Some(transfer_amount.into()) + ); } - consume_oneshot_account { + + #[benchmark] + fn consume_oneshot_account() { let existential_deposit = T::ExistentialDeposit::get(); let caller: T::AccountId = whitelisted_caller(); - - // Give some multiple of the existential deposit let balance = existential_deposit.saturating_mul((2).into()); OneshotAccounts::<T>::insert( caller.clone(), - Into::<<T::Currency as Currency<T::AccountId>>::Balance>::into(balance) + Into::<<T::Currency as Currency<T::AccountId>>::Balance>::into(balance), ); - // Deposit into a normal account is more expensive than into a oneshot account // so we create the recipient account with an existential deposit. - let recipient: T::AccountId = account("recipient", 0, SEED); + let recipient: T::AccountId = account("recipient", 0, 1); let recipient_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient.clone()); let _ = T::Currency::make_free_balance_be(&recipient, existential_deposit.into()); - }: _( - RawOrigin::Signed(caller.clone()), - BlockNumberFor::<T>::zero(), - Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient_lookup) - ) - verify { + + #[extrinsic_call] + _( + RawOrigin::Signed(caller.clone()), + BlockNumberFor::<T>::zero(), + Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient_lookup), + ); + assert_eq!(OneshotAccounts::<T>::get(&caller), None); assert_eq!( Balances::<T>::free_balance(&recipient), existential_deposit.saturating_mul((3).into()) ); } - consume_oneshot_account_with_remaining { + + #[benchmark] + fn consume_oneshot_account_with_remaining() { let existential_deposit = T::ExistentialDeposit::get(); let caller: T::AccountId = whitelisted_caller(); - - // Give some multiple of the existential deposit let balance = existential_deposit.saturating_mul((2).into()); OneshotAccounts::<T>::insert( caller.clone(), - Into::<<T::Currency as Currency<T::AccountId>>::Balance>::into(balance) + Into::<<T::Currency as Currency<T::AccountId>>::Balance>::into(balance), ); - // Deposit into a normal account is more expensive than into a oneshot account // so we create the recipient accounts with an existential deposits. - let recipient1: T::AccountId = account("recipient1", 0, SEED); + let recipient1: T::AccountId = account("recipient1", 0, 1); let recipient1_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient1.clone()); let _ = T::Currency::make_free_balance_be(&recipient1, existential_deposit.into()); - let recipient2: T::AccountId = account("recipient2", 1, SEED); + let recipient2: T::AccountId = account("recipient2", 1, 1); let recipient2_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient2.clone()); let _ = T::Currency::make_free_balance_be(&recipient2, existential_deposit.into()); - }: _( - RawOrigin::Signed(caller.clone()), - BlockNumberFor::<T>::zero(), - Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient1_lookup), - Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient2_lookup), - existential_deposit.into() - ) - verify { + + #[extrinsic_call] + _( + RawOrigin::Signed(caller.clone()), + BlockNumberFor::<T>::zero(), + Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient1_lookup), + Account::<<T::Lookup as StaticLookup>::Source>::Normal(recipient2_lookup), + existential_deposit.into(), + ); + assert_eq!(OneshotAccounts::<T>::get(&caller), None); assert_eq!( Balances::<T>::free_balance(&recipient1), @@ -121,9 +131,5 @@ benchmarks! { ); } - impl_benchmark_test_suite!( - Pallet, - crate::mock::new_test_ext(), - crate::mock::Test - ); + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/pallets/oneshot-account/src/lib.rs b/pallets/oneshot-account/src/lib.rs index 0c86b3ce425d5bd0028745615e0d3d3a7f7db50c..637debf4d6ee77bd9aac739bc967ee57048a1d58 100644 --- a/pallets/oneshot-account/src/lib.rs +++ b/pallets/oneshot-account/src/lib.rs @@ -147,7 +147,7 @@ pub mod pallet { Error::<T>::OneshotAccountAlreadyCreated ); - <T::Currency as Currency<T::AccountId>>::withdraw( + let _ = <T::Currency as Currency<T::AccountId>>::withdraw( &transactor, value, WithdrawReasons::TRANSFER, @@ -206,7 +206,8 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest, value)?; + let _ = + <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest, value)?; } OneshotAccounts::<T>::remove(&transactor); Self::deposit_event(Event::OneshotAccountConsumed { @@ -295,7 +296,9 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest2, balance2)?; + let _ = <T::Currency as Currency<T::AccountId>>::deposit_into_existing( + &dest2, balance2, + )?; } if dest1_is_oneshot { OneshotAccounts::<T>::insert(&dest1, balance1); @@ -305,7 +308,9 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest1, balance1)?; + let _ = <T::Currency as Currency<T::AccountId>>::deposit_into_existing( + &dest1, balance1, + )?; } OneshotAccounts::<T>::remove(&transactor); Self::deposit_event(Event::OneshotAccountConsumed { diff --git a/pallets/provide-randomness/Cargo.toml b/pallets/provide-randomness/Cargo.toml index e845c2d85f54f636d21780e00515431819c30492..c16ed1399689885cc69be3f0eabebceb2b1e2be9 100644 --- a/pallets/provide-randomness/Cargo.toml +++ b/pallets/provide-randomness/Cargo.toml @@ -1,93 +1,53 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet to provide randomness to users.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-provide-randomness' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet to provide randomness to users" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-provide-randomness" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/try-runtime", + "sp-runtime/try-runtime", ] std = [ - 'codec/std', - 'scale-info/std', - 'pallet-balances/std', - 'frame-support/std', - 'frame-system/std', - 'sp-runtime/std', - 'frame-benchmarking?/std', - "sp-core/std", - "sp-io/std", - "sp-std/std", + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] [dependencies] - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -# benchmarks -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', optional = true, default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -### DOC ### +scale-info = { workspace = true, features = ["derive"] } +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +pallet-balances = { workspace = true } [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/provide-randomness/src/benchmarking.rs b/pallets/provide-randomness/src/benchmarking.rs index 56dfe1590f3fb824e454a8dda11fba9120bc6881..5f0ed8eedfa54ac9ea3905c9191f8df74bf157fc 100644 --- a/pallets/provide-randomness/src/benchmarking.rs +++ b/pallets/provide-randomness/src/benchmarking.rs @@ -18,7 +18,8 @@ use super::*; -use frame_benchmarking::{benchmarks, whitelisted_caller}; +use frame_benchmarking::v2::*; +use frame_benchmarking::whitelisted_caller; use frame_support::ensure; use frame_support::pallet_prelude::IsType; use frame_support::sp_runtime::{traits::One, Saturating}; @@ -29,49 +30,51 @@ use sp_core::H256; use crate::Pallet; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} +#[benchmarks( + where + T: pallet_balances::Config, + T::Balance: From<u64>, + <T::Currency as Currency<T::AccountId>>::Balance: IsType<T::Balance>, + BlockNumberFor<T>: From<u32>, +)] +mod benchmarks { + use super::*; -fn add_requests_next_block<T: Config>(i: u32) -> Result<(), &'static str> { - for _ in 0..i { - let salt: H256 = H256([0; 32]); - let request_id = RequestIdProvider::<T>::mutate(|next_request_id| { - core::mem::replace(next_request_id, next_request_id.saturating_add(1)) - }); - RequestsIds::<T>::insert(request_id, ()); - RequestsReadyAtNextBlock::<T>::append(Request { request_id, salt }); + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - Ok(()) -} -fn add_requests_next_epoch<T: Config>(i: u32) -> Result<(), &'static str> { - for _ in 0..i { - let salt: H256 = H256([0; 32]); - let request_id = RequestIdProvider::<T>::mutate(|next_request_id| { - core::mem::replace(next_request_id, next_request_id.saturating_add(1)) - }); - RequestsIds::<T>::insert(request_id, ()); - RequestsReadyAtEpoch::<T>::append( - T::GetCurrentEpochIndex::get(), - Request { request_id, salt }, - ); + fn add_requests_next_block<T: Config>(i: u32) -> Result<(), &'static str> { + for _ in 0..i { + let salt: H256 = H256([0; 32]); + let request_id = RequestIdProvider::<T>::mutate(|next_request_id| { + core::mem::replace(next_request_id, next_request_id.saturating_add(1)) + }); + RequestsIds::<T>::insert(request_id, ()); + RequestsReadyAtNextBlock::<T>::append(Request { request_id, salt }); + } + Ok(()) } - Ok(()) -} -benchmarks! { - where_clause { where - T: pallet_balances::Config, - T::Balance: From<u64>, - <T::Currency as Currency<T::AccountId>>::Balance: IsType<T::Balance>, - BlockNumberFor<T>: From<u32>, + fn add_requests_next_epoch<T: Config>(i: u32) -> Result<(), &'static str> { + for _ in 0..i { + let salt: H256 = H256([0; 32]); + let request_id = RequestIdProvider::<T>::mutate(|next_request_id| { + core::mem::replace(next_request_id, next_request_id.saturating_add(1)) + }); + RequestsIds::<T>::insert(request_id, ()); + RequestsReadyAtEpoch::<T>::append( + T::GetCurrentEpochIndex::get(), + Request { request_id, salt }, + ); + } + Ok(()) } - request { + + #[benchmark] + fn request() { // Get account let caller: T::AccountId = whitelisted_caller(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = - RawOrigin::Signed(caller.clone()).into(); // Provide deposit let existential_deposit = T::ExistentialDeposit::get(); @@ -81,36 +84,71 @@ benchmarks! { // Set randomness parameters let random = RandomnessType::RandomnessFromOneEpochAgo; let salt: H256 = H256([1; 32]); - }: _<T::RuntimeOrigin>(caller_origin.clone(), random, salt) - verify { + + #[extrinsic_call] + _(RawOrigin::Signed(caller), random, salt); + let request_id = RequestIdProvider::<T>::get() - 1; - assert_has_event::<T>(Event::RequestedRandomness { - request_id, salt, r#type: random }.into() ); + assert_has_event::<T>( + Event::RequestedRandomness { + request_id, + salt, + r#type: random, + } + .into(), + ); } - on_initialize { - let i in 1 .. T::MaxRequests::get() => add_requests_next_block::<T>(i)?; + + #[benchmark] + fn on_initialize(i: Linear<1, { T::MaxRequests::get() }>) -> Result<(), BenchmarkError> { + add_requests_next_block::<T>(i)?; ensure!(RequestsIds::<T>::count() == i, "List not filled properly."); - ensure!(RequestsReadyAtNextBlock::<T>::get().len() == i as usize, "List not filled properly."); + ensure!( + RequestsReadyAtNextBlock::<T>::get().len() == i as usize, + "List not filled properly." + ); let next_epoch_hook_in = NexEpochHookIn::<T>::mutate(|next_in| { core::mem::replace(next_in, next_in.saturating_sub(1)) }); ensure!(next_epoch_hook_in != 1, "Will be next epoch."); - }: { Pallet::<T>::on_initialize(BlockNumberFor::<T>::one()); } - verify { + + #[block] + { + Pallet::<T>::on_initialize(BlockNumberFor::<T>::one()); + } + ensure!(RequestsIds::<T>::count() == 0, "List not processed."); - ensure!(RequestsReadyAtNextBlock::<T>::get().is_empty(), "List not processed."); + ensure!( + RequestsReadyAtNextBlock::<T>::get().is_empty(), + "List not processed." + ); + Ok(()) } - on_initialize_epoch { - let i in 1 .. T::MaxRequests::get() => add_requests_next_epoch::<T>(i)?; - ensure!(RequestsReadyAtNextBlock::<T>::get().is_empty(), "List not filled properly."); + + #[benchmark] + fn on_initialize_epoch(i: Linear<1, { T::MaxRequests::get() }>) -> Result<(), BenchmarkError> { + add_requests_next_epoch::<T>(i)?; + ensure!( + RequestsReadyAtNextBlock::<T>::get().is_empty(), + "List not filled properly." + ); ensure!(RequestsIds::<T>::count() == i, "List not filled properly."); - ensure!(RequestsReadyAtEpoch::<T>::get(T::GetCurrentEpochIndex::get()).len() == i as usize, "List not filled properly."); - let next_epoch_hook_in = NexEpochHookIn::<T>::mutate(|next_in| { - core::mem::replace(next_in, 1) - }); - }: { Pallet::<T>::on_initialize(1.into()); } - verify { + ensure!( + RequestsReadyAtEpoch::<T>::get(T::GetCurrentEpochIndex::get()).len() == i as usize, + "List not filled properly." + ); + NexEpochHookIn::<T>::mutate(|next_in| core::mem::replace(next_in, 1)); + + #[block] + { + Pallet::<T>::on_initialize(1.into()); + } + ensure!(RequestsIds::<T>::count() == 0, "List not processed."); - ensure!(RequestsReadyAtEpoch::<T>::get(T::GetCurrentEpochIndex::get()).is_empty(), "List not processed properly."); + ensure!( + RequestsReadyAtEpoch::<T>::get(T::GetCurrentEpochIndex::get()).is_empty(), + "List not processed properly." + ); + Ok(()) } } diff --git a/pallets/quota/Cargo.toml b/pallets/quota/Cargo.toml index c2133c79ef7409f56177697ba355d668c15bd911..3c92a89ec438d823a34d91fe3a6eacaaf77b4adc 100644 --- a/pallets/quota/Cargo.toml +++ b/pallets/quota/Cargo.toml @@ -1,91 +1,61 @@ [package] -authors = ['HugoTrentesaux <hugo@trentesaux.fr>'] -description = 'duniter pallet quota' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-quota' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet quota" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-quota" +readme = "README.md" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/runtime-benchmarks", + "pallet-balances/try-runtime", + "pallet-identity/runtime-benchmarks", + "pallet-identity/try-runtime", + "sp-runtime/try-runtime", ] std = [ - 'codec/std', - 'scale-info/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'sp-core/std', - 'sp-runtime/std', - 'sp-std/std', - 'sp-io/std', - 'pallet-identity/std', - 'pallet-balances/std', + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "pallet-identity/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] [package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] - -# crates.io -codec = { package = 'parity-scale-codec', version = "3.6.9", features = ['derive'], default-features = false } -pallet-identity = { path = "../identity", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -# substrate - -[dependencies.pallet-balances] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } +pallet-identity = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } [dev-dependencies] -sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-io = { workspace = true } diff --git a/pallets/quota/README.md b/pallets/quota/README.md index 6ed526208db7b13ab2ebda4983c76778aeaff853..485460de592face6a99597fef19eb952df5936d4 100644 --- a/pallets/quota/README.md +++ b/pallets/quota/README.md @@ -5,7 +5,7 @@ Duniter identity system allows to allocate quota and refund transaction fees whe ## General behavior Quota system is plugged to transactions fees which is a rather critical aspect of substrate. -That's why in `duniter-account` pallet `OnChargeTransaction` implementation, the default behavior is preserved, and refunds are added to a queue handeled in `on_idle`. +That's why in `duniter-account` pallet `OnChargeTransaction` implementation, the default behavior is preserved, and refunds are added to a queue handled in `on_idle`. ## Path for a refund diff --git a/pallets/quota/src/benchmarking.rs b/pallets/quota/src/benchmarking.rs index bae829e73049f7fac956680a33be754b9ee95779..834268d9c014194c61a16a092e1fcd15c0f53e65 100644 --- a/pallets/quota/src/benchmarking.rs +++ b/pallets/quota/src/benchmarking.rs @@ -17,21 +17,25 @@ #![cfg(feature = "runtime-benchmarks")] use super::*; -use frame_benchmarking::{account, benchmarks}; +use frame_benchmarking::account; +use frame_benchmarking::v2::*; use sp_runtime::traits::One; fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } -benchmarks! { - where_clause { +#[benchmarks( where IdtyId<T>: From<u32>, BalanceOf<T>: From<u64>, T::AccountId: From<[u8; 32]>, - } - queue_refund { +)] +mod benchmarks { + use super::*; + + #[benchmark] + fn queue_refund() { let account: T::AccountId = account("Alice", 1, 1); let dummy_refund = Refund { account: account.clone(), @@ -44,15 +48,21 @@ benchmarks! { amount: 10u64.into(), }; // Complexity is bound to MAX_QUEUD_REFUNDS where an insertion is O(n-1) - for i in 0..MAX_QUEUED_REFUNDS-1 { + for _ in 0..MAX_QUEUED_REFUNDS - 1 { Pallet::<T>::queue_refund(dummy_refund.clone()) } - }: { Pallet::<T>::queue_refund(refund.clone()) } - verify { + + #[block] + { + Pallet::<T>::queue_refund(refund.clone()); + } + assert_eq!(RefundQueue::<T>::get().last(), Some(refund).as_ref()); assert_eq!(RefundQueue::<T>::get().len() as u32, MAX_QUEUED_REFUNDS); } - spend_quota { + + #[benchmark] + fn spend_quota() { let idty_id: IdtyId<T> = 1u32.into(); let amount = 2u64; let quota_amount = 10u64; @@ -63,15 +73,23 @@ benchmarks! { amount: quota_amount.into(), }, ); - }: { Pallet::<T>::spend_quota(idty_id, amount.into()) } - verify { - let quota_growth = sp_runtime::Perbill::from_rational( - BlockNumberFor::<T>::one(), - T::ReloadRate::get(), - ).mul_floor(T::MaxQuota::get()); - assert_eq!(IdtyQuota::<T>::get(idty_id).unwrap().amount, quota_growth +quota_amount.into() - amount.into()); + + #[block] + { + Pallet::<T>::spend_quota(idty_id, amount.into()); + } + + let quota_growth = + sp_runtime::Perbill::from_rational(BlockNumberFor::<T>::one(), T::ReloadRate::get()) + .mul_floor(T::MaxQuota::get()); + assert_eq!( + IdtyQuota::<T>::get(idty_id).unwrap().amount, + quota_growth + quota_amount.into() - amount.into() + ); } - try_refund { + + #[benchmark] + fn try_refund() { let account: T::AccountId = account("Alice", 1, 1); let idty_id: IdtyId<T> = 1u32.into(); IdtyQuota::<T>::insert( @@ -81,9 +99,7 @@ benchmarks! { amount: 10u64.into(), }, ); - let _ = CurrencyOf::<T>:: make_free_balance_be( - &T::RefundAccount::get(),u32::MAX.into(), - ); + let _ = CurrencyOf::<T>::make_free_balance_be(&T::RefundAccount::get(), u32::MAX.into()); // The worst-case scenario is when the refund fails // and can only be triggered if the account is dead, // in this case by having no balance in the account. @@ -92,15 +108,19 @@ benchmarks! { identity: 1u32.into(), amount: 10u64.into(), }; - }: { Pallet::<T>::try_refund(refund) } - verify { - assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into()); + + #[block] + { + Pallet::<T>::try_refund(refund); + } + + assert_has_event::<T>(Event::<T>::RefundFailed(account).into()); } - do_refund { + + #[benchmark] + fn do_refund() { let account: T::AccountId = account("Alice", 1, 1); - let _ = CurrencyOf::<T>:: make_free_balance_be( - &T::RefundAccount::get(),u32::MAX.into(), - ); + let _ = CurrencyOf::<T>::make_free_balance_be(&T::RefundAccount::get(), u32::MAX.into()); // The worst-case scenario is when the refund fails // and can only be triggered if the account is dead, // in this case by having no balance in the account. @@ -109,19 +129,30 @@ benchmarks! { identity: 1u32.into(), amount: 10u64.into(), }; - }: { Pallet::<T>::try_refund(refund) } - verify { - assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into()); + + #[block] + { + Pallet::<T>::try_refund(refund); + } + + assert_has_event::<T>(Event::<T>::RefundFailed(account).into()); } - // The base weight consumed on processing refund queue when empty. - on_process_refund_queue { + + #[benchmark] + fn on_process_refund_queue() { + // The base weight consumed on processing refund queue when empty. assert_eq!(RefundQueue::<T>::get().len() as u32, 0); - }: { Pallet::<T>::process_refund_queue(Weight::MAX) } - // The weight consumed on processing refund queue with one element. - // Can deduce the process_refund_queue overhead by subtracting try_refund weight. - #[pov_mode = Measured] - on_process_refund_queue_elements { - let i in 1..MAX_QUEUED_REFUNDS; + + #[block] + { + Pallet::<T>::process_refund_queue(Weight::MAX); + } + } + + #[benchmark] + fn on_process_refund_queue_elements(i: Linear<1, MAX_QUEUED_REFUNDS>) { + // The weight consumed on processing refund queue with one element. + // Can deduce the process_refund_queue overhead by subtracting try_refund weight. let account: T::AccountId = account("Alice", 1, 1); let idty_id: IdtyId<T> = 1u32.into(); IdtyQuota::<T>::insert( @@ -131,9 +162,7 @@ benchmarks! { amount: 10u64.into(), }, ); - let _ = CurrencyOf::<T>:: make_free_balance_be( - &T::RefundAccount::get(),u32::MAX.into(), - ); + let _ = CurrencyOf::<T>::make_free_balance_be(&T::RefundAccount::get(), u32::MAX.into()); // The worst-case scenario is when the refund fails // and can only be triggered if the account is dead, // in this case by having no balance in the account. @@ -146,10 +175,21 @@ benchmarks! { Pallet::<T>::queue_refund(refund.clone()); } assert_eq!(RefundQueue::<T>::get().len() as u32, i); - }: { Pallet::<T>::process_refund_queue(Weight::MAX) } - verify { + + #[block] + { + Pallet::<T>::process_refund_queue(Weight::MAX); + } + assert_eq!(RefundQueue::<T>::get().len() as u32, 0); - assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into()); + assert_has_event::<T>(Event::<T>::RefundFailed(account).into()); } - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(crate::mock::QuotaConfig{identities: vec![1, 2]}), crate::mock::Test); + + impl_benchmark_test_suite!( + Pallet, + crate::mock::new_test_ext(crate::mock::QuotaConfig { + identities: vec![1, 2] + }), + crate::mock::Test + ); } diff --git a/pallets/session-benchmarking/Cargo.toml b/pallets/session-benchmarking/Cargo.toml index b1658a6c648d668219ee0a50f230361238196ce6..3da6b64a6edc96811e58a6ae367922d750305869 100644 --- a/pallets/session-benchmarking/Cargo.toml +++ b/pallets/session-benchmarking/Cargo.toml @@ -1,113 +1,42 @@ [package] name = "pallet-session-benchmarking" -version = "4.0.0-dev" -authors = ["Parity Technologies <admin@parity.io>"] -edition = "2021" -license = "Apache-2.0" -homepage = "https://substrate.io" -repository = "https://github.com/paritytech/substrate/" +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true description = "FRAME sessions pallet benchmarking" readme = "README.md" +version.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -pallet-authority-members = { path = "../authority-members", default-features = false } - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-session] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-session] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.parity-scale-codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.1.5" - -[dev-dependencies.pallet-balances] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.pallet-timestamp] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dev-dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +frame-benchmarking = { workspace = true, optional = true } +frame-system = { workspace = true } +pallet-session = { workspace = true } +sp-std = { workspace = true } +sp-runtime = { workspace = true } +codec = { workspace = true } [features] default = ["std"] std = [ - "parity-scale-codec/std", + "codec/std", "frame-benchmarking?/std", - "frame-support/std", "frame-system/std", "pallet-session/std", - "pallet-balances/std", - "pallet-timestamp/std", "sp-runtime/std", - "sp-session/std", "sp-std/std", - "sp-core/std", - "sp-io/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-system/try-runtime", + "pallet-session/try-runtime", + "sp-runtime/try-runtime", ] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] - diff --git a/pallets/session-benchmarking/src/lib.rs b/pallets/session-benchmarking/src/lib.rs index 057de1931ec2e87434e2f3c83e9f0576d924402e..dd22408a1a7e1918bd8da529f2bd296bdd0ba916 100644 --- a/pallets/session-benchmarking/src/lib.rs +++ b/pallets/session-benchmarking/src/lib.rs @@ -19,7 +19,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(feature = "runtime-benchmarks")] -use parity_scale_codec::Decode; +use codec::Decode; use sp_std::{prelude::*, vec}; use frame_benchmarking::{benchmarks, whitelisted_caller}; diff --git a/pallets/smith-members/Cargo.toml b/pallets/smith-members/Cargo.toml index 8949b9149ec2197df2dd8688e508e13f977ac780..651a62a8a77f543bfaf71ee4b09128a424c30844 100644 --- a/pallets/smith-members/Cargo.toml +++ b/pallets/smith-members/Cargo.toml @@ -1,68 +1,62 @@ [package] name = "pallet-smith-members" -authors = ["c-geek <https://forum.duniter.org/u/cgeek>"] -description = 'duniter pallet to handle offences.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet to handle offences" +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true readme = "README.md" +version.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -log = { version = "0.4.20", default-features = false } -pallet-authority-members = { path = "../authority-members", default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +log = { workspace = true } +pallet-authority-members = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-runtime = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } [dev-dependencies] -maplit = { version = "1.0.2", default-features = false } -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +maplit = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } [features] default = ["std"] std = [ "codec/std", + "frame-benchmarking?/std", "frame-support/std", "frame-system/std", - 'frame-benchmarking?/std', "log/std", - "pallet-balances/std", "pallet-authority-members/std", "scale-info/std", + "sp-core/std", + "sp-io/std", "sp-runtime/std", "sp-staking/std", "sp-std/std", ] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", "pallet-authority-members/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "sp-staking/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'pallet-authority-members/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-authority-members/runtime-benchmarks", + "pallet-authority-members/try-runtime", + "sp-runtime/try-runtime", ] diff --git a/pallets/smith-members/src/benchmarking.rs b/pallets/smith-members/src/benchmarking.rs index 62e0b8ddc7251e957b5edaddf1092a2a54c55e40..b3730a866f87cf3131a8c749122e1e6e939ab71a 100644 --- a/pallets/smith-members/src/benchmarking.rs +++ b/pallets/smith-members/src/benchmarking.rs @@ -18,83 +18,88 @@ use super::*; -use frame_benchmarking::benchmarks; +use frame_benchmarking::v2::*; use frame_system::RawOrigin; use sp_runtime::traits::Convert; -#[cfg(test)] -use maplit::btreemap; - use crate::Pallet; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} - -benchmarks! { - where_clause { +#[benchmarks( where T::IdtyIndex: From<u32> +)] +mod benchmarks { + use super::*; + + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - invite_smith { + + #[benchmark] + fn invite_smith() { let issuer: T::IdtyIndex = 1.into(); let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); Pallet::<T>::on_smith_goes_online(1.into()); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); let receiver: T::IdtyIndex = 4.into(); - }: _<T::RuntimeOrigin>(caller_origin, receiver) - verify { - assert_has_event::<T>(Event::<T>::InvitationSent{ - receiver, - issuer, - }.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver); + + assert_has_event::<T>(Event::<T>::InvitationSent { receiver, issuer }.into()); } - accept_invitation { - // Worst case preparation + + #[benchmark] + fn accept_invitation() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); Pallet::<T>::on_smith_goes_online(1.into()); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(caller.clone()).into(); let receiver: T::IdtyIndex = 4.into(); Pallet::<T>::invite_smith(caller_origin, receiver)?; - // test let issuer: T::IdtyIndex = 4.into(); let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - }: _<T::RuntimeOrigin>(caller_origin) - verify { - assert_has_event::<T>(Event::<T>::InvitationAccepted{ - idty_index: receiver, - }.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller)); + + assert_has_event::<T>( + Event::<T>::InvitationAccepted { + idty_index: receiver, + } + .into(), + ); + Ok(()) } - certify_smith { - // Worst case preparation + + #[benchmark] + fn certify_smith() -> Result<(), BenchmarkError> { let issuer: T::IdtyIndex = 1.into(); let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); Pallet::<T>::on_smith_goes_online(1.into()); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(caller.clone()).into(); let receiver: T::IdtyIndex = 4.into(); Pallet::<T>::invite_smith(caller_origin, receiver)?; let issuer: T::IdtyIndex = receiver; let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); + let caller_origin: <T as frame_system::Config>::RuntimeOrigin = + RawOrigin::Signed(caller.clone()).into(); Pallet::<T>::accept_invitation(caller_origin)?; - // test let issuer: T::IdtyIndex = 1.into(); let caller: T::AccountId = T::OwnerKeyOf::convert(issuer).unwrap(); - let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into(); - }: _<T::RuntimeOrigin>(caller_origin, receiver) - verify { - assert_has_event::<T>(Event::<T>::SmithCertAdded{ - receiver, - issuer, - }.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), receiver); + + assert_has_event::<T>(Event::<T>::SmithCertAdded { receiver, issuer }.into()); + Ok(()) } impl_benchmark_test_suite!( Pallet, - crate::mock::new_test_ext(GenesisConfig { - initial_smiths: btreemap![ + crate::mock::new_test_ext(crate::GenesisConfig { + initial_smiths: maplit::btreemap![ 1 => (false, vec![2, 3]), 2 => (false, vec![1, 3]), 3 => (false, vec![1, 2]), diff --git a/pallets/universal-dividend/Cargo.toml b/pallets/universal-dividend/Cargo.toml index bb15b5881f177ae86e7fa0da57b606d40306a743..5fdfc69f5e85236bb3ec576abc7247b3052c4fad 100644 --- a/pallets/universal-dividend/Cargo.toml +++ b/pallets/universal-dividend/Cargo.toml @@ -1,17 +1,17 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet universal dividend.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-universal-dividend' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet universal dividend" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-universal-dividend" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", @@ -19,80 +19,49 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-balances/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/runtime-benchmarks", + "pallet-balances/try-runtime", + "pallet-timestamp/runtime-benchmarks", + "pallet-timestamp/try-runtime", + "sp-runtime/try-runtime", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - 'pallet-timestamp/std', - 'pallet-balances/std', - 'scale-info/std', - "serde/std", - "sp-arithmetic/std", - "sp-io/std", - "sp-core/std", - "sp-std/std", - "sp-runtime/std", + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "pallet-timestamp/std", + "scale-info/std", + "serde/std", + "sp-arithmetic/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", ] - -[dependencies] -# crates.io -codec = { package = 'parity-scale-codec', version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } - -# substrate bencharks -frame-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', optional = true, default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', optional = true, default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", features = ["derive"], default-features = false } - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.pallet-timestamp] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-arithmetic] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' ### DOC ### [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DEV ### +[dependencies] +codec = { workspace = true, features = ["derive", "max-encoded-len"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } +pallet-timestamp = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +sp-arithmetic = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } -[dev-dependencies.sp-core] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dev-dependencies] +sp-core = { workspace = true } diff --git a/pallets/universal-dividend/src/benchmarking.rs b/pallets/universal-dividend/src/benchmarking.rs index 5786d2ee0930ddf30ce14f5766aa412c77ecce82..8614441b3a2025c50ef9518a95d5e71f7f471723 100644 --- a/pallets/universal-dividend/src/benchmarking.rs +++ b/pallets/universal-dividend/src/benchmarking.rs @@ -19,9 +19,10 @@ use super::*; use core::num::NonZeroU16; -use frame_benchmarking::{account, benchmarks, whitelisted_caller}; +use frame_benchmarking::v2::*; +use frame_benchmarking::{account, whitelisted_caller}; use frame_support::pallet_prelude::IsType; -use frame_support::traits::Get; // OnTimestampSet +use frame_support::traits::Get; use frame_support::traits::StoredMap; use frame_system::RawOrigin; use pallet_balances::Pallet as Balances; @@ -31,88 +32,139 @@ use sp_runtime::traits::Convert; use crate::Pallet; const ED_MULTIPLIER: u32 = 10; -const SEED: u32 = 0; -fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { - frame_system::Pallet::<T>::assert_has_event(generic_event.into()); -} - -benchmarks! { - - // Benchmark `transfer_ud` extrinsic with the worst possible conditions: - // * Transfer will kill the sender account. - // * Transfer will create the recipient account. - where_clause { +#[benchmarks( where T: pallet_balances::Config, T::Balance: From<u64>, <T::Currency as Currency<T::AccountId>>::Balance: IsType<T::Balance> +)] +mod benchmarks { + use super::*; + + fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) { + frame_system::Pallet::<T>::assert_has_event(generic_event.into()); } - claim_uds { - let i in 1..T::MaxPastReeval::get(); - let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); + + #[benchmark] + fn claim_uds(i: Linear<1, { T::MaxPastReeval::get() }>) -> Result<(), BenchmarkError> { + // Benchmark `transfer_ud` extrinsic with the worst possible conditions: + // * Transfer will kill the sender account. + // * Transfer will create the recipient account. + let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); CurrentUdIndex::<T>::put(2054u16); - T::MembersStorage::insert(&caller, FirstEligibleUd(Some(NonZeroU16::new(CurrentUdIndex::<T>::get() - i as u16).unwrap())))?; + T::MembersStorage::insert( + &caller, + FirstEligibleUd(Some( + NonZeroU16::new(CurrentUdIndex::<T>::get() - i as u16).unwrap(), + )), + )?; let (_, uds_total) = compute_claim_uds::compute_claim_uds( CurrentUdIndex::<T>::get(), CurrentUdIndex::<T>::get() - i as u16, PastReevals::<T>::get().into_iter(), ); - }: _(RawOrigin::Signed(caller.clone())) - verify { - assert_has_event::<T>(Event::<T>::UdsClaimed {count: i as u16, total: uds_total, who: caller}.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone())); + + assert_has_event::<T>( + Event::<T>::UdsClaimed { + count: i as u16, + total: uds_total, + who: caller, + } + .into(), + ); + Ok(()) } - transfer_ud { + + #[benchmark] + fn transfer_ud() { let existential_deposit = T::ExistentialDeposit::get(); let caller = whitelisted_caller(); - - // Give some multiple of the existential deposit let balance = existential_deposit.saturating_mul(ED_MULTIPLIER.into()); let _ = T::Currency::make_free_balance_be(&caller, balance.into()); + // Transfer `e - 1` existential deposits + 1 unit, which guarantees to create one account and reap this user. + let recipient: T::AccountId = account("recipient", 0, 1); + let recipient_lookup: <T::Lookup as StaticLookup>::Source = + T::Lookup::unlookup(recipient.clone()); + let transfer_amount = + existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into(); + let transfer_amount_ud = + transfer_amount.saturating_mul(1_000.into()) / Pallet::<T>::current_ud().into(); + + #[extrinsic_call] + _( + RawOrigin::Signed(caller.clone()), + recipient_lookup, + transfer_amount_ud.into(), + ); - // Transfer `e - 1` existential deposits + 1 unit, which guarantees to create one account, - // and reap this user. - let recipient: T::AccountId = account("recipient", 0, SEED); - let recipient_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient.clone()); - let transfer_amount = existential_deposit.saturating_mul((ED_MULTIPLIER - 1).into()) + 1u32.into(); - let transfer_amount_ud = transfer_amount.saturating_mul(1_000.into()) / Pallet::<T>::current_ud().into(); - }: _(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount_ud.into()) - verify { assert_eq!(Balances::<T>::free_balance(&caller), Zero::zero()); assert_eq!(Balances::<T>::free_balance(&recipient), transfer_amount); } - // Benchmark `transfer_ud_keep_alive` with the worst possible condition: - // * The recipient account is created. - transfer_ud_keep_alive { + #[benchmark] + fn transfer_ud_keep_alive() { + // Benchmark `transfer_ud_keep_alive` with the worst possible condition: + // * The recipient account is created. let caller = whitelisted_caller(); - let recipient: T::AccountId = account("recipient", 0, SEED); - let recipient_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(recipient.clone()); - + let recipient: T::AccountId = account("recipient", 0, 1); + let recipient_lookup: <T::Lookup as StaticLookup>::Source = + T::Lookup::unlookup(recipient.clone()); // Give the sender account max funds, thus a transfer will not kill account. - let _ = T::Currency::make_free_balance_be(&caller, <T::Currency as Currency<T::AccountId>>::Balance::max_value()); + let _ = T::Currency::make_free_balance_be( + &caller, + <T::Currency as Currency<T::AccountId>>::Balance::max_value(), + ); let existential_deposit = T::ExistentialDeposit::get(); let transfer_amount = existential_deposit.saturating_mul(ED_MULTIPLIER.into()); - let transfer_amount_ud = transfer_amount.saturating_mul(1_000.into()) / Pallet::<T>::current_ud().into(); - }: _(RawOrigin::Signed(caller.clone()), recipient_lookup, transfer_amount_ud.into()) - verify { + let transfer_amount_ud = + transfer_amount.saturating_mul(1_000.into()) / Pallet::<T>::current_ud().into(); + + #[extrinsic_call] + _( + RawOrigin::Signed(caller.clone()), + recipient_lookup, + transfer_amount_ud.into(), + ); + assert!(!Balances::<T>::free_balance(&caller).is_zero()); assert_eq!(Balances::<T>::free_balance(&recipient), transfer_amount); } - on_removed_member { - let i in 0..T::MaxPastReeval::get(); - let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); + + #[benchmark] + fn on_removed_member(i: Linear<1, { T::MaxPastReeval::get() }>) -> Result<(), BenchmarkError> { + let caller: T::AccountId = T::AccountIdOf::convert(1).unwrap(); CurrentUdIndex::<T>::put(2054u16); - T::MembersStorage::insert(&caller, FirstEligibleUd(Some(NonZeroU16::new(CurrentUdIndex::<T>::get() - i as u16).unwrap())))?; + T::MembersStorage::insert( + &caller, + FirstEligibleUd(Some( + NonZeroU16::new(CurrentUdIndex::<T>::get() - i as u16).unwrap(), + )), + )?; let (_, uds_total) = compute_claim_uds::compute_claim_uds( CurrentUdIndex::<T>::get(), CurrentUdIndex::<T>::get() - i as u16, PastReevals::<T>::get().into_iter(), ); - }: {Pallet::<T>::on_removed_member(CurrentUdIndex::<T>::get() - i as u16, &caller);} - verify { + + #[block] + { + Pallet::<T>::on_removed_member(CurrentUdIndex::<T>::get() - i as u16, &caller); + } + if i != 0 { - assert_has_event::<T>(Event::<T>::UdsAutoPaid {count: i as u16, total: uds_total, who: caller}.into()); + assert_has_event::<T>( + Event::<T>::UdsAutoPaid { + count: i as u16, + total: uds_total, + who: caller, + } + .into(), + ); } + Ok(()) } impl_benchmark_test_suite!( diff --git a/pallets/universal-dividend/src/lib.rs b/pallets/universal-dividend/src/lib.rs index d475f974ca82f1a7d397a019ab3b531fe1078e5c..a360fbdf4a9cac88631fd1353e33822fa57fdea2 100644 --- a/pallets/universal-dividend/src/lib.rs +++ b/pallets/universal-dividend/src/lib.rs @@ -303,9 +303,9 @@ pub mod pallet { let _ = core::mem::replace( first_ud_index, core::num::NonZeroU16::new(current_ud_index) - .expect("unrechable because current_ud_index is never zero."), + .expect("unreachable because current_ud_index is never zero."), ); - T::Currency::deposit_creating(who, uds_total); + let _ = T::Currency::deposit_creating(who, uds_total); Self::deposit_event(Event::UdsClaimed { count: uds_count, total: uds_total, @@ -443,7 +443,7 @@ pub mod pallet { first_ud_index, PastReevals::<T>::get().into_iter(), ); - T::Currency::deposit_creating(who, uds_total); + let _ = T::Currency::deposit_creating(who, uds_total); Self::deposit_event(Event::UdsAutoPaid { count: uds_count, total: uds_total, diff --git a/pallets/upgrade-origin/Cargo.toml b/pallets/upgrade-origin/Cargo.toml index 6aabbaeb067ccfbcb9419ac3d87231e9fe4ed31d..b1f08f0bced4e8a5baac966d5b1a5677cb41dd15 100644 --- a/pallets/upgrade-origin/Cargo.toml +++ b/pallets/upgrade-origin/Cargo.toml @@ -1,80 +1,52 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'duniter pallet to upgrade specified origin to root.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'pallet-upgrade-origin' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "duniter pallet to upgrade specified origin to root" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "pallet-upgrade-origin" +repository.workspace = true +version.workspace = true [features] -default = ['std'] +default = ["std"] runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'sp-runtime/try-runtime', + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", ] std = [ - 'codec/std', - 'scale-info/std', - 'frame-support/std', - 'frame-system/std', - 'frame-benchmarking?/std', - "sp-io/std", - "sp-runtime/std", - "sp-std/std", + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-staking/std", + "sp-std/std", ] -[dependencies] - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-benchmarking] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -optional = true -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +[dependencies] +codec = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } diff --git a/pallets/upgrade-origin/src/benchmarking.rs b/pallets/upgrade-origin/src/benchmarking.rs index 78a92c9206a694fb872dca143fac465a2acb260f..33821436d4bf96c90e6b9602e5e731c093d2ce70 100644 --- a/pallets/upgrade-origin/src/benchmarking.rs +++ b/pallets/upgrade-origin/src/benchmarking.rs @@ -19,12 +19,19 @@ use super::*; use crate::Pallet; -use frame_benchmarking::benchmarks; +use frame_benchmarking::v2::*; use frame_support::traits::Get; -benchmarks! { - dispatch_as_root { +#[benchmarks] +mod benchmarks { + use super::*; + + #[benchmark] + fn dispatch_as_root() { let call = Box::new(frame_system::Call::remark { remark: vec![] }.into()); let origin: T::WorstCaseOriginType = T::WorstCaseOrigin::get(); - }: dispatch_as_root (origin, call) + + #[extrinsic_call] + _(origin, call); + } } diff --git a/primitives/distance/Cargo.toml b/primitives/distance/Cargo.toml index afd7e3c3c5784b9efbb239dd0cfa500094573594..9c035c38be1091c0d33dbbea6069c0ec0860756c 100644 --- a/primitives/distance/Cargo.toml +++ b/primitives/distance/Cargo.toml @@ -1,71 +1,41 @@ [package] -authors = ['tuxmain <tuxmain@zettascript.org>'] -description = 'primitives for pallet distance.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'sp-distance' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "primitives for pallet distance" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "sp-distance" +readme = "README.md" +repository.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +default-features = false +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] +default = ["std"] std = [ - 'async-trait', - 'scale-info/std', - 'codec/std', - 'frame-support/std', - 'serde/std', - 'sp-inherents/std', - 'sp-runtime/std', - 'sp-std/std', - 'thiserror' -] -try-runtime = [ - 'frame-support/try-runtime', - 'sp-runtime/try-runtime', + "async-trait", + "codec/std", + "frame-support/std", + "scale-info/std", + "serde/std", + "sp-inherents/std", + "sp-runtime/std", + "sp-std/std", + "thiserror", ] +try-runtime = ["frame-support/try-runtime", "sp-runtime/try-runtime"] +runtime-benchmarks = [] [dependencies] -async-trait = { version = "0.1", optional = true, default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -thiserror = { version = "1.0.56", optional = true, default-features = false } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.serde] -default-features = false -version = "1.0.195" -features = ["derive"] - -[dependencies.sp-inherents] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - -[package.metadata.docs.rs] -default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +async-trait = { workspace = true, optional = true } +codec = { workspace = true, features = ["derive"] } +frame-support = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +sp-inherents = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } +thiserror = { workspace = true, optional = true } diff --git a/primitives/duniter/Cargo.toml b/primitives/duniter/Cargo.toml index 9cb227fb8939bee810a0c0d6fa619307543b0cfc..0dc499ff35a884ade61a3ff9b2b18e8edc51bde0 100644 --- a/primitives/duniter/Cargo.toml +++ b/primitives/duniter/Cargo.toml @@ -1,56 +1,19 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'primitives for duniter runtime.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'duniter-primitives' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' - -[features] -default = ['std'] -std = [ - 'scale-info/std', - 'codec/std', - 'frame-support/std', - 'sp-runtime/std', - 'sp-std/std', -] -try-runtime = [ - 'frame-support/try-runtime', - 'sp-runtime/try-runtime', -] - -[dependencies] - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -### DOC ### +authors.workspace = true +description = "primitives for duniter runtime" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "duniter-primitives" +readme = "README.md" +repository.workspace = true +version.workspace = true [package.metadata.docs.rs] default-features = false -targets = ['x86_64-unknown-linux-gnu'] +targets = ["x86_64-unknown-linux-gnu"] + +[features] +default = ["std"] +std = [] +try-runtime = [] diff --git a/primitives/membership/Cargo.toml b/primitives/membership/Cargo.toml index a66bc91dc3926e6b23b921bc3b1715ac8fcb80e1..0a79733901f4d79ddcc017acbe669a4ef595a6dc 100644 --- a/primitives/membership/Cargo.toml +++ b/primitives/membership/Cargo.toml @@ -1,64 +1,37 @@ [package] -authors = ['librelois <c@elo.tf>'] -description = 'primitives for pallet membership.' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'sp-membership' -readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +description = "primitives for pallet membership" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "sp-membership" +readme = "README.md" +repository.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +default-features = false +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] +default = ["std"] std = [ - 'scale-info/std', - 'codec/std', - 'frame-support/std', - 'serde/std', - 'sp-runtime/std', - 'sp-std/std', -] -try-runtime = [ - 'frame-support/try-runtime', - 'sp-runtime/try-runtime', + "codec/std", + "frame-support/std", + "scale-info/std", + "serde/std", + "sp-runtime/std", + "sp-std/std", ] +try-runtime = ["frame-support/try-runtime", "sp-runtime/try-runtime"] +runtime-benchmarks = [] [dependencies] -# crates.io -impl-trait-for-tuples = { version = "0.2.2", default-features = false } - -# substrate -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = "3.6.9" - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' - -[dependencies.serde] -default-features = false -version = "1.0.195" -features = ["derive"] - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' -### DOC ### - -[package.metadata.docs.rs] -default-features = false -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/duniter/duniter-polkadot-sdk' -branch = 'duniter-substrate-v1.6.0' +codec = { workspace = true, features = ["derive"] } +frame-support = { workspace = true } +impl-trait-for-tuples = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } diff --git a/resources/metadata.scale b/resources/metadata.scale index 2166a0563e80550fe7bb592b6b5968490ce3f0e4..1d38da799164b8bde953d18f7f14fe192863634b 100644 Binary files a/resources/metadata.scale and b/resources/metadata.scale differ diff --git a/resources/weight_analyzer/Cargo.toml b/resources/weight_analyzer/Cargo.toml index 9a935bd0fb60eab847ba887bb4091fec148b8c4b..c33889c446f9a434b8f65759acd861664d9b9401 100644 --- a/resources/weight_analyzer/Cargo.toml +++ b/resources/weight_analyzer/Cargo.toml @@ -1,19 +1,21 @@ [package] name = "weight-analyzer" -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -description = 'Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency' -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '0.0.0' +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true [lib] name = "weightanalyzer" path = "src/lib.rs" [dependencies] -convert_case = "0.6.0" -glob = "0.3.1" -serde = { version = "1.0.101", features = ["derive"] } -subweight-core = "3.3.1" +convert_case = { workspace = true } +glob = { workspace = true } +serde = { workspace = true, features = ["derive"] } +subweight-core = { workspace = true } + +[features] +std = [] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 11e953e402c132883ac0f904458bcca3ca5b42fe..4dae708319da060ab31d88f70a9f7ff399b6a4e8 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,173 +1,174 @@ [package] -name = 'common-runtime' -description = 'Common code shared between all runtimes' -license = 'GPL-3.0-only' -version = '0.8.0-dev' -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -edition = "2021" +name = "common-runtime" +description = "Common code shared between all runtimes" +license.workspace = true +authors.workspace = true +edition.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] +default = ["std"] no_std = [] constant-fees = [] runtime-benchmarks = [ - 'frame-benchmarking/runtime-benchmarks', - 'frame-system-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - "pallet-babe/runtime-benchmarks", - 'pallet-balances/runtime-benchmarks', - 'pallet-certification/runtime-benchmarks', - 'pallet-offences/runtime-benchmarks', - 'pallet-collective/runtime-benchmarks', - 'pallet-duniter-wot/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-quota/runtime-benchmarks', - 'pallet-provide-randomness/runtime-benchmarks', - 'pallet-im-online/runtime-benchmarks', - 'pallet-universal-dividend/runtime-benchmarks', - 'pallet-oneshot-account/runtime-benchmarks', - 'pallet-multisig/runtime-benchmarks', - 'pallet-proxy/runtime-benchmarks', - 'pallet-preimage/runtime-benchmarks', - 'pallet-treasury/runtime-benchmarks', - 'pallet-upgrade-origin/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-authority-members/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-certification/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "pallet-duniter-account/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "pallet-oneshot-account/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-provide-randomness/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-quota/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-smith-members/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-universal-dividend/runtime-benchmarks", + "pallet-upgrade-origin/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-benchmarking/std', - 'frame-system-benchmarking?/std', - 'frame-support/std', - 'frame-system/std', - 'pallet-authority-members/std', - 'pallet-babe/std', - 'pallet-balances/std', - 'pallet-certification/std', - 'pallet-collective/std', - 'pallet-duniter-account/std', - 'pallet-duniter-wot/std', - 'pallet-grandpa/std', - 'pallet-identity/std', - 'pallet-im-online/std', - 'pallet-membership/std', - 'pallet-multisig/std', - "pallet-offences/std", - 'pallet-oneshot-account/std', - 'pallet-preimage/std', - 'pallet-provide-randomness/std', - 'pallet-proxy/std', - 'pallet-quota/std', - 'pallet-multisig/std', - "pallet-scheduler/std", - 'pallet-session/std', - 'pallet-smith-members/std', - 'pallet-sudo/std', - 'pallet-timestamp/std', - 'pallet-treasury/std', - 'pallet-universal-dividend/std', - 'pallet-upgrade-origin/std', - 'pallet-utility/std', - 'scale-info/std', - "serde/std", - 'sp-arithmetic/std', - 'sp-consensus-babe/std', - 'sp-core/std', - 'sp-membership/std', - 'sp-runtime/std', - 'sp-staking/std', - 'sp-std/std', - 'sp-weights/std', - 'node-primitives/std', + "codec/std", + "duniter-primitives/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system-benchmarking?/std", + "frame-system/std", + "pallet-authority-members/std", + "pallet-babe/std", + "pallet-balances/std", + "pallet-certification/std", + "pallet-collective/std", + "pallet-distance/std", + "pallet-duniter-account/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-offences/std", + "pallet-oneshot-account/std", + "pallet-preimage/std", + "pallet-provide-randomness/std", + "pallet-proxy/std", + "pallet-quota/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-smith-members/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-treasury/std", + "pallet-universal-dividend/std", + "pallet-upgrade-origin/std", + "pallet-utility/std", + "scale-info/std", + "serde/std", + "sp-arithmetic/std", + "sp-consensus-babe/std", + "sp-core/std", + "sp-membership/std", + "sp-runtime/std", + "sp-staking/std", + "sp-std/std", + "sp-weights/std", ] try-runtime = [ - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'pallet-babe/try-runtime', - 'pallet-balances/try-runtime', - 'pallet-certification/try-runtime', - 'pallet-collective/try-runtime', - 'pallet-duniter-account/try-runtime', - 'pallet-duniter-wot/try-runtime', - 'pallet-grandpa/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-im-online/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-offences/try-runtime", - 'pallet-oneshot-account/try-runtime', - 'pallet-preimage/try-runtime', - 'pallet-provide-randomness/try-runtime', - 'pallet-proxy/try-runtime', - 'pallet-quota/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-scheduler/try-runtime", - 'pallet-session/try-runtime', - 'pallet-smith-members/try-runtime', - 'pallet-sudo/try-runtime', - 'pallet-timestamp/try-runtime', - 'pallet-treasury/try-runtime', - 'pallet-universal-dividend/try-runtime', - 'pallet-upgrade-origin/try-runtime', - 'pallet-utility/try-runtime', + "duniter-primitives/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-authority-members/try-runtime", + "pallet-babe/try-runtime", + "pallet-balances/try-runtime", + "pallet-certification/try-runtime", + "pallet-collective/try-runtime", + "pallet-distance/try-runtime", + "pallet-duniter-account/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-identity/try-runtime", + "pallet-im-online/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-offences/try-runtime", + "pallet-oneshot-account/try-runtime", + "pallet-preimage/try-runtime", + "pallet-provide-randomness/try-runtime", + "pallet-proxy/try-runtime", + "pallet-quota/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-smith-members/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-treasury/try-runtime", + "pallet-universal-dividend/try-runtime", + "pallet-upgrade-origin/try-runtime", + "pallet-utility/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] [dependencies] - -# Crates.io -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -duniter-primitives = { path = '../../primitives/duniter', default-features = false } - -# substrate benchmarks -frame-system-benchmarking = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-benchmarking = { git = "https://github.com/duniter/duniter-polkadot-sdk", branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -# Substrate -pallet-authority-members = { path = '../../pallets/authority-members', default-features = false } -pallet-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-certification = { path = '../../pallets/certification', default-features = false } -pallet-collective = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-distance = { path = "../../pallets/distance", default-features = false } -pallet-duniter-account = { path = '../../pallets/duniter-account', default-features = false } -pallet-duniter-wot = { path = '../../pallets/duniter-wot', default-features = false } -pallet-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-identity = { path = '../../pallets/identity', default-features = false } -pallet-im-online = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-membership = { path = '../../pallets/membership', default-features = false } -pallet-multisig = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-offences = { path = '../../pallets/offences', default-features = false } -pallet-oneshot-account = { path = '../../pallets/oneshot-account', default-features = false } -pallet-preimage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-provide-randomness = { path = '../../pallets/provide-randomness', default-features = false } -pallet-proxy = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-quota = { path = '../../pallets/quota', default-features = false } -pallet-scheduler = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-smith-members = { path = '../../pallets/smith-members', default-features = false } -pallet-sudo = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-treasury = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-universal-dividend = { path = '../../pallets/universal-dividend', default-features = false } -pallet-upgrade-origin = { path = '../../pallets/upgrade-origin', default-features = false } -pallet-utility = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", default-features = false } -smallvec = { version = "1.13.1", default-features = false } -sp-arithmetic = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-membership = { path = '../../primitives/membership', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -# TODO: there is a bad coupling in substrate that force to add this dependency -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-weights = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -node-primitives = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +codec = { workspace = true, features = ["derive"] } +duniter-primitives = { workspace = true } +frame-benchmarking = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } +pallet-authority-members = { workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +pallet-certification = { workspace = true } +pallet-collective = { workspace = true } +pallet-distance = { workspace = true } +pallet-duniter-account = { workspace = true } +pallet-grandpa = { workspace = true } +pallet-identity = { workspace = true } +pallet-im-online = { workspace = true } +pallet-membership = { workspace = true } +pallet-multisig = { workspace = true } +pallet-offences = { workspace = true } +pallet-oneshot-account = { workspace = true } +pallet-preimage = { workspace = true } +pallet-provide-randomness = { workspace = true } +pallet-proxy = { workspace = true } +pallet-quota = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-smith-members = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-treasury = { workspace = true } +pallet-universal-dividend = { workspace = true } +pallet-upgrade-origin = { workspace = true } +pallet-utility = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true } +smallvec = { workspace = true } +sp-arithmetic = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-core = { workspace = true } +sp-membership = { workspace = true } +sp-runtime = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } +sp-weights = { workspace = true } diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index ef895c58cfdd3d71ee3e88d3ea588b7c3336166e..af95e113f640d2a2318d6f464d20722c1b760f63 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -220,6 +220,15 @@ macro_rules! runtime_apis { TransactionPayment::length_to_fee(length) } } + impl sp_genesis_builder::GenesisBuilder<Block> for Runtime { + fn create_default_config() -> Vec<u8> { + frame_support::genesis_builder_helper::create_default_config::<RuntimeGenesisConfig>() + } + + fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result { + frame_support::genesis_builder_helper::build_config::<RuntimeGenesisConfig>(config) + } + } #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime<Block> for Runtime where <Runtime as frame_system::Config>::BlockNumber: Clone + sp_std::fmt::Debug + sp_runtime::traits::AtLeast32BitUnsigned { diff --git a/runtime/common/src/handlers.rs b/runtime/common/src/handlers.rs index 1942c41959b502d1b0a56143051cf479ea8eec88..f72a59a3c07ab8d00afa533227061c66ad4972ca 100644 --- a/runtime/common/src/handlers.rs +++ b/runtime/common/src/handlers.rs @@ -24,11 +24,13 @@ use pallet_smith_members::SmithRemovalReason; pub struct OnNewSessionHandler<Runtime>(core::marker::PhantomData<Runtime>); impl<Runtime> pallet_authority_members::traits::OnNewSession for OnNewSessionHandler<Runtime> where - Runtime: pallet_provide_randomness::Config + pallet_distance::Config, + Runtime: + pallet_provide_randomness::Config + pallet_distance::Config + pallet_smith_members::Config, { fn on_new_session(index: sp_staking::SessionIndex) { pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch(); pallet_distance::Pallet::<Runtime>::on_new_session(index); + pallet_smith_members::Pallet::<Runtime>::on_new_session(index); } } diff --git a/runtime/common/src/weights/block_weights.rs b/runtime/common/src/weights/block_weights.rs index 13709dc5312da322f51bd462dfe46782ec33c15b..e099f3d77b6cfa7e7634abab7f8a4fe1b3f812f7 100644 --- a/runtime/common/src/weights/block_weights.rs +++ b/runtime/common/src/weights/block_weights.rs @@ -1,6 +1,6 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24 (Y/M/D) +//! DATE: 2024-02-04 (Y/M/D) //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! //! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Ğdev Local Testnet` @@ -26,17 +26,17 @@ parameter_types! { /// Calculated by multiplying the *Average* with `1.0` and adding `0`. /// /// Stats nanoseconds: - /// Min, Max: 127_953, 157_199 - /// Average: 136_253 - /// Median: 134_999 - /// Std-Dev: 4551.46 + /// Min, Max: 123_084, 150_596 + /// Average: 130_621 + /// Median: 129_744 + /// Std-Dev: 4623.45 /// /// Percentiles nanoseconds: - /// 99th: 155_010 - /// 95th: 145_334 - /// 75th: 136_845 + /// 99th: 150_183 + /// 95th: 139_003 + /// 75th: 131_346 pub const BlockExecutionWeight: Weight = - Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(136_253), 0); + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(130_621), 0); } #[cfg(test)] diff --git a/runtime/common/src/weights/extrinsic_weights.rs b/runtime/common/src/weights/extrinsic_weights.rs index cbb74a08903acddc76e2c01f0a228f16aa21f9eb..95d2aa2d371f30e09440891767c1d17e9196a3a8 100644 --- a/runtime/common/src/weights/extrinsic_weights.rs +++ b/runtime/common/src/weights/extrinsic_weights.rs @@ -1,6 +1,6 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24 (Y/M/D) +//! DATE: 2024-02-04 (Y/M/D) //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! //! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Ğdev Local Testnet` @@ -26,17 +26,17 @@ parameter_types! { /// Calculated by multiplying the *Average* with `1.0` and adding `0`. /// /// Stats nanoseconds: - /// Min, Max: 70_783, 71_184 - /// Average: 70_943 - /// Median: 70_929 - /// Std-Dev: 83.18 + /// Min, Max: 77_859, 79_469 + /// Average: 78_235 + /// Median: 78_181 + /// Std-Dev: 252.75 /// /// Percentiles nanoseconds: - /// 99th: 71_160 - /// 95th: 71_090 - /// 75th: 70_988 + /// 99th: 79_293 + /// 95th: 78_565 + /// 75th: 78_341 pub const ExtrinsicBaseWeight: Weight = - Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(70_943), 0); + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(78_235), 0); } #[cfg(test)] diff --git a/runtime/common/src/weights/frame_benchmarking_baseline.rs b/runtime/common/src/weights/frame_benchmarking_baseline.rs index 1c6d684c8295c5c760a01500bc7199391c032f54..403ac14e5349557ca976b07ccc835d6a34b94d24 100644 --- a/runtime/common/src/weights/frame_benchmarking_baseline.rs +++ b/runtime/common/src/weights/frame_benchmarking_baseline.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `frame_benchmarking::baseline` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -52,8 +52,8 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 346_000 picoseconds. - Weight::from_parts(459_000, 0) + // Minimum execution time: 122_000 picoseconds. + Weight::from_parts(155_897, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `i` is `[0, 1000000]`. @@ -61,8 +61,8 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 664_000 picoseconds. - Weight::from_parts(855_500, 0) + // Minimum execution time: 122_000 picoseconds. + Weight::from_parts(153_956, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `i` is `[0, 1000000]`. @@ -70,8 +70,8 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 656_000 picoseconds. - Weight::from_parts(808_500, 0) + // Minimum execution time: 124_000 picoseconds. + Weight::from_parts(153_907, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `i` is `[0, 1000000]`. @@ -79,16 +79,16 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 392_000 picoseconds. - Weight::from_parts(772_500, 0) + // Minimum execution time: 123_000 picoseconds. + Weight::from_parts(154_592, 0) .saturating_add(Weight::from_parts(0, 0)) } fn hashing() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 26_700_103_000 picoseconds. - Weight::from_parts(30_137_103_000, 0) + // Minimum execution time: 21_202_188_000 picoseconds. + Weight::from_parts(21_259_205_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `i` is `[0, 100]`. @@ -96,10 +96,10 @@ impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for Weigh // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 397_000 picoseconds. - Weight::from_parts(458_500, 0) + // Minimum execution time: 142_000 picoseconds. + Weight::from_parts(28_060_861, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 76_937 - .saturating_add(Weight::from_parts(51_487_440, 0).saturating_mul(i.into())) + // Standard Error: 11_132 + .saturating_add(Weight::from_parts(30_550_214, 0).saturating_mul(i.into())) } } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index ca4024d06cc5466649a7e3898f7be5726bb482c2..1468b8922a57bd2298e6841362fc6362a49e0df1 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -52,22 +52,22 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_973_000 picoseconds. - Weight::from_parts(4_641_500, 0) + // Minimum execution time: 1_466_000 picoseconds. + Weight::from_parts(1_452_227, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 48 - .saturating_add(Weight::from_parts(462, 0).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(244, 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: 17_566_000 picoseconds. - Weight::from_parts(18_023_500, 0) + // Minimum execution time: 4_132_000 picoseconds. + Weight::from_parts(4_287_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 145 - .saturating_add(Weight::from_parts(1_760, 0).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_008, 0).saturating_mul(b.into())) } /// Storage: `System::Digest` (r:1 w:1) /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -77,8 +77,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 8_515_000 picoseconds. - Weight::from_parts(10_663_000, 0) + // Minimum execution time: 2_582_000 picoseconds. + Weight::from_parts(2_896_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -91,8 +91,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 77_630_689_000 picoseconds. - Weight::from_parts(78_881_053_000, 0) + // Minimum execution time: 77_846_699_000 picoseconds. + Weight::from_parts(78_440_655_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -104,11 +104,11 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_293_000 picoseconds. - Weight::from_parts(5_218_500, 0) + // Minimum execution time: 1_510_000 picoseconds. + Weight::from_parts(1_613_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 61_139 - .saturating_add(Weight::from_parts(1_380_876, 0).saturating_mul(i.into())) + // Standard Error: 514 + .saturating_add(Weight::from_parts(608_791, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -118,11 +118,11 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_015_000 picoseconds. - Weight::from_parts(4_990_500, 0) + // Minimum execution time: 1_502_000 picoseconds. + Weight::from_parts(1_628_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 7_147 - .saturating_add(Weight::from_parts(841_068, 0).saturating_mul(i.into())) + // Standard Error: 597 + .saturating_add(Weight::from_parts(459_711, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -130,13 +130,13 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `39 + p * (69 ±0)` - // Estimated: `39 + p * (70 ±0)` - // Minimum execution time: 6_924_000 picoseconds. - Weight::from_parts(8_369_000, 0) - .saturating_add(Weight::from_parts(0, 39)) - // Standard Error: 16_662 - .saturating_add(Weight::from_parts(1_427_230, 0).saturating_mul(p.into())) + // Measured: `77 + p * (69 ±0)` + // Estimated: `76 + p * (70 ±0)` + // Minimum execution time: 2_837_000 picoseconds. + Weight::from_parts(2_914_000, 0) + .saturating_add(Weight::from_parts(0, 76)) + // Standard Error: 705 + .saturating_add(Weight::from_parts(906_626, 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())) @@ -147,8 +147,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_879_000 picoseconds. - Weight::from_parts(8_896_000, 0) + // Minimum execution time: 9_106_000 picoseconds. + Weight::from_parts(9_766_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -162,8 +162,8 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `22` // Estimated: `1518` - // Minimum execution time: 81_052_498_000 picoseconds. - Weight::from_parts(81_887_122_000, 0) + // Minimum execution time: 81_518_691_000 picoseconds. + Weight::from_parts(82_510_356_000, 0) .saturating_add(Weight::from_parts(0, 1518)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/common/src/weights/pallet_authority_members.rs b/runtime/common/src/weights/pallet_authority_members.rs index 59950c97fe545430c5ba2b4e9cf90d88bd774516..c2eaef1ead7f73c38247642be34b1bd691d480c5 100644 --- a/runtime/common/src/weights/pallet_authority_members.rs +++ b/runtime/common/src/weights/pallet_authority_members.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_authority_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -61,11 +61,11 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf /// Proof: `AuthorityMembers::OnlineAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn go_offline() -> Weight { // Proof Size summary in bytes: - // Measured: `717` - // Estimated: `4182` - // Minimum execution time: 45_399_000 picoseconds. - Weight::from_parts(49_182_000, 0) - .saturating_add(Weight::from_parts(0, 4182)) + // Measured: `750` + // Estimated: `4215` + // Minimum execution time: 19_137_000 picoseconds. + Weight::from_parts(19_687_000, 0) + .saturating_add(Weight::from_parts(0, 4215)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -87,11 +87,11 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf /// Proof: `AuthorityMembers::OnlineAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn go_online() -> Weight { // Proof Size summary in bytes: - // Measured: `1108` - // Estimated: `4573` - // Minimum execution time: 59_314_000 picoseconds. - Weight::from_parts(76_647_000, 0) - .saturating_add(Weight::from_parts(0, 4573)) + // Measured: `1141` + // Estimated: `4606` + // Minimum execution time: 24_381_000 picoseconds. + Weight::from_parts(25_720_000, 0) + .saturating_add(Weight::from_parts(0, 4606)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -100,7 +100,7 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf /// Storage: `SmithMembers::Smiths` (r:1 w:0) /// Proof: `SmithMembers::Smiths` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Session::NextKeys` (r:1 w:1) /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Session::KeyOwner` (r:4 w:0) @@ -109,11 +109,11 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf /// Proof: `AuthorityMembers::Members` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_session_keys() -> Weight { // Proof Size summary in bytes: - // Measured: `1512` - // Estimated: `12402` - // Minimum execution time: 67_522_000 picoseconds. - Weight::from_parts(102_647_000, 0) - .saturating_add(Weight::from_parts(0, 12402)) + // Measured: `1511` + // Estimated: `12401` + // Minimum execution time: 31_532_000 picoseconds. + Weight::from_parts(32_707_000, 0) + .saturating_add(Weight::from_parts(0, 12401)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -128,16 +128,16 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf /// Storage: `Session::NextKeys` (r:1 w:1) /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Session::KeyOwner` (r:0 w:4) /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_member() -> Weight { // Proof Size summary in bytes: - // Measured: `750` - // Estimated: `4215` - // Minimum execution time: 76_516_000 picoseconds. - Weight::from_parts(81_201_000, 0) - .saturating_add(Weight::from_parts(0, 4215)) + // Measured: `716` + // Estimated: `4181` + // Minimum execution time: 31_417_000 picoseconds. + Weight::from_parts(33_503_000, 0) + .saturating_add(Weight::from_parts(0, 4181)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(10)) } @@ -147,8 +147,8 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `199` // Estimated: `1684` - // Minimum execution time: 29_964_000 picoseconds. - Weight::from_parts(39_785_000, 0) + // Minimum execution time: 6_793_000 picoseconds. + Weight::from_parts(7_479_000, 0) .saturating_add(Weight::from_parts(0, 1684)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 4ddad95941958fc8e8ea7c2a00d39ae23eda476c..5c7254998564d7f4c5a860400b8896e9c6eae42c 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -48,86 +48,86 @@ use core::marker::PhantomData; pub struct WeightInfo<T>(PhantomData<T>); impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn transfer_allow_death() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3591` - // Minimum execution time: 103_052_000 picoseconds. - Weight::from_parts(104_632_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `63` + // Estimated: `6126` + // Minimum execution time: 44_332_000 picoseconds. + Weight::from_parts(45_368_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) + .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(126), added: 2601, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `3591` - // Minimum execution time: 133_263_000 picoseconds. - Weight::from_parts(136_924_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Estimated: `3558` + // Minimum execution time: 29_062_000 picoseconds. + Weight::from_parts(30_291_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `64` - // Estimated: `6192` - // Minimum execution time: 105_518_000 picoseconds. - Weight::from_parts(226_206_000, 0) - .saturating_add(Weight::from_parts(0, 6192)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn force_set_balance_creating() -> Weight { // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3591` - // Minimum execution time: 9_693_000 picoseconds. - Weight::from_parts(10_211_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Measured: `100` + // Estimated: `3558` + // Minimum execution time: 9_584_000 picoseconds. + Weight::from_parts(9_916_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .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(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn force_set_balance_killing() -> Weight { // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3591` - // Minimum execution time: 14_040_000 picoseconds. - Weight::from_parts(14_480_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Measured: `100` + // Estimated: `3558` + // Minimum execution time: 13_637_000 picoseconds. + Weight::from_parts(13_912_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + fn force_transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `126` + // Estimated: `8694` + // Minimum execution time: 42_442_000 picoseconds. + Weight::from_parts(44_029_000, 0) + .saturating_add(Weight::from_parts(0, 8694)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `3591` - // Minimum execution time: 38_912_000 picoseconds. - Weight::from_parts(40_985_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Estimated: `3558` + // Minimum execution time: 34_474_000 picoseconds. + Weight::from_parts(35_659_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn force_unreserve() -> Weight { // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3591` - // Minimum execution time: 41_380_000 picoseconds. - Weight::from_parts(44_612_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Measured: `100` + // Estimated: `3558` + // Minimum execution time: 12_185_000 picoseconds. + Weight::from_parts(12_713_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_certification.rs b/runtime/common/src/weights/pallet_certification.rs index 948c3caf242de24ca4c98a8d2bc60c495f96db77..b300963c4620ef2744ae7d576ce3d65bd18dea82 100644 --- a/runtime/common/src/weights/pallet_certification.rs +++ b/runtime/common/src/weights/pallet_certification.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_certification` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -47,127 +47,127 @@ use core::marker::PhantomData; /// Weight functions for `pallet_certification`. pub struct WeightInfo<T>(PhantomData<T>); impl<T: frame_system::Config> pallet_certification::WeightInfo for WeightInfo<T> { - /// Storage: Identity IdentityIndexOf (r:1 w:0) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:2 w:2) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Identity Identities (r:2 w:0) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsRemovableOn (r:1 w:1) - /// Proof Skipped: Certification CertsRemovableOn (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) + /// Storage: `Identity::IdentityIndexOf` (r:1 w:0) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:2 w:2) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:2 w:0) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsRemovableOn` (r:1 w:1) + /// Proof: `Certification::CertsRemovableOn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_cert() -> Weight { // Proof Size summary in bytes: - // Measured: `923` - // Estimated: `6863` - // Minimum execution time: 65_778_000 picoseconds. - Weight::from_parts(72_978_000, 0) - .saturating_add(Weight::from_parts(0, 6863)) + // Measured: `956` + // Estimated: `6896` + // Minimum execution time: 30_158_000 picoseconds. + Weight::from_parts(31_303_000, 0) + .saturating_add(Weight::from_parts(0, 6896)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Identity IdentityIndexOf (r:1 w:0) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:1 w:1) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Identity Identities (r:2 w:0) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsRemovableOn (r:1 w:1) - /// Proof Skipped: Certification CertsRemovableOn (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) + /// Storage: `Identity::IdentityIndexOf` (r:1 w:0) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:1 w:1) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:2 w:0) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsRemovableOn` (r:1 w:1) + /// Proof: `Certification::CertsRemovableOn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) fn renew_cert() -> Weight { // Proof Size summary in bytes: - // Measured: `947` - // Estimated: `6887` - // Minimum execution time: 61_109_000 picoseconds. - Weight::from_parts(64_931_000, 0) - .saturating_add(Weight::from_parts(0, 6887)) + // Measured: `980` + // Estimated: `6920` + // Minimum execution time: 28_884_000 picoseconds. + Weight::from_parts(29_612_000, 0) + .saturating_add(Weight::from_parts(0, 6920)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:2 w:2) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:2 w:2) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn del_cert() -> Weight { // Proof Size summary in bytes: // Measured: `444` // Estimated: `6384` - // Minimum execution time: 35_139_000 picoseconds. - Weight::from_parts(37_463_000, 0) + // Minimum execution time: 16_455_000 picoseconds. + Weight::from_parts(17_256_000, 0) .saturating_add(Weight::from_parts(0, 6384)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:1000 w:1000) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Membership Membership (r:1 w:0) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:1000 w:1000) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Membership::Membership` (r:1 w:0) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[2, 1000]`. fn remove_all_certs_received_by(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `588 + i * (35 ±0)` - // Estimated: `4054 + i * (2511 ±0)` - // Minimum execution time: 44_709_000 picoseconds. - Weight::from_parts(15_690_704, 0) - .saturating_add(Weight::from_parts(0, 4054)) - // Standard Error: 20_451 - .saturating_add(Weight::from_parts(15_749_397, 0).saturating_mul(i.into())) + // Measured: `546 + i * (35 ±0)` + // Estimated: `4017 + i * (2511 ±0)` + // Minimum execution time: 23_417_000 picoseconds. + Weight::from_parts(23_956_000, 0) + .saturating_add(Weight::from_parts(0, 4017)) + // Standard Error: 22_385 + .saturating_add(Weight::from_parts(8_489_500, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) .saturating_add(Weight::from_parts(0, 2511).saturating_mul(i.into())) } - /// Storage: Certification CertsRemovableOn (r:1 w:0) - /// Proof Skipped: Certification CertsRemovableOn (max_values: None, max_size: None, mode: Measured) + /// Storage: `Certification::CertsRemovableOn` (r:1 w:0) + /// Proof: `Certification::CertsRemovableOn` (`max_values`: None, `max_size`: None, mode: `Measured`) fn on_initialize() -> Weight { // Proof Size summary in bytes: // Measured: `139` // Estimated: `3604` - // Minimum execution time: 4_352_000 picoseconds. - Weight::from_parts(7_580_000, 0) + // Minimum execution time: 2_483_000 picoseconds. + Weight::from_parts(2_609_000, 0) .saturating_add(Weight::from_parts(0, 3604)) .saturating_add(T::DbWeight::get().reads(1)) } - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_remove_cert_noop() -> Weight { // Proof Size summary in bytes: // Measured: `237` // Estimated: `3702` - // Minimum execution time: 7_868_000 picoseconds. - Weight::from_parts(11_220_000, 0) + // Minimum execution time: 3_474_000 picoseconds. + Weight::from_parts(3_649_000, 0) .saturating_add(Weight::from_parts(0, 3702)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:2 w:2) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Membership Membership (r:1 w:0) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:2 w:2) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Membership::Membership` (r:1 w:0) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_remove_cert() -> Weight { // Proof Size summary in bytes: // Measured: `660` // Estimated: `6600` - // Minimum execution time: 33_665_000 picoseconds. - Weight::from_parts(38_208_000, 0) + // Minimum execution time: 19_307_000 picoseconds. + Weight::from_parts(20_020_000, 0) .saturating_add(Weight::from_parts(0, 6600)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 3aa7a37d93334498accb833ddac343b79254a524..0682dc4b50c749b1d0dd2fd4e03c1c345a1d2500 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -60,21 +60,21 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[0, 20]`. fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + m * (671 ±0) + p * (3196 ±0)` - // Estimated: `1514 + m * (9624 ±90) + p * (1918 ±452)` - // Minimum execution time: 23_422_000 picoseconds. - Weight::from_parts(23_422_000, 0) - .saturating_add(Weight::from_parts(0, 1514)) - // Standard Error: 409_364 - .saturating_add(Weight::from_parts(1_681_286, 0).saturating_mul(m.into())) - // Standard Error: 2_046_823 - .saturating_add(Weight::from_parts(7_823_957, 0).saturating_mul(p.into())) + // Measured: `0 + m * (672 ±0) + p * (3191 ±0)` + // Estimated: `10019 + m * (416 ±5) + p * (4183 ±27)` + // Minimum execution time: 11_299_000 picoseconds. + Weight::from_parts(11_509_000, 0) + .saturating_add(Weight::from_parts(0, 10019)) + // Standard Error: 8_549 + .saturating_add(Weight::from_parts(644_119, 0).saturating_mul(m.into())) + // Standard Error: 42_263 + .saturating_add(Weight::from_parts(5_653_926, 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, 9624).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 1918).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 416).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4183).saturating_mul(p.into())) } /// Storage: `TechnicalCommittee::Members` (r:1 w:0) /// Proof: `TechnicalCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -82,15 +82,15 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `31 + m * (32 ±0)` - // Estimated: `1517 + m * (32 ±0)` - // Minimum execution time: 22_528_000 picoseconds. - Weight::from_parts(21_965_656, 0) - .saturating_add(Weight::from_parts(0, 1517)) - // Standard Error: 1_391 - .saturating_add(Weight::from_parts(1_492, 0).saturating_mul(b.into())) - // Standard Error: 14_365 - .saturating_add(Weight::from_parts(19_858, 0).saturating_mul(m.into())) + // Measured: `32 + m * (32 ±0)` + // Estimated: `1518 + m * (32 ±0)` + // Minimum execution time: 9_634_000 picoseconds. + Weight::from_parts(9_182_276, 0) + .saturating_add(Weight::from_parts(0, 1518)) + // Standard Error: 27 + .saturating_add(Weight::from_parts(1_193, 0).saturating_mul(b.into())) + // Standard Error: 287 + .saturating_add(Weight::from_parts(12_966, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -102,15 +102,15 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `31 + m * (32 ±0)` - // Estimated: `3497 + m * (32 ±0)` - // Minimum execution time: 26_296_000 picoseconds. - Weight::from_parts(24_449_661, 0) - .saturating_add(Weight::from_parts(0, 3497)) - // Standard Error: 1_225 - .saturating_add(Weight::from_parts(2_808, 0).saturating_mul(b.into())) - // Standard Error: 12_650 - .saturating_add(Weight::from_parts(49_722, 0).saturating_mul(m.into())) + // Measured: `32 + m * (32 ±0)` + // Estimated: `3498 + m * (32 ±0)` + // Minimum execution time: 11_648_000 picoseconds. + Weight::from_parts(11_249_880, 0) + .saturating_add(Weight::from_parts(0, 3498)) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_155, 0).saturating_mul(b.into())) + // Standard Error: 374 + .saturating_add(Weight::from_parts(19_049, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -127,21 +127,23 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 20]`. - fn propose_proposed(_b: u32, m: u32, p: u32, ) -> Weight { + fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + m * (32 ±0) + p * (58 ±0)` - // Estimated: `3413 + m * (32 ±0) + p * (58 ±0)` - // Minimum execution time: 35_130_000 picoseconds. - Weight::from_parts(71_833_850, 0) - .saturating_add(Weight::from_parts(0, 3413)) - // Standard Error: 168_522 - .saturating_add(Weight::from_parts(30_556, 0).saturating_mul(m.into())) - // Standard Error: 869_222 - .saturating_add(Weight::from_parts(454_105, 0).saturating_mul(p.into())) + // Measured: `24 + m * (32 ±0) + p * (55 ±0)` + // Estimated: `3461 + m * (32 ±0) + p * (54 ±0)` + // Minimum execution time: 16_530_000 picoseconds. + Weight::from_parts(15_662_728, 0) + .saturating_add(Weight::from_parts(0, 3461)) + // Standard Error: 63 + .saturating_add(Weight::from_parts(2_178, 0).saturating_mul(b.into())) + // Standard Error: 661 + .saturating_add(Weight::from_parts(17_907, 0).saturating_mul(m.into())) + // Standard Error: 3_307 + .saturating_add(Weight::from_parts(259_014, 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, 32).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 58).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(p.into())) } /// Storage: `TechnicalCommittee::Members` (r:1 w:0) /// Proof: `TechnicalCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -150,11 +152,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `m` is `[5, 100]`. fn vote(m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `572 + m * (64 ±0)` - // Estimated: `4038 + m * (64 ±0)` - // Minimum execution time: 30_355_000 picoseconds. - Weight::from_parts(53_128_131, 0) - .saturating_add(Weight::from_parts(0, 4038)) + // Measured: `573 + m * (64 ±0)` + // Estimated: `4037 + m * (64 ±0)` + // Minimum execution time: 15_171_000 picoseconds. + Weight::from_parts(15_664_934, 0) + .saturating_add(Weight::from_parts(0, 4037)) + // Standard Error: 548 + .saturating_add(Weight::from_parts(35_118, 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())) @@ -171,13 +175,15 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 20]`. fn close_early_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `127 + m * (64 ±0) + p * (55 ±0)` - // Estimated: `3593 + m * (64 ±0) + p * (55 ±0)` - // Minimum execution time: 37_074_000 picoseconds. - Weight::from_parts(87_124_277, 0) - .saturating_add(Weight::from_parts(0, 3593)) - // Standard Error: 2_039_774 - .saturating_add(Weight::from_parts(170_868, 0).saturating_mul(p.into())) + // Measured: `117 + m * (64 ±0) + p * (55 ±0)` + // Estimated: `3591 + m * (64 ±0) + p * (55 ±0)` + // Minimum execution time: 18_725_000 picoseconds. + Weight::from_parts(17_295_145, 0) + .saturating_add(Weight::from_parts(0, 3591)) + // Standard Error: 611 + .saturating_add(Weight::from_parts(31_903, 0).saturating_mul(m.into())) + // Standard Error: 3_017 + .saturating_add(Weight::from_parts(236_285, 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, 64).saturating_mul(m.into())) @@ -196,20 +202,22 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 20]`. fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `50 + b * (1 ±0) + m * (64 ±0) + p * (78 ±0)` - // Estimated: `3516 + b * (1 ±0) + m * (64 ±0) + p * (79 ±0)` - // Minimum execution time: 51_993_000 picoseconds. - Weight::from_parts(48_872_547, 0) - .saturating_add(Weight::from_parts(0, 3516)) - // Standard Error: 88_708 - .saturating_add(Weight::from_parts(79_471, 0).saturating_mul(m.into())) - // Standard Error: 448_213 - .saturating_add(Weight::from_parts(1_142_776, 0).saturating_mul(p.into())) + // Measured: `62 + b * (1 ±0) + m * (64 ±0) + p * (78 ±0)` + // Estimated: `3619 + b * (1 ±0) + m * (63 ±0) + p * (74 ±0)` + // Minimum execution time: 27_086_000 picoseconds. + Weight::from_parts(25_836_642, 0) + .saturating_add(Weight::from_parts(0, 3619)) + // Standard Error: 83 + .saturating_add(Weight::from_parts(1_757, 0).saturating_mul(b.into())) + // Standard Error: 885 + .saturating_add(Weight::from_parts(18_479, 0).saturating_mul(m.into())) + // Standard Error: 4_366 + .saturating_add(Weight::from_parts(334_711, 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, 64).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 79).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 63).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 74).saturating_mul(p.into())) } /// Storage: `TechnicalCommittee::Voting` (r:1 w:1) /// Proof: `TechnicalCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -225,15 +233,15 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 20]`. fn close_disapproved(m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `147 + m * (64 ±0) + p * (55 ±0)` - // Estimated: `3613 + m * (64 ±0) + p * (55 ±0)` - // Minimum execution time: 40_212_000 picoseconds. - Weight::from_parts(38_638_717, 0) - .saturating_add(Weight::from_parts(0, 3613)) - // Standard Error: 11_146 - .saturating_add(Weight::from_parts(18_281, 0).saturating_mul(m.into())) - // Standard Error: 56_317 - .saturating_add(Weight::from_parts(250_157, 0).saturating_mul(p.into())) + // Measured: `137 + m * (64 ±0) + p * (55 ±0)` + // Estimated: `3611 + m * (64 ±0) + p * (55 ±0)` + // Minimum execution time: 20_995_000 picoseconds. + Weight::from_parts(18_820_652, 0) + .saturating_add(Weight::from_parts(0, 3611)) + // Standard Error: 615 + .saturating_add(Weight::from_parts(38_431, 0).saturating_mul(m.into())) + // Standard Error: 3_037 + .saturating_add(Weight::from_parts(252_565, 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, 64).saturating_mul(m.into())) @@ -254,18 +262,22 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 20]`. fn close_approved(b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `70 + b * (1 ±0) + m * (64 ±0) + p * (78 ±0)` - // Estimated: `3536 + b * (1 ±0) + m * (64 ±0) + p * (79 ±0)` - // Minimum execution time: 56_237_000 picoseconds. - Weight::from_parts(97_149_848, 0) - .saturating_add(Weight::from_parts(0, 3536)) - // Standard Error: 16_748 - .saturating_add(Weight::from_parts(1_216, 0).saturating_mul(b.into())) + // Measured: `82 + b * (1 ±0) + m * (64 ±0) + p * (78 ±0)` + // Estimated: `3639 + b * (1 ±0) + m * (63 ±0) + p * (74 ±0)` + // Minimum execution time: 28_333_000 picoseconds. + Weight::from_parts(26_411_146, 0) + .saturating_add(Weight::from_parts(0, 3639)) + // Standard Error: 88 + .saturating_add(Weight::from_parts(2_323, 0).saturating_mul(b.into())) + // Standard Error: 935 + .saturating_add(Weight::from_parts(21_833, 0).saturating_mul(m.into())) + // Standard Error: 4_613 + .saturating_add(Weight::from_parts(354_718, 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, 64).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 79).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 63).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 74).saturating_mul(p.into())) } /// Storage: `TechnicalCommittee::Proposals` (r:1 w:1) /// Proof: `TechnicalCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -276,13 +288,13 @@ impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 20]`. fn disapprove_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `187 + p * (32 ±0)` - // Estimated: `1673 + p * (32 ±0)` - // Minimum execution time: 24_197_000 picoseconds. - Weight::from_parts(25_080_789, 0) - .saturating_add(Weight::from_parts(0, 1673)) - // Standard Error: 115_740 - .saturating_add(Weight::from_parts(144_210, 0).saturating_mul(p.into())) + // Measured: `189 + p * (32 ±0)` + // Estimated: `1674 + p * (32 ±0)` + // Minimum execution time: 9_381_000 picoseconds. + Weight::from_parts(10_496_418, 0) + .saturating_add(Weight::from_parts(0, 1674)) + // Standard Error: 2_040 + .saturating_add(Weight::from_parts(164_732, 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/runtime/common/src/weights/pallet_distance.rs b/runtime/common/src/weights/pallet_distance.rs index b930f67446dab73b5b335d4371a0e1606dfd529d..46dc9308d3b50efb65f72af04e95e6f1b4798e63 100644 --- a/runtime/common/src/weights/pallet_distance.rs +++ b/runtime/common/src/weights/pallet_distance.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_distance` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -47,59 +47,59 @@ use core::marker::PhantomData; /// Weight functions for `pallet_distance`. pub struct WeightInfo<T>(PhantomData<T>); impl<T: frame_system::Config> pallet_distance::WeightInfo for WeightInfo<T> { - /// Storage: Identity IdentityIndexOf (r:1 w:0) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity Identities (r:1 w:0) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Distance PendingEvaluationRequest (r:1 w:1) - /// Proof Skipped: Distance PendingEvaluationRequest (max_values: None, max_size: None, mode: Measured) - /// Storage: Membership Membership (r:1 w:0) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:1 w:0) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Session CurrentIndex (r:1 w:0) - /// Proof Skipped: Session CurrentIndex (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Distance EvaluationPool2 (r:1 w:1) - /// Proof Skipped: Distance EvaluationPool2 (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityIndexOf` (r:1 w:0) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:1 w:0) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Distance::PendingEvaluationRequest` (r:1 w:1) + /// Proof: `Distance::PendingEvaluationRequest` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Membership::Membership` (r:1 w:0) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:1 w:0) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Session::CurrentIndex` (r:1 w:0) + /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Distance::EvaluationPool2` (r:1 w:1) + /// Proof: `Distance::EvaluationPool2` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn request_distance_evaluation() -> Weight { // Proof Size summary in bytes: - // Measured: `1597` - // Estimated: `5062` - // Minimum execution time: 73_986_000 picoseconds. - Weight::from_parts(77_918_000, 0) - .saturating_add(Weight::from_parts(0, 5062)) + // Measured: `1596` + // Estimated: `5061` + // Minimum execution time: 41_417_000 picoseconds. + Weight::from_parts(43_366_000, 0) + .saturating_add(Weight::from_parts(0, 5061)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Identity IdentityIndexOf (r:1 w:0) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity Identities (r:2 w:0) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Distance PendingEvaluationRequest (r:1 w:1) - /// Proof Skipped: Distance PendingEvaluationRequest (max_values: None, max_size: None, mode: Measured) - /// Storage: Membership Membership (r:1 w:0) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:1 w:0) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Session CurrentIndex (r:1 w:0) - /// Proof Skipped: Session CurrentIndex (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Distance EvaluationPool2 (r:1 w:1) - /// Proof Skipped: Distance EvaluationPool2 (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityIndexOf` (r:1 w:0) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:2 w:0) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Distance::PendingEvaluationRequest` (r:1 w:1) + /// Proof: `Distance::PendingEvaluationRequest` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Membership::Membership` (r:1 w:0) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:1 w:0) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Session::CurrentIndex` (r:1 w:0) + /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Distance::EvaluationPool2` (r:1 w:1) + /// Proof: `Distance::EvaluationPool2` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn request_distance_evaluation_for() -> Weight { // Proof Size summary in bytes: - // Measured: `1626` - // Estimated: `7566` - // Minimum execution time: 76_351_000 picoseconds. - Weight::from_parts(79_888_000, 0) - .saturating_add(Weight::from_parts(0, 7566)) + // Measured: `1625` + // Estimated: `7565` + // Minimum execution time: 43_523_000 picoseconds. + Weight::from_parts(45_745_000, 0) + .saturating_add(Weight::from_parts(0, 7565)) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -118,13 +118,13 @@ impl<T: frame_system::Config> pallet_distance::WeightInfo for WeightInfo<T> { /// The range of component `i` is `[1, 600]`. fn update_evaluation(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `768 + i * (10 ±0)` - // Estimated: `2254 + i * (10 ±0)` - // Minimum execution time: 29_515_000 picoseconds. - Weight::from_parts(38_570_252, 0) - .saturating_add(Weight::from_parts(0, 2254)) - // Standard Error: 19_866 - .saturating_add(Weight::from_parts(169_747, 0).saturating_mul(i.into())) + // Measured: `773 + i * (10 ±0)` + // Estimated: `2257 + i * (10 ±0)` + // Minimum execution time: 13_633_000 picoseconds. + Weight::from_parts(16_097_962, 0) + .saturating_add(Weight::from_parts(0, 2257)) + // Standard Error: 139 + .saturating_add(Weight::from_parts(103_266, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(i.into())) @@ -136,32 +136,32 @@ impl<T: frame_system::Config> pallet_distance::WeightInfo for WeightInfo<T> { /// The range of component `i` is `[1, 600]`. fn force_update_evaluation(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `606 + i * (10 ±0)` - // Estimated: `2092 + i * (10 ±0)` - // Minimum execution time: 15_384_000 picoseconds. - Weight::from_parts(16_168_381, 0) - .saturating_add(Weight::from_parts(0, 2092)) - // Standard Error: 11_822 - .saturating_add(Weight::from_parts(182_118, 0).saturating_mul(i.into())) + // Measured: `612 + i * (10 ±0)` + // Estimated: `2096 + i * (10 ±0)` + // Minimum execution time: 6_222_000 picoseconds. + Weight::from_parts(8_460_482, 0) + .saturating_add(Weight::from_parts(0, 2096)) + // Standard Error: 296 + .saturating_add(Weight::from_parts(104_396, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(i.into())) } - /// Storage: Identity Identities (r:1 w:0) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Membership Membership (r:1 w:1) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) - /// Storage: Membership MembershipsExpireOn (r:2 w:2) - /// Proof Skipped: Membership MembershipsExpireOn (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `Identity::Identities` (r:1 w:0) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Membership::Membership` (r:1 w:1) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Membership::MembershipsExpireOn` (r:2 w:2) + /// Proof: `Membership::MembershipsExpireOn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn force_valid_distance_status() -> Weight { // Proof Size summary in bytes: - // Measured: `576` - // Estimated: `6516` - // Minimum execution time: 62_190_000 picoseconds. - Weight::from_parts(64_633_000, 0) - .saturating_add(Weight::from_parts(0, 6516)) + // Measured: `609` + // Estimated: `6549` + // Minimum execution time: 24_403_000 picoseconds. + Weight::from_parts(25_562_000, 0) + .saturating_add(Weight::from_parts(0, 6549)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -171,8 +171,8 @@ impl<T: frame_system::Config> pallet_distance::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `170` // Estimated: `1655` - // Minimum execution time: 8_402_000 picoseconds. - Weight::from_parts(9_335_000, 0) + // Minimum execution time: 2_756_000 picoseconds. + Weight::from_parts(2_960_000, 0) .saturating_add(Weight::from_parts(0, 1655)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/common/src/weights/pallet_duniter_account.rs b/runtime/common/src/weights/pallet_duniter_account.rs index 749b642cafcbedbdff8dcbc641dfba64e9c5ce79..00f2696bc36fb22cd479162e1821adf12f70b6e0 100644 --- a/runtime/common/src/weights/pallet_duniter_account.rs +++ b/runtime/common/src/weights/pallet_duniter_account.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_duniter_account` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -48,65 +48,15 @@ use core::marker::PhantomData; pub struct WeightInfo<T>(PhantomData<T>); impl<T: frame_system::Config> pallet_duniter_account::WeightInfo for WeightInfo<T> { /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn unlink_identity() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `3591` - // Minimum execution time: 10_296_000 picoseconds. - Weight::from_parts(15_289_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Estimated: `3558` + // Minimum execution time: 3_497_000 picoseconds. + Weight::from_parts(3_730_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `Babe::EpochIndex` (r:1 w:0) - /// Proof: `Babe::EpochIndex` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - /// The range of component `i` is `[0, 1]`. - fn on_initialize_sufficient(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `42 + i * (309 ±0)` - // Estimated: `3816 + i * (309 ±0)` - // Minimum execution time: 10_313_000 picoseconds. - Weight::from_parts(10_674_000, 0) - .saturating_add(Weight::from_parts(0, 3816)) - // Standard Error: 2_538_302 - .saturating_add(Weight::from_parts(27_819_500, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(i.into()))) - .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(i.into()))) - .saturating_add(Weight::from_parts(0, 309).saturating_mul(i.into())) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) - /// Storage: `Babe::EpochIndex` (r:1 w:0) - /// Proof: `Babe::EpochIndex` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - /// The range of component `i` is `[0, 1]`. - fn on_initialize_with_balance(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `42 + i * (309 ±0)` - // Estimated: `3816 + i * (309 ±0)` - // Minimum execution time: 6_629_000 picoseconds. - Weight::from_parts(7_761_500, 0) - .saturating_add(Weight::from_parts(0, 3816)) - // Standard Error: 3_335_635 - .saturating_add(Weight::from_parts(69_367_000, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(i.into()))) - .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(i.into()))) - .saturating_add(Weight::from_parts(0, 309).saturating_mul(i.into())) - } - /// The range of component `i` is `[0, 1]`. - fn on_initialize_no_balance(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `42 + i * (74 ±0)` - // Estimated: `3507 + i * (74 ±0)` - // Minimum execution time: 6_699_000 picoseconds. - Weight::from_parts(7_645_000, 0) - .saturating_add(Weight::from_parts(0, 3507)) - // Standard Error: 10_642_627 - .saturating_add(Weight::from_parts(25_816_500, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - .saturating_add(Weight::from_parts(0, 74).saturating_mul(i.into())) - } } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 7f77612568a91d826195ca81d789146f7dec42e9..84b2b5ffc6315a8b32a63dc8caf515403938df04 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_identity` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -47,35 +47,35 @@ use core::marker::PhantomData; /// Weight functions for `pallet_identity`. pub struct WeightInfo<T>(PhantomData<T>); impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { - /// Storage: Identity IdentityIndexOf (r:2 w:1) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity Identities (r:2 w:2) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification StorageIdtyCertMeta (r:2 w:2) - /// Proof Skipped: Certification StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) - /// Storage: Parameters ParametersStorage (r:1 w:0) - /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) - /// Storage: Identity NextIdtyIndex (r:1 w:1) - /// Proof Skipped: Identity NextIdtyIndex (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Identity IdentityChangeSchedule (r:1 w:1) - /// Proof Skipped: Identity IdentityChangeSchedule (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity CounterForIdentities (r:1 w:1) - /// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Certification CertsRemovableOn (r:1 w:1) - /// Proof Skipped: Certification CertsRemovableOn (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsByReceiver (r:1 w:1) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) - /// Storage: Quota IdtyQuota (r:0 w:1) - /// Proof: Quota IdtyQuota (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityIndexOf` (r:2 w:1) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:2 w:2) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::StorageIdtyCertMeta` (r:2 w:2) + /// Proof: `Certification::StorageIdtyCertMeta` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Parameters::ParametersStorage` (r:1 w:0) + /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// Storage: `Identity::NextIdtyIndex` (r:1 w:1) + /// Proof: `Identity::NextIdtyIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Identity::IdentityChangeSchedule` (r:1 w:1) + /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::CounterForIdentities` (r:1 w:1) + /// Proof: `Identity::CounterForIdentities` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Certification::CertsRemovableOn` (r:1 w:1) + /// Proof: `Certification::CertsRemovableOn` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsByReceiver` (r:1 w:1) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Quota::IdtyQuota` (r:0 w:1) + /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn create_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `921` - // Estimated: `6861` - // Minimum execution time: 132_024_000 picoseconds. - Weight::from_parts(163_110_000, 0) - .saturating_add(Weight::from_parts(0, 6861)) + // Measured: `1022` + // Estimated: `6962` + // Minimum execution time: 59_993_000 picoseconds. + Weight::from_parts(62_040_000, 0) + .saturating_add(Weight::from_parts(0, 6962)) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(12)) } @@ -89,11 +89,11 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) fn confirm_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `661` - // Estimated: `6601` - // Minimum execution time: 54_645_000 picoseconds. - Weight::from_parts(75_103_000, 0) - .saturating_add(Weight::from_parts(0, 6601)) + // Measured: `698` + // Estimated: `6638` + // Minimum execution time: 27_699_000 picoseconds. + Weight::from_parts(28_361_000, 0) + .saturating_add(Weight::from_parts(0, 6638)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -104,14 +104,14 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn change_owner_key() -> Weight { // Proof Size summary in bytes: - // Measured: `714` - // Estimated: `6654` - // Minimum execution time: 178_066_000 picoseconds. - Weight::from_parts(219_916_000, 0) - .saturating_add(Weight::from_parts(0, 6654)) + // Measured: `723` + // Estimated: `6663` + // Minimum execution time: 75_801_000 picoseconds. + Weight::from_parts(77_299_000, 0) + .saturating_add(Weight::from_parts(0, 6663)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -127,37 +127,38 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn revoke_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `631` - // Estimated: `6571` - // Minimum execution time: 158_320_000 picoseconds. - Weight::from_parts(202_029_000, 0) - .saturating_add(Weight::from_parts(0, 6571)) + // Measured: `664` + // Estimated: `6604` + // Minimum execution time: 64_428_000 picoseconds. + Weight::from_parts(65_963_000, 0) + .saturating_add(Weight::from_parts(0, 6604)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: Identity IdentitiesNames (r:0 w:999) - /// Proof Skipped: Identity IdentitiesNames (max_values: None, max_size: None, mode: Measured) - /// The range of component `i` is `[1, 1000]`. + /// Storage: `Identity::IdentitiesNames` (r:0 w:999) + /// Proof: `Identity::IdentitiesNames` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `i` is `[2, 1000]`. fn prune_item_identities_names(i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_266_000 picoseconds. - Weight::from_parts(15_371_520, 0) + // Minimum execution time: 3_722_000 picoseconds. + Weight::from_parts(3_857_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 38_204 - .saturating_add(Weight::from_parts(2_138_979, 0).saturating_mul(i.into())) + // Standard Error: 1_121 + .saturating_add(Weight::from_parts(1_224_519, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn fix_sufficients() -> Weight { // Proof Size summary in bytes: - // Measured: `105` - // Estimated: `3591` - // Minimum execution time: 13_275_000 picoseconds. - Weight::from_parts(14_053_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Measured: `104` + // Estimated: `3558` + // Minimum execution time: 6_169_000 picoseconds. + Weight::from_parts(6_730_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -166,14 +167,14 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn link_account() -> Weight { // Proof Size summary in bytes: - // Measured: `371` - // Estimated: `3836` - // Minimum execution time: 103_563_000 picoseconds. - Weight::from_parts(107_316_000, 0) - .saturating_add(Weight::from_parts(0, 3836)) + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 51_183_000 picoseconds. + Weight::from_parts(55_391_000, 0) + .saturating_add(Weight::from_parts(0, 3868)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -181,24 +182,24 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 286_000 picoseconds. - Weight::from_parts(492_000, 0) + // Minimum execution time: 154_000 picoseconds. + Weight::from_parts(175_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Identity::Identities` (r:1 w:0) /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_revoke_identity_noop() -> Weight { // Proof Size summary in bytes: - // Measured: `269` - // Estimated: `3734` - // Minimum execution time: 8_267_000 picoseconds. - Weight::from_parts(8_928_000, 0) - .saturating_add(Weight::from_parts(0, 3734)) + // Measured: `302` + // Estimated: `3767` + // Minimum execution time: 3_659_000 picoseconds. + Weight::from_parts(3_854_000, 0) + .saturating_add(Weight::from_parts(0, 3767)) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Identity::Identities` (r:1 w:1) /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Identity::IdentityChangeSchedule` (r:2 w:1) + /// Storage: `Identity::IdentityChangeSchedule` (r:2 w:2) /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Membership::Membership` (r:1 w:1) /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -221,30 +222,30 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Storage: `Session::NextKeys` (r:1 w:1) /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Quota::IdtyQuota` (r:0 w:1) /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) /// Storage: `Session::KeyOwner` (r:0 w:4) /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_revoke_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `1540` - // Estimated: `9955` - // Minimum execution time: 146_876_000 picoseconds. - Weight::from_parts(158_403_000, 0) - .saturating_add(Weight::from_parts(0, 9955)) + // Measured: `1555` + // Estimated: `9970` + // Minimum execution time: 83_658_000 picoseconds. + Weight::from_parts(86_935_000, 0) + .saturating_add(Weight::from_parts(0, 9970)) .saturating_add(T::DbWeight::get().reads(16)) - .saturating_add(T::DbWeight::get().writes(19)) + .saturating_add(T::DbWeight::get().writes(20)) } /// Storage: `Identity::Identities` (r:1 w:0) /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_remove_identity_noop() -> Weight { // Proof Size summary in bytes: - // Measured: `269` - // Estimated: `3734` - // Minimum execution time: 7_847_000 picoseconds. - Weight::from_parts(8_887_000, 0) - .saturating_add(Weight::from_parts(0, 3734)) + // Measured: `302` + // Estimated: `3767` + // Minimum execution time: 3_550_000 picoseconds. + Weight::from_parts(3_691_000, 0) + .saturating_add(Weight::from_parts(0, 3767)) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Identity::Identities` (r:1 w:1) @@ -252,7 +253,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Storage: `Identity::CounterForIdentities` (r:1 w:1) /// Proof: `Identity::CounterForIdentities` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Membership::Membership` (r:1 w:1) /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Membership::CounterForMembership` (r:1 w:1) @@ -279,11 +280,11 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) fn do_remove_identity() -> Weight { // Proof Size summary in bytes: - // Measured: `1447` - // Estimated: `9862` - // Minimum execution time: 163_144_000 picoseconds. - Weight::from_parts(223_357_000, 0) - .saturating_add(Weight::from_parts(0, 9862)) + // Measured: `1498` + // Estimated: `9913` + // Minimum execution time: 89_725_000 picoseconds. + Weight::from_parts(93_000_000, 0) + .saturating_add(Weight::from_parts(0, 9913)) .saturating_add(T::DbWeight::get().reads(15)) .saturating_add(T::DbWeight::get().writes(21)) } @@ -291,11 +292,11 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) fn prune_identities_noop() -> Weight { // Proof Size summary in bytes: - // Measured: `108` - // Estimated: `3573` - // Minimum execution time: 4_257_000 picoseconds. - Weight::from_parts(4_848_000, 0) - .saturating_add(Weight::from_parts(0, 3573)) + // Measured: `157` + // Estimated: `3622` + // Minimum execution time: 2_750_000 picoseconds. + Weight::from_parts(2_921_000, 0) + .saturating_add(Weight::from_parts(0, 3622)) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Identity::IdentityChangeSchedule` (r:1 w:1) @@ -304,37 +305,37 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) fn prune_identities_none() -> Weight { // Proof Size summary in bytes: - // Measured: `292` - // Estimated: `3757` - // Minimum execution time: 13_902_000 picoseconds. - Weight::from_parts(29_881_000, 0) - .saturating_add(Weight::from_parts(0, 3757)) + // Measured: `327` + // Estimated: `3792` + // Minimum execution time: 6_322_000 picoseconds. + Weight::from_parts(6_501_000, 0) + .saturating_add(Weight::from_parts(0, 3792)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity IdentityChangeSchedule (r:1 w:1) - /// Proof Skipped: Identity IdentityChangeSchedule (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity Identities (r:1 w:1) - /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity CounterForIdentities (r:1 w:1) - /// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) - /// Storage: Membership Membership (r:1 w:1) - /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) - /// Storage: Certification CertsByReceiver (r:1 w:0) - /// Proof Skipped: Certification CertsByReceiver (max_values: None, max_size: None, mode: Measured) - /// Storage: Identity IdentityIndexOf (r:0 w:1) - /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) - /// Storage: Quota IdtyQuota (r:0 w:1) - /// Proof: Quota IdtyQuota (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityChangeSchedule` (r:1 w:1) + /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::Identities` (r:1 w:1) + /// Proof: `Identity::Identities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::CounterForIdentities` (r:1 w:1) + /// Proof: `Identity::CounterForIdentities` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// Storage: `Membership::Membership` (r:1 w:1) + /// Proof: `Membership::Membership` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Certification::CertsByReceiver` (r:1 w:0) + /// Proof: `Certification::CertsByReceiver` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Identity::IdentityIndexOf` (r:0 w:1) + /// Proof: `Identity::IdentityIndexOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Quota::IdtyQuota` (r:0 w:1) + /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn prune_identities_err() -> Weight { // Proof Size summary in bytes: - // Measured: `753` - // Estimated: `4218` - // Minimum execution time: 71_875_000 picoseconds. - Weight::from_parts(84_556_000, 0) - .saturating_add(Weight::from_parts(0, 4218)) + // Measured: `788` + // Estimated: `4253` + // Minimum execution time: 33_151_000 picoseconds. + Weight::from_parts(34_375_000, 0) + .saturating_add(Weight::from_parts(0, 4253)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } diff --git a/runtime/common/src/weights/pallet_im_online.rs b/runtime/common/src/weights/pallet_im_online.rs index 82e221d7b451d19896b96df7d5649bcf22b664b9..8ae42d0cdac5b7844a7d6c5609a8e9cd6f0e80c6 100644 --- a/runtime/common/src/weights/pallet_im_online.rs +++ b/runtime/common/src/weights/pallet_im_online.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_im_online` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -64,11 +64,11 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `603 + k * (32 ±0)` // Estimated: `33487 + k * (1761 ±0)` - // Minimum execution time: 53_722_000 picoseconds. - Weight::from_parts(66_607_466, 0) + // Minimum execution time: 52_323_000 picoseconds. + Weight::from_parts(67_471_180, 0) .saturating_add(Weight::from_parts(0, 33487)) - // Standard Error: 482 - .saturating_add(Weight::from_parts(28_435, 0).saturating_mul(k.into())) + // Standard Error: 683 + .saturating_add(Weight::from_parts(46_057, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into())) diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index 624d14353e82a492f56f4720d9d264bff6b6ffa9..dda4365f3ca97cb5620fae0ca7eddf8ecfe989c8 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_membership` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -51,8 +51,8 @@ impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 378_000 picoseconds. - Weight::from_parts(511_000, 0) + // Minimum execution time: 164_000 picoseconds. + Weight::from_parts(180_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Membership::MembershipsExpireOn` (r:2 w:2) @@ -78,25 +78,25 @@ impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> { /// Storage: `Session::NextKeys` (r:3 w:3) /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) - /// Storage: `Identity::IdentityChangeSchedule` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityChangeSchedule` (r:2 w:2) /// Proof: `Identity::IdentityChangeSchedule` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Session::KeyOwner` (r:0 w:12) /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[0, 3]`. fn expire_memberships(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `138 + i * (639 ±0)` - // Estimated: `10471 + i * (1464 ±0)` - // Minimum execution time: 12_285_000 picoseconds. - Weight::from_parts(14_483_500, 0) - .saturating_add(Weight::from_parts(0, 10471)) - // Standard Error: 8_003_454 - .saturating_add(Weight::from_parts(122_359_333, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((9_u64).saturating_mul(i.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((12_u64).saturating_mul(i.into()))) - .saturating_add(Weight::from_parts(0, 1464).saturating_mul(i.into())) + // Measured: `138 + i * (804 ±0)` + // Estimated: `9744 + i * (2687 ±0)` + // Minimum execution time: 4_154_000 picoseconds. + Weight::from_parts(10_550_258, 0) + .saturating_add(Weight::from_parts(0, 9744)) + // Standard Error: 417_990 + .saturating_add(Weight::from_parts(62_126_193, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(i.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((14_u64).saturating_mul(i.into()))) + .saturating_add(Weight::from_parts(0, 2687).saturating_mul(i.into())) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index bc0bc453d410d44afbce4d13f9769b42fbfbe0b1..809c0922c59c89f9e28264cd90a37fab1b7408be 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -52,11 +52,11 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_294_000 picoseconds. - Weight::from_parts(17_767_000, 0) + // Minimum execution time: 4_978_000 picoseconds. + Weight::from_parts(5_382_909, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 947 - .saturating_add(Weight::from_parts(221, 0).saturating_mul(z.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(334, 0).saturating_mul(z.into())) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(457), added: 2932, mode: `MaxEncodedLen`) @@ -64,15 +64,15 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `134 + s * (4 ±0)` + // Measured: `125 + s * (5 ±0)` // Estimated: `3922` - // Minimum execution time: 43_829_000 picoseconds. - Weight::from_parts(22_076_250, 0) + // Minimum execution time: 23_491_000 picoseconds. + Weight::from_parts(24_049_148, 0) .saturating_add(Weight::from_parts(0, 3922)) - // Standard Error: 650_697 - .saturating_add(Weight::from_parts(2_451_125, 0).saturating_mul(s.into())) - // Standard Error: 520 - .saturating_add(Weight::from_parts(3_350, 0).saturating_mul(z.into())) + // Standard Error: 5_895 + .saturating_add(Weight::from_parts(80_169, 0).saturating_mul(s.into())) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_030, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -84,33 +84,33 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `240` // Estimated: `3922` - // Minimum execution time: 27_439_000 picoseconds. - Weight::from_parts(23_259_571, 0) + // Minimum execution time: 13_765_000 picoseconds. + Weight::from_parts(13_706_792, 0) .saturating_add(Weight::from_parts(0, 3922)) - // Standard Error: 477_625 - .saturating_add(Weight::from_parts(598_142, 0).saturating_mul(s.into())) - // Standard Error: 334 - .saturating_add(Weight::from_parts(1_942, 0).saturating_mul(z.into())) + // Standard Error: 4_132 + .saturating_add(Weight::from_parts(68_237, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(457), added: 2932, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 10]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `268 + s * (36 ±0)` + // Measured: `259 + s * (37 ±0)` // Estimated: `3922` - // Minimum execution time: 54_255_000 picoseconds. - Weight::from_parts(50_336_875, 0) + // Minimum execution time: 26_519_000 picoseconds. + Weight::from_parts(26_370_537, 0) .saturating_add(Weight::from_parts(0, 3922)) - // Standard Error: 202_613 - .saturating_add(Weight::from_parts(484_062, 0).saturating_mul(s.into())) - // Standard Error: 162 - .saturating_add(Weight::from_parts(996, 0).saturating_mul(z.into())) + // Standard Error: 7_852 + .saturating_add(Weight::from_parts(161_224, 0).saturating_mul(s.into())) + // Standard Error: 6 + .saturating_add(Weight::from_parts(1_053, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -119,13 +119,13 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[2, 10]`. fn approve_as_multi_create(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `134 + s * (4 ±0)` + // Measured: `130 + s * (5 ±0)` // Estimated: `3922` - // Minimum execution time: 41_585_000 picoseconds. - Weight::from_parts(43_152_750, 0) + // Minimum execution time: 20_919_000 picoseconds. + Weight::from_parts(22_650_151, 0) .saturating_add(Weight::from_parts(0, 3922)) - // Standard Error: 282_586 - .saturating_add(Weight::from_parts(53_625, 0).saturating_mul(s.into())) + // Standard Error: 8_934 + .saturating_add(Weight::from_parts(124_461, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -136,24 +136,26 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `240` // Estimated: `3922` - // Minimum execution time: 24_560_000 picoseconds. - Weight::from_parts(20_280_625, 0) + // Minimum execution time: 11_643_000 picoseconds. + Weight::from_parts(12_253_092, 0) .saturating_add(Weight::from_parts(0, 3922)) - // Standard Error: 125_216 - .saturating_add(Weight::from_parts(2_519_937, 0).saturating_mul(s.into())) + // Standard Error: 3_568 + .saturating_add(Weight::from_parts(135_819, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(457), added: 2932, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 10]`. - fn cancel_as_multi(_s: u32, ) -> Weight { + fn cancel_as_multi(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `332 + s * (4 ±0)` + // Measured: `328 + s * (5 ±0)` // Estimated: `3922` - // Minimum execution time: 43_044_000 picoseconds. - Weight::from_parts(58_535_000, 0) + // Minimum execution time: 22_091_000 picoseconds. + Weight::from_parts(23_574_254, 0) .saturating_add(Weight::from_parts(0, 3922)) + // Standard Error: 6_372 + .saturating_add(Weight::from_parts(112_181, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_oneshot_account.rs b/runtime/common/src/weights/pallet_oneshot_account.rs index 763fc12107959f049d6764edfa5b24786dab05c8..f233263ca5561059dd5ed0835c1e6bc3ef4bc242 100644 --- a/runtime/common/src/weights/pallet_oneshot_account.rs +++ b/runtime/common/src/weights/pallet_oneshot_account.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_oneshot_account` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -53,8 +53,8 @@ impl<T: frame_system::Config> pallet_oneshot_account::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 40_392_000 picoseconds. - Weight::from_parts(41_299_000, 0) + // Minimum execution time: 15_595_000 picoseconds. + Weight::from_parts(16_111_000, 0) .saturating_add(Weight::from_parts(0, 3507)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -64,14 +64,14 @@ impl<T: frame_system::Config> pallet_oneshot_account::WeightInfo for WeightInfo< /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn consume_oneshot_account() -> Weight { // Proof Size summary in bytes: - // Measured: `242` - // Estimated: `3707` - // Minimum execution time: 50_349_000 picoseconds. - Weight::from_parts(53_834_000, 0) - .saturating_add(Weight::from_parts(0, 3707)) + // Measured: `241` + // Estimated: `3706` + // Minimum execution time: 21_406_000 picoseconds. + Weight::from_parts(22_593_000, 0) + .saturating_add(Weight::from_parts(0, 3706)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -80,14 +80,14 @@ impl<T: frame_system::Config> pallet_oneshot_account::WeightInfo for WeightInfo< /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn consume_oneshot_account_with_remaining() -> Weight { // Proof Size summary in bytes: - // Measured: `306` - // Estimated: `6192` - // Minimum execution time: 71_084_000 picoseconds. - Weight::from_parts(76_511_000, 0) - .saturating_add(Weight::from_parts(0, 6192)) + // Measured: `301` + // Estimated: `6126` + // Minimum execution time: 29_605_000 picoseconds. + Weight::from_parts(30_459_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 8cea5d5178324ddb6dddec908284fe9cfa5ffdfe..463f391dd6f088b56031818be1d7bf5c8a8327aa 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -58,12 +58,12 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3548` - // Minimum execution time: 38_160_000 picoseconds. - Weight::from_parts(39_633_500, 0) + // Minimum execution time: 11_051_000 picoseconds. + Weight::from_parts(11_230_000, 0) .saturating_add(Weight::from_parts(0, 3548)) - // Standard Error: 65 - .saturating_add(Weight::from_parts(2_347, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1_276, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Preimage::StatusFor` (r:1 w:0) @@ -77,12 +77,12 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3548` - // Minimum execution time: 25_789_000 picoseconds. - Weight::from_parts(51_365_500, 0) + // Minimum execution time: 13_018_000 picoseconds. + Weight::from_parts(13_243_000, 0) .saturating_add(Weight::from_parts(0, 3548)) - // Standard Error: 59 - .saturating_add(Weight::from_parts(2_238, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1_281, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Preimage::StatusFor` (r:1 w:0) @@ -96,12 +96,12 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3548` - // Minimum execution time: 24_406_000 picoseconds. - Weight::from_parts(25_614_000, 0) + // Minimum execution time: 11_672_000 picoseconds. + Weight::from_parts(11_777_000, 0) .saturating_add(Weight::from_parts(0, 3548)) - // Standard Error: 17 - .saturating_add(Weight::from_parts(2_811, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1_278, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Preimage::StatusFor` (r:1 w:0) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `172` // Estimated: `3548` - // Minimum execution time: 60_607_000 picoseconds. - Weight::from_parts(70_545_000, 0) + // Minimum execution time: 23_631_000 picoseconds. + Weight::from_parts(25_860_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -130,8 +130,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3548` - // Minimum execution time: 38_868_000 picoseconds. - Weight::from_parts(46_917_000, 0) + // Minimum execution time: 22_985_000 picoseconds. + Weight::from_parts(25_660_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -144,8 +144,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `172` // Estimated: `3548` - // Minimum execution time: 30_541_000 picoseconds. - Weight::from_parts(37_066_000, 0) + // Minimum execution time: 21_615_000 picoseconds. + Weight::from_parts(23_521_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -158,8 +158,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3548` - // Minimum execution time: 30_620_000 picoseconds. - Weight::from_parts(44_732_000, 0) + // Minimum execution time: 13_134_000 picoseconds. + Weight::from_parts(15_067_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -172,8 +172,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3548` - // Minimum execution time: 32_593_000 picoseconds. - Weight::from_parts(48_836_000, 0) + // Minimum execution time: 9_217_000 picoseconds. + Weight::from_parts(10_352_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -186,8 +186,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3548` - // Minimum execution time: 18_050_000 picoseconds. - Weight::from_parts(20_396_000, 0) + // Minimum execution time: 6_997_000 picoseconds. + Weight::from_parts(7_663_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -202,8 +202,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3548` - // Minimum execution time: 34_145_000 picoseconds. - Weight::from_parts(38_096_000, 0) + // Minimum execution time: 20_216_000 picoseconds. + Weight::from_parts(23_210_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -216,8 +216,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3548` - // Minimum execution time: 11_945_000 picoseconds. - Weight::from_parts(15_583_000, 0) + // Minimum execution time: 6_998_000 picoseconds. + Weight::from_parts(7_393_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -230,8 +230,8 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3548` - // Minimum execution time: 16_740_000 picoseconds. - Weight::from_parts(19_662_000, 0) + // Minimum execution time: 6_933_000 picoseconds. + Weight::from_parts(7_518_000, 0) .saturating_add(Weight::from_parts(0, 3548)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -239,21 +239,21 @@ impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> { /// Storage: `Preimage::StatusFor` (r:1023 w:1023) /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1023 w:1023) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Preimage::RequestStatusFor` (r:0 w:1023) /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 1024]`. fn ensure_updated(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + n * (180 ±0)` - // Estimated: `990 + n * (2601 ±0)` - // Minimum execution time: 16_685_000 picoseconds. - Weight::from_parts(17_134_000, 0) + // Measured: `0 + n * (179 ±0)` + // Estimated: `990 + n * (2568 ±0)` + // Minimum execution time: 16_410_000 picoseconds. + Weight::from_parts(16_989_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 17_297 - .saturating_add(Weight::from_parts(13_805_632, 0).saturating_mul(n.into())) + // Standard Error: 24_570 + .saturating_add(Weight::from_parts(13_639_875, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 2601).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(n.into())) } } diff --git a/runtime/common/src/weights/pallet_provide_randomness.rs b/runtime/common/src/weights/pallet_provide_randomness.rs index 003ec1b3c7e3d515f4551c84f64cd52af22637b3..f61b52623f927d06b4ec5404fa6fde08189071b9 100644 --- a/runtime/common/src/weights/pallet_provide_randomness.rs +++ b/runtime/common/src/weights/pallet_provide_randomness.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_provide_randomness` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -50,7 +50,7 @@ impl<T: frame_system::Config> pallet_provide_randomness::WeightInfo for WeightIn /// Storage: `ProvideRandomness::CounterForRequestsIds` (r:1 w:1) /// Proof: `ProvideRandomness::CounterForRequestsIds` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `ProvideRandomness::RequestIdProvider` (r:1 w:1) /// Proof: `ProvideRandomness::RequestIdProvider` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `ProvideRandomness::RequestsIds` (r:1 w:1) @@ -63,13 +63,13 @@ impl<T: frame_system::Config> pallet_provide_randomness::WeightInfo for WeightIn /// Proof: `ProvideRandomness::RequestsReadyAtEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) fn request() -> Weight { // Proof Size summary in bytes: - // Measured: `235` - // Estimated: `3700` - // Minimum execution time: 80_561_000 picoseconds. - Weight::from_parts(108_149_000, 0) - .saturating_add(Weight::from_parts(0, 3700)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 31_535_000 picoseconds. + Weight::from_parts(33_673_000, 0) + .saturating_add(Weight::from_parts(0, 3763)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `ProvideRandomness::RequestsReadyAtNextBlock` (r:1 w:1) /// Proof: `ProvideRandomness::RequestsReadyAtNextBlock` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -79,22 +79,20 @@ impl<T: frame_system::Config> pallet_provide_randomness::WeightInfo for WeightIn /// Proof: `ProvideRandomness::RequestsIds` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `ProvideRandomness::CounterForRequestsIds` (r:1 w:1) /// Proof: `ProvideRandomness::CounterForRequestsIds` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `Account::PendingRandomIdAssignments` (r:100 w:0) - /// Proof: `Account::PendingRandomIdAssignments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `ProvideRandomness::NexEpochHookIn` (r:1 w:1) /// Proof: `ProvideRandomness::NexEpochHookIn` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 100]`. fn on_initialize(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `375 + i * (59 ±0)` - // Estimated: `1860 + i * (2535 ±0)` - // Minimum execution time: 43_649_000 picoseconds. - Weight::from_parts(27_155_939, 0) - .saturating_add(Weight::from_parts(0, 1860)) - // Standard Error: 194_874 - .saturating_add(Weight::from_parts(16_862_060, 0).saturating_mul(i.into())) + // Measured: `341 + i * (59 ±0)` + // Estimated: `1827 + i * (2535 ±0)` + // Minimum execution time: 14_676_000 picoseconds. + Weight::from_parts(12_354_555, 0) + .saturating_add(Weight::from_parts(0, 1827)) + // Standard Error: 5_734 + .saturating_add(Weight::from_parts(4_864_658, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(i.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) .saturating_add(Weight::from_parts(0, 2535).saturating_mul(i.into())) @@ -115,20 +113,18 @@ impl<T: frame_system::Config> pallet_provide_randomness::WeightInfo for WeightIn /// Proof: `ProvideRandomness::RequestsIds` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `ProvideRandomness::CounterForRequestsIds` (r:1 w:1) /// Proof: `ProvideRandomness::CounterForRequestsIds` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `Account::PendingRandomIdAssignments` (r:100 w:0) - /// Proof: `Account::PendingRandomIdAssignments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 100]`. fn on_initialize_epoch(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `385 + i * (59 ±0)` - // Estimated: `3850 + i * (2535 ±0)` - // Minimum execution time: 53_551_000 picoseconds. - Weight::from_parts(57_278_090, 0) - .saturating_add(Weight::from_parts(0, 3850)) - // Standard Error: 3_676_910 - .saturating_add(Weight::from_parts(19_046_909, 0).saturating_mul(i.into())) + // Measured: `351 + i * (59 ±0)` + // Estimated: `3817 + i * (2535 ±0)` + // Minimum execution time: 16_332_000 picoseconds. + Weight::from_parts(14_537_373, 0) + .saturating_add(Weight::from_parts(0, 3817)) + // Standard Error: 7_399 + .saturating_add(Weight::from_parts(5_157_639, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(i.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) .saturating_add(Weight::from_parts(0, 2535).saturating_mul(i.into())) diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index f21307d4706ae053eeec5f4a7d29a03a96329a3b..679b3f90b8be4fb560c2e34142702cfce8692002 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -52,13 +52,13 @@ impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `155 + p * (37 ±0)` + // Measured: `157 + p * (37 ±0)` // Estimated: `4698` - // Minimum execution time: 25_631_000 picoseconds. - Weight::from_parts(26_675_316, 0) + // Minimum execution time: 11_368_000 picoseconds. + Weight::from_parts(12_404_289, 0) .saturating_add(Weight::from_parts(0, 4698)) - // Standard Error: 114_144 - .saturating_add(Weight::from_parts(191_683, 0).saturating_mul(p.into())) + // Standard Error: 1_777 + .saturating_add(Weight::from_parts(16_678, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Proxy::Proxies` (r:1 w:0) @@ -66,56 +66,60 @@ impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> { /// Storage: `Proxy::Announcements` (r:1 w:1) /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2225), added: 4700, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, 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: `437 + a * (68 ±0) + p * (35 ±0)` + // Measured: `399 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5690` - // Minimum execution time: 52_992_000 picoseconds. - Weight::from_parts(11_730_200, 0) + // Minimum execution time: 26_765_000 picoseconds. + Weight::from_parts(27_557_786, 0) .saturating_add(Weight::from_parts(0, 5690)) - // Standard Error: 592_609 - .saturating_add(Weight::from_parts(1_318_258, 0).saturating_mul(a.into())) - // Standard Error: 612_363 - .saturating_add(Weight::from_parts(1_363_300, 0).saturating_mul(p.into())) + // Standard Error: 2_067 + .saturating_add(Weight::from_parts(133_536, 0).saturating_mul(a.into())) + // Standard Error: 2_136 + .saturating_add(Weight::from_parts(32_786, 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(2225), added: 4700, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, 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 { + fn remove_announcement(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `361 + a * (68 ±0)` + // Measured: `322 + a * (68 ±0)` // Estimated: `5690` - // Minimum execution time: 36_348_000 picoseconds. - Weight::from_parts(45_209_200, 0) + // Minimum execution time: 17_933_000 picoseconds. + Weight::from_parts(18_740_744, 0) .saturating_add(Weight::from_parts(0, 5690)) + // Standard Error: 1_809 + .saturating_add(Weight::from_parts(127_810, 0).saturating_mul(a.into())) + // Standard Error: 1_869 + .saturating_add(Weight::from_parts(8_769, 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(2225), added: 4700, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, 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: `361 + a * (68 ±0)` + // Measured: `322 + a * (68 ±0)` // Estimated: `5690` - // Minimum execution time: 32_605_000 picoseconds. - Weight::from_parts(41_767_616, 0) + // Minimum execution time: 17_456_000 picoseconds. + Weight::from_parts(18_316_397, 0) .saturating_add(Weight::from_parts(0, 5690)) - // Standard Error: 337_979 - .saturating_add(Weight::from_parts(142_145, 0).saturating_mul(a.into())) - // Standard Error: 349_245 - .saturating_add(Weight::from_parts(115_883, 0).saturating_mul(p.into())) + // Standard Error: 1_829 + .saturating_add(Weight::from_parts(136_230, 0).saturating_mul(a.into())) + // Standard Error: 1_890 + .saturating_add(Weight::from_parts(7_976, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -124,31 +128,35 @@ impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> { /// Storage: `Proxy::Announcements` (r:1 w:1) /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2225), added: 4700, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, 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 { + fn announce(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `296 + a * (70 ±0) + p * (35 ±0)` + // Measured: `331 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5690` - // Minimum execution time: 49_970_000 picoseconds. - Weight::from_parts(53_871_883, 0) + // Minimum execution time: 24_340_000 picoseconds. + Weight::from_parts(24_038_296, 0) .saturating_add(Weight::from_parts(0, 5690)) - // Standard Error: 146_491 - .saturating_add(Weight::from_parts(272_483, 0).saturating_mul(a.into())) + // Standard Error: 1_643 + .saturating_add(Weight::from_parts(135_270, 0).saturating_mul(a.into())) + // Standard Error: 1_697 + .saturating_add(Weight::from_parts(40_733, 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(1233), added: 3708, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn add_proxy(_p: u32, ) -> Weight { + fn add_proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `155 + p * (37 ±0)` + // Measured: `157 + p * (37 ±0)` // Estimated: `4698` - // Minimum execution time: 40_566_000 picoseconds. - Weight::from_parts(47_260_300, 0) + // Minimum execution time: 16_775_000 picoseconds. + Weight::from_parts(17_977_186, 0) .saturating_add(Weight::from_parts(0, 4698)) + // Standard Error: 1_714 + .saturating_add(Weight::from_parts(26_419, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -157,54 +165,56 @@ impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `155 + p * (37 ±0)` + // Measured: `157 + p * (37 ±0)` // Estimated: `4698` - // Minimum execution time: 41_275_000 picoseconds. - Weight::from_parts(41_844_616, 0) + // Minimum execution time: 16_731_000 picoseconds. + Weight::from_parts(18_126_864, 0) .saturating_add(Weight::from_parts(0, 4698)) - // Standard Error: 386_747 - .saturating_add(Weight::from_parts(409_883, 0).saturating_mul(p.into())) + // Standard Error: 2_461 + .saturating_add(Weight::from_parts(34_851, 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(1233), added: 3708, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn remove_proxies(_p: u32, ) -> Weight { + fn remove_proxies(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `155 + p * (37 ±0)` + // Measured: `157 + p * (37 ±0)` // Estimated: `4698` - // Minimum execution time: 35_764_000 picoseconds. - Weight::from_parts(47_260_516, 0) + // Minimum execution time: 16_319_000 picoseconds. + Weight::from_parts(17_540_003, 0) .saturating_add(Weight::from_parts(0, 4698)) + // Standard Error: 1_751 + .saturating_add(Weight::from_parts(19_700, 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(1233), added: 3708, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn create_pure(p: u32, ) -> Weight { + fn create_pure(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `177` // Estimated: `4698` - // Minimum execution time: 44_405_000 picoseconds. - Weight::from_parts(71_055_316, 0) + // Minimum execution time: 17_960_000 picoseconds. + Weight::from_parts(19_731_703, 0) .saturating_add(Weight::from_parts(0, 4698)) - // Standard Error: 1_936 - .saturating_add(Weight::from_parts(2_195, 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(1233), added: 3708, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 30]`. - fn kill_pure(_p: u32, ) -> Weight { + fn kill_pure(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `193 + p * (37 ±0)` + // Measured: `194 + p * (37 ±0)` // Estimated: `4698` - // Minimum execution time: 36_924_000 picoseconds. - Weight::from_parts(39_701_000, 0) + // Minimum execution time: 17_009_000 picoseconds. + Weight::from_parts(18_260_092, 0) .saturating_add(Weight::from_parts(0, 4698)) + // Standard Error: 1_917 + .saturating_add(Weight::from_parts(21_418, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_quota.rs b/runtime/common/src/weights/pallet_quota.rs index 2e67c768b4813a7920181bcd6f2bc3663e89964a..39bef3af846e43b03ff5acc1d88eece6932dea42 100644 --- a/runtime/common/src/weights/pallet_quota.rs +++ b/runtime/common/src/weights/pallet_quota.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_quota` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -53,8 +53,8 @@ impl<T: frame_system::Config> pallet_quota::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `11288` // Estimated: `12751` - // Minimum execution time: 20_999_000 picoseconds. - Weight::from_parts(33_078_000, 0) + // Minimum execution time: 7_600_000 picoseconds. + Weight::from_parts(7_758_000, 0) .saturating_add(Weight::from_parts(0, 12751)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -65,8 +65,8 @@ impl<T: frame_system::Config> pallet_quota::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `139` // Estimated: `3489` - // Minimum execution time: 9_664_000 picoseconds. - Weight::from_parts(10_321_000, 0) + // Minimum execution time: 4_705_000 picoseconds. + Weight::from_parts(4_974_000, 0) .saturating_add(Weight::from_parts(0, 3489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -74,30 +74,30 @@ impl<T: frame_system::Config> pallet_quota::WeightInfo for WeightInfo<T> { /// Storage: `Quota::IdtyQuota` (r:1 w:1) /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn try_refund() -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `3591` - // Minimum execution time: 47_064_000 picoseconds. - Weight::from_parts(48_828_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `202` + // Estimated: `6126` + // Minimum execution time: 22_910_000 picoseconds. + Weight::from_parts(23_707_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Quota::IdtyQuota` (r:1 w:1) /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn do_refund() -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `3591` - // Minimum execution time: 46_343_000 picoseconds. - Weight::from_parts(71_066_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `202` + // Estimated: `6126` + // Minimum execution time: 21_986_000 picoseconds. + Weight::from_parts(23_378_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Quota::RefundQueue` (r:1 w:1) /// Proof: `Quota::RefundQueue` (`max_values`: Some(1), `max_size`: Some(11266), added: 11761, mode: `MaxEncodedLen`) @@ -105,30 +105,29 @@ impl<T: frame_system::Config> pallet_quota::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `43` // Estimated: `12751` - // Minimum execution time: 5_297_000 picoseconds. - Weight::from_parts(5_802_000, 0) + // Minimum execution time: 1_814_000 picoseconds. + Weight::from_parts(1_923_000, 0) .saturating_add(Weight::from_parts(0, 12751)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Quota::RefundQueue` (r:1 w:1) - /// Proof: `Quota::RefundQueue` (`max_values`: Some(1), `max_size`: Some(11266), added: 11761, mode: `Measured`) + /// Proof: `Quota::RefundQueue` (`max_values`: Some(1), `max_size`: Some(11266), added: 11761, mode: `MaxEncodedLen`) /// Storage: `Quota::IdtyQuota` (r:1 w:1) - /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `Measured`) + /// Proof: `Quota::IdtyQuota` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// The range of component `i` is `[1, 256]`. fn on_process_refund_queue_elements(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `161 + i * (44 ±0)` - // Estimated: `3627 + i * (44 ±0)` - // Minimum execution time: 54_337_000 picoseconds. - Weight::from_parts(57_391_466, 0) - .saturating_add(Weight::from_parts(0, 3627)) - // Standard Error: 30_722 - .saturating_add(Weight::from_parts(2_727_533, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 44).saturating_mul(i.into())) + // Measured: `227 + i * (44 ±0)` + // Estimated: `12751` + // Minimum execution time: 24_570_000 picoseconds. + Weight::from_parts(38_679_473, 0) + .saturating_add(Weight::from_parts(0, 12751)) + // Standard Error: 1_905 + .saturating_add(Weight::from_parts(1_219_186, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index 7a86277ae324c41dc41a93411c42c83cfe743705..39515edc59fde30596951aba4acce084c03640b4 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -53,8 +53,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `30` // Estimated: `1489` - // Minimum execution time: 5_917_000 picoseconds. - Weight::from_parts(6_875_000, 0) + // Minimum execution time: 2_232_000 picoseconds. + Weight::from_parts(2_370_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -64,13 +64,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[0, 50]`. fn service_agenda_base(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3 + s * (178 ±0)` + // Measured: `77 + s * (177 ±0)` // Estimated: `13928` - // Minimum execution time: 5_375_000 picoseconds. - Weight::from_parts(5_869_000, 0) + // Minimum execution time: 2_703_000 picoseconds. + Weight::from_parts(5_285_209, 0) .saturating_add(Weight::from_parts(0, 13928)) - // Standard Error: 735_416 - .saturating_add(Weight::from_parts(1_431_610, 0).saturating_mul(s.into())) + // Standard Error: 1_467 + .saturating_add(Weight::from_parts(297_347, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_667_000 picoseconds. - Weight::from_parts(10_122_000, 0) + // Minimum execution time: 2_310_000 picoseconds. + Weight::from_parts(2_533_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Preimage::PreimageFor` (r:1 w:1) @@ -91,14 +91,14 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[128, 4194304]`. fn service_task_fetched(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `172 + s * (1 ±0)` - // Estimated: `3638 + s * (1 ±0)` - // Minimum execution time: 30_949_000 picoseconds. - Weight::from_parts(31_708_943, 0) - .saturating_add(Weight::from_parts(0, 3638)) - // Standard Error: 88 - .saturating_add(Weight::from_parts(2_164, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `179 + s * (1 ±0)` + // Estimated: `3644 + s * (1 ±0)` + // Minimum execution time: 13_770_000 picoseconds. + Weight::from_parts(14_217_000, 0) + .saturating_add(Weight::from_parts(0, 3644)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(931, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) } @@ -108,8 +108,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_569_000 picoseconds. - Weight::from_parts(13_496_000, 0) + // Minimum execution time: 3_484_000 picoseconds. + Weight::from_parts(3_664_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -117,24 +117,24 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_803_000 picoseconds. - Weight::from_parts(10_347_000, 0) + // Minimum execution time: 2_273_000 picoseconds. + Weight::from_parts(2_502_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_signed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_067_000 picoseconds. - Weight::from_parts(6_483_000, 0) + // Minimum execution time: 1_612_000 picoseconds. + Weight::from_parts(1_733_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_unsigned() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_837_000 picoseconds. - Weight::from_parts(6_432_000, 0) + // Minimum execution time: 1_511_000 picoseconds. + Weight::from_parts(1_645_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Scheduler::Agenda` (r:1 w:1) @@ -142,13 +142,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3 + s * (178 ±0)` + // Measured: `77 + s * (177 ±0)` // Estimated: `13928` - // Minimum execution time: 19_912_000 picoseconds. - Weight::from_parts(21_702_500, 0) + // Minimum execution time: 7_228_000 picoseconds. + Weight::from_parts(10_120_396, 0) .saturating_add(Weight::from_parts(0, 13928)) - // Standard Error: 44_424 - .saturating_add(Weight::from_parts(559_500, 0).saturating_mul(s.into())) + // Standard Error: 1_562 + .saturating_add(Weight::from_parts(311_196, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -161,11 +161,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `77 + s * (177 ±0)` // Estimated: `13928` - // Minimum execution time: 24_537_000 picoseconds. - Weight::from_parts(24_737_234, 0) + // Minimum execution time: 10_928_000 picoseconds. + Weight::from_parts(11_364_895, 0) .saturating_add(Weight::from_parts(0, 13928)) - // Standard Error: 23_186 - .saturating_add(Weight::from_parts(754_765, 0).saturating_mul(s.into())) + // Standard Error: 1_293 + .saturating_add(Weight::from_parts(483_700, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -176,13 +176,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3 + s * (191 ±0)` + // Measured: `254 + s * (185 ±0)` // Estimated: `13928` - // Minimum execution time: 22_267_000 picoseconds. - Weight::from_parts(23_915_000, 0) + // Minimum execution time: 10_429_000 picoseconds. + Weight::from_parts(14_514_582, 0) .saturating_add(Weight::from_parts(0, 13928)) - // Standard Error: 40_796 - .saturating_add(Weight::from_parts(637_887, 0).saturating_mul(s.into())) + // Standard Error: 6_410 + .saturating_add(Weight::from_parts(336_583, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -193,13 +193,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `101 + s * (188 ±0)` + // Measured: `280 + s * (185 ±0)` // Estimated: `13928` - // Minimum execution time: 26_099_000 picoseconds. - Weight::from_parts(26_618_969, 0) + // Minimum execution time: 12_953_000 picoseconds. + Weight::from_parts(14_518_850, 0) .saturating_add(Weight::from_parts(0, 13928)) - // Standard Error: 30_479 - .saturating_add(Weight::from_parts(813_030, 0).saturating_mul(s.into())) + // Standard Error: 1_923 + .saturating_add(Weight::from_parts(499_073, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_session.rs b/runtime/common/src/weights/pallet_session.rs index 249b19475ea84ae44e008a0d5e832e5cea6cda60..6a50fc75a025cdda45455ade655eb3a4cce6c1b7 100644 --- a/runtime/common/src/weights/pallet_session.rs +++ b/runtime/common/src/weights/pallet_session.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -55,8 +55,8 @@ impl<T: frame_system::Config> pallet_session::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `723` // Estimated: `11613` - // Minimum execution time: 37_945_000 picoseconds. - Weight::from_parts(40_868_000, 0) + // Minimum execution time: 23_354_000 picoseconds. + Weight::from_parts(24_163_000, 0) .saturating_add(Weight::from_parts(0, 11613)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -69,8 +69,8 @@ impl<T: frame_system::Config> pallet_session::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 22_999_000 picoseconds. - Weight::from_parts(23_845_000, 0) + // Minimum execution time: 13_795_000 picoseconds. + Weight::from_parts(14_645_000, 0) .saturating_add(Weight::from_parts(0, 3877)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(5)) diff --git a/runtime/common/src/weights/pallet_smith_members.rs b/runtime/common/src/weights/pallet_smith_members.rs index 3e89d16dd5654befdbac2bca8b8d8025788d6f15..43aadea8d6edf17e0ba866ec598effd13c308c93 100644 --- a/runtime/common/src/weights/pallet_smith_members.rs +++ b/runtime/common/src/weights/pallet_smith_members.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_smith_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -61,11 +61,11 @@ impl<T: frame_system::Config> pallet_smith_members::WeightInfo for WeightInfo<T> /// Proof: `SmithMembers::ExpiresOn` (`max_values`: None, `max_size`: None, mode: `Measured`) fn invite_smith() -> Weight { // Proof Size summary in bytes: - // Measured: `732` - // Estimated: `6672` - // Minimum execution time: 61_398_000 picoseconds. - Weight::from_parts(63_088_000, 0) - .saturating_add(Weight::from_parts(0, 6672)) + // Measured: `765` + // Estimated: `6705` + // Minimum execution time: 24_603_000 picoseconds. + Weight::from_parts(26_004_000, 0) + .saturating_add(Weight::from_parts(0, 6705)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -75,11 +75,11 @@ impl<T: frame_system::Config> pallet_smith_members::WeightInfo for WeightInfo<T> /// Proof: `SmithMembers::Smiths` (`max_values`: None, `max_size`: None, mode: `Measured`) fn accept_invitation() -> Weight { // Proof Size summary in bytes: - // Measured: `463` - // Estimated: `3928` - // Minimum execution time: 31_273_000 picoseconds. - Weight::from_parts(32_005_000, 0) - .saturating_add(Weight::from_parts(0, 3928)) + // Measured: `496` + // Estimated: `3961` + // Minimum execution time: 13_956_000 picoseconds. + Weight::from_parts(14_691_000, 0) + .saturating_add(Weight::from_parts(0, 3961)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -91,14 +91,16 @@ impl<T: frame_system::Config> pallet_smith_members::WeightInfo for WeightInfo<T> /// Proof: `Parameters::ParametersStorage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SmithMembers::CurrentSession` (r:1 w:0) /// Proof: `SmithMembers::CurrentSession` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `SmithMembers::ExpiresOn` (r:1 w:1) + /// Proof: `SmithMembers::ExpiresOn` (`max_values`: None, `max_size`: None, mode: `Measured`) fn certify_smith() -> Weight { // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `6517` - // Minimum execution time: 47_601_000 picoseconds. - Weight::from_parts(48_286_000, 0) - .saturating_add(Weight::from_parts(0, 6517)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `626` + // Estimated: `6566` + // Minimum execution time: 25_044_000 picoseconds. + Weight::from_parts(25_893_000, 0) + .saturating_add(Weight::from_parts(0, 6566)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/runtime/common/src/weights/pallet_sudo.rs b/runtime/common/src/weights/pallet_sudo.rs index d66cc41fa2664c8022c8b96b38663feb7dd5ddcf..682edad417e907be9d8d8ee470042f5d3a653fed 100644 --- a/runtime/common/src/weights/pallet_sudo.rs +++ b/runtime/common/src/weights/pallet_sudo.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_sudo` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -53,8 +53,8 @@ impl<T: frame_system::Config> pallet_sudo::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `165` // Estimated: `1517` - // Minimum execution time: 6_941_000 picoseconds. - Weight::from_parts(7_451_000, 0) + // Minimum execution time: 6_849_000 picoseconds. + Weight::from_parts(7_482_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -65,8 +65,8 @@ impl<T: frame_system::Config> pallet_sudo::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `165` // Estimated: `1517` - // Minimum execution time: 7_383_000 picoseconds. - Weight::from_parts(7_917_000, 0) + // Minimum execution time: 7_184_000 picoseconds. + Weight::from_parts(7_604_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -76,8 +76,8 @@ impl<T: frame_system::Config> pallet_sudo::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `165` // Estimated: `1517` - // Minimum execution time: 7_367_000 picoseconds. - Weight::from_parts(7_890_000, 0) + // Minimum execution time: 7_135_000 picoseconds. + Weight::from_parts(7_482_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -87,8 +87,8 @@ impl<T: frame_system::Config> pallet_sudo::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `165` // Estimated: `1517` - // Minimum execution time: 6_445_000 picoseconds. - Weight::from_parts(6_714_000, 0) + // Minimum execution time: 6_189_000 picoseconds. + Weight::from_parts(6_603_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index 6518156f09c0aaa72d8ba3b9353bb01e03ded23a..6fbf6b198290b97a5c3dc55aa3ae8b1935b0b6a4 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -59,8 +59,8 @@ impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `379` // Estimated: `1864` - // Minimum execution time: 23_818_000 picoseconds. - Weight::from_parts(29_069_000, 0) + // Minimum execution time: 10_564_000 picoseconds. + Weight::from_parts(11_021_000, 0) .saturating_add(Weight::from_parts(0, 1864)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -69,8 +69,8 @@ impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 5_122_000 picoseconds. - Weight::from_parts(8_269_000, 0) + // Minimum execution time: 2_370_000 picoseconds. + Weight::from_parts(2_506_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 2f74e8d48c4a946855e1645734957e632080e103..22b365da01efcef7cf6b4eed5b525ffda67fa6dc 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -51,8 +51,8 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 377_000 picoseconds. - Weight::from_parts(557_000, 0) + // Minimum execution time: 0_000 picoseconds. + Weight::from_parts(0, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Treasury::ProposalCount` (r:1 w:1) @@ -61,10 +61,10 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) fn propose_spend() -> Weight { // Proof Size summary in bytes: - // Measured: `68` + // Measured: `67` // Estimated: `1489` - // Minimum execution time: 35_505_000 picoseconds. - Weight::from_parts(38_046_000, 0) + // Minimum execution time: 16_971_000 picoseconds. + Weight::from_parts(17_608_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -72,16 +72,16 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { /// Storage: `Treasury::Proposals` (r:1 w:1) /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn reject_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `210` - // Estimated: `3591` - // Minimum execution time: 50_438_000 picoseconds. - Weight::from_parts(77_399_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `272` + // Estimated: `6126` + // Minimum execution time: 27_276_000 picoseconds. + Weight::from_parts(28_562_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Treasury::Proposals` (r:1 w:0) /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`) @@ -90,13 +90,13 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[0, 99]`. fn approve_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `97 + p * (11 ±0)` + // Measured: `433 + p * (8 ±0)` // Estimated: `3557` - // Minimum execution time: 12_736_000 picoseconds. - Weight::from_parts(13_685_500, 0) + // Minimum execution time: 6_249_000 picoseconds. + Weight::from_parts(9_360_025, 0) .saturating_add(Weight::from_parts(0, 3557)) - // Standard Error: 9_954 - .saturating_add(Weight::from_parts(55_005, 0).saturating_mul(p.into())) + // Standard Error: 1_119 + .saturating_add(Weight::from_parts(45_823, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -106,14 +106,14 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `90` // Estimated: `1887` - // Minimum execution time: 9_504_000 picoseconds. - Weight::from_parts(10_584_000, 0) + // Minimum execution time: 4_233_000 picoseconds. + Weight::from_parts(4_497_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:199 w:199) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// Storage: `Treasury::Deactivated` (r:1 w:1) /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `Treasury::Approvals` (r:1 w:1) @@ -123,17 +123,18 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { /// The range of component `p` is `[0, 99]`. fn on_initialize_proposals(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `6 + p * (194 ±0)` - // Estimated: `521190` - // Minimum execution time: 36_855_000 picoseconds. - Weight::from_parts(46_349_000, 0) - .saturating_add(Weight::from_parts(0, 521190)) - // Standard Error: 393_829 - .saturating_add(Weight::from_parts(47_248_945, 0).saturating_mul(p.into())) + // Measured: `0 + p * (195 ±0)` + // Estimated: `3558 + p * (5136 ±0)` + // Minimum execution time: 11_467_000 picoseconds. + Weight::from_parts(20_940_373, 0) + .saturating_add(Weight::from_parts(0, 3558)) + // Standard Error: 27_756 + .saturating_add(Weight::from_parts(23_346_230, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 5136).saturating_mul(p.into())) } fn spend() -> Weight { // Proof Size summary in bytes: @@ -146,16 +147,16 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { /// Storage: `Treasury::Spends` (r:1 w:1) /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `6192` - // Minimum execution time: 42_526_000 picoseconds. - Weight::from_parts(43_552_000, 0) - .saturating_add(Weight::from_parts(0, 6192)) + // Measured: `179` + // Estimated: `6126` + // Minimum execution time: 39_353_000 picoseconds. + Weight::from_parts(40_007_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Treasury::Spends` (r:1 w:1) /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) @@ -163,8 +164,8 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `116` // Estimated: `3526` - // Minimum execution time: 8_915_000 picoseconds. - Weight::from_parts(9_287_000, 0) + // Minimum execution time: 8_674_000 picoseconds. + Weight::from_parts(9_085_000, 0) .saturating_add(Weight::from_parts(0, 3526)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -175,8 +176,8 @@ impl<T: frame_system::Config> pallet_treasury::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `116` // Estimated: `3526` - // Minimum execution time: 7_955_000 picoseconds. - Weight::from_parts(8_849_000, 0) + // Minimum execution time: 7_806_000 picoseconds. + Weight::from_parts(8_262_000, 0) .saturating_add(Weight::from_parts(0, 3526)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/common/src/weights/pallet_universal_dividend.rs b/runtime/common/src/weights/pallet_universal_dividend.rs index b2e5d7650e0a06bbfd7206b6b720096283f99b84..4b55f1df54b2b22dcd86909a1987838b6a6d463a 100644 --- a/runtime/common/src/weights/pallet_universal_dividend.rs +++ b/runtime/common/src/weights/pallet_universal_dividend.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_universal_dividend` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -56,62 +56,60 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn /// Storage: `UniversalDividend::PastReevals` (r:1 w:0) /// Proof: `UniversalDividend::PastReevals` (`max_values`: Some(1), `max_size`: Some(1602), added: 2097, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) /// The range of component `i` is `[1, 160]`. fn claim_uds(_i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `644` - // Estimated: `4109` - // Minimum execution time: 25_591_000 picoseconds. - Weight::from_parts(27_628_958, 0) - .saturating_add(Weight::from_parts(0, 4109)) + // Measured: `643` + // Estimated: `4108` + // Minimum execution time: 25_256_000 picoseconds. + Weight::from_parts(27_602_699, 0) + .saturating_add(Weight::from_parts(0, 4108)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `UniversalDividend::CurrentUd` (r:1 w:0) /// Proof: `UniversalDividend::CurrentUd` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn transfer_ud() -> Weight { // Proof Size summary in bytes: - // Measured: `157` - // Estimated: `6192` - // Minimum execution time: 47_742_000 picoseconds. - Weight::from_parts(49_561_000, 0) - .saturating_add(Weight::from_parts(0, 6192)) + // Measured: `156` + // Estimated: `6126` + // Minimum execution time: 45_184_000 picoseconds. + Weight::from_parts(46_638_000, 0) + .saturating_add(Weight::from_parts(0, 6126)) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `UniversalDividend::CurrentUd` (r:1 w:0) /// Proof: `UniversalDividend::CurrentUd` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) fn transfer_ud_keep_alive() -> Weight { // Proof Size summary in bytes: // Measured: `93` - // Estimated: `3591` - // Minimum execution time: 34_158_000 picoseconds. - Weight::from_parts(35_312_000, 0) - .saturating_add(Weight::from_parts(0, 3591)) + // Estimated: `3558` + // Minimum execution time: 32_351_000 picoseconds. + Weight::from_parts(33_166_000, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `UniversalDividend::CurrentUdIndex` (r:1 w:0) /// Proof: `UniversalDividend::CurrentUdIndex` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) /// Storage: `UniversalDividend::PastReevals` (r:1 w:0) /// Proof: `UniversalDividend::PastReevals` (`max_values`: Some(1), `max_size`: Some(1602), added: 2097, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(126), added: 2601, mode: `MaxEncodedLen`) - /// The range of component `i` is `[0, 160]`. - fn on_removed_member(i: u32, ) -> Weight { + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// The range of component `i` is `[1, 160]`. + fn on_removed_member(_i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `215` - // Estimated: `3591` - // Minimum execution time: 3_240_000 picoseconds. - Weight::from_parts(14_149_848, 0) - .saturating_add(Weight::from_parts(0, 3591)) - // Standard Error: 1_525 - .saturating_add(Weight::from_parts(5_772, 0).saturating_mul(i.into())) + // Measured: `181` + // Estimated: `3558` + // Minimum execution time: 13_259_000 picoseconds. + Weight::from_parts(14_743_097, 0) + .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_upgrade_origin.rs b/runtime/common/src/weights/pallet_upgrade_origin.rs index 287a8b650adc67dffaff94e7cc5cb7ff8d8e4ca9..84d6dd584d02b082fc8593fe539834f7055d606c 100644 --- a/runtime/common/src/weights/pallet_upgrade_origin.rs +++ b/runtime/common/src/weights/pallet_upgrade_origin.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_upgrade_origin` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -51,8 +51,8 @@ impl<T: frame_system::Config> pallet_upgrade_origin::WeightInfo for WeightInfo<T // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_982_000 picoseconds. - Weight::from_parts(28_253_000, 0) + // Minimum execution time: 4_788_000 picoseconds. + Weight::from_parts(5_082_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index 3bbc0e50f65454c7168465298b36bd9b597444d3..a8f75d976bbd7a1d6605df18292bf09d89dd3073 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -17,18 +17,18 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-22, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `squirrel`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: -// ./target/release/duniter +// target/release/duniter // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=* // --extrinsic=* // --wasm-execution=compiled @@ -52,18 +52,18 @@ impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_177_000 picoseconds. - Weight::from_parts(11_674_500, 0) + // Minimum execution time: 3_581_000 picoseconds. + Weight::from_parts(7_374_359, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 27_396 - .saturating_add(Weight::from_parts(5_373_642, 0).saturating_mul(c.into())) + // Standard Error: 1_632 + .saturating_add(Weight::from_parts(2_118_997, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_509_000 picoseconds. - Weight::from_parts(9_706_000, 0) + // Minimum execution time: 3_024_000 picoseconds. + Weight::from_parts(3_208_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -71,18 +71,18 @@ impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_566_000 picoseconds. - Weight::from_parts(11_745_000, 0) + // Minimum execution time: 3_473_000 picoseconds. + Weight::from_parts(8_353_428, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 186_645 - .saturating_add(Weight::from_parts(5_786_628, 0).saturating_mul(c.into())) + // Standard Error: 996 + .saturating_add(Weight::from_parts(2_259_350, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 20_582_000 picoseconds. - Weight::from_parts(29_829_000, 0) + // Minimum execution time: 4_885_000 picoseconds. + Weight::from_parts(5_109_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -90,10 +90,10 @@ impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_326_000 picoseconds. - Weight::from_parts(13_269_000, 0) + // Minimum execution time: 3_429_000 picoseconds. + Weight::from_parts(7_728_963, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 721_799 - .saturating_add(Weight::from_parts(6_123_784, 0).saturating_mul(c.into())) + // Standard Error: 2_171 + .saturating_add(Weight::from_parts(2_117_531, 0).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/paritydb_weights.rs b/runtime/common/src/weights/paritydb_weights.rs index 4673b94b3907f7761eb255fbaeb2131346cd0efd..816d3c4492b132367bc173bde73c9e48f678d468 100644 --- a/runtime/common/src/weights/paritydb_weights.rs +++ b/runtime/common/src/weights/paritydb_weights.rs @@ -1,6 +1,6 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-24 (Y/M/D) +//! DATE: 2024-02-04 (Y/M/D) //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F` //! //! DATABASE: `ParityDb`, RUNTIME: `Ğdev Local Testnet` @@ -33,31 +33,31 @@ pub mod constants { /// Calculated by multiplying the *Average* of all values with `2.0` and adding `0`. /// /// Stats nanoseconds: - /// Min, Max: 951, 1_277_318 - /// Average: 11_592 - /// Median: 1_567 - /// Std-Dev: 111445.56 + /// Min, Max: 1_030, 1_712_222 + /// Average: 15_060 + /// Median: 1_860 + /// Std-Dev: 148855.15 /// /// Percentiles nanoseconds: - /// 99th: 10_193 - /// 95th: 2_928 - /// 75th: 1_855 - read: 23_184 * constants::WEIGHT_REF_TIME_PER_NANOS, + /// 99th: 13_285 + /// 95th: 2_804 + /// 75th: 2_239 + read: 30_120 * constants::WEIGHT_REF_TIME_PER_NANOS, /// Time to write one storage item. /// Calculated by multiplying the *Average* of all values with `2.0` and adding `0`. /// /// Stats nanoseconds: - /// Min, Max: 3_824, 6_440_944 - /// Average: 58_440 - /// Median: 8_907 - /// Std-Dev: 561954.34 + /// Min, Max: 3_902, 6_736_518 + /// Average: 60_761 + /// Median: 9_435 + /// Std-Dev: 585511.43 /// /// Percentiles nanoseconds: - /// 99th: 18_256 - /// 95th: 13_376 - /// 75th: 10_858 - write: 116_880 * constants::WEIGHT_REF_TIME_PER_NANOS, + /// 99th: 23_963 + /// 95th: 13_938 + /// 75th: 11_295 + write: 121_522 * constants::WEIGHT_REF_TIME_PER_NANOS, }; } diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml index fb0cc12856fead6e4bbf4e841cbd3eb95a95ffc7..76c98358b332ebbdd5e5289daf76d18bf2a39775 100644 --- a/runtime/g1/Cargo.toml +++ b/runtime/g1/Cargo.toml @@ -1,244 +1,236 @@ [package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'g1-runtime' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "g1-runtime" +repository.workspace = true +version.workspace = true + + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] -constant-fees = ['common-runtime/constant-fees'] +default = ["std"] +constant-fees = ["common-runtime/constant-fees"] runtime-benchmarks = [ - 'common-runtime/runtime-benchmarks', - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system-benchmarking', - 'frame-system/runtime-benchmarks', - 'pallet-authority-members/runtime-benchmarks', - 'pallet-smith-members/runtime-benchmarks', - 'pallet-babe/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', - 'pallet-certification/runtime-benchmarks', - 'pallet-collective/runtime-benchmarks', - 'pallet-distance/runtime-benchmarks', - 'pallet-duniter-test-parameters/runtime-benchmarks', - 'pallet-duniter-account/runtime-benchmarks', - 'pallet-quota/runtime-benchmarks', - 'pallet-duniter-wot/runtime-benchmarks', - 'pallet-grandpa/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-provide-randomness/runtime-benchmarks', - 'pallet-im-online/runtime-benchmarks', - 'pallet-multisig/runtime-benchmarks', - 'pallet-oneshot-account/runtime-benchmarks', - 'pallet-preimage/runtime-benchmarks', - 'pallet-session-benchmarking/runtime-benchmarks', - 'pallet-proxy/runtime-benchmarks', - 'pallet-scheduler/runtime-benchmarks', - 'pallet-sudo/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'pallet-treasury/runtime-benchmarks', - 'pallet-universal-dividend/runtime-benchmarks', - 'pallet-upgrade-origin/runtime-benchmarks', - 'pallet-utility/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "common-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-authority-members/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-certification/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "pallet-duniter-account/runtime-benchmarks", + "pallet-duniter-wot/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "pallet-oneshot-account/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-provide-randomness/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-quota/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-session-benchmarking/runtime-benchmarks", + "pallet-smith-members/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-universal-dividend/runtime-benchmarks", + "pallet-upgrade-origin/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ - 'codec/std', - 'common-runtime/std', - 'frame-benchmarking/std', - 'frame-executive/std', - 'frame-support/std', - 'frame-system/std', - 'frame-system-benchmarking/std', - 'frame-system-rpc-runtime-api/std', - "frame-try-runtime/std", - 'log/std', - 'pallet-atomic-swap/std', - 'pallet-authority-discovery/std', - 'pallet-authority-members/std', - "pallet-authorship/std", - 'pallet-babe/std', - 'pallet-balances/std', - 'pallet-certification/std', - 'pallet-collective/std', - 'pallet-distance/std', - 'pallet-duniter-account/std', - 'pallet-duniter-test-parameters/std', - 'pallet-duniter-wot/std', - 'pallet-grandpa/std', - 'pallet-identity/std', - 'pallet-im-online/std', - 'pallet-membership/std', - 'pallet-multisig/std', - "pallet-offences/std", - 'pallet-oneshot-account/std', - 'pallet-preimage/std', - 'pallet-provide-randomness/std', - 'pallet-proxy/std', - 'pallet-quota/std', - 'pallet-multisig/std', - "pallet-scheduler/std", - 'pallet-session/std', - 'pallet-session-benchmarking/std', - 'pallet-smith-members/std', - 'pallet-sudo/std', - 'pallet-timestamp/std', - 'pallet-transaction-payment/std', - 'pallet-transaction-payment-rpc-runtime-api/std', - 'pallet-treasury/std', - 'pallet-universal-dividend/std', - 'pallet-upgrade-origin/std', - 'pallet-utility/std', - 'scale-info/std', - "serde/std", - "serde_derive", - 'sp-api/std', - 'sp-arithmetic/std', - 'sp-authority-discovery/std', - 'sp-block-builder/std', - 'sp-consensus-babe/std', - 'sp-consensus-grandpa/std', - 'sp-core/std', - 'sp-distance/std', - 'sp-inherents/std', - 'sp-membership/std', - 'sp-offchain/std', - 'sp-runtime/std', - 'sp-session/std', - 'sp-std/std', - 'sp-transaction-pool/std', - 'sp-version/std', - 'sp-staking/std', - 'node-primitives/std', - 'substrate-wasm-builder', + "codec/std", + "common-runtime/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-benchmarking/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "log/std", + "node-primitives/std", + "pallet-atomic-swap/std", + "pallet-authority-discovery/std", + "pallet-authority-members/std", + "pallet-authorship/std", + "pallet-babe/std", + "pallet-balances/std", + "pallet-certification/std", + "pallet-collective/std", + "pallet-distance/std", + "pallet-duniter-account/std", + "pallet-duniter-wot/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-offences/std", + "pallet-oneshot-account/std", + "pallet-preimage/std", + "pallet-provide-randomness/std", + "pallet-proxy/std", + "pallet-quota/std", + "pallet-scheduler/std", + "pallet-session-benchmarking/std", + "pallet-session/std", + "pallet-smith-members/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-universal-dividend/std", + "pallet-upgrade-origin/std", + "pallet-utility/std", + "scale-info/std", + "serde/std", + "serde_derive", + "sp-api/std", + "sp-arithmetic/std", + "sp-authority-discovery/std", + "sp-block-builder/std", + "sp-consensus-babe/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-distance/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-membership/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-staking/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "substrate-wasm-builder", ] try-runtime = [ - 'common-runtime/try-runtime', - 'frame-executive/try-runtime', - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'frame-try-runtime/try-runtime', - 'pallet-atomic-swap/try-runtime', - 'pallet-authority-discovery/try-runtime', - 'pallet-authority-members/try-runtime', - "pallet-authorship/try-runtime", - 'pallet-babe/try-runtime', - 'pallet-balances/try-runtime', - 'pallet-certification/try-runtime', - 'pallet-collective/try-runtime', - 'pallet-distance/try-runtime', - 'pallet-duniter-account/try-runtime', - 'pallet-duniter-test-parameters/try-runtime', - 'pallet-duniter-wot/try-runtime', - 'pallet-grandpa/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-im-online/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-offences/try-runtime", - 'pallet-oneshot-account/try-runtime', - 'pallet-preimage/try-runtime', - 'pallet-provide-randomness/try-runtime', - 'pallet-proxy/try-runtime', - 'pallet-quota/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-scheduler/try-runtime", - 'pallet-session/try-runtime', - 'pallet-smith-members/try-runtime', - 'pallet-sudo/try-runtime', - 'pallet-timestamp/try-runtime', - 'pallet-transaction-payment/try-runtime', - 'pallet-treasury/try-runtime', - 'pallet-universal-dividend/try-runtime', - 'pallet-upgrade-origin/try-runtime', - 'pallet-utility/try-runtime', + "common-runtime/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-atomic-swap/try-runtime", + "pallet-authority-discovery/try-runtime", + "pallet-authority-members/try-runtime", + "pallet-authorship/try-runtime", + "pallet-babe/try-runtime", + "pallet-balances/try-runtime", + "pallet-certification/try-runtime", + "pallet-collective/try-runtime", + "pallet-distance/try-runtime", + "pallet-duniter-account/try-runtime", + "pallet-duniter-wot/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-identity/try-runtime", + "pallet-im-online/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-offences/try-runtime", + "pallet-oneshot-account/try-runtime", + "pallet-preimage/try-runtime", + "pallet-provide-randomness/try-runtime", + "pallet-proxy/try-runtime", + "pallet-quota/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session-benchmarking/try-runtime", + "pallet-session/try-runtime", + "pallet-smith-members/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-universal-dividend/try-runtime", + "pallet-upgrade-origin/try-runtime", + "pallet-utility/try-runtime", + "sp-distance/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] [dev-dependencies] -sp-keyring = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-staking = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/duniter/duniter-polkadot-sdk", optional = true , branch = "duniter-substrate-v1.6.0" } +substrate-wasm-builder = { workspace = true, optional = true } [dependencies] - -# crates.io -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -# local -common-runtime = { path = "../common", default-features = false } - -# substrate benchmarking -frame-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = false } -frame-executive = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -# substrate -frame-try-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -hex-literal = { version = '0.4.1', default-features = false, optional = true } -log = { version = "0.4.20", default-features = false } -pallet-atomic-swap = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-members = { path = '../../pallets/authority-members', default-features = false } -pallet-authorship = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-certification = { path = '../../pallets/certification', default-features = false } -pallet-collective = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-distance = { path = "../../pallets/distance", default-features = false } -pallet-duniter-account = { path = '../../pallets/duniter-account', default-features = false } -pallet-duniter-test-parameters = { path = '../../pallets/duniter-test-parameters', default-features = false } -pallet-duniter-wot = { path = '../../pallets/duniter-wot', default-features = false } -pallet-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-identity = { path = '../../pallets/identity', default-features = false } -pallet-im-online = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-membership = { path = '../../pallets/membership', default-features = false } -pallet-multisig = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-offences = { path = '../../pallets/offences', default-features = false } -pallet-oneshot-account = { path = '../../pallets/oneshot-account', default-features = false } -pallet-preimage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-provide-randomness = { path = '../../pallets/provide-randomness', default-features = false } -pallet-proxy = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-quota = { path = '../../pallets/quota', default-features = false } -pallet-scheduler = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session-benchmarking = { path = '../../pallets/session-benchmarking', default-features = false } -pallet-smith-members = { path = '../../pallets/smith-members', default-features = false } -pallet-sudo = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-treasury = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-universal-dividend = { path = '../../pallets/universal-dividend', default-features = false } -pallet-upgrade-origin = { path = '../../pallets/upgrade-origin', default-features = false } -pallet-utility = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", default-features = false } -serde_derive = { version = "1.0.195", default-features = false, optional = true } -sp-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-arithmetic = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-block-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-distance = { path = '../../primitives/distance', default-features = false } -sp-inherents = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-membership = { path = '../../primitives/membership', default-features = false } -sp-offchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-transaction-pool = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-version = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -node-primitives = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +codec = { workspace = true, features = ["derive"] } +common-runtime = { workspace = true } +frame-executive = { workspace = true } +pallet-session-benchmarking = { workspace = true } +frame-support = { workspace = true } +frame-benchmarking = { workspace = true } +frame-system-benchmarking = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +pallet-atomic-swap = { workspace = true } +pallet-authority-discovery = { workspace = true } +pallet-authority-members = { workspace = true } +pallet-authorship = { workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +pallet-certification = { workspace = true } +pallet-collective = { workspace = true } +pallet-distance = { workspace = true } +pallet-duniter-account = { workspace = true } +pallet-duniter-wot = { workspace = true } +pallet-grandpa = { workspace = true } +pallet-identity = { workspace = true } +pallet-im-online = { workspace = true } +pallet-membership = { workspace = true } +pallet-multisig = { workspace = true } +pallet-offences = { workspace = true } +pallet-oneshot-account = { workspace = true } +pallet-preimage = { workspace = true } +pallet-provide-randomness = { workspace = true } +pallet-proxy = { workspace = true } +pallet-quota = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-smith-members = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-universal-dividend = { workspace = true } +pallet-upgrade-origin = { workspace = true } +pallet-utility = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true } +serde_derive = { workspace = true, optional = true } +sp-api = { workspace = true } +sp-arithmetic = { workspace = true } +sp-authority-discovery = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-grandpa = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-inherents = { workspace = true } +sp-membership = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +node-primitives = { workspace = true } +sp-genesis-builder = { workspace = true } diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index 7a10663810dbfe38ba98afa6ae2e4ea641ced8cd..ef804b7e94e0c75568108ba79655475c39aa64ea 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -1,247 +1,242 @@ [package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'gdev-runtime' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "gdev-runtime" +repository.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] -constant-fees = ['common-runtime/constant-fees'] +default = ["std"] +constant-fees = ["common-runtime/constant-fees"] runtime-benchmarks = [ - 'common-runtime/runtime-benchmarks', - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system-benchmarking/runtime-benchmarks', - 'frame-system/runtime-benchmarks', - 'pallet-authority-members/runtime-benchmarks', - 'pallet-smith-members/runtime-benchmarks', - 'pallet-babe/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', - 'pallet-certification/runtime-benchmarks', - 'pallet-collective/runtime-benchmarks', - 'pallet-distance/runtime-benchmarks', - 'pallet-duniter-test-parameters/runtime-benchmarks', - 'pallet-duniter-account/runtime-benchmarks', - 'pallet-quota/runtime-benchmarks', - 'pallet-duniter-wot/runtime-benchmarks', - 'pallet-grandpa/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-provide-randomness/runtime-benchmarks', - 'pallet-im-online/runtime-benchmarks', - 'pallet-multisig/runtime-benchmarks', - 'pallet-oneshot-account/runtime-benchmarks', - 'pallet-preimage/runtime-benchmarks', - 'pallet-session-benchmarking/runtime-benchmarks', - 'pallet-proxy/runtime-benchmarks', - 'pallet-scheduler/runtime-benchmarks', - 'pallet-sudo/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'pallet-treasury/runtime-benchmarks', - 'pallet-universal-dividend/runtime-benchmarks', - 'pallet-upgrade-origin/runtime-benchmarks', - 'pallet-utility/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "common-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-authority-members/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-certification/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "pallet-duniter-account/runtime-benchmarks", + "pallet-duniter-test-parameters/runtime-benchmarks", + "pallet-duniter-wot/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "pallet-oneshot-account/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-provide-randomness/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-quota/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-session-benchmarking/runtime-benchmarks", + "pallet-smith-members/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-universal-dividend/runtime-benchmarks", + "pallet-upgrade-origin/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-try-runtime?/std', - 'common-runtime/std', - 'frame-benchmarking?/std', - 'frame-executive/std', - 'frame-support/std', - 'frame-system/std', - 'frame-system-benchmarking?/std', - 'frame-system-rpc-runtime-api/std', - "frame-try-runtime/std", - 'log/std', - 'pallet-atomic-swap/std', - 'pallet-authority-discovery/std', - 'pallet-authority-members/std', - "pallet-authorship/std", - 'pallet-babe/std', - 'pallet-balances/std', - 'pallet-certification/std', - 'pallet-collective/std', - 'pallet-distance/std', - 'pallet-duniter-account/std', - 'pallet-duniter-test-parameters/std', - 'pallet-duniter-wot/std', - 'pallet-grandpa/std', - 'pallet-identity/std', - 'pallet-im-online/std', - 'pallet-membership/std', - 'pallet-multisig/std', - "pallet-offences/std", - 'pallet-oneshot-account/std', - 'pallet-preimage/std', - 'pallet-provide-randomness/std', - 'pallet-proxy/std', - 'pallet-quota/std', - 'pallet-multisig/std', - "pallet-scheduler/std", - 'pallet-session/std', - 'pallet-session-benchmarking/std', - 'pallet-smith-members/std', - 'pallet-sudo/std', - 'pallet-timestamp/std', - 'pallet-transaction-payment/std', - 'pallet-transaction-payment-rpc-runtime-api/std', - 'pallet-treasury/std', - 'pallet-universal-dividend/std', - 'pallet-upgrade-origin/std', - 'pallet-utility/std', - 'scale-info/std', - "serde/std", - "serde_derive", - 'sp-api/std', - 'sp-arithmetic/std', - 'sp-authority-discovery/std', - 'sp-block-builder/std', - 'sp-consensus-babe/std', - 'sp-consensus-grandpa/std', - 'sp-core/std', - 'sp-distance/std', - 'sp-inherents/std', - 'sp-membership/std', - 'sp-offchain/std', - 'sp-runtime/std', - 'sp-session/std', - 'sp-std/std', - 'sp-transaction-pool/std', - 'sp-version/std', - 'sp-staking/std', - 'sp-io/std', - 'node-primitives/std', - 'substrate-wasm-builder', + "codec/std", + "common-runtime/std", + "frame-benchmarking?/std", + "frame-executive/std", + "frame-support/std", + "frame-system-benchmarking/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "log/std", + "node-primitives/std", + "pallet-atomic-swap/std", + "pallet-authority-discovery/std", + "pallet-authority-members/std", + "pallet-authorship/std", + "pallet-babe/std", + "pallet-balances/std", + "pallet-certification/std", + "pallet-collective/std", + "pallet-distance/std", + "pallet-duniter-account/std", + "pallet-duniter-test-parameters/std", + "pallet-duniter-wot/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-offences/std", + "pallet-oneshot-account/std", + "pallet-preimage/std", + "pallet-provide-randomness/std", + "pallet-proxy/std", + "pallet-quota/std", + "pallet-scheduler/std", + "pallet-session-benchmarking/std", + "pallet-session/std", + "pallet-smith-members/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-universal-dividend/std", + "pallet-upgrade-origin/std", + "pallet-utility/std", + "scale-info/std", + "serde/std", + "serde_derive", + "sp-api/std", + "sp-arithmetic/std", + "sp-authority-discovery/std", + "sp-block-builder/std", + "sp-consensus-babe/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-distance/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-io/std", + "sp-membership/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-staking/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "substrate-wasm-builder", ] try-runtime = [ - 'common-runtime/try-runtime', - 'frame-executive/try-runtime', - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'frame-try-runtime/try-runtime', - 'pallet-atomic-swap/try-runtime', - 'pallet-authority-discovery/try-runtime', - 'pallet-authority-members/try-runtime', - "pallet-authorship/try-runtime", - 'pallet-babe/try-runtime', - 'pallet-balances/try-runtime', - 'pallet-certification/try-runtime', - 'pallet-collective/try-runtime', - 'pallet-distance/try-runtime', - 'pallet-duniter-account/try-runtime', - 'pallet-duniter-test-parameters/try-runtime', - 'pallet-duniter-wot/try-runtime', - 'pallet-grandpa/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-im-online/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-offences/try-runtime", - 'pallet-oneshot-account/try-runtime', - 'pallet-preimage/try-runtime', - 'pallet-provide-randomness/try-runtime', - 'pallet-proxy/try-runtime', - 'pallet-quota/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-scheduler/try-runtime", - 'pallet-session/try-runtime', - 'pallet-smith-members/try-runtime', - 'pallet-sudo/try-runtime', - 'pallet-timestamp/try-runtime', - 'pallet-transaction-payment/try-runtime', - 'pallet-treasury/try-runtime', - 'pallet-universal-dividend/try-runtime', - 'pallet-upgrade-origin/try-runtime', - 'pallet-utility/try-runtime', + "common-runtime/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-atomic-swap/try-runtime", + "pallet-authority-discovery/try-runtime", + "pallet-authority-members/try-runtime", + "pallet-authorship/try-runtime", + "pallet-babe/try-runtime", + "pallet-balances/try-runtime", + "pallet-certification/try-runtime", + "pallet-collective/try-runtime", + "pallet-distance/try-runtime", + "pallet-duniter-account/try-runtime", + "pallet-duniter-test-parameters/try-runtime", + "pallet-duniter-wot/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-identity/try-runtime", + "pallet-im-online/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-offences/try-runtime", + "pallet-oneshot-account/try-runtime", + "pallet-preimage/try-runtime", + "pallet-provide-randomness/try-runtime", + "pallet-proxy/try-runtime", + "pallet-quota/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session-benchmarking/try-runtime", + "pallet-session/try-runtime", + "pallet-smith-members/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-universal-dividend/try-runtime", + "pallet-upgrade-origin/try-runtime", + "pallet-utility/try-runtime", + "sp-distance/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] [dev-dependencies] -sp-keyring = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-io = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-io = { workspace = true } +sp-keyring = { workspace = true } +sp-staking = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/duniter/duniter-polkadot-sdk", optional = true , branch = "duniter-substrate-v1.6.0" } +substrate-wasm-builder = { workspace = true, optional = true } [dependencies] - -# crates.io -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -# local -common-runtime = { path = "../common", default-features = false } - -# substrate benchmarking -frame-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-executive = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -# substrate -frame-try-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -hex-literal = { version = '0.4.1', default-features = false, optional = true } -log = { version = "0.4.20", default-features = false } -pallet-atomic-swap = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-members = { path = '../../pallets/authority-members', default-features = false } -pallet-authorship = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-certification = { path = '../../pallets/certification', default-features = false } -pallet-collective = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-distance = { path = "../../pallets/distance", default-features = false } -pallet-duniter-account = { path = '../../pallets/duniter-account', default-features = false } -pallet-duniter-test-parameters = { path = '../../pallets/duniter-test-parameters', default-features = false } -pallet-duniter-wot = { path = '../../pallets/duniter-wot', default-features = false } -pallet-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-identity = { path = '../../pallets/identity', default-features = false } -pallet-im-online = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-membership = { path = '../../pallets/membership', default-features = false } -pallet-multisig = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-offences = { path = '../../pallets/offences', default-features = false } -pallet-oneshot-account = { path = '../../pallets/oneshot-account', default-features = false } -pallet-preimage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-provide-randomness = { path = '../../pallets/provide-randomness', default-features = false } -pallet-proxy = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-quota = { path = '../../pallets/quota', default-features = false } -pallet-scheduler = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session-benchmarking = { path = '../../pallets/session-benchmarking', default-features = false } -pallet-smith-members = { path = '../../pallets/smith-members', default-features = false } -pallet-sudo = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-treasury = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-universal-dividend = { path = '../../pallets/universal-dividend', default-features = false } -pallet-upgrade-origin = { path = '../../pallets/upgrade-origin', default-features = false } -pallet-utility = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", default-features = false } -serde_derive = { version = "1.0.195", default-features = false, optional = true } -sp-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-arithmetic = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-block-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-distance = { path = '../../primitives/distance', default-features = false } -sp-inherents = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-membership = { path = '../../primitives/membership', default-features = false } -sp-offchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-transaction-pool = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-version = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -node-primitives = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +codec = { workspace = true, features = ["derive"] } +common-runtime = { workspace = true } +frame-benchmarking = { workspace = true, optional = true } +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-system-rpc-runtime-api = { workspace = true } +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +node-primitives = { workspace = true } +pallet-atomic-swap = { workspace = true } +pallet-authority-discovery = { workspace = true } +pallet-authority-members = { workspace = true } +pallet-authorship = { workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +pallet-certification = { workspace = true } +pallet-collective = { workspace = true } +pallet-distance = { workspace = true } +pallet-duniter-account = { workspace = true } +pallet-duniter-test-parameters = { workspace = true } +pallet-duniter-wot = { workspace = true } +pallet-grandpa = { workspace = true } +pallet-identity = { workspace = true } +pallet-im-online = { workspace = true } +pallet-membership = { workspace = true } +pallet-multisig = { workspace = true } +pallet-offences = { workspace = true } +pallet-oneshot-account = { workspace = true } +pallet-preimage = { workspace = true } +pallet-provide-randomness = { workspace = true } +pallet-proxy = { workspace = true } +pallet-quota = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-session-benchmarking = { workspace = true } +pallet-smith-members = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-universal-dividend = { workspace = true } +pallet-upgrade-origin = { workspace = true } +pallet-utility = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true } +serde_derive = { workspace = true, optional = true } +sp-api = { workspace = true } +sp-arithmetic = { workspace = true } +sp-authority-discovery = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-grandpa = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-genesis-builder = { workspace = true } +sp-inherents = { workspace = true } +sp-membership = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index e77cd68094e0ec18fdaabc0fa2761badd98b1e99..43902ada745d0e748d13e69fc3d881e448043610 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -94,7 +94,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 800, + spec_version: 801, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/gdev/tests/integration_tests.rs b/runtime/gdev/tests/integration_tests.rs index 4f0b442f02922e3c08b0685c1a90d201367cea7e..3864d3a012d39f363b9c8c0b42c2b5279672804b 100644 --- a/runtime/gdev/tests/integration_tests.rs +++ b/runtime/gdev/tests/integration_tests.rs @@ -246,6 +246,7 @@ fn test_session_change() { ExtBuilder::new(1, 3, 4).build().execute_with(|| { assert_eq!(<Runtime as pallet_babe::Config>::EpochDuration::get(), 25); assert_eq!(Session::current_index(), 0); + assert_eq!(SmithMembers::current_session(), 0); assert_eq!(Babe::epoch_index(), 0); assert_eq!(Babe::current_epoch_start(), 0u64); run_to_block(2); @@ -253,33 +254,42 @@ fn test_session_change() { assert_eq!(Babe::epoch_index(), 0); run_to_block(24); assert_eq!(Session::current_index(), 0); + assert_eq!(SmithMembers::current_session(), 0); assert_eq!(Babe::epoch_index(), 0); run_to_block(25); assert_eq!(Session::current_index(), 1); + assert_eq!(SmithMembers::current_session(), 1); assert_eq!(Babe::epoch_index(), 1); assert_eq!(Babe::current_epoch_start(), 25u64); run_to_block(26); assert_eq!(Session::current_index(), 1); + assert_eq!(SmithMembers::current_session(), 1); assert_eq!(Babe::epoch_index(), 1); run_to_block(50); assert_eq!(Session::current_index(), 2); + assert_eq!(SmithMembers::current_session(), 2); assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::current_epoch_start(), 50u64); run_to_block(51); assert_eq!(Session::current_index(), 2); + assert_eq!(SmithMembers::current_session(), 2); assert_eq!(Babe::epoch_index(), 2); run_to_block(52); assert_eq!(Session::current_index(), 2); + assert_eq!(SmithMembers::current_session(), 2); assert_eq!(Babe::epoch_index(), 2); run_to_block(60); assert_eq!(Session::current_index(), 2); + assert_eq!(SmithMembers::current_session(), 2); assert_eq!(Babe::epoch_index(), 2); assert_eq!(Babe::current_epoch_start(), 50u64); run_to_block(75); assert_eq!(Session::current_index(), 3); + assert_eq!(SmithMembers::current_session(), 3); assert_eq!(Babe::epoch_index(), 3); run_to_block(100); assert_eq!(Session::current_index(), 4); + assert_eq!(SmithMembers::current_session(), 4); assert_eq!(Babe::epoch_index(), 4); }) } diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml index 9c7a497a0d1ba271cc7254a036cb73e06c0f8d64..2b7cbbcc1edcc490efac4a91f96e4d980a7d180d 100644 --- a/runtime/gtest/Cargo.toml +++ b/runtime/gtest/Cargo.toml @@ -1,244 +1,238 @@ [package] -authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -edition = "2021" -homepage = 'https://duniter.org' -license = 'AGPL-3.0' -name = 'gtest-runtime' -repository = 'https://git.duniter.org/nodes/rust/duniter-v2s' -version = '3.0.0' +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "gtest-runtime" +repository.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] [features] -default = ['std'] -constant-fees = ['common-runtime/constant-fees'] +default = ["std"] +constant-fees = ["common-runtime/constant-fees"] runtime-benchmarks = [ - 'common-runtime/runtime-benchmarks', - 'frame-benchmarking/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system-benchmarking', - 'frame-system/runtime-benchmarks', - 'pallet-authority-members/runtime-benchmarks', - 'pallet-smith-members/runtime-benchmarks', - 'pallet-babe/runtime-benchmarks', - 'pallet-balances/runtime-benchmarks', - 'pallet-certification/runtime-benchmarks', - 'pallet-collective/runtime-benchmarks', - 'pallet-distance/runtime-benchmarks', - 'pallet-duniter-test-parameters/runtime-benchmarks', - 'pallet-duniter-account/runtime-benchmarks', - 'pallet-quota/runtime-benchmarks', - 'pallet-duniter-wot/runtime-benchmarks', - 'pallet-grandpa/runtime-benchmarks', - 'pallet-identity/runtime-benchmarks', - 'pallet-membership/runtime-benchmarks', - 'pallet-provide-randomness/runtime-benchmarks', - 'pallet-im-online/runtime-benchmarks', - 'pallet-multisig/runtime-benchmarks', - 'pallet-oneshot-account/runtime-benchmarks', - 'pallet-preimage/runtime-benchmarks', - 'pallet-session-benchmarking/runtime-benchmarks', - 'pallet-proxy/runtime-benchmarks', - 'pallet-scheduler/runtime-benchmarks', - 'pallet-sudo/runtime-benchmarks', - 'pallet-timestamp/runtime-benchmarks', - 'pallet-treasury/runtime-benchmarks', - 'pallet-universal-dividend/runtime-benchmarks', - 'pallet-upgrade-origin/runtime-benchmarks', - 'pallet-utility/runtime-benchmarks', - 'sp-runtime/runtime-benchmarks', + "common-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-authority-members/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-certification/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-distance/runtime-benchmarks", + "pallet-duniter-account/runtime-benchmarks", + "pallet-duniter-wot/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-membership/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "pallet-oneshot-account/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-provide-randomness/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-quota/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-session-benchmarking/runtime-benchmarks", + "pallet-smith-members/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-universal-dividend/runtime-benchmarks", + "pallet-upgrade-origin/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", ] std = [ - 'codec/std', - 'common-runtime/std', - 'frame-benchmarking/std', - 'frame-executive/std', - 'frame-support/std', - 'frame-system/std', - 'frame-system-benchmarking/std', - 'frame-system-rpc-runtime-api/std', - "frame-try-runtime/std", - 'log/std', - 'pallet-atomic-swap/std', - 'pallet-authority-discovery/std', - 'pallet-authority-members/std', - "pallet-authorship/std", - 'pallet-babe/std', - 'pallet-balances/std', - 'pallet-certification/std', - 'pallet-collective/std', - 'pallet-distance/std', - 'pallet-duniter-account/std', - 'pallet-duniter-test-parameters/std', - 'pallet-duniter-wot/std', - 'pallet-grandpa/std', - 'pallet-identity/std', - 'pallet-im-online/std', - 'pallet-membership/std', - 'pallet-multisig/std', - "pallet-offences/std", - 'pallet-oneshot-account/std', - 'pallet-preimage/std', - 'pallet-provide-randomness/std', - 'pallet-proxy/std', - 'pallet-quota/std', - 'pallet-multisig/std', - "pallet-scheduler/std", - 'pallet-session/std', - 'pallet-session-benchmarking/std', - 'pallet-smith-members/std', - 'pallet-sudo/std', - 'pallet-timestamp/std', - 'pallet-transaction-payment/std', - 'pallet-transaction-payment-rpc-runtime-api/std', - 'pallet-treasury/std', - 'pallet-universal-dividend/std', - 'pallet-upgrade-origin/std', - 'pallet-utility/std', - 'scale-info/std', - "serde/std", - "serde_derive", - 'sp-api/std', - 'sp-arithmetic/std', - 'sp-authority-discovery/std', - 'sp-block-builder/std', - 'sp-consensus-babe/std', - 'sp-consensus-grandpa/std', - 'sp-core/std', - 'sp-distance/std', - 'sp-inherents/std', - 'sp-membership/std', - 'sp-offchain/std', - 'sp-runtime/std', - 'sp-session/std', - 'sp-std/std', - 'sp-transaction-pool/std', - 'sp-version/std', - 'sp-staking/std', - 'node-primitives/std', - 'substrate-wasm-builder', + "codec/std", + "common-runtime/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-benchmarking/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime?/std", + "log/std", + "node-primitives/std", + "pallet-atomic-swap/std", + "pallet-authority-discovery/std", + "pallet-authority-members/std", + "pallet-authorship/std", + "pallet-babe/std", + "pallet-balances/std", + "pallet-certification/std", + "pallet-collective/std", + "pallet-distance/std", + "pallet-duniter-account/std", + "pallet-duniter-wot/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-offences/std", + "pallet-oneshot-account/std", + "pallet-preimage/std", + "pallet-provide-randomness/std", + "pallet-proxy/std", + "pallet-quota/std", + "pallet-scheduler/std", + "pallet-session-benchmarking/std", + "pallet-session/std", + "pallet-smith-members/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-universal-dividend/std", + "pallet-upgrade-origin/std", + "pallet-utility/std", + "scale-info/std", + "serde/std", + "serde_derive", + "sp-api/std", + "sp-arithmetic/std", + "sp-authority-discovery/std", + "sp-block-builder/std", + "sp-consensus-babe/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-distance/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-membership/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-staking/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "substrate-wasm-builder", ] try-runtime = [ - 'common-runtime/try-runtime', - 'frame-executive/try-runtime', - 'frame-support/try-runtime', - 'frame-system/try-runtime', - 'frame-try-runtime/try-runtime', - 'pallet-atomic-swap/try-runtime', - 'pallet-authority-discovery/try-runtime', - 'pallet-authority-members/try-runtime', - "pallet-authorship/try-runtime", - 'pallet-babe/try-runtime', - 'pallet-balances/try-runtime', - 'pallet-certification/try-runtime', - 'pallet-collective/try-runtime', - 'pallet-distance/try-runtime', - 'pallet-duniter-account/try-runtime', - 'pallet-duniter-test-parameters/try-runtime', - 'pallet-duniter-wot/try-runtime', - 'pallet-grandpa/try-runtime', - 'pallet-identity/try-runtime', - 'pallet-im-online/try-runtime', - 'pallet-membership/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-offences/try-runtime", - 'pallet-oneshot-account/try-runtime', - 'pallet-preimage/try-runtime', - 'pallet-provide-randomness/try-runtime', - 'pallet-proxy/try-runtime', - 'pallet-quota/try-runtime', - 'pallet-multisig/try-runtime', - "pallet-scheduler/try-runtime", - 'pallet-session/try-runtime', - 'pallet-smith-members/try-runtime', - 'pallet-sudo/try-runtime', - 'pallet-timestamp/try-runtime', - 'pallet-transaction-payment/try-runtime', - 'pallet-treasury/try-runtime', - 'pallet-universal-dividend/try-runtime', - 'pallet-upgrade-origin/try-runtime', - 'pallet-utility/try-runtime', + "common-runtime/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime?/try-runtime", + "pallet-atomic-swap/try-runtime", + "pallet-authority-discovery/try-runtime", + "pallet-authority-members/try-runtime", + "pallet-authorship/try-runtime", + "pallet-babe/try-runtime", + "pallet-balances/try-runtime", + "pallet-certification/try-runtime", + "pallet-collective/try-runtime", + "pallet-distance/try-runtime", + "pallet-duniter-account/try-runtime", + "pallet-duniter-wot/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-identity/try-runtime", + "pallet-im-online/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-offences/try-runtime", + "pallet-oneshot-account/try-runtime", + "pallet-preimage/try-runtime", + "pallet-provide-randomness/try-runtime", + "pallet-proxy/try-runtime", + "pallet-quota/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session-benchmarking/try-runtime", + "pallet-session/try-runtime", + "pallet-smith-members/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-universal-dividend/try-runtime", + "pallet-upgrade-origin/try-runtime", + "pallet-utility/try-runtime", + "sp-distance/try-runtime", + "sp-membership/try-runtime", + "sp-runtime/try-runtime", ] [dev-dependencies] -sp-keyring = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-staking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } +sp-staking = { workspace = true } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/duniter/duniter-polkadot-sdk", optional = true , branch = "duniter-substrate-v1.6.0" } +substrate-wasm-builder = { workspace = true, optional = true } [dependencies] - -# crates.io -codec = { package = "parity-scale-codec", version = "3.6.9", features = ["derive"], default-features = false } -# local -common-runtime = { path = "../common", default-features = false } - -# substrate benchmarking -frame-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = false } -frame-executive = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-support = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -frame-system-benchmarking = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -# substrate -frame-try-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false, optional = true } -hex-literal = { version = '0.4.1', default-features = false, optional = true } -log = { version = "0.4.20", default-features = false } -pallet-atomic-swap = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-authority-members = { path = '../../pallets/authority-members', default-features = false } -pallet-authorship = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-balances = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-certification = { path = '../../pallets/certification', default-features = false } -pallet-collective = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-distance = { path = "../../pallets/distance", default-features = false } -pallet-duniter-account = { path = '../../pallets/duniter-account', default-features = false } -pallet-duniter-test-parameters = { path = '../../pallets/duniter-test-parameters', default-features = false } -pallet-duniter-wot = { path = '../../pallets/duniter-wot', default-features = false } -pallet-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-identity = { path = '../../pallets/identity', default-features = false } -pallet-im-online = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-membership = { path = '../../pallets/membership', default-features = false } -pallet-multisig = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-offences = { path = '../../pallets/offences', default-features = false } -pallet-oneshot-account = { path = '../../pallets/oneshot-account', default-features = false } -pallet-preimage = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-provide-randomness = { path = '../../pallets/provide-randomness', default-features = false } -pallet-proxy = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-quota = { path = '../../pallets/quota', default-features = false } -pallet-scheduler = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-session-benchmarking = { path = '../../pallets/session-benchmarking', default-features = false } -pallet-smith-members = { path = '../../pallets/smith-members', default-features = false } -pallet-sudo = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-timestamp = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-treasury = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -pallet-universal-dividend = { path = '../../pallets/universal-dividend', default-features = false } -pallet-upgrade-origin = { path = '../../pallets/upgrade-origin', default-features = false } -pallet-utility = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", default-features = false } -serde_derive = { version = "1.0.195", default-features = false, optional = true } -sp-api = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-arithmetic = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-authority-discovery = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-block-builder = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-babe = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-consensus-grandpa = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-core = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-distance = { path = '../../primitives/distance', default-features = false } -sp-inherents = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-membership = { path = '../../primitives/membership', default-features = false } -sp-offchain = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-runtime = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-session = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-std = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-transaction-pool = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -sp-version = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } -node-primitives = { git = 'https://github.com/duniter/duniter-polkadot-sdk', branch = 'duniter-substrate-v1.6.0', default-features = false } - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +common-runtime = { workspace = true } +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } +hex-literal = { workspace = true, optional = true } +pallet-session-benchmarking = { workspace = true } +log = { workspace = true } +pallet-atomic-swap = { workspace = true } +pallet-authority-discovery = { workspace = true } +pallet-authority-members = { workspace = true } +pallet-authorship = { workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +pallet-certification = { workspace = true } +pallet-collective = { workspace = true } +pallet-distance = { workspace = true } +frame-benchmarking = { workspace = true } +frame-system-benchmarking = { workspace = true } +pallet-duniter-account = { workspace = true } +pallet-duniter-wot = { workspace = true } +pallet-grandpa = { workspace = true } +pallet-identity = { workspace = true } +pallet-im-online = { workspace = true } +pallet-membership = { workspace = true } +pallet-multisig = { workspace = true } +pallet-offences = { workspace = true } +pallet-oneshot-account = { workspace = true } +pallet-preimage = { workspace = true } +pallet-provide-randomness = { workspace = true } +pallet-proxy = { workspace = true } +pallet-quota = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-session = { workspace = true } +pallet-smith-members = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-universal-dividend = { workspace = true } +pallet-upgrade-origin = { workspace = true } +pallet-utility = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true } +serde_derive = { workspace = true, optional = true } +sp-api = { workspace = true } +sp-arithmetic = { workspace = true } +sp-authority-discovery = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-grandpa = { workspace = true } +sp-core = { workspace = true } +sp-distance = { workspace = true } +sp-inherents = { workspace = true } +sp-membership = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +sp-genesis-builder = { workspace = true } +node-primitives = { workspace = true } +codec = { workspace = true, features = ["derive"] } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5e98fede28ca46517d26e8496c6493b4ea4a4acd..259cec803ea4691f467d1a1f4c489c0102725d6b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2023-10-31" +channel = "nightly-2024-02-08" components = [ "rustfmt", "clippy", "rust-std", "cargo", "rust-src" ] targets = [ "wasm32-unknown-unknown" ] profile = "minimal" diff --git a/scripts/check_metadata.sh b/scripts/check_metadata.sh index 96b2c47209a8bdb75c96a993004a6a787a90afd9..69bd92b6f755a18b7945df0d1766bd051902352a 100755 --- a/scripts/check_metadata.sh +++ b/scripts/check_metadata.sh @@ -2,8 +2,8 @@ cargo install subxt-cli cargo build -cargo run -- --dev& -sleep 15 +target/debug/duniter --dev& +sleep 20 subxt metadata -f bytes > resources/new_metadata.scale kill $! diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index c996fece88646766487b5a81bf37b01513e4e270..4226040fdcbd1b576f9d3179994e17ca04fb785a 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,10 +1,10 @@ [package] -authors = ["elois <elois@duniter.org>"] +authors.workspace = true description = "Duniter-v2s xtask" -edition = "2021" -license = "AGPL-3.0" +edition.workspace = true +license.workspace = true name = "xtask" -repository = "https://git.duniter.org/nodes/rust/duniter-v2s" +repository.workspace = true version = "0.1.0" [[bin]] @@ -13,22 +13,23 @@ path = "src/main.rs" name = "xtask" [dependencies] -anyhow = "1.0.32" -clap = { version = "4.0", features = ["derive"] } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "full", "bit-vec"] } -frame-metadata = "16.0.0" -graphql_client = "0.10.0" -hex = "0.4" -memmap2 = "0.5.0" -placeholder = "1.1.3" -reqwest = { version = "0.11.11", features = ["json"] } -run_script = "0.6.3" -scale-info = { version = "2.1.1", features = ["bit-vec"] } -scale-value = "0.13.0" -serde = { version = "1.0.101", features = ["derive"] } -serde_json = "1.0" -tera = { version = "1", default-features = false } -tokio = { version = "1.24.2", features = ["macros"] } -version-compare = "0.0.11" -version_check = "0.9.2" -weight-analyzer = { path = "../resources/weight_analyzer" } +anyhow = { workspace = true } +clap = { workspace = true, features = ["derive"] } +codec = { workspace = true, features = ["derive", "full", "bit-vec"] } +frame-metadata = { workspace = true } +graphql_client = { workspace = true } +hex = { workspace = true } +memmap2 = { workspace = true } +placeholder = { workspace = true } +reqwest = { workspace = true, features = ["json"] } +scale-info = { workspace = true, features = ["bit-vec"] } +scale-value = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +tera = { workspace = true } +tokio = { workspace = true, features = ["macros"] } +version_check = { workspace = true } +weight-analyzer = { workspace = true } + +[features] +std = []