From 1b1783106d8ce1299c9141f5d764fb049b604284 Mon Sep 17 00:00:00 2001
From: bgallois <benjamin@gallois.cc>
Date: Thu, 8 Feb 2024 20:36:29 +0100
Subject: [PATCH] fix features propagation

---
 Cargo.lock                                 |  1 +
 client/distance/Cargo.toml                 | 25 ++++++++++--
 distance-oracle/Cargo.toml                 |  1 +
 end2end-tests/Cargo.toml                   |  1 +
 live-tests/Cargo.toml                      |  5 +++
 node/Cargo.toml                            | 47 ++++++++++++++++++++++
 pallets/authority-members/Cargo.toml       |  4 ++
 pallets/certification/Cargo.toml           |  1 +
 pallets/distance/Cargo.toml                |  1 +
 pallets/duniter-test-parameters/Cargo.toml |  1 +
 pallets/oneshot-account/Cargo.toml         |  2 +
 pallets/quota/Cargo.toml                   |  1 +
 pallets/session-benchmarking/Cargo.toml    | 16 +++++++-
 pallets/smith-members/Cargo.toml           |  2 +
 pallets/universal-dividend/Cargo.toml      |  2 +
 pallets/upgrade-origin/Cargo.toml          |  3 ++
 primitives/distance/Cargo.toml             |  1 +
 primitives/membership/Cargo.toml           |  1 +
 resources/weight_analyzer/Cargo.toml       |  3 ++
 runtime/common/Cargo.toml                  |  9 +++++
 runtime/g1/Cargo.toml                      |  6 +++
 runtime/gdev/Cargo.toml                    |  4 +-
 runtime/gdev/rust-toolchain.toml           |  5 +++
 runtime/gtest/Cargo.toml                   |  8 ++++
 xtask/Cargo.toml                           |  3 ++
 25 files changed, 147 insertions(+), 6 deletions(-)
 create mode 100644 runtime/gdev/rust-toolchain.toml

