diff --git a/Cargo.lock b/Cargo.lock
index 0a9e201290a50..3d51a0fb1ffa4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1189,9 +1189,9 @@ dependencies = [
[[package]]
name = "cfg-expr"
-version = "0.15.2"
+version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e70d3ad08698a0568b0562f22710fe6bfc1f4a61a367c77d0398c562eadd453a"
+checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9"
dependencies = [
"smallvec",
]
@@ -1440,9 +1440,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "comfy-table"
-version = "7.0.0"
+version = "7.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9e1f7e5d046697d34b593bdba8ee31f4649366e452a2ccabb3baf3511e503d1"
+checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b"
dependencies = [
"strum",
"strum_macros",
@@ -2915,6 +2915,7 @@ dependencies = [
"frame-support",
"frame-system",
"frame-try-runtime",
+ "log",
"pallet-balances",
"pallet-transaction-payment",
"parity-scale-codec",
@@ -2994,12 +2995,14 @@ dependencies = [
"sp-genesis-builder",
"sp-inherents",
"sp-io",
+ "sp-metadata-ir",
"sp-runtime",
"sp-staking",
"sp-state-machine",
"sp-std",
"sp-tracing",
"sp-weights",
+ "static_assertions",
"tt-call",
]
@@ -3046,6 +3049,7 @@ version = "3.0.0"
dependencies = [
"frame-benchmarking",
"frame-executive",
+ "frame-metadata",
"frame-support",
"frame-support-test-pallet",
"frame-system",
@@ -3058,6 +3062,7 @@ dependencies = [
"sp-arithmetic",
"sp-core",
"sp-io",
+ "sp-metadata-ir",
"sp-runtime",
"sp-state-machine",
"sp-std",
@@ -3708,33 +3713,19 @@ dependencies = [
[[package]]
name = "hyper-rustls"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
-dependencies = [
- "http",
- "hyper",
- "log",
- "rustls 0.20.8",
- "rustls-native-certs",
- "tokio",
- "tokio-rustls 0.23.4",
- "webpki-roots",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.24.0"
+version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7"
+checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97"
dependencies = [
+ "futures-util",
"http",
"hyper",
"log",
- "rustls 0.21.1",
+ "rustls 0.21.6",
"rustls-native-certs",
"tokio",
- "tokio-rustls 0.24.0",
+ "tokio-rustls",
+ "webpki-roots 0.23.1",
]
[[package]]
@@ -4050,9 +4041,9 @@ dependencies = [
[[package]]
name = "jsonrpsee"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e"
+checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b"
dependencies = [
"jsonrpsee-core",
"jsonrpsee-http-client",
@@ -4065,9 +4056,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-client-transport"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb"
+checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a"
dependencies = [
"futures-util",
"http",
@@ -4078,17 +4069,17 @@ dependencies = [
"soketto",
"thiserror",
"tokio",
- "tokio-rustls 0.23.4",
+ "tokio-rustls",
"tokio-util",
"tracing",
- "webpki-roots",
+ "webpki-roots 0.25.2",
]
[[package]]
name = "jsonrpsee-core"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b"
+checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803"
dependencies = [
"anyhow",
"arrayvec 0.7.2",
@@ -4114,13 +4105,13 @@ dependencies = [
[[package]]
name = "jsonrpsee-http-client"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad"
+checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43"
dependencies = [
"async-trait",
"hyper",
- "hyper-rustls 0.23.2",
+ "hyper-rustls",
"jsonrpsee-core",
"jsonrpsee-types",
"rustc-hash",
@@ -4133,9 +4124,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-proc-macros"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c"
+checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a"
dependencies = [
"heck",
"proc-macro-crate",
@@ -4146,9 +4137,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-server"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc"
+checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba"
dependencies = [
"futures-channel",
"futures-util",
@@ -4168,9 +4159,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-types"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c"
+checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5"
dependencies = [
"anyhow",
"beef",
@@ -4182,9 +4173,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-ws-client"
-version = "0.16.2"
+version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9"
+checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e"
dependencies = [
"http",
"jsonrpsee-client-transport",
@@ -4252,6 +4243,7 @@ dependencies = [
"pallet-bags-list",
"pallet-balances",
"pallet-bounties",
+ "pallet-broker",
"pallet-child-bounties",
"pallet-collective",
"pallet-contracts",
@@ -4290,6 +4282,7 @@ dependencies = [
"pallet-referenda",
"pallet-remark",
"pallet-root-testing",
+ "pallet-safe-mode",
"pallet-salary",
"pallet-scheduler",
"pallet-session",
@@ -4307,6 +4300,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api",
"pallet-transaction-storage",
"pallet-treasury",
+ "pallet-tx-pause",
"pallet-uniques",
"pallet-utility",
"pallet-vesting",
@@ -4328,6 +4322,7 @@ dependencies = [
"sp-staking",
"sp-statement-store",
"sp-std",
+ "sp-storage",
"sp-transaction-pool",
"sp-version",
"static_assertions",
@@ -4387,9 +4382,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
[[package]]
name = "libc"
-version = "0.2.145"
+version = "0.2.147"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81"
+checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
[[package]]
name = "libloading"
@@ -4816,7 +4811,7 @@ dependencies = [
"rw-stream-sink",
"soketto",
"url",
- "webpki-roots",
+ "webpki-roots 0.22.6",
]
[[package]]
@@ -5835,6 +5830,7 @@ dependencies = [
"sp-runtime",
"sp-session",
"sp-std",
+ "sp-storage",
"sp-transaction-pool",
"sp-version",
"substrate-wasm-builder",
@@ -6203,6 +6199,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
+ "log",
"pallet-balances",
"parity-scale-codec",
"scale-info",
@@ -6233,6 +6230,7 @@ version = "4.0.0-dev"
dependencies = [
"frame-support",
"frame-system",
+ "log",
"pallet-timestamp",
"parity-scale-codec",
"scale-info",
@@ -6378,6 +6376,7 @@ dependencies = [
"frame-election-provider-support",
"frame-support",
"frame-system",
+ "log",
"pallet-authorship",
"pallet-balances",
"pallet-offences",
@@ -6394,6 +6393,7 @@ dependencies = [
"sp-runtime",
"sp-session",
"sp-staking",
+ "sp-state-machine",
"sp-std",
]
@@ -6418,6 +6418,7 @@ dependencies = [
"sp-io",
"sp-runtime",
"sp-staking",
+ "sp-state-machine",
"sp-std",
]
@@ -6439,6 +6440,23 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-broker"
+version = "0.1.0"
+dependencies = [
+ "bitvec",
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-child-bounties"
version = "4.0.0-dev"
@@ -6681,6 +6699,7 @@ dependencies = [
"parity-scale-codec",
"sp-npos-elections",
"sp-runtime",
+ "sp-std",
]
[[package]]
@@ -6989,6 +7008,7 @@ dependencies = [
"frame-support",
"frame-system",
"itertools",
+ "log",
"parity-scale-codec",
"scale-info",
"sp-core",
@@ -7257,6 +7277,7 @@ dependencies = [
"scale-info",
"sp-core",
"sp-io",
+ "sp-metadata-ir",
"sp-runtime",
"sp-std",
]
@@ -7412,6 +7433,25 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-safe-mode"
+version = "4.0.0-dev"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-proxy",
+ "pallet-utility",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-arithmetic",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-salary"
version = "4.0.0-dev"
@@ -7480,6 +7520,7 @@ dependencies = [
"sp-runtime",
"sp-session",
"sp-staking",
+ "sp-state-machine",
"sp-std",
"sp-trie",
]
@@ -7654,6 +7695,7 @@ dependencies = [
"sp-core",
"sp-io",
"sp-runtime",
+ "sp-std",
]
[[package]]
@@ -7671,6 +7713,7 @@ dependencies = [
"sp-io",
"sp-runtime",
"sp-std",
+ "sp-storage",
"sp-timestamp",
]
@@ -7777,6 +7820,24 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-tx-pause"
+version = "4.0.0-dev"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-proxy",
+ "pallet-utility",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-uniques"
version = "4.0.0-dev"
@@ -9033,13 +9094,13 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.21.1"
+version = "0.21.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e"
+checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb"
dependencies = [
"log",
"ring 0.16.20",
- "rustls-webpki",
+ "rustls-webpki 0.101.4",
"sct 0.7.0",
]
@@ -9066,9 +9127,19 @@ dependencies = [
[[package]]
name = "rustls-webpki"
-version = "0.100.1"
+version = "0.100.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab"
+dependencies = [
+ "ring 0.16.20",
+ "untrusted",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.101.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
+checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d"
dependencies = [
"ring 0.16.20",
"untrusted",
@@ -10061,7 +10132,7 @@ dependencies = [
"futures",
"futures-timer",
"hyper",
- "hyper-rustls 0.24.0",
+ "hyper-rustls",
"lazy_static",
"libp2p",
"log",
@@ -12479,9 +12550,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tar"
-version = "0.4.38"
+version = "0.4.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6"
+checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb"
dependencies = [
"filetime",
"libc",
@@ -12718,22 +12789,11 @@ dependencies = [
[[package]]
name = "tokio-rustls"
-version = "0.23.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
-dependencies = [
- "rustls 0.20.8",
- "tokio",
- "webpki 0.22.0",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.24.0"
+version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5"
+checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
- "rustls 0.21.1",
+ "rustls 0.21.6",
"tokio",
]
@@ -13828,6 +13888,21 @@ dependencies = [
"webpki 0.22.0",
]
+[[package]]
+name = "webpki-roots"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"
+dependencies = [
+ "rustls-webpki 0.100.2",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
+
[[package]]
name = "webrtc"
version = "0.6.0"
@@ -14368,9 +14443,9 @@ dependencies = [
[[package]]
name = "xattr"
-version = "0.2.3"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
+checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985"
dependencies = [
"libc",
]
diff --git a/Cargo.toml b/Cargo.toml
index 9ee8142e23e76..3585a5ecd3572 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -131,6 +131,7 @@ members = [
"frame/benchmarking",
"frame/benchmarking/pov",
"frame/bounties",
+ "frame/broker",
"frame/child-bounties",
"frame/collective",
"frame/contracts",
@@ -187,6 +188,8 @@ members = [
"frame/recovery",
"frame/referenda",
"frame/remark",
+ "frame/tx-pause",
+ "frame/safe-mode",
"frame/salary",
"frame/scheduler",
"frame/scored-pool",
diff --git a/README.md b/README.md
index b6b5d0ccc9c41..59e0cff015d39 100644
--- a/README.md
+++ b/README.md
@@ -1,35 +1,13 @@
-# Substrate · [](#LICENSE) [](https://gitlab.parity.io/parity/substrate/pipelines) [](docs/CONTRIBUTING.md) [](https://substrate.stackexchange.com/)
-
-
-
+Dear contributors and users,
-Substrate is a next-generation framework for blockchain innovation 🚀.
+We would like to inform you that we have recently made significant changes to our repository structure. In order to streamline our development process and foster better contributions, we have merged three separate repositories Cumulus, Substrate and Polkadot into a single new repository: [the Polkadot SDK](https://github.com/paritytech/polkadot-sdk). Go ahead and make sure to support us by giving a star ⭐️ to the new repo.
-## Getting Started
+By consolidating our codebase, we aim to enhance collaboration and provide a more efficient platform for future development.
-Head to [docs.substrate.io](https://docs.substrate.io) and follow the [installation](https://docs.substrate.io/install/) instructions.
-Then try out one of the [tutorials](https://docs.substrate.io/tutorials/).
-Refer to the [Docker instructions](./docker/README.md) to quickly run Substrate, Substrate Node Template, Subkey, or to build a chain spec.
+If you currently have an open pull request in any of the merged repositories, we kindly request that you resubmit your PR in the new repository. This will ensure that your contributions are considered within the updated context and enable us to review and merge them more effectively.
-## Community & Support
+We appreciate your understanding and ongoing support throughout this transition. Should you have any questions or require further assistance, please don't hesitate to [reach out to us](https://forum.polkadot.network/t/psa-parity-is-currently-working-on-merging-the-polkadot-stack-repositories-into-one-single-repository/2883).
-Join the highly active and supportive community on the [Substrate Stack Exchange](https://substrate.stackexchange.com/) to ask questions about use and problems you run into using this software.
-Please do report bugs and [issues here](https://github.com/paritytech/substrate/issues) for anything you suspect requires action in the source.
+Best Regards,
-## Contributions & Code of Conduct
-
-Please follow the contributions guidelines as outlined in [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md).
-In all communications and contributions, this project follows the [Contributor Covenant Code of Conduct](docs/CODE_OF_CONDUCT.md).
-
-## Security
-
-The security policy and procedures can be found in [`docs/SECURITY.md`](docs/SECURITY.md).
-
-## License
-
-- Substrate Primitives (`sp-*`), Frame (`frame-*`) and the pallets (`pallets-*`), binaries (`/bin`) and all other utilities are licensed under [Apache 2.0](LICENSE-APACHE2).
-- Substrate Client (`/client/*` / `sc-*`) is licensed under [GPL v3.0 with a classpath linking exception](LICENSE-GPL3).
-
-The reason for the split-licensing is to ensure that for the vast majority of teams using Substrate to create feature-chains, then all changes can be made entirely in Apache2-licensed code, allowing teams full freedom over what and how they release and giving licensing clarity to commercial teams.
-
-In the interests of the community, we require any deeper improvements made to Substrate's core logic (e.g. Substrate's internal consensus, crypto or database code) to be contributed back so everyone can benefit.
+Parity Technologies
\ No newline at end of file
diff --git a/bin/node-template/node/Cargo.toml b/bin/node-template/node/Cargo.toml
index b05fed96bc8a2..6eb5b4df9c536 100644
--- a/bin/node-template/node/Cargo.toml
+++ b/bin/node-template/node/Cargo.toml
@@ -70,19 +70,19 @@ substrate-build-script-utils = { version = "3.0.0", path = "../../../utils/build
default = []
# Dependencies that are only required if runtime benchmarking should be build.
runtime-benchmarks = [
- "node-template-runtime/runtime-benchmarks",
- "frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
+ "frame-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
+ "node-template-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
- "sp-runtime/runtime-benchmarks"
+ "sp-runtime/runtime-benchmarks",
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = [
- "node-template-runtime/try-runtime",
- "try-runtime-cli/try-runtime",
"frame-system/try-runtime",
+ "node-template-runtime/try-runtime",
"pallet-transaction-payment/try-runtime",
- "sp-runtime/try-runtime"
+ "sp-runtime/try-runtime",
+ "try-runtime-cli/try-runtime",
]
diff --git a/bin/node-template/pallets/template/Cargo.toml b/bin/node-template/pallets/template/Cargo.toml
index f468374c2ff9f..ba108cd0052fe 100644
--- a/bin/node-template/pallets/template/Cargo.toml
+++ b/bin/node-template/pallets/template/Cargo.toml
@@ -20,6 +20,7 @@ scale-info = { version = "2.5.0", default-features = false, features = ["derive"
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../../../../frame/benchmarking" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../../../frame/support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../../frame/system" }
+sp-std = { version = "8.0.0", default-features = false, path = "../../../../primitives/std" }
[dev-dependencies]
sp-core = { version = "21.0.0", path = "../../../../primitives/core" }
@@ -27,7 +28,7 @@ sp-io = { version = "23.0.0", path = "../../../../primitives/io" }
sp-runtime = { version = "24.0.0", path = "../../../../primitives/runtime" }
[features]
-default = ["std"]
+default = [ "std" ]
std = [
"codec/std",
"frame-benchmarking?/std",
@@ -36,16 +37,17 @@ std = [
"scale-info/std",
"sp-core/std",
"sp-io/std",
- "sp-runtime/std"
+ "sp-runtime/std",
+ "sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
- "sp-runtime/runtime-benchmarks"
+ "sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
- "sp-runtime/try-runtime"
+ "sp-runtime/try-runtime",
]
diff --git a/bin/node-template/pallets/template/src/benchmarking.rs b/bin/node-template/pallets/template/src/benchmarking.rs
index 5a262417629c5..6c3cae6066b41 100644
--- a/bin/node-template/pallets/template/src/benchmarking.rs
+++ b/bin/node-template/pallets/template/src/benchmarking.rs
@@ -1,6 +1,7 @@
//! Benchmarking setup for pallet-template
#![cfg(feature = "runtime-benchmarks")]
use super::*;
+use sp_std::vec;
#[allow(unused)]
use crate::Pallet as Template;
diff --git a/bin/node-template/runtime/Cargo.toml b/bin/node-template/runtime/Cargo.toml
index 51e30187c9d63..5f4411df54110 100644
--- a/bin/node-template/runtime/Cargo.toml
+++ b/bin/node-template/runtime/Cargo.toml
@@ -36,6 +36,7 @@ sp-offchain = { version = "4.0.0-dev", default-features = false, path = "../../.
sp-runtime = { version = "24.0.0", default-features = false, path = "../../../primitives/runtime" }
sp-session = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/session" }
sp-std = { version = "8.0.0", default-features = false, path = "../../../primitives/std" }
+sp-storage = { version = "13.0.0", default-features = false, path = "../../../primitives/storage" }
sp-transaction-pool = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/transaction-pool" }
sp-version = { version = "22.0.0", default-features = false, path = "../../../primitives/version" }
@@ -54,18 +55,17 @@ pallet-template = { version = "4.0.0-dev", default-features = false, path = "../
substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder", optional = true }
[features]
-default = ["std"]
+default = [ "std" ]
std = [
- "frame-try-runtime?/std",
- "frame-system-benchmarking?/std",
- "frame-benchmarking?/std",
"codec/std",
- "scale-info/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",
+ "frame-try-runtime?/std",
"pallet-aura/std",
"pallet-balances/std",
"pallet-grandpa/std",
@@ -74,6 +74,7 @@ std = [
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
+ "scale-info/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
@@ -84,6 +85,7 @@ std = [
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
+ "sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
@@ -101,10 +103,10 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
- "frame-try-runtime/try-runtime",
"frame-executive/try-runtime",
- "frame-system/try-runtime",
"frame-support/try-runtime",
+ "frame-system/try-runtime",
+ "frame-try-runtime/try-runtime",
"pallet-aura/try-runtime",
"pallet-balances/try-runtime",
"pallet-grandpa/try-runtime",
@@ -112,6 +114,6 @@ try-runtime = [
"pallet-template/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
- "sp-runtime/try-runtime"
+ "sp-runtime/try-runtime",
]
-experimental = ["pallet-aura/experimental"]
+experimental = [ "pallet-aura/experimental" ]
diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs
index c3375d2ee601a..216be9588bca1 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -531,8 +531,8 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result, sp_runtime::RuntimeString> {
- use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey};
-
+ use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch};
+ use sp_storage::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;
diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml
index 37f03fbb0dd7e..fcab4cc6517a9 100644
--- a/bin/node/cli/Cargo.toml
+++ b/bin/node/cli/Cargo.toml
@@ -147,22 +147,22 @@ pallet-balances = { version = "4.0.0-dev", path = "../../../frame/balances" }
sc-storage-monitor = { version = "0.1.0", path = "../../../client/storage-monitor" }
[features]
-default = ["cli"]
+default = [ "cli" ]
cli = [
+ "clap",
+ "clap_complete",
+ "frame-benchmarking-cli",
"node-inspect",
"sc-cli",
- "frame-benchmarking-cli",
- "substrate-frame-cli",
"sc-service/rocksdb",
- "clap",
- "clap_complete",
"substrate-build-script-utils",
+ "substrate-frame-cli",
"try-runtime-cli",
]
runtime-benchmarks = [
- "kitchensink-runtime/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-system/runtime-benchmarks",
+ "kitchensink-runtime/runtime-benchmarks",
"pallet-asset-tx-payment/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
@@ -170,14 +170,13 @@ runtime-benchmarks = [
"pallet-timestamp/runtime-benchmarks",
"sc-client-db/runtime-benchmarks",
"sc-service/runtime-benchmarks",
- "sp-runtime/runtime-benchmarks"
+ "sp-runtime/runtime-benchmarks",
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = [
- "kitchensink-runtime/try-runtime",
- "try-runtime-cli/try-runtime",
"frame-system/try-runtime",
+ "kitchensink-runtime/try-runtime",
"pallet-asset-conversion-tx-payment/try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
@@ -185,7 +184,8 @@ try-runtime = [
"pallet-im-online/try-runtime",
"pallet-timestamp/try-runtime",
"sp-runtime/try-runtime",
- "substrate-cli-test-utils/try-runtime"
+ "substrate-cli-test-utils/try-runtime",
+ "try-runtime-cli/try-runtime",
]
[[bench]]
diff --git a/bin/node/cli/src/chain_spec.rs b/bin/node/cli/src/chain_spec.rs
index 57d367e7c49a8..51beaad03688a 100644
--- a/bin/node/cli/src/chain_spec.rs
+++ b/bin/node/cli/src/chain_spec.rs
@@ -358,6 +358,8 @@ pub fn testnet_genesis(
transaction_storage: Default::default(),
transaction_payment: Default::default(),
alliance: Default::default(),
+ safe_mode: Default::default(),
+ tx_pause: Default::default(),
alliance_motion: Default::default(),
nomination_pools: NominationPoolsConfig {
min_create_bond: 10 * DOLLARS,
diff --git a/bin/node/primitives/Cargo.toml b/bin/node/primitives/Cargo.toml
index ac178c67f7188..586d0bce2dbbc 100644
--- a/bin/node/primitives/Cargo.toml
+++ b/bin/node/primitives/Cargo.toml
@@ -17,8 +17,5 @@ sp-core = { version = "21.0.0", default-features = false, path = "../../../primi
sp-runtime = { version = "24.0.0", default-features = false, path = "../../../primitives/runtime" }
[features]
-default = ["std"]
-std = [
- "sp-core/std",
- "sp-runtime/std",
-]
+default = [ "std" ]
+std = [ "sp-core/std", "sp-runtime/std" ]
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index de0ec1a5489a8..4aa048efcf60a 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -40,6 +40,7 @@ sp-std = { version = "8.0.0", default-features = false, path = "../../../primiti
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/api" }
sp-runtime = { version = "24.0.0", default-features = false, path = "../../../primitives/runtime" }
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/staking" }
+sp-storage = { version = "13.0.0", default-features = false, path = "../../../primitives/storage" }
sp-session = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/session" }
sp-transaction-pool = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/transaction-pool" }
sp-statement-store = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/statement-store" }
@@ -66,6 +67,7 @@ pallet-babe = { version = "4.0.0-dev", default-features = false, path = "../../.
pallet-bags-list = { version = "4.0.0-dev", default-features = false, path = "../../../frame/bags-list" }
pallet-balances = { version = "4.0.0-dev", default-features = false, path = "../../../frame/balances" }
pallet-bounties = { version = "4.0.0-dev", default-features = false, path = "../../../frame/bounties" }
+pallet-broker = { version = "0.1.0", default-features = false, path = "../../../frame/broker" }
pallet-child-bounties = { version = "4.0.0-dev", default-features = false, path = "../../../frame/child-bounties" }
pallet-collective = { version = "4.0.0-dev", default-features = false, path = "../../../frame/collective" }
pallet-contracts = { version = "4.0.0-dev", default-features = false, path = "../../../frame/contracts" }
@@ -127,128 +129,138 @@ pallet-transaction-storage = { version = "4.0.0-dev", default-features = false,
pallet-uniques = { version = "4.0.0-dev", default-features = false, path = "../../../frame/uniques" }
pallet-vesting = { version = "4.0.0-dev", default-features = false, path = "../../../frame/vesting" }
pallet-whitelist = { version = "4.0.0-dev", default-features = false, path = "../../../frame/whitelist" }
+pallet-tx-pause = { version = "4.0.0-dev", default-features = false, path = "../../../frame/tx-pause" }
+pallet-safe-mode = { version = "4.0.0-dev", default-features = false, path = "../../../frame/safe-mode" }
[build-dependencies]
substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-builder", optional = true }
[features]
-default = ["std"]
-with-tracing = ["frame-executive/with-tracing"]
+default = [ "std" ]
+with-tracing = [ "frame-executive/with-tracing" ]
std = [
- "pallet-whitelist/std",
- "pallet-offences-benchmarking?/std",
- "pallet-election-provider-support-benchmarking?/std",
- "pallet-asset-conversion-tx-payment/std",
- "pallet-asset-tx-payment/std",
- "frame-system-benchmarking?/std",
+ "codec/std",
+ "frame-benchmarking-pallet-pov/std",
+ "frame-benchmarking/std",
"frame-election-provider-support/std",
- "sp-authority-discovery/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-alliance/std",
+ "pallet-asset-conversion-tx-payment/std",
"pallet-asset-conversion/std",
+ "pallet-asset-rate/std",
+ "pallet-asset-tx-payment/std",
"pallet-assets/std",
"pallet-authority-discovery/std",
"pallet-authorship/std",
- "sp-consensus-babe/std",
- "sp-consensus-grandpa/std",
"pallet-babe/std",
"pallet-bags-list/std",
"pallet-balances/std",
"pallet-bounties/std",
- "sp-block-builder/std",
- "codec/std",
- "scale-info/std",
+ "pallet-broker/std",
+ "pallet-child-bounties/std",
"pallet-collective/std",
- "pallet-contracts/std",
"pallet-contracts-primitives/std",
+ "pallet-contracts/std",
"pallet-conviction-voting/std",
"pallet-core-fellowship/std",
"pallet-democracy/std",
+ "pallet-election-provider-multi-phase/std",
+ "pallet-election-provider-support-benchmarking?/std",
"pallet-elections-phragmen/std",
"pallet-fast-unstake/std",
- "frame-executive/std",
- "pallet-nis/std",
+ "pallet-glutton/std",
"pallet-grandpa/std",
+ "pallet-identity/std",
"pallet-im-online/std",
"pallet-indices/std",
- "sp-inherents/std",
+ "pallet-insecure-randomness-collective-flip/std",
"pallet-lottery/std",
"pallet-membership/std",
"pallet-message-queue/std",
"pallet-mmr/std",
"pallet-multisig/std",
- "pallet-nomination-pools/std",
- "pallet-nomination-pools-runtime-api/std",
+ "pallet-nft-fractionalization/std",
+ "pallet-nfts-runtime-api/std",
+ "pallet-nfts/std",
+ "pallet-nis/std",
"pallet-nomination-pools-benchmarking?/std",
- "pallet-identity/std",
- "pallet-scheduler/std",
- "node-primitives/std",
- "sp-offchain/std",
+ "pallet-nomination-pools-runtime-api/std",
+ "pallet-nomination-pools/std",
+ "pallet-offences-benchmarking?/std",
"pallet-offences/std",
- "pallet-glutton/std",
"pallet-preimage/std",
"pallet-proxy/std",
- "sp-core/std",
- "pallet-insecure-randomness-collective-flip/std",
- "sp-std/std",
- "pallet-session/std",
+ "pallet-ranked-collective/std",
+ "pallet-recovery/std",
+ "pallet-referenda/std",
+ "pallet-remark/std",
+ "pallet-root-testing/std",
+ "pallet-safe-mode/std",
+ "pallet-salary/std",
+ "pallet-scheduler/std",
"pallet-session-benchmarking?/std",
- "sp-api/std",
- "sp-runtime/std",
- "sp-staking/std",
- "pallet-staking/std",
+ "pallet-session/std",
+ "pallet-society/std",
"pallet-staking-runtime-api/std",
+ "pallet-staking/std",
"pallet-state-trie-migration/std",
"pallet-statement/std",
- "pallet-salary/std",
- "sp-session/std",
"pallet-sudo/std",
- "frame-support/std",
- "frame-benchmarking/std",
- "frame-benchmarking-pallet-pov/std",
- "frame-system-rpc-runtime-api/std",
- "frame-system/std",
- "pallet-election-provider-multi-phase/std",
"pallet-timestamp/std",
"pallet-tips/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-transaction-storage/std",
"pallet-treasury/std",
- "pallet-asset-rate/std",
- "sp-transaction-pool/std",
- "sp-statement-store/std",
- "pallet-utility/std",
- "sp-version/std",
- "pallet-society/std",
- "pallet-ranked-collective/std",
- "pallet-referenda/std",
- "pallet-remark/std",
- "pallet-root-testing/std",
- "pallet-recovery/std",
+ "pallet-tx-pause/std",
"pallet-uniques/std",
- "pallet-nfts/std",
- "pallet-nfts-runtime-api/std",
- "pallet-nft-fractionalization/std",
+ "pallet-utility/std",
"pallet-vesting/std",
- "log/std",
- "frame-try-runtime?/std",
+ "pallet-whitelist/std",
+ "scale-info/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",
- "pallet-child-bounties/std",
- "pallet-alliance/std",
+ "sp-offchain/std",
+ "sp-runtime/std",
+ "sp-session/std",
+ "sp-staking/std",
+ "sp-statement-store/std",
+ "sp-std/std",
+ "sp-storage/std",
+ "sp-transaction-pool/std",
+ "sp-version/std",
"substrate-wasm-builder",
]
runtime-benchmarks = [
- "frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-pallet-pov/runtime-benchmarks",
+ "frame-benchmarking/runtime-benchmarks",
+ "frame-election-provider-support/runtime-benchmarks",
"frame-support/runtime-benchmarks",
+ "frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
- "sp-runtime/runtime-benchmarks",
"pallet-alliance/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
+ "pallet-asset-rate/runtime-benchmarks",
+ "pallet-asset-tx-payment/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-babe/runtime-benchmarks",
"pallet-bags-list/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bounties/runtime-benchmarks",
+ "pallet-broker/runtime-benchmarks",
"pallet-child-bounties/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
@@ -259,7 +271,7 @@ runtime-benchmarks = [
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-fast-unstake/runtime-benchmarks",
- "pallet-nis/runtime-benchmarks",
+ "pallet-glutton/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
@@ -269,17 +281,22 @@ runtime-benchmarks = [
"pallet-message-queue/runtime-benchmarks",
"pallet-mmr/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
+ "pallet-nft-fractionalization/runtime-benchmarks",
+ "pallet-nfts/runtime-benchmarks",
+ "pallet-nis/runtime-benchmarks",
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
+ "pallet-nomination-pools/runtime-benchmarks",
"pallet-offences-benchmarking/runtime-benchmarks",
- "pallet-glutton/runtime-benchmarks",
+ "pallet-offences/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
- "pallet-scheduler/runtime-benchmarks",
"pallet-ranked-collective/runtime-benchmarks",
- "pallet-referenda/runtime-benchmarks",
"pallet-recovery/runtime-benchmarks",
+ "pallet-referenda/runtime-benchmarks",
"pallet-remark/runtime-benchmarks",
+ "pallet-safe-mode/runtime-benchmarks",
"pallet-salary/runtime-benchmarks",
+ "pallet-scheduler/runtime-benchmarks",
"pallet-session-benchmarking/runtime-benchmarks",
"pallet-society/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
@@ -289,28 +306,26 @@ runtime-benchmarks = [
"pallet-tips/runtime-benchmarks",
"pallet-transaction-storage/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
- "pallet-asset-rate/runtime-benchmarks",
- "pallet-utility/runtime-benchmarks",
+ "pallet-tx-pause/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
- "pallet-nfts/runtime-benchmarks",
- "pallet-nft-fractionalization/runtime-benchmarks",
+ "pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
- "frame-system-benchmarking/runtime-benchmarks",
- "frame-election-provider-support/runtime-benchmarks",
- "pallet-asset-tx-payment/runtime-benchmarks",
- "pallet-nomination-pools/runtime-benchmarks",
- "pallet-offences/runtime-benchmarks",
- "sp-staking/runtime-benchmarks"
+ "sp-runtime/runtime-benchmarks",
+ "sp-staking/runtime-benchmarks",
]
try-runtime = [
- "frame-try-runtime/try-runtime",
"frame-benchmarking-pallet-pov/try-runtime",
+ "frame-election-provider-support/try-runtime",
"frame-executive/try-runtime",
- "frame-system/try-runtime",
"frame-support/try-runtime",
+ "frame-system/try-runtime",
+ "frame-try-runtime/try-runtime",
"pallet-alliance/try-runtime",
+ "pallet-asset-conversion-tx-payment/try-runtime",
"pallet-asset-conversion/try-runtime",
+ "pallet-asset-rate/try-runtime",
+ "pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-authority-discovery/try-runtime",
"pallet-authorship/try-runtime",
@@ -318,6 +333,7 @@ try-runtime = [
"pallet-bags-list/try-runtime",
"pallet-balances/try-runtime",
"pallet-bounties/try-runtime",
+ "pallet-broker/try-runtime",
"pallet-child-bounties/try-runtime",
"pallet-collective/try-runtime",
"pallet-contracts/try-runtime",
@@ -327,50 +343,47 @@ try-runtime = [
"pallet-election-provider-multi-phase/try-runtime",
"pallet-elections-phragmen/try-runtime",
"pallet-fast-unstake/try-runtime",
- "pallet-nis/try-runtime",
+ "pallet-glutton/try-runtime",
"pallet-grandpa/try-runtime",
+ "pallet-identity/try-runtime",
"pallet-im-online/try-runtime",
"pallet-indices/try-runtime",
- "pallet-identity/try-runtime",
+ "pallet-insecure-randomness-collective-flip/try-runtime",
"pallet-lottery/try-runtime",
"pallet-membership/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-mmr/try-runtime",
"pallet-multisig/try-runtime",
+ "pallet-nft-fractionalization/try-runtime",
+ "pallet-nfts/try-runtime",
+ "pallet-nis/try-runtime",
"pallet-nomination-pools/try-runtime",
"pallet-offences/try-runtime",
- "pallet-glutton/try-runtime",
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
- "pallet-insecure-randomness-collective-flip/try-runtime",
"pallet-ranked-collective/try-runtime",
"pallet-recovery/try-runtime",
"pallet-referenda/try-runtime",
"pallet-remark/try-runtime",
"pallet-root-testing/try-runtime",
+ "pallet-safe-mode/try-runtime",
"pallet-salary/try-runtime",
+ "pallet-scheduler/try-runtime",
"pallet-session/try-runtime",
+ "pallet-society/try-runtime",
"pallet-staking/try-runtime",
"pallet-state-trie-migration/try-runtime",
"pallet-statement/try-runtime",
- "pallet-scheduler/try-runtime",
- "pallet-society/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-tips/try-runtime",
- "pallet-treasury/try-runtime",
- "pallet-asset-rate/try-runtime",
- "pallet-utility/try-runtime",
"pallet-transaction-payment/try-runtime",
- "pallet-asset-conversion-tx-payment/try-runtime",
- "pallet-asset-tx-payment/try-runtime",
"pallet-transaction-storage/try-runtime",
+ "pallet-treasury/try-runtime",
+ "pallet-tx-pause/try-runtime",
"pallet-uniques/try-runtime",
- "pallet-nfts/try-runtime",
- "pallet-nft-fractionalization/try-runtime",
+ "pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-whitelist/try-runtime",
- "frame-election-provider-support/try-runtime",
- "sp-runtime/try-runtime"
+ "sp-runtime/try-runtime",
]
-unsafe-debug = ["pallet-contracts/unsafe-debug"]
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index 4e1b6d4e8bec0..4f34e4ecd8122 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -35,11 +35,11 @@ use frame_support::{
pallet_prelude::Get,
parameter_types,
traits::{
- fungible::ItemOf,
+ fungible::{Balanced, Credit, ItemOf},
tokens::{nonfungibles_v2::Inspect, GetSalary, PayFromAccount},
- AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU16, ConstU32, Currency, EitherOfDiverse,
- EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter, KeyOwnerProofSystem,
- LockIdentifier, Nothing, OnUnbalanced, WithdrawReasons,
+ AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU16, ConstU32, Contains, Currency,
+ EitherOfDiverse, EqualPrivilegeOnly, Imbalance, InsideBoth, InstanceFilter,
+ KeyOwnerProofSystem, LockIdentifier, Nothing, OnUnbalanced, WithdrawReasons,
},
weights::{
constants::{
@@ -47,7 +47,7 @@ use frame_support::{
},
ConstantMultiplier, IdentityFee, Weight,
},
- BoundedVec, PalletId, RuntimeDebug,
+ BoundedVec, PalletId,
};
use frame_system::{
limits::{BlockLength, BlockWeights},
@@ -56,6 +56,7 @@ use frame_system::{
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
use pallet_asset_conversion::{NativeOrAssetId, NativeOrAssetIdConverter};
+use pallet_broker::{CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600};
use pallet_election_provider_multi_phase::SolutionAccuracyOf;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_nfts::PalletFeatures;
@@ -63,6 +64,7 @@ use pallet_nis::WithMaximumOf;
use pallet_session::historical as pallet_session_historical;
pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
+use pallet_tx_pause::RuntimeCallNameOf;
use sp_api::impl_runtime_apis;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
@@ -78,6 +80,7 @@ use sp_runtime::{
},
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Percent, Permill, Perquintill,
+ RuntimeDebug,
};
use sp_std::prelude::*;
#[cfg(any(feature = "std", test))]
@@ -218,8 +221,67 @@ parameter_types! {
const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
+/// Calls that can bypass the safe-mode pallet.
+pub struct SafeModeWhitelistedCalls;
+impl Contains for SafeModeWhitelistedCalls {
+ fn contains(call: &RuntimeCall) -> bool {
+ match call {
+ RuntimeCall::System(_) | RuntimeCall::SafeMode(_) | RuntimeCall::TxPause(_) => true,
+ _ => false,
+ }
+ }
+}
+
+/// Calls that cannot be paused by the tx-pause pallet.
+pub struct TxPauseWhitelistedCalls;
+/// Whitelist `Balances::transfer_keep_alive`, all others are pauseable.
+impl Contains> for TxPauseWhitelistedCalls {
+ fn contains(full_name: &RuntimeCallNameOf) -> bool {
+ match (full_name.0.as_slice(), full_name.1.as_slice()) {
+ (b"Balances", b"transfer_keep_alive") => true,
+ _ => false,
+ }
+ }
+}
+
+impl pallet_tx_pause::Config for Runtime {
+ type RuntimeEvent = RuntimeEvent;
+ type RuntimeCall = RuntimeCall;
+ type PauseOrigin = EnsureRoot;
+ type UnpauseOrigin = EnsureRoot;
+ type WhitelistedCalls = TxPauseWhitelistedCalls;
+ type MaxNameLen = ConstU32<256>;
+ type WeightInfo = pallet_tx_pause::weights::SubstrateWeight;
+}
+
+parameter_types! {
+ pub const EnterDuration: BlockNumber = 4 * HOURS;
+ pub const EnterDepositAmount: Balance = 2_000_000 * DOLLARS;
+ pub const ExtendDuration: BlockNumber = 2 * HOURS;
+ pub const ExtendDepositAmount: Balance = 1_000_000 * DOLLARS;
+ pub const ReleaseDelay: u32 = 2 * DAYS;
+}
+
+impl pallet_safe_mode::Config for Runtime {
+ type RuntimeEvent = RuntimeEvent;
+ type Currency = Balances;
+ type RuntimeHoldReason = RuntimeHoldReason;
+ type WhitelistedCalls = SafeModeWhitelistedCalls;
+ type EnterDuration = EnterDuration;
+ type EnterDepositAmount = EnterDepositAmount;
+ type ExtendDuration = ExtendDuration;
+ type ExtendDepositAmount = ExtendDepositAmount;
+ type ForceEnterOrigin = EnsureRootWithSuccess>;
+ type ForceExtendOrigin = EnsureRootWithSuccess>;
+ type ForceExitOrigin = EnsureRoot;
+ type ForceDepositOrigin = EnsureRoot;
+ type ReleaseDelay = ReleaseDelay;
+ type Notify = ();
+ type WeightInfo = pallet_safe_mode::weights::SubstrateWeight;
+}
+
impl frame_system::Config for Runtime {
- type BaseCallFilter = Everything;
+ type BaseCallFilter = InsideBoth;
type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength;
type DbWeight = RocksDbWeight;
@@ -1263,8 +1325,8 @@ impl pallet_contracts::Config for Runtime {
type Migrations = pallet_contracts::migration::codegen::BenchMigrations;
type MaxDelegateDependencies = ConstU32<32>;
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
- #[cfg(feature = "unsafe-debug")]
type Debug = ();
+ type Environment = ();
}
impl pallet_sudo::Config for Runtime {
@@ -1680,8 +1742,8 @@ impl pallet_core_fellowship::Config for Runtime {
type Balance = Balance;
type ParamsOrigin = frame_system::EnsureRoot;
type InductOrigin = pallet_core_fellowship::EnsureInducted;
- type ApproveOrigin = frame_system::EnsureRootWithSuccess>;
- type PromoteOrigin = frame_system::EnsureRootWithSuccess>;
+ type ApproveOrigin = EnsureRootWithSuccess>;
+ type PromoteOrigin = EnsureRootWithSuccess>;
type EvidenceSize = ConstU32<16_384>;
}
@@ -1876,6 +1938,77 @@ impl pallet_statement::Config for Runtime {
type MaxAllowedBytes = MaxAllowedBytes;
}
+parameter_types! {
+ pub const BrokerPalletId: PalletId = PalletId(*b"py/broke");
+}
+
+pub struct IntoAuthor;
+impl OnUnbalanced> for IntoAuthor {
+ fn on_nonzero_unbalanced(credit: Credit) {
+ if let Some(author) = Authorship::author() {
+ let _ = >::resolve(&author, credit);
+ }
+ }
+}
+
+parameter_types! {
+ pub storage CoreCount: Option = None;
+ pub storage CoretimeRevenue: Option<(BlockNumber, Balance)> = None;
+}
+
+pub struct CoretimeProvider;
+impl CoretimeInterface for CoretimeProvider {
+ type AccountId = AccountId;
+ type Balance = Balance;
+ type BlockNumber = BlockNumber;
+ fn latest() -> Self::BlockNumber {
+ System::block_number()
+ }
+ fn request_core_count(_count: CoreIndex) {}
+ fn request_revenue_info_at(_when: Self::BlockNumber) {}
+ fn credit_account(_who: Self::AccountId, _amount: Self::Balance) {}
+ fn assign_core(
+ _core: CoreIndex,
+ _begin: Self::BlockNumber,
+ _assignment: Vec<(CoreAssignment, PartsOf57600)>,
+ _end_hint: Option,
+ ) {
+ }
+ fn check_notify_core_count() -> Option {
+ let count = CoreCount::get();
+ CoreCount::set(&None);
+ count
+ }
+ fn check_notify_revenue_info() -> Option<(Self::BlockNumber, Self::Balance)> {
+ let revenue = CoretimeRevenue::get();
+ CoretimeRevenue::set(&None);
+ revenue
+ }
+ #[cfg(feature = "runtime-benchmarks")]
+ fn ensure_notify_core_count(count: u16) {
+ CoreCount::set(&Some(count));
+ }
+ #[cfg(feature = "runtime-benchmarks")]
+ fn ensure_notify_revenue_info(when: Self::BlockNumber, revenue: Self::Balance) {
+ CoretimeRevenue::set(&Some((when, revenue)));
+ }
+}
+
+impl pallet_broker::Config for Runtime {
+ type RuntimeEvent = RuntimeEvent;
+ type Currency = Balances;
+ type OnRevenue = IntoAuthor;
+ type TimeslicePeriod = ConstU32<2>;
+ type MaxLeasedCores = ConstU32<5>;
+ type MaxReservedCores = ConstU32<5>;
+ type Coretime = CoretimeProvider;
+ type ConvertBalance = traits::Identity;
+ type WeightInfo = ();
+ type PalletId = BrokerPalletId;
+ type AdminOrigin = EnsureRoot;
+ type PriceAdapter = pallet_broker::Linear;
+}
+
construct_runtime!(
pub struct Runtime
{
@@ -1948,7 +2081,10 @@ construct_runtime!(
FastUnstake: pallet_fast_unstake,
MessageQueue: pallet_message_queue,
Pov: frame_benchmarking_pallet_pov,
+ TxPause: pallet_tx_pause,
+ SafeMode: pallet_safe_mode,
Statement: pallet_statement,
+ Broker: pallet_broker,
}
);
@@ -2029,6 +2165,7 @@ mod benches {
[pallet_bags_list, VoterList]
[pallet_balances, Balances]
[pallet_bounties, Bounties]
+ [pallet_broker, Broker]
[pallet_child_bounties, ChildBounties]
[pallet_collective, Council]
[pallet_conviction_voting, ConvictionVoting]
@@ -2078,6 +2215,8 @@ mod benches {
[pallet_utility, Utility]
[pallet_vesting, Vesting]
[pallet_whitelist, Whitelist]
+ [pallet_tx_pause, TxPause]
+ [pallet_safe_mode, SafeMode]
);
}
@@ -2569,7 +2708,8 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result, sp_runtime::RuntimeString> {
- use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey};
+ use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch};
+ use sp_storage::TrackedStorageKey;
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency
// issues. To get around that, we separated the Session benchmarks into its own crate,
diff --git a/bin/node/testing/src/genesis.rs b/bin/node/testing/src/genesis.rs
index 8063b8ef45708..6e7bcebfc00d1 100644
--- a/bin/node/testing/src/genesis.rs
+++ b/bin/node/testing/src/genesis.rs
@@ -101,6 +101,8 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec) -> Run
alliance: Default::default(),
alliance_motion: Default::default(),
nomination_pools: Default::default(),
+ safe_mode: Default::default(),
+ tx_pause: Default::default(),
glutton: GluttonConfig {
compute: Default::default(),
storage: Default::default(),
diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml
index 61750766fa3f8..92ddbe59fc562 100644
--- a/client/cli/Cargo.toml
+++ b/client/cli/Cargo.toml
@@ -52,5 +52,5 @@ futures-timer = "3.0.1"
sp-tracing = { version = "10.0.0", path = "../../primitives/tracing" }
[features]
-default = ["rocksdb"]
-rocksdb = ["sc-client-db/rocksdb"]
+default = [ "rocksdb" ]
+rocksdb = [ "sc-client-db/rocksdb" ]
diff --git a/client/consensus/beefy/src/communication/peers.rs b/client/consensus/beefy/src/communication/peers.rs
index 4704b8dcf4576..8f2d5cc90a1d9 100644
--- a/client/consensus/beefy/src/communication/peers.rs
+++ b/client/consensus/beefy/src/communication/peers.rs
@@ -24,7 +24,7 @@ use std::collections::{HashMap, VecDeque};
/// Report specifying a reputation change for a given peer.
#[derive(Debug, PartialEq)]
-pub(crate) struct PeerReport {
+pub struct PeerReport {
pub who: PeerId,
pub cost_benefit: ReputationChange,
}
diff --git a/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs b/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs
index 8240dd71104c2..b8d8cd35434c9 100644
--- a/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs
+++ b/client/consensus/beefy/src/communication/request_response/incoming_requests_handler.rs
@@ -18,7 +18,7 @@
use codec::DecodeAll;
use futures::{channel::oneshot, StreamExt};
-use log::{debug, error, trace};
+use log::{debug, trace};
use sc_client_api::BlockBackend;
use sc_network::{
config as netconfig, config::RequestResponseConfig, types::ProtocolName, PeerId,
@@ -182,7 +182,9 @@ where
}
/// Run [`BeefyJustifsRequestHandler`].
- pub async fn run(mut self) {
+ ///
+ /// Should never end, returns `Error` otherwise.
+ pub async fn run(&mut self) -> Error {
trace!(target: BEEFY_SYNC_LOG_TARGET, "🥩 Running BeefyJustifsRequestHandler");
while let Ok(request) = self
@@ -215,9 +217,6 @@ where
},
}
}
- error!(
- target: crate::LOG_TARGET,
- "🥩 On-demand requests receiver stream terminated, closing worker."
- );
+ Error::RequestsReceiverStreamClosed
}
}
diff --git a/client/consensus/beefy/src/communication/request_response/mod.rs b/client/consensus/beefy/src/communication/request_response/mod.rs
index 1801512fa5421..4bad3b061c8e9 100644
--- a/client/consensus/beefy/src/communication/request_response/mod.rs
+++ b/client/consensus/beefy/src/communication/request_response/mod.rs
@@ -75,7 +75,7 @@ pub struct JustificationRequest {
}
#[derive(Debug, thiserror::Error)]
-pub(crate) enum Error {
+pub enum Error {
#[error(transparent)]
Client(#[from] sp_blockchain::Error),
@@ -102,4 +102,7 @@ pub(crate) enum Error {
#[error("Internal error while getting response.")]
ResponseError,
+
+ #[error("On-demand requests receiver stream terminated.")]
+ RequestsReceiverStreamClosed,
}
diff --git a/client/consensus/beefy/src/error.rs b/client/consensus/beefy/src/error.rs
index 08b9960f41a1a..b4773f940193e 100644
--- a/client/consensus/beefy/src/error.rs
+++ b/client/consensus/beefy/src/error.rs
@@ -34,8 +34,18 @@ pub enum Error {
Signature(String),
#[error("Session uninitialized")]
UninitSession,
- #[error("pallet-beefy was reset, please restart voter")]
+ #[error("pallet-beefy was reset")]
ConsensusReset,
+ #[error("Block import stream terminated")]
+ BlockImportStreamTerminated,
+ #[error("Gossip Engine terminated")]
+ GossipEngineTerminated,
+ #[error("Finality proofs gossiping stream terminated")]
+ FinalityProofGossipStreamTerminated,
+ #[error("Finality stream terminated")]
+ FinalityStreamTerminated,
+ #[error("Votes gossiping stream terminated")]
+ VotesGossipStreamTerminated,
}
#[cfg(test)]
diff --git a/client/consensus/beefy/src/lib.rs b/client/consensus/beefy/src/lib.rs
index da339dae7e1f5..0b3baa007c1ce 100644
--- a/client/consensus/beefy/src/lib.rs
+++ b/client/consensus/beefy/src/lib.rs
@@ -221,7 +221,7 @@ pub async fn start_beefy_gadget(
B: Block,
BE: Backend,
C: Client + BlockBackend,
- P: PayloadProvider,
+ P: PayloadProvider + Clone,
R: ProvideRuntimeApi,
R::Api: BeefyApi + MmrApi>,
N: GossipNetwork + NetworkRequest + Send + Sync + 'static,
@@ -237,7 +237,7 @@ pub async fn start_beefy_gadget(
min_block_delta,
prometheus_registry,
links,
- on_demand_justifications_handler,
+ mut on_demand_justifications_handler,
} = beefy_params;
let BeefyNetworkParams {
@@ -248,83 +248,105 @@ pub async fn start_beefy_gadget(
..
} = network_params;
- let known_peers = Arc::new(Mutex::new(KnownPeers::new()));
- // Default votes filter is to discard everything.
- // Validator is updated later with correct starting round and set id.
- let (gossip_validator, gossip_report_stream) =
- communication::gossip::GossipValidator::new(known_peers.clone());
- let gossip_validator = Arc::new(gossip_validator);
- let mut gossip_engine = GossipEngine::new(
- network.clone(),
- sync.clone(),
- gossip_protocol_name,
- gossip_validator.clone(),
- None,
- );
let metrics = register_metrics(prometheus_registry.clone());
- // The `GossipValidator` adds and removes known peers based on valid votes and network events.
- let on_demand_justifications = OnDemandJustificationsEngine::new(
- network.clone(),
- justifications_protocol_name,
- known_peers,
- prometheus_registry.clone(),
- );
-
// Subscribe to finality notifications and justifications before waiting for runtime pallet and
// reuse the streams, so we don't miss notifications while waiting for pallet to be available.
let mut finality_notifications = client.finality_notification_stream().fuse();
- let block_import_justif = links.from_block_import_justif_stream.subscribe(100_000).fuse();
-
- // Wait for BEEFY pallet to be active before starting voter.
- let persisted_state =
- match wait_for_runtime_pallet(&*runtime, &mut gossip_engine, &mut finality_notifications)
- .await
- .and_then(|(beefy_genesis, best_grandpa)| {
- load_or_init_voter_state(
- &*backend,
- &*runtime,
- beefy_genesis,
- best_grandpa,
- min_block_delta,
- )
- }) {
+ let mut block_import_justif = links.from_block_import_justif_stream.subscribe(100_000).fuse();
+
+ // We re-create and re-run the worker in this loop in order to quickly reinit and resume after
+ // select recoverable errors.
+ loop {
+ let known_peers = Arc::new(Mutex::new(KnownPeers::new()));
+ // Default votes filter is to discard everything.
+ // Validator is updated later with correct starting round and set id.
+ let (gossip_validator, gossip_report_stream) =
+ communication::gossip::GossipValidator::new(known_peers.clone());
+ let gossip_validator = Arc::new(gossip_validator);
+ let mut gossip_engine = GossipEngine::new(
+ network.clone(),
+ sync.clone(),
+ gossip_protocol_name.clone(),
+ gossip_validator.clone(),
+ None,
+ );
+
+ // The `GossipValidator` adds and removes known peers based on valid votes and network
+ // events.
+ let on_demand_justifications = OnDemandJustificationsEngine::new(
+ network.clone(),
+ justifications_protocol_name.clone(),
+ known_peers,
+ prometheus_registry.clone(),
+ );
+
+ // Wait for BEEFY pallet to be active before starting voter.
+ let persisted_state = match wait_for_runtime_pallet(
+ &*runtime,
+ &mut gossip_engine,
+ &mut finality_notifications,
+ )
+ .await
+ .and_then(|(beefy_genesis, best_grandpa)| {
+ load_or_init_voter_state(
+ &*backend,
+ &*runtime,
+ beefy_genesis,
+ best_grandpa,
+ min_block_delta,
+ )
+ }) {
Ok(state) => state,
Err(e) => {
error!(target: LOG_TARGET, "Error: {:?}. Terminating.", e);
return
},
};
- // Update the gossip validator with the right starting round and set id.
- if let Err(e) = persisted_state
- .gossip_filter_config()
- .map(|f| gossip_validator.update_filter(f))
- {
- error!(target: LOG_TARGET, "Error: {:?}. Terminating.", e);
- return
- }
+ // Update the gossip validator with the right starting round and set id.
+ if let Err(e) = persisted_state
+ .gossip_filter_config()
+ .map(|f| gossip_validator.update_filter(f))
+ {
+ error!(target: LOG_TARGET, "Error: {:?}. Terminating.", e);
+ return
+ }
- let worker = worker::BeefyWorker {
- backend,
- payload_provider,
- runtime,
- sync,
- key_store: key_store.into(),
- gossip_engine,
- gossip_validator,
- gossip_report_stream,
- on_demand_justifications,
- links,
- metrics,
- pending_justifications: BTreeMap::new(),
- persisted_state,
- };
+ let worker = worker::BeefyWorker {
+ backend: backend.clone(),
+ payload_provider: payload_provider.clone(),
+ runtime: runtime.clone(),
+ sync: sync.clone(),
+ key_store: key_store.clone().into(),
+ gossip_engine,
+ gossip_validator,
+ gossip_report_stream,
+ on_demand_justifications,
+ links: links.clone(),
+ metrics: metrics.clone(),
+ pending_justifications: BTreeMap::new(),
+ persisted_state,
+ };
- futures::future::select(
- Box::pin(worker.run(block_import_justif, finality_notifications)),
- Box::pin(on_demand_justifications_handler.run()),
- )
- .await;
+ match futures::future::select(
+ Box::pin(worker.run(&mut block_import_justif, &mut finality_notifications)),
+ Box::pin(on_demand_justifications_handler.run()),
+ )
+ .await
+ {
+ // On `ConsensusReset` error, just reinit and restart voter.
+ futures::future::Either::Left((error::Error::ConsensusReset, _)) => {
+ error!(target: LOG_TARGET, "🥩 Error: {:?}. Restarting voter.", error::Error::ConsensusReset);
+ continue
+ },
+ // On other errors, bring down / finish the task.
+ futures::future::Either::Left((worker_err, _)) =>
+ error!(target: LOG_TARGET, "🥩 Error: {:?}. Terminating.", worker_err),
+ futures::future::Either::Right((odj_handler_err, _)) =>
+ error!(target: LOG_TARGET, "🥩 Error: {:?}. Terminating.", odj_handler_err),
+ };
+ return
+ }
}
fn load_or_init_voter_state(
diff --git a/client/consensus/beefy/src/worker.rs b/client/consensus/beefy/src/worker.rs
index 17a8891b06142..0d3845a270368 100644
--- a/client/consensus/beefy/src/worker.rs
+++ b/client/consensus/beefy/src/worker.rs
@@ -447,11 +447,7 @@ where
.ok()
.flatten()
.filter(|genesis| *genesis == self.persisted_state.pallet_genesis)
- .ok_or_else(|| {
- let err = Error::ConsensusReset;
- error!(target: LOG_TARGET, "🥩 Error: {}", err);
- err
- })?;
+ .ok_or(Error::ConsensusReset)?;
if *header.number() > self.best_grandpa_block() {
// update best GRANDPA finalized block we have seen
@@ -795,11 +791,12 @@ where
/// Main loop for BEEFY worker.
///
/// Run the main async loop which is driven by finality notifications and gossiped votes.
+ /// Should never end, returns `Error` otherwise.
pub(crate) async fn run(
mut self,
- mut block_import_justif: Fuse>>,
- mut finality_notifications: Fuse>,
- ) {
+ block_import_justif: &mut Fuse>>,
+ finality_notifications: &mut Fuse>,
+ ) -> Error {
info!(
target: LOG_TARGET,
"🥩 run BEEFY worker, best grandpa: #{:?}.",
@@ -848,17 +845,17 @@ where
// Use `select_biased!` to prioritize order below.
// Process finality notifications first since these drive the voter.
notification = finality_notifications.next() => {
- if notification.and_then(|notif| {
- self.handle_finality_notification(¬if).ok()
- }).is_none() {
- error!(target: LOG_TARGET, "🥩 Finality stream terminated, closing worker.");
- return;
+ if let Some(notif) = notification {
+ if let Err(err) = self.handle_finality_notification(¬if) {
+ return err;
+ }
+ } else {
+ return Error::FinalityStreamTerminated;
}
},
// Make sure to pump gossip engine.
_ = gossip_engine => {
- error!(target: LOG_TARGET, "🥩 Gossip engine has terminated, closing worker.");
- return;
+ return Error::GossipEngineTerminated;
},
// Process incoming justifications as these can make some in-flight votes obsolete.
response_info = self.on_demand_justifications.next().fuse() => {
@@ -881,8 +878,7 @@ where
debug!(target: LOG_TARGET, "🥩 {}", err);
}
} else {
- error!(target: LOG_TARGET, "🥩 Block import stream terminated, closing worker.");
- return;
+ return Error::BlockImportStreamTerminated;
}
},
justif = gossip_proofs.next() => {
@@ -892,11 +888,7 @@ where
debug!(target: LOG_TARGET, "🥩 {}", err);
}
} else {
- error!(
- target: LOG_TARGET,
- "🥩 Finality proofs gossiping stream terminated, closing worker."
- );
- return;
+ return Error::FinalityProofGossipStreamTerminated;
}
},
// Finally process incoming votes.
@@ -907,11 +899,7 @@ where
debug!(target: LOG_TARGET, "🥩 {}", err);
}
} else {
- error!(
- target: LOG_TARGET,
- "🥩 Votes gossiping stream terminated, closing worker."
- );
- return;
+ return Error::VotesGossipStreamTerminated;
}
},
// Process peer reports.
diff --git a/client/consensus/grandpa/src/communication/gossip.rs b/client/consensus/grandpa/src/communication/gossip.rs
index 5688aff3ea717..3a78b157d5b1b 100644
--- a/client/consensus/grandpa/src/communication/gossip.rs
+++ b/client/consensus/grandpa/src/communication/gossip.rs
@@ -546,9 +546,7 @@ impl Peers {
who: &PeerId,
update: NeighborPacket,
) -> Result