diff --git a/Cargo.lock b/Cargo.lock
index a91a12338..e95d90212 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11722,6 +11722,7 @@ dependencies = [
  "async-trait",
  "clap",
  "frame-remote-externalities",
+ "frame-try-runtime",
  "hex",
  "log",
  "parity-scale-codec",
diff --git a/client/distance/Cargo.toml b/client/distance/Cargo.toml
index c699d5775..92c4926d9 100644
--- a/client/distance/Cargo.toml
+++ b/client/distance/Cargo.toml
@@ -12,9 +12,28 @@ repository.workspace = true
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-std = [ "pallet-distance/std", "sp-distance/std" ]
-runtime-benchmarks = [ 'pallet-distance/runtime-benchmarks' ]
-try-runtime = [ 'pallet-distance/try-runtime', 'sp-distance/try-runtime' ]
+std = [
+	"pallet-distance/std",
+	"sp-distance/std",
+	"frame-support/std",
+	"log/std",
+	"codec/std",
+	"scale-info/std",
+	"sp-core/std",
+	"sp-keystore/std",
+	"sp-runtime/std"
+]
+runtime-benchmarks = [
+	'pallet-distance/runtime-benchmarks',
+	"frame-support/runtime-benchmarks",
+	"sp-runtime/runtime-benchmarks"
+]
+try-runtime = [
+	'pallet-distance/try-runtime',
+	'sp-distance/try-runtime',
+	"frame-support/try-runtime",
+	"sp-runtime/try-runtime"
+]
 
 [dependencies]
 codec = { workspace = true, features = ['derive'] }
diff --git a/distance-oracle/Cargo.toml b/distance-oracle/Cargo.toml
index 09f3f529f..949edee05 100644
--- a/distance-oracle/Cargo.toml
+++ b/distance-oracle/Cargo.toml
@@ -24,6 +24,7 @@ std = [
 	'sp-runtime/std',
 ]
 try-runtime = [ 'sp-distance/try-runtime', "sp-runtime/try-runtime" ]
+runtime-benchmarks = []
 
 [dependencies]
 clap = { workspace = true, features = ['derive'], optional = true }
diff --git a/end2end-tests/Cargo.toml b/end2end-tests/Cargo.toml
index 5bf23fc55..1f55fc819 100644
--- a/end2end-tests/Cargo.toml
+++ b/end2end-tests/Cargo.toml
@@ -26,6 +26,7 @@ std = [
 ]
 standalone = ['distance-oracle/standalone']
 try-runtime = ['distance-oracle/try-runtime', "sp-runtime/try-runtime"]
+runtime-benchmarks = []
 
 [dev-dependencies]
 anyhow = { workspace = true }
diff --git a/live-tests/Cargo.toml b/live-tests/Cargo.toml
index 49112b42f..a941468ab 100644
--- a/live-tests/Cargo.toml
+++ b/live-tests/Cargo.toml
@@ -21,3 +21,8 @@ subxt = { workspace = true, features = [
     '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
index 6fa1e7e30..9d822b1f1 100644
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -37,6 +37,14 @@ runtime-benchmarks = [
 	'gdev-runtime/runtime-benchmarks',
 	'gtest-runtime/runtime-benchmarks',
 	'sc-client-db/runtime-benchmarks',
+	"frame-benchmarking/runtime-benchmarks",
+	"frame-benchmarking-cli/runtime-benchmarks",
+	"frame-system/runtime-benchmarks",
+	"pallet-grandpa/runtime-benchmarks",
+	"pallet-im-online/runtime-benchmarks",
+	"pallet-treasury/runtime-benchmarks",
+	"sc-service/runtime-benchmarks",
+	"sp-runtime/runtime-benchmarks"
 ]
 try-runtime = [
 	'common-runtime/try-runtime',
@@ -48,6 +56,13 @@ try-runtime = [
 	'sp-distance/try-runtime',
 	'sp-membership/try-runtime',
 	'try-runtime-cli',
+	"frame-system/try-runtime",
+	"pallet-grandpa/try-runtime",
+	"pallet-im-online/try-runtime",
+	"pallet-transaction-payment/try-runtime",
+	"pallet-treasury/try-runtime",
+	"sp-runtime/try-runtime",
+	"try-runtime-cli?/try-runtime"
 ]
 std = [
 	'common-runtime/std',
@@ -58,6 +73,38 @@ std = [
 	'gtest-runtime/std',
 	'sp-distance/std',
 	'sp-membership/std',
+	"bs58/std",
+	"frame-benchmarking/std",
+	"frame-system/std",
+	"futures/std",
+	"hex/std",
+	"log/std",
+	"num-format/std",
+	"pallet-grandpa/std",
+	"pallet-im-online/std",
+	"pallet-transaction-payment/std",
+	"pallet-transaction-payment-rpc-runtime-api/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-inherents/std",
+	"sp-io/std",
+	"sp-keystore/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' ]
 
diff --git a/pallets/authority-members/Cargo.toml b/pallets/authority-members/Cargo.toml
index 5c1c304a8..223f031ca 100644
--- a/pallets/authority-members/Cargo.toml
+++ b/pallets/authority-members/Cargo.toml
@@ -14,6 +14,10 @@ default = ['std']
 runtime-benchmarks = [
 	'frame-benchmarking/runtime-benchmarks',
 	'pallet-offences/runtime-benchmarks',
+	"frame-support/runtime-benchmarks",
+	"frame-system/runtime-benchmarks",
+	"sp-runtime/runtime-benchmarks",
+	"sp-staking/runtime-benchmarks"
 ]
 std = [
 	'codec/std',
diff --git a/pallets/certification/Cargo.toml b/pallets/certification/Cargo.toml
index 19f8a24d9..62c5288d8 100644
--- a/pallets/certification/Cargo.toml
+++ b/pallets/certification/Cargo.toml
@@ -28,6 +28,7 @@ std = [
 	'sp-io/std',
 	'sp-runtime/std',
 	'sp-std/std',
+	"sp-keystore/std"
 ]
 try-runtime = [
 	'duniter-primitives/try-runtime',
diff --git a/pallets/distance/Cargo.toml b/pallets/distance/Cargo.toml
index 17a1c2962..b81ab2271 100644
--- a/pallets/distance/Cargo.toml
+++ b/pallets/distance/Cargo.toml
@@ -39,6 +39,7 @@ std = [
 	'sp-keystore/std',
 	'sp-runtime/std',
 	'sp-std/std',
+	"getrandom/std"
 ]
 try-runtime = [
 	'frame-support/try-runtime',
diff --git a/pallets/duniter-test-parameters/Cargo.toml b/pallets/duniter-test-parameters/Cargo.toml
index 27a744431..399392deb 100644
--- a/pallets/duniter-test-parameters/Cargo.toml
+++ b/pallets/duniter-test-parameters/Cargo.toml
@@ -26,6 +26,7 @@ std = [
 	'sp-io/std',
 	'sp-runtime/std',
 	'sp-std/std',
+	"sp-core/std"
 ]
 try-runtime = [
 	'frame-support/try-runtime',
diff --git a/pallets/oneshot-account/Cargo.toml b/pallets/oneshot-account/Cargo.toml
index 90982465f..b049b9e65 100644
--- a/pallets/oneshot-account/Cargo.toml
+++ b/pallets/oneshot-account/Cargo.toml
@@ -23,6 +23,8 @@ try-runtime = [
 	'frame-system/try-runtime',
 	'pallet-balances/runtime-benchmarks',
 	'sp-runtime/try-runtime',
+	"pallet-balances/try-runtime",
+	"pallet-transaction-payment/try-runtime"
 ]
 std = [
 	'codec/std',
diff --git a/pallets/quota/Cargo.toml b/pallets/quota/Cargo.toml
index ac65a11cf..77cf59d85 100644
--- a/pallets/quota/Cargo.toml
+++ b/pallets/quota/Cargo.toml
@@ -26,6 +26,7 @@ try-runtime = [
 	'pallet-identity/runtime-benchmarks',
 	'pallet-identity/try-runtime',
 	'sp-runtime/try-runtime',
+	"pallet-balances/try-runtime"
 ]
 std = [
 	'codec/std',
diff --git a/pallets/session-benchmarking/Cargo.toml b/pallets/session-benchmarking/Cargo.toml
index 6cdfbe887..89df8fb00 100644
--- a/pallets/session-benchmarking/Cargo.toml
+++ b/pallets/session-benchmarking/Cargo.toml
@@ -22,9 +22,21 @@ codec = { workspace = true }
 
 [features]
 default = ['std']
-std = ['frame-benchmarking?/std', 'frame-system/std', 'pallet-session/std']
-try-runtime = ['frame-system/try-runtime', 'pallet-session/try-runtime']
+std = [
+	'frame-benchmarking?/std',
+	'frame-system/std',
+	'pallet-session/std',
+	"codec/std",
+	"sp-runtime/std",
+	"sp-std/std"
+]
+try-runtime = [
+	'frame-system/try-runtime',
+	'pallet-session/try-runtime',
+	"sp-runtime/try-runtime"
+]
 runtime-benchmarks = [
 	'frame-benchmarking/runtime-benchmarks',
 	'frame-system/runtime-benchmarks',
+	"sp-runtime/runtime-benchmarks"
 ]
diff --git a/pallets/smith-members/Cargo.toml b/pallets/smith-members/Cargo.toml
index 60518b35a..e26a02668 100644
--- a/pallets/smith-members/Cargo.toml
+++ b/pallets/smith-members/Cargo.toml
@@ -42,6 +42,8 @@ std = [
 	'sp-runtime/std',
 	'sp-staking/std',
 	'sp-std/std',
+	"sp-core/std",
+	"sp-io/std"
 ]
 runtime-benchmarks = [
 	'frame-benchmarking/runtime-benchmarks',
diff --git a/pallets/universal-dividend/Cargo.toml b/pallets/universal-dividend/Cargo.toml
index 89918bdfd..cb4104fa0 100644
--- a/pallets/universal-dividend/Cargo.toml
+++ b/pallets/universal-dividend/Cargo.toml
@@ -24,6 +24,8 @@ try-runtime = [
 	'pallet-balances/runtime-benchmarks',
 	'pallet-timestamp/runtime-benchmarks',
 	'sp-runtime/try-runtime',
+	"pallet-balances/try-runtime",
+	"pallet-timestamp/try-runtime"
 ]
 std = [
 	'codec/std',
diff --git a/pallets/upgrade-origin/Cargo.toml b/pallets/upgrade-origin/Cargo.toml
index c6400ea84..b357af7d1 100644
--- a/pallets/upgrade-origin/Cargo.toml
+++ b/pallets/upgrade-origin/Cargo.toml
@@ -15,6 +15,7 @@ runtime-benchmarks = [
 	'frame-support/runtime-benchmarks',
 	'frame-system/runtime-benchmarks',
 	'sp-runtime/runtime-benchmarks',
+	"sp-staking/runtime-benchmarks"
 ]
 try-runtime = [
 	'frame-support/try-runtime',
@@ -30,6 +31,8 @@ std = [
 	'sp-io/std',
 	'sp-runtime/std',
 	'sp-std/std',
+	"sp-core/std",
+	"sp-staking/std"
 ]
 
 [package.metadata.docs.rs]
diff --git a/primitives/distance/Cargo.toml b/primitives/distance/Cargo.toml
index 31e8881ed..c4ff9b976 100644
--- a/primitives/distance/Cargo.toml
+++ b/primitives/distance/Cargo.toml
@@ -27,6 +27,7 @@ std = [
 	'thiserror',
 ]
 try-runtime = ['frame-support/try-runtime', 'sp-runtime/try-runtime']
+runtime-benchmarks = []
 
 [dependencies]
 async-trait = { workspace = true, optional = true }
diff --git a/primitives/membership/Cargo.toml b/primitives/membership/Cargo.toml
index 85e2a928e..1f1e73b98 100644
--- a/primitives/membership/Cargo.toml
+++ b/primitives/membership/Cargo.toml
@@ -24,6 +24,7 @@ std = [
 	'sp-std/std',
 ]
 try-runtime = ['frame-support/try-runtime', 'sp-runtime/try-runtime']
+runtime-benchmarks = []
 
 [dependencies]
 
diff --git a/resources/weight_analyzer/Cargo.toml b/resources/weight_analyzer/Cargo.toml
index 8186fe48b..fb1b3e443 100644
--- a/resources/weight_analyzer/Cargo.toml
+++ b/resources/weight_analyzer/Cargo.toml
@@ -16,3 +16,6 @@ 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 7b0b8c79e..cf2e5c2e1 100644
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -39,6 +39,13 @@ runtime-benchmarks = [
 	'pallet-universal-dividend/runtime-benchmarks',
 	'pallet-upgrade-origin/runtime-benchmarks',
 	'sp-runtime/runtime-benchmarks',
+	"frame-benchmarking/runtime-benchmarks",
+	"pallet-grandpa/runtime-benchmarks",
+	"pallet-scheduler/runtime-benchmarks",
+	"pallet-sudo/runtime-benchmarks",
+	"pallet-timestamp/runtime-benchmarks",
+	"pallet-utility/runtime-benchmarks",
+	"sp-staking/runtime-benchmarks"
 ]
 std = [
 	'codec/std',
@@ -83,6 +90,7 @@ std = [
 	'sp-staking/std',
 	'sp-std/std',
 	'sp-weights/std',
+	"frame-benchmarking/std"
 ]
 try-runtime = [
 	'duniter-primitives/try-runtime',
@@ -116,6 +124,7 @@ try-runtime = [
 	'pallet-upgrade-origin/try-runtime',
 	'pallet-utility/try-runtime',
 	'sp-membership/try-runtime',
+	"sp-runtime/try-runtime"
 ]
 
 [dependencies]
diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml
index 4f5bc1cbd..f5307d478 100644
--- a/runtime/g1/Cargo.toml
+++ b/runtime/g1/Cargo.toml
@@ -47,6 +47,9 @@ runtime-benchmarks = [
 	'pallet-upgrade-origin/runtime-benchmarks',
 	'pallet-utility/runtime-benchmarks',
 	'sp-runtime/runtime-benchmarks',
+	"frame-benchmarking/runtime-benchmarks",
+	"frame-system-benchmarking/runtime-benchmarks",
+	"sp-staking/runtime-benchmarks"
 ]
 std = [
 	'codec/std',
@@ -113,6 +116,8 @@ std = [
 	'sp-transaction-pool/std',
 	'sp-version/std',
 	'substrate-wasm-builder',
+	"frame-benchmarking/std",
+	"frame-system-benchmarking/std"
 ]
 try-runtime = [
 	'common-runtime/try-runtime',
@@ -154,6 +159,7 @@ try-runtime = [
 	'pallet-utility/try-runtime',
 	'sp-distance/try-runtime',
 	'sp-membership/try-runtime',
+	"sp-runtime/try-runtime"
 ]
 
 [dev-dependencies]
diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml
index 659173854..ba7d980d0 100644
--- a/runtime/gdev/Cargo.toml
+++ b/runtime/gdev/Cargo.toml
@@ -49,6 +49,7 @@ runtime-benchmarks = [
 	'pallet-upgrade-origin/runtime-benchmarks',
 	'pallet-utility/runtime-benchmarks',
 	'sp-runtime/runtime-benchmarks',
+	"sp-staking/runtime-benchmarks"
 ]
 std = [
 	'codec/std',
@@ -56,7 +57,7 @@ std = [
 	'frame-benchmarking?/std',
 	'frame-executive/std',
 	'frame-support/std',
-	'frame-system-benchmarking?/std',
+	'frame-system-benchmarking/std',
 	'frame-system-rpc-runtime-api/std',
 	'frame-system/std',
 	'log/std',
@@ -161,6 +162,7 @@ try-runtime = [
 	'pallet-utility/try-runtime',
 	'sp-distance/try-runtime',
 	'sp-membership/try-runtime',
+	"sp-runtime/try-runtime"
 ]
 
 [dev-dependencies]
diff --git a/runtime/gdev/rust-toolchain.toml b/runtime/gdev/rust-toolchain.toml
new file mode 100644
index 000000000..c2110c273
--- /dev/null
+++ b/runtime/gdev/rust-toolchain.toml
@@ -0,0 +1,5 @@
+[toolchain]
+channel = "1.74"
+components = [ "rustfmt", "clippy", "rust-std", "cargo", "rust-src" ]
+targets = [ "wasm32-unknown-unknown" ]
+profile = "minimal"
diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml
index 1c4e20f13..27e50eb63 100644
--- a/runtime/gtest/Cargo.toml
+++ b/runtime/gtest/Cargo.toml
@@ -46,6 +46,9 @@ runtime-benchmarks = [
 	'pallet-upgrade-origin/runtime-benchmarks',
 	'pallet-utility/runtime-benchmarks',
 	'sp-runtime/runtime-benchmarks',
+	"frame-benchmarking/runtime-benchmarks",
+	"frame-system-benchmarking/runtime-benchmarks",
+	"sp-staking/runtime-benchmarks"
 ]
 std = [
 	'codec/std',
@@ -112,6 +115,9 @@ std = [
 	'sp-transaction-pool/std',
 	'sp-version/std',
 	'substrate-wasm-builder',
+	"frame-benchmarking/std",
+	"frame-system-benchmarking/std",
+	"frame-try-runtime?/std"
 ]
 try-runtime = [
 	'common-runtime/try-runtime',
@@ -153,6 +159,8 @@ try-runtime = [
 	'pallet-utility/try-runtime',
 	'sp-distance/try-runtime',
 	'sp-membership/try-runtime',
+	"frame-try-runtime?/try-runtime",
+	"sp-runtime/try-runtime"
 ]
 
 [dev-dependencies]
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
index 87d44067f..de3844d52 100644
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -30,3 +30,6 @@ tera = { workspace = true }
 tokio = { workspace = true, features = ['macros'] }
 version_check =  { workspace = true }
 weight-analyzer = { workspace = true }
+
+[features]
+std = []
-- 
GitLab