diff --git a/cumulus/client/collator/Cargo.toml b/cumulus/client/collator/Cargo.toml index 1d87efa443ce..9bfb373f7650 100644 --- a/cumulus/client/collator/Cargo.toml +++ b/cumulus/client/collator/Cargo.toml @@ -29,7 +29,6 @@ cumulus-client-network = { path = "../network" } cumulus-primitives-core = { path = "../../primitives/core" } [dev-dependencies] -async-trait = "0.1.73" # Substrate sp-maybe-compressed-blob = { path = "../../../substrate/primitives/maybe-compressed-blob" } diff --git a/cumulus/client/collator/src/lib.rs b/cumulus/client/collator/src/lib.rs index f17ae4883106..ab5d981913d5 100644 --- a/cumulus/client/collator/src/lib.rs +++ b/cumulus/client/collator/src/lib.rs @@ -333,7 +333,6 @@ pub fn start_collator_sync( #[cfg(test)] mod tests { use super::*; - use async_trait::async_trait; use cumulus_client_consensus_common::ParachainCandidate; use cumulus_primitives_core::ParachainBlockData; use cumulus_test_client::{ @@ -355,7 +354,6 @@ mod tests { struct AlwaysSupportsParachains; - #[async_trait] impl HeadSupportsParachains for AlwaysSupportsParachains { async fn head_supports_parachains(&self, _head: &PHash) -> bool { true @@ -367,7 +365,6 @@ mod tests { client: Arc, } - #[async_trait::async_trait] impl ParachainConsensus for DummyParachainConsensus { async fn produce_candidate( &mut self, diff --git a/cumulus/client/consensus/aura/Cargo.toml b/cumulus/client/consensus/aura/Cargo.toml index 8239a498746e..481b320015f0 100644 --- a/cumulus/client/consensus/aura/Cargo.toml +++ b/cumulus/client/consensus/aura/Cargo.toml @@ -6,7 +6,6 @@ authors.workspace = true edition.workspace = true [dependencies] -async-trait = "0.1.73" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } futures = "0.3.28" tracing = "0.1.37" diff --git a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs index 5cd65ed5546b..fbb934c179d4 100644 --- a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs +++ b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs @@ -76,7 +76,6 @@ struct Verifier { _phantom: std::marker::PhantomData (Block, P)>, } -#[async_trait::async_trait] impl VerifierT for Verifier where P: Pair, diff --git a/cumulus/client/consensus/aura/src/lib.rs b/cumulus/client/consensus/aura/src/lib.rs index 6ededa7a92c1..05ce176f62f7 100644 --- a/cumulus/client/consensus/aura/src/lib.rs +++ b/cumulus/client/consensus/aura/src/lib.rs @@ -191,7 +191,6 @@ where } } -#[async_trait::async_trait] impl ParachainConsensus for AuraConsensus where B: BlockT, diff --git a/cumulus/client/consensus/common/Cargo.toml b/cumulus/client/consensus/common/Cargo.toml index 26d7ba1b142c..052dc2ea8f35 100644 --- a/cumulus/client/consensus/common/Cargo.toml +++ b/cumulus/client/consensus/common/Cargo.toml @@ -6,7 +6,6 @@ authors.workspace = true edition.workspace = true [dependencies] -async-trait = "0.1.73" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } dyn-clone = "1.0.12" futures = "0.3.28" diff --git a/cumulus/client/consensus/common/src/import_queue.rs b/cumulus/client/consensus/common/src/import_queue.rs index 311a2b7ad8cf..3d4269580ac8 100644 --- a/cumulus/client/consensus/common/src/import_queue.rs +++ b/cumulus/client/consensus/common/src/import_queue.rs @@ -47,7 +47,6 @@ use crate::ParachainBlockImportMarker; /// This should only be used when the runtime is responsible for checking block seals and inherents. pub struct VerifyNothing; -#[async_trait::async_trait] impl Verifier for VerifyNothing { async fn verify( &mut self, diff --git a/cumulus/client/consensus/common/src/lib.rs b/cumulus/client/consensus/common/src/lib.rs index 08bceabb2bd4..1d2e18f2df7b 100644 --- a/cumulus/client/consensus/common/src/lib.rs +++ b/cumulus/client/consensus/common/src/lib.rs @@ -77,7 +77,6 @@ pub struct ParachainCandidate { /// decide if this specific collator should build a candidate for the given relay chain block. The /// consensus implementation could, for example, check whether this specific collator is part of a /// staked set. -#[async_trait::async_trait] pub trait ParachainConsensus: Send + Sync + dyn_clone::DynClone { /// Produce a new candidate at the given parent block and relay-parent blocks. /// @@ -97,7 +96,6 @@ pub trait ParachainConsensus: Send + Sync + dyn_clone::DynClone { dyn_clone::clone_trait_object!( ParachainConsensus where B: BlockT); -#[async_trait::async_trait] impl ParachainConsensus for Box + Send + Sync> { async fn produce_candidate( &mut self, @@ -151,7 +149,6 @@ impl Clone for ParachainBlockImport { } } -#[async_trait::async_trait] impl BlockImport for ParachainBlockImport where Block: BlockT, diff --git a/cumulus/client/consensus/common/src/tests.rs b/cumulus/client/consensus/common/src/tests.rs index 9658a0add790..172104ca2941 100644 --- a/cumulus/client/consensus/common/src/tests.rs +++ b/cumulus/client/consensus/common/src/tests.rs @@ -16,7 +16,6 @@ use crate::*; -use async_trait::async_trait; use codec::Encode; use cumulus_client_pov_recovery::RecoveryKind; use cumulus_primitives_core::{ @@ -89,7 +88,6 @@ impl Relaychain { } } -#[async_trait] impl RelayChainInterface for Relaychain { async fn validators(&self, _: PHash) -> RelayChainResult> { unimplemented!("Not needed for test") diff --git a/cumulus/client/consensus/proposer/Cargo.toml b/cumulus/client/consensus/proposer/Cargo.toml index 29720a8f4791..b18be5c4b16b 100644 --- a/cumulus/client/consensus/proposer/Cargo.toml +++ b/cumulus/client/consensus/proposer/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true [dependencies] anyhow = "1.0" -async-trait = "0.1.73" thiserror = "1.0.48" # Substrate diff --git a/cumulus/client/consensus/proposer/src/lib.rs b/cumulus/client/consensus/proposer/src/lib.rs index 7404651bcd96..a36038841251 100644 --- a/cumulus/client/consensus/proposer/src/lib.rs +++ b/cumulus/client/consensus/proposer/src/lib.rs @@ -19,8 +19,6 @@ //! //! This utility is designed to be composed within any collator consensus algorithm. -use async_trait::async_trait; - use cumulus_primitives_parachain_inherent::ParachainInherentData; use sp_consensus::{EnableProofRecording, Environment, Proposal, Proposer as SubstrateProposer}; use sp_inherents::InherentData; @@ -53,7 +51,6 @@ impl Error { pub type ProposalOf = Proposal; /// An interface for proposers. -#[async_trait] pub trait ProposerInterface { /// Propose a collation using the supplied `InherentData` and the provided /// `ParachainInherentData`. @@ -92,7 +89,6 @@ impl Proposer { } } -#[async_trait] impl ProposerInterface for Proposer where B: sp_runtime::traits::Block, diff --git a/cumulus/client/consensus/relay-chain/Cargo.toml b/cumulus/client/consensus/relay-chain/Cargo.toml index ba077f624030..14949d057200 100644 --- a/cumulus/client/consensus/relay-chain/Cargo.toml +++ b/cumulus/client/consensus/relay-chain/Cargo.toml @@ -6,7 +6,6 @@ authors.workspace = true edition.workspace = true [dependencies] -async-trait = "0.1.73" futures = "0.3.28" parking_lot = "0.12.1" tracing = "0.1.37" diff --git a/cumulus/client/consensus/relay-chain/src/import_queue.rs b/cumulus/client/consensus/relay-chain/src/import_queue.rs index 9ee03b95904c..27b69b28b108 100644 --- a/cumulus/client/consensus/relay-chain/src/import_queue.rs +++ b/cumulus/client/consensus/relay-chain/src/import_queue.rs @@ -43,7 +43,6 @@ impl Verifier { } } -#[async_trait::async_trait] impl VerifierT for Verifier where Block: BlockT, diff --git a/cumulus/client/consensus/relay-chain/src/lib.rs b/cumulus/client/consensus/relay-chain/src/lib.rs index fc395a9d9573..4967ee836643 100644 --- a/cumulus/client/consensus/relay-chain/src/lib.rs +++ b/cumulus/client/consensus/relay-chain/src/lib.rs @@ -140,7 +140,6 @@ where } } -#[async_trait::async_trait] impl ParachainConsensus for RelayChainConsensus where diff --git a/cumulus/client/network/Cargo.toml b/cumulus/client/network/Cargo.toml index eaaf497ac3ed..a869ad724ad4 100644 --- a/cumulus/client/network/Cargo.toml +++ b/cumulus/client/network/Cargo.toml @@ -6,7 +6,6 @@ description = "Cumulus-specific networking protocol" edition.workspace = true [dependencies] -async-trait = "0.1.73" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } futures = "0.3.28" futures-timer = "3.0.2" diff --git a/cumulus/client/network/src/tests.rs b/cumulus/client/network/src/tests.rs index e03f470753bb..5fb635213787 100644 --- a/cumulus/client/network/src/tests.rs +++ b/cumulus/client/network/src/tests.rs @@ -15,7 +15,6 @@ // along with Polkadot. If not, see . use super::*; -use async_trait::async_trait; use cumulus_primitives_core::relay_chain::BlockId; use cumulus_relay_chain_inprocess_interface::{check_block_in_chain, BlockCheckStatus}; use cumulus_relay_chain_interface::{ @@ -76,7 +75,6 @@ impl DummyRelayChainInterface { } } -#[async_trait] impl RelayChainInterface for DummyRelayChainInterface { async fn validators(&self, _: PHash) -> RelayChainResult> { Ok(self.data.lock().validators.clone()) diff --git a/cumulus/client/pov-recovery/Cargo.toml b/cumulus/client/pov-recovery/Cargo.toml index 2ce903fd3524..cbfe42682047 100644 --- a/cumulus/client/pov-recovery/Cargo.toml +++ b/cumulus/client/pov-recovery/Cargo.toml @@ -28,7 +28,6 @@ polkadot-primitives = { path = "../../../polkadot/primitives" } # Cumulus cumulus-primitives-core = { path = "../../primitives/core" } cumulus-relay-chain-interface = { path = "../relay-chain-interface" } -async-trait = "0.1.73" [dev-dependencies] tokio = { version = "1.32.0", features = ["macros"] } diff --git a/cumulus/client/pov-recovery/src/lib.rs b/cumulus/client/pov-recovery/src/lib.rs index b050bc66799c..53f927b0b065 100644 --- a/cumulus/client/pov-recovery/src/lib.rs +++ b/cumulus/client/pov-recovery/src/lib.rs @@ -82,7 +82,6 @@ const LOG_TARGET: &str = "cumulus-pov-recovery"; /// Test-friendly wrapper trait for the overseer handle. /// Can be used to simulate failing recovery requests. -#[async_trait::async_trait] pub trait RecoveryHandle: Send { async fn send_recovery_msg( &mut self, @@ -91,7 +90,6 @@ pub trait RecoveryHandle: Send { ); } -#[async_trait::async_trait] impl RecoveryHandle for OverseerHandle { async fn send_recovery_msg( &mut self, diff --git a/cumulus/client/relay-chain-inprocess-interface/Cargo.toml b/cumulus/client/relay-chain-inprocess-interface/Cargo.toml index bc8d0d430c77..3275a33f2847 100644 --- a/cumulus/client/relay-chain-inprocess-interface/Cargo.toml +++ b/cumulus/client/relay-chain-inprocess-interface/Cargo.toml @@ -5,7 +5,6 @@ version = "0.1.0" edition.workspace = true [dependencies] -async-trait = "0.1.73" futures = "0.3.28" futures-timer = "3.0.2" diff --git a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs index 42a56b649f03..f7e00683b6a6 100644 --- a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs +++ b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs @@ -16,7 +16,6 @@ use std::{pin::Pin, sync::Arc, time::Duration}; -use async_trait::async_trait; use cumulus_primitives_core::{ relay_chain::{ runtime_api::ParachainHost, Block as PBlock, BlockId, CommittedCandidateReceipt, @@ -66,7 +65,6 @@ impl RelayChainInProcessInterface { } } -#[async_trait] impl RelayChainInterface for RelayChainInProcessInterface { async fn retrieve_dmq_contents( &self, diff --git a/cumulus/client/relay-chain-interface/Cargo.toml b/cumulus/client/relay-chain-interface/Cargo.toml index 3da7ab0b0e82..c2e6eda6aa67 100644 --- a/cumulus/client/relay-chain-interface/Cargo.toml +++ b/cumulus/client/relay-chain-interface/Cargo.toml @@ -15,7 +15,6 @@ sp-state-machine = { path = "../../../substrate/primitives/state-machine" } sc-client-api = { path = "../../../substrate/client/api" } futures = "0.3.28" -async-trait = "0.1.73" thiserror = "1.0.48" jsonrpsee-core = "0.16.2" parity-scale-codec = "3.6.4" diff --git a/cumulus/client/relay-chain-interface/src/lib.rs b/cumulus/client/relay-chain-interface/src/lib.rs index 3dda61635804..94ce0bb8086b 100644 --- a/cumulus/client/relay-chain-interface/src/lib.rs +++ b/cumulus/client/relay-chain-interface/src/lib.rs @@ -21,7 +21,6 @@ use sc_client_api::StorageProof; use futures::Stream; -use async_trait::async_trait; use jsonrpsee_core::Error as JsonRpcError; use parity_scale_codec::Error as CodecError; use sp_api::ApiError; @@ -96,7 +95,6 @@ impl From> for RelayChainEr } /// Trait that provides all necessary methods for interaction between collator and relay chain. -#[async_trait] pub trait RelayChainInterface: Send + Sync { /// Fetch a storage item by key. async fn get_storage_by_key( @@ -196,7 +194,6 @@ pub trait RelayChainInterface: Send + Sync { ) -> RelayChainResult; } -#[async_trait] impl RelayChainInterface for Arc where T: RelayChainInterface + ?Sized, diff --git a/cumulus/client/relay-chain-minimal-node/Cargo.toml b/cumulus/client/relay-chain-minimal-node/Cargo.toml index f132b1a76535..102cf48c79f7 100644 --- a/cumulus/client/relay-chain-minimal-node/Cargo.toml +++ b/cumulus/client/relay-chain-minimal-node/Cargo.toml @@ -38,6 +38,5 @@ cumulus-primitives-core = { path = "../../primitives/core" } array-bytes = "6.1" tracing = "0.1.37" -async-trait = "0.1.73" futures = "0.3.28" diff --git a/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs index 1e78df711543..64c04e8aedf4 100644 --- a/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs +++ b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs @@ -53,7 +53,6 @@ impl BlockChainRpcClient { } } -#[async_trait::async_trait] impl RuntimeApiSubsystemClient for BlockChainRpcClient { async fn validators( &self, @@ -366,7 +365,6 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient { } } -#[async_trait::async_trait] impl AuthorityDiscovery for BlockChainRpcClient { async fn authorities( &self, diff --git a/cumulus/client/relay-chain-rpc-interface/Cargo.toml b/cumulus/client/relay-chain-rpc-interface/Cargo.toml index 0f09377e106c..13a4a3bab60c 100644 --- a/cumulus/client/relay-chain-rpc-interface/Cargo.toml +++ b/cumulus/client/relay-chain-rpc-interface/Cargo.toml @@ -30,7 +30,6 @@ futures-timer = "3.0.2" parity-scale-codec = "3.6.4" jsonrpsee = { version = "0.16.2", features = ["ws-client"] } tracing = "0.1.37" -async-trait = "0.1.73" url = "2.4.0" serde_json = "1.0.107" serde = "1.0.188" diff --git a/cumulus/client/relay-chain-rpc-interface/src/lib.rs b/cumulus/client/relay-chain-rpc-interface/src/lib.rs index 96f8fc8b5563..c375d63558df 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/lib.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/lib.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use async_trait::async_trait; use core::time::Duration; use cumulus_primitives_core::{ relay_chain::{ @@ -64,7 +63,6 @@ impl RelayChainRpcInterface { } } -#[async_trait] impl RelayChainInterface for RelayChainRpcInterface { async fn retrieve_dmq_contents( &self, diff --git a/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs b/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs index 6fd057e170b7..5ea9225aa152 100644 --- a/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs +++ b/cumulus/client/relay-chain-rpc-interface/src/light_client_worker.rs @@ -60,7 +60,6 @@ struct SimpleStringSender { chain_id: ChainId, } -#[async_trait::async_trait] impl TransportSenderT for SimpleStringSender { type Error = LightClientError; @@ -76,7 +75,6 @@ struct SimpleStringReceiver { inner: JsonRpcResponses, } -#[async_trait::async_trait] impl TransportReceiverT for SimpleStringReceiver { type Error = LightClientError; diff --git a/cumulus/polkadot-parachain/Cargo.toml b/cumulus/polkadot-parachain/Cargo.toml index 3c2069c81ef4..f42c55eafb41 100644 --- a/cumulus/polkadot-parachain/Cargo.toml +++ b/cumulus/polkadot-parachain/Cargo.toml @@ -11,7 +11,6 @@ name = "polkadot-parachain" path = "src/main.rs" [dependencies] -async-trait = "0.1.73" clap = { version = "4.4.6", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" diff --git a/cumulus/polkadot-parachain/src/service.rs b/cumulus/polkadot-parachain/src/service.rs index 438d09a4c777..9c497d5cf106 100644 --- a/cumulus/polkadot-parachain/src/service.rs +++ b/cumulus/polkadot-parachain/src/service.rs @@ -1173,7 +1173,6 @@ impl Clone for WaitForAuraConsensus { } } -#[async_trait::async_trait] impl ParachainConsensus for WaitForAuraConsensus where Client: sp_api::ProvideRuntimeApi + Send + Sync, @@ -1215,7 +1214,6 @@ struct Verifier { _phantom: PhantomData, } -#[async_trait::async_trait] impl VerifierT for Verifier where Client: sp_api::ProvideRuntimeApi + Send + Sync, diff --git a/cumulus/primitives/parachain-inherent/Cargo.toml b/cumulus/primitives/parachain-inherent/Cargo.toml index 026d5a61bc8b..2a766c82e957 100644 --- a/cumulus/primitives/parachain-inherent/Cargo.toml +++ b/cumulus/primitives/parachain-inherent/Cargo.toml @@ -5,7 +5,6 @@ authors.workspace = true edition.workspace = true [dependencies] -async-trait = { version = "0.1.73", optional = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } tracing = { version = "0.1.37", optional = true } @@ -29,7 +28,6 @@ cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder", [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "cumulus-primitives-core/std", "cumulus-relay-chain-interface", diff --git a/cumulus/primitives/parachain-inherent/src/client_side.rs b/cumulus/primitives/parachain-inherent/src/client_side.rs index 52987d2da44c..f8dffa1c5af9 100644 --- a/cumulus/primitives/parachain-inherent/src/client_side.rs +++ b/cumulus/primitives/parachain-inherent/src/client_side.rs @@ -179,7 +179,6 @@ impl ParachainInherentData { } } -#[async_trait::async_trait] impl sp_inherents::InherentDataProvider for ParachainInherentData { async fn provide_inherent_data( &self, diff --git a/cumulus/primitives/parachain-inherent/src/mock.rs b/cumulus/primitives/parachain-inherent/src/mock.rs index 5168b46a14d0..375aeb6ee183 100644 --- a/cumulus/primitives/parachain-inherent/src/mock.rs +++ b/cumulus/primitives/parachain-inherent/src/mock.rs @@ -148,7 +148,6 @@ impl MockXcmConfig { } } -#[async_trait::async_trait] impl> InherentDataProvider for MockValidationDataInherentDataProvider { diff --git a/cumulus/test/service/Cargo.toml b/cumulus/test/service/Cargo.toml index c996a01a12ed..7647106cd1a0 100644 --- a/cumulus/test/service/Cargo.toml +++ b/cumulus/test/service/Cargo.toml @@ -10,7 +10,6 @@ name = "test-parachain" path = "src/main.rs" [dependencies] -async-trait = "0.1.73" clap = { version = "4.4.6", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } diff --git a/cumulus/test/service/src/lib.rs b/cumulus/test/service/src/lib.rs index a721645546af..60f8471cae9c 100644 --- a/cumulus/test/service/src/lib.rs +++ b/cumulus/test/service/src/lib.rs @@ -94,7 +94,6 @@ const LOG_TARGET: &str = "cumulus-test-service"; #[derive(Clone)] struct NullConsensus; -#[async_trait::async_trait] impl ParachainConsensus for NullConsensus { async fn produce_candidate( &mut self, @@ -153,7 +152,6 @@ impl FailingRecoveryHandle { } } -#[async_trait::async_trait] impl RecoveryHandle for FailingRecoveryHandle { async fn send_recovery_msg( &mut self, diff --git a/polkadot/node/core/approval-voting/Cargo.toml b/polkadot/node/core/approval-voting/Cargo.toml index acad0d1fa4e4..2b66e9ab42c5 100644 --- a/polkadot/node/core/approval-voting/Cargo.toml +++ b/polkadot/node/core/approval-voting/Cargo.toml @@ -32,7 +32,6 @@ sp-application-crypto = { path = "../../../../substrate/primitives/application-c sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false } [dev-dependencies] -async-trait = "0.1.57" parking_lot = "0.12.0" rand_core = "0.5.1" # should match schnorrkel sp-keyring = { path = "../../../../substrate/primitives/keyring" } diff --git a/polkadot/node/core/approval-voting/src/tests.rs b/polkadot/node/core/approval-voting/src/tests.rs index 0b98f28fbbf0..28ce4d8b3f73 100644 --- a/polkadot/node/core/approval-voting/src/tests.rs +++ b/polkadot/node/core/approval-voting/src/tests.rs @@ -39,7 +39,6 @@ use polkadot_primitives::{ use std::time::Duration; use assert_matches::assert_matches; -use async_trait::async_trait; use parking_lot::Mutex; use sp_keyring::sr25519::Keyring as Sr25519Keyring; use sp_keystore::Keystore; @@ -122,7 +121,6 @@ pub mod test_constants { struct MockSupportsParachains; -#[async_trait] impl HeadSupportsParachains for MockSupportsParachains { async fn head_supports_parachains(&self, _head: &Hash) -> bool { true diff --git a/polkadot/node/core/candidate-validation/Cargo.toml b/polkadot/node/core/candidate-validation/Cargo.toml index a2e88778532f..6394c7067da5 100644 --- a/polkadot/node/core/candidate-validation/Cargo.toml +++ b/polkadot/node/core/candidate-validation/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true license.workspace = true [dependencies] -async-trait = "0.1.57" futures = "0.3.21" futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } diff --git a/polkadot/node/core/candidate-validation/src/lib.rs b/polkadot/node/core/candidate-validation/src/lib.rs index 93db7d11cee8..b37840e72cd8 100644 --- a/polkadot/node/core/candidate-validation/src/lib.rs +++ b/polkadot/node/core/candidate-validation/src/lib.rs @@ -63,8 +63,6 @@ use std::{ time::{Duration, Instant}, }; -use async_trait::async_trait; - mod metrics; use self::metrics::Metrics; @@ -691,7 +689,6 @@ async fn validate_candidate_exhaustive( } } -#[async_trait] trait ValidationBackend { /// Tries executing a PVF a single time (no retries). async fn validate_candidate( @@ -788,7 +785,6 @@ trait ValidationBackend { async fn precheck_pvf(&mut self, pvf: PvfPrepData) -> Result; } -#[async_trait] impl ValidationBackend for ValidationHost { /// Tries executing a PVF a single time (no retries). async fn validate_candidate( diff --git a/polkadot/node/core/candidate-validation/src/tests.rs b/polkadot/node/core/candidate-validation/src/tests.rs index af530a20c4e0..1fca2448c2a7 100644 --- a/polkadot/node/core/candidate-validation/src/tests.rs +++ b/polkadot/node/core/candidate-validation/src/tests.rs @@ -361,7 +361,6 @@ impl MockValidateCandidateBackend { } } -#[async_trait] impl ValidationBackend for MockValidateCandidateBackend { async fn validate_candidate( &mut self, @@ -1021,7 +1020,6 @@ impl MockPreCheckBackend { } } -#[async_trait] impl ValidationBackend for MockPreCheckBackend { async fn validate_candidate( &mut self, diff --git a/polkadot/node/core/parachains-inherent/Cargo.toml b/polkadot/node/core/parachains-inherent/Cargo.toml index 18d91dcfb565..f1b42ca7b2b4 100644 --- a/polkadot/node/core/parachains-inherent/Cargo.toml +++ b/polkadot/node/core/parachains-inherent/Cargo.toml @@ -10,7 +10,6 @@ futures = "0.3.21" futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } thiserror = "1.0.48" -async-trait = "0.1.57" polkadot-node-subsystem = { path = "../../subsystem" } polkadot-overseer = { path = "../../overseer" } polkadot-primitives = { path = "../../../primitives" } diff --git a/polkadot/node/core/parachains-inherent/src/lib.rs b/polkadot/node/core/parachains-inherent/src/lib.rs index 1de3cab32bed..c1da67b6c7ec 100644 --- a/polkadot/node/core/parachains-inherent/src/lib.rs +++ b/polkadot/node/core/parachains-inherent/src/lib.rs @@ -124,7 +124,6 @@ impl> ParachainsInherentDataProvider { } } -#[async_trait::async_trait] impl> sp_inherents::InherentDataProvider for ParachainsInherentDataProvider { diff --git a/polkadot/node/core/runtime-api/Cargo.toml b/polkadot/node/core/runtime-api/Cargo.toml index b16a501686d3..52f2d478e9d8 100644 --- a/polkadot/node/core/runtime-api/Cargo.toml +++ b/polkadot/node/core/runtime-api/Cargo.toml @@ -21,7 +21,6 @@ polkadot-node-subsystem-types = { path = "../../subsystem-types" } sp-api = { path = "../../../../substrate/primitives/api" } sp-core = { path = "../../../../substrate/primitives/core" } sp-keyring = { path = "../../../../substrate/primitives/keyring" } -async-trait = "0.1.57" futures = { version = "0.3.21", features = ["thread-pool"] } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } polkadot-node-primitives = { path = "../../primitives" } diff --git a/polkadot/node/core/runtime-api/src/tests.rs b/polkadot/node/core/runtime-api/src/tests.rs index 979b3587d269..6fa6128ae290 100644 --- a/polkadot/node/core/runtime-api/src/tests.rs +++ b/polkadot/node/core/runtime-api/src/tests.rs @@ -58,7 +58,6 @@ struct MockSubsystemClient { candidate_events: Vec, } -#[async_trait::async_trait] impl RuntimeApiSubsystemClient for MockSubsystemClient { async fn api_version_parachain_host(&self, _: Hash) -> Result, ApiError> { Ok(Some(5)) diff --git a/polkadot/node/malus/Cargo.toml b/polkadot/node/malus/Cargo.toml index 9ce725f16822..08f8057b1350 100644 --- a/polkadot/node/malus/Cargo.toml +++ b/polkadot/node/malus/Cargo.toml @@ -37,7 +37,6 @@ polkadot-node-primitives = { path = "../primitives" } polkadot-primitives = { path = "../../primitives" } color-eyre = { version = "0.6.1", default-features = false } assert_matches = "1.5" -async-trait = "0.1.57" sp-keystore = { path = "../../../substrate/primitives/keystore" } sp-core = { path = "../../../substrate/primitives/core" } clap = { version = "4.4.6", features = ["derive"] } diff --git a/polkadot/node/malus/src/interceptor.rs b/polkadot/node/malus/src/interceptor.rs index 04ee0905deeb..5129fa90c1b3 100644 --- a/polkadot/node/malus/src/interceptor.rs +++ b/polkadot/node/malus/src/interceptor.rs @@ -71,7 +71,6 @@ pub struct InterceptedSender { message_filter: Fil, } -#[async_trait::async_trait] impl overseer::SubsystemSender for InterceptedSender where OutgoingMessage: overseer::AssociateOutgoing + Send + 'static + TryFrom, @@ -193,7 +192,6 @@ where } } -#[async_trait::async_trait] impl overseer::SubsystemContext for InterceptedContext where Context: overseer::SubsystemContext, diff --git a/polkadot/node/network/availability-recovery/Cargo.toml b/polkadot/node/network/availability-recovery/Cargo.toml index 42c3abef547b..07ff09c7e70e 100644 --- a/polkadot/node/network/availability-recovery/Cargo.toml +++ b/polkadot/node/network/availability-recovery/Cargo.toml @@ -11,7 +11,6 @@ schnellru = "0.2.1" rand = "0.8.5" fatality = "0.0.6" thiserror = "1.0.48" -async-trait = "0.1.73" gum = { package = "tracing-gum", path = "../../gum" } polkadot-erasure-coding = { path = "../../../erasure-coding" } diff --git a/polkadot/node/network/availability-recovery/src/task.rs b/polkadot/node/network/availability-recovery/src/task.rs index d5bc2da84944..43cf31375816 100644 --- a/polkadot/node/network/availability-recovery/src/task.rs +++ b/polkadot/node/network/availability-recovery/src/task.rs @@ -58,7 +58,6 @@ const TIMEOUT_START_NEW_REQUESTS: Duration = CHUNK_REQUEST_TIMEOUT; #[cfg(test)] const TIMEOUT_START_NEW_REQUESTS: Duration = Duration::from_millis(100); -#[async_trait::async_trait] /// Common trait for runnable recovery strategies. pub trait RecoveryStrategy: Send { /// Main entry point of the strategy. @@ -465,7 +464,6 @@ impl FetchFull { } } -#[async_trait::async_trait] impl RecoveryStrategy for FetchFull { fn display_name(&self) -> &'static str { "Full recovery from backers" @@ -699,7 +697,6 @@ impl FetchChunks { } } -#[async_trait::async_trait] impl RecoveryStrategy for FetchChunks { fn display_name(&self) -> &'static str { "Fetch chunks" diff --git a/polkadot/node/network/bridge/Cargo.toml b/polkadot/node/network/bridge/Cargo.toml index df8e881234dc..39b1146c402b 100644 --- a/polkadot/node/network/bridge/Cargo.toml +++ b/polkadot/node/network/bridge/Cargo.toml @@ -7,7 +7,6 @@ license.workspace = true [dependencies] always-assert = "0.1" -async-trait = "0.1.57" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } polkadot-primitives = { path = "../../../primitives" } diff --git a/polkadot/node/network/bridge/src/network.rs b/polkadot/node/network/bridge/src/network.rs index 823e1254612f..ce70ef1e38bb 100644 --- a/polkadot/node/network/bridge/src/network.rs +++ b/polkadot/node/network/bridge/src/network.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{collections::HashSet, sync::Arc}; - -use async_trait::async_trait; use futures::{prelude::*, stream::BoxStream}; +use std::{collections::HashSet, sync::Arc}; use parity_scale_codec::Encode; @@ -83,7 +81,6 @@ pub(crate) fn send_message( } /// An abstraction over networking for the purposes of this subsystem. -#[async_trait] pub trait Network: Clone + Send + 'static { /// Get a stream of all events occurring on the network. This may include events unrelated /// to the Polkadot protocol - the user of this function should filter only for events related @@ -126,7 +123,6 @@ pub trait Network: Clone + Send + 'static { fn write_notification(&self, who: PeerId, protocol: ProtocolName, message: Vec); } -#[async_trait] impl Network for Arc> { fn event_stream(&mut self) -> BoxStream<'static, NetworkEvent> { NetworkService::event_stream(self, "polkadot-network-bridge").boxed() diff --git a/polkadot/node/network/bridge/src/rx/tests.rs b/polkadot/node/network/bridge/src/rx/tests.rs index 7c69cce48391..feba29337bee 100644 --- a/polkadot/node/network/bridge/src/rx/tests.rs +++ b/polkadot/node/network/bridge/src/rx/tests.rs @@ -21,7 +21,6 @@ use polkadot_node_network_protocol::{self as net_protocol, OurView}; use polkadot_node_subsystem::messages::NetworkBridgeEvent; use assert_matches::assert_matches; -use async_trait::async_trait; use parking_lot::Mutex; use std::{ collections::HashSet, @@ -100,7 +99,6 @@ fn new_test_network( ) } -#[async_trait] impl Network for TestNetwork { fn event_stream(&mut self) -> BoxStream<'static, NetworkEvent> { self.net_events @@ -161,7 +159,6 @@ impl Network for TestNetwork { } } -#[async_trait] impl validator_discovery::AuthorityDiscovery for TestAuthorityDiscovery { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/network/bridge/src/tx/tests.rs b/polkadot/node/network/bridge/src/tx/tests.rs index 48287f8b74c9..32ee30258a4c 100644 --- a/polkadot/node/network/bridge/src/tx/tests.rs +++ b/polkadot/node/network/bridge/src/tx/tests.rs @@ -18,7 +18,6 @@ use super::*; use futures::{executor, stream::BoxStream}; use polkadot_node_subsystem_util::TimeoutExt; -use async_trait::async_trait; use parking_lot::Mutex; use std::collections::HashSet; @@ -87,7 +86,6 @@ fn new_test_network( ) } -#[async_trait] impl Network for TestNetwork { fn event_stream(&mut self) -> BoxStream<'static, NetworkEvent> { self.net_events @@ -148,7 +146,6 @@ impl Network for TestNetwork { } } -#[async_trait] impl validator_discovery::AuthorityDiscovery for TestAuthorityDiscovery { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/network/bridge/src/validator_discovery.rs b/polkadot/node/network/bridge/src/validator_discovery.rs index 86e861fbc5b5..8142a2e4870c 100644 --- a/polkadot/node/network/bridge/src/validator_discovery.rs +++ b/polkadot/node/network/bridge/src/validator_discovery.rs @@ -168,7 +168,6 @@ mod tests { use super::*; use crate::network::Network; - use async_trait::async_trait; use futures::stream::BoxStream; use polkadot_node_network_protocol::{ request_response::{outgoing::Requests, ReqProtocolNames}, @@ -222,7 +221,6 @@ mod tests { } } - #[async_trait] impl Network for TestNetwork { fn event_stream(&mut self) -> BoxStream<'static, NetworkEvent> { panic!() @@ -268,7 +266,6 @@ mod tests { } } - #[async_trait] impl AuthorityDiscovery for TestAuthorityDiscovery { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/network/dispute-distribution/Cargo.toml b/polkadot/node/network/dispute-distribution/Cargo.toml index 5d8e245d289a..a3f89df2d857 100644 --- a/polkadot/node/network/dispute-distribution/Cargo.toml +++ b/polkadot/node/network/dispute-distribution/Cargo.toml @@ -27,7 +27,6 @@ indexmap = "1.9.1" [dev-dependencies] async-channel = "1.8.0" -async-trait = "0.1.57" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { path = "../../../../substrate/primitives/keyring" } sp-tracing = { path = "../../../../substrate/primitives/tracing" } diff --git a/polkadot/node/network/dispute-distribution/src/tests/mock.rs b/polkadot/node/network/dispute-distribution/src/tests/mock.rs index e6a49f14c094..5a561796027b 100644 --- a/polkadot/node/network/dispute-distribution/src/tests/mock.rs +++ b/polkadot/node/network/dispute-distribution/src/tests/mock.rs @@ -17,15 +17,13 @@ //! Mock data and utility functions for unit tests in this subsystem. +use lazy_static::lazy_static; use std::{ collections::{HashMap, HashSet}, sync::Arc, time::Instant, }; -use async_trait::async_trait; -use lazy_static::lazy_static; - use polkadot_node_network_protocol::{authority_discovery::AuthorityDiscovery, PeerId}; use sc_keystore::LocalKeystore; use sp_application_crypto::AppCrypto; @@ -203,7 +201,6 @@ impl MockAuthorityDiscovery { } } -#[async_trait] impl AuthorityDiscovery for MockAuthorityDiscovery { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/network/gossip-support/Cargo.toml b/polkadot/node/network/gossip-support/Cargo.toml index a5bfda73833f..a7d3e31f81ec 100644 --- a/polkadot/node/network/gossip-support/Cargo.toml +++ b/polkadot/node/network/gossip-support/Cargo.toml @@ -32,5 +32,4 @@ sp-authority-discovery = { path = "../../../../substrate/primitives/authority-di polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.4.0" -async-trait = "0.1.57" lazy_static = "1.4.0" diff --git a/polkadot/node/network/gossip-support/src/tests.rs b/polkadot/node/network/gossip-support/src/tests.rs index 2e909bb0a674..431d140e237f 100644 --- a/polkadot/node/network/gossip-support/src/tests.rs +++ b/polkadot/node/network/gossip-support/src/tests.rs @@ -19,7 +19,6 @@ use std::{collections::HashSet, time::Duration}; use assert_matches::assert_matches; -use async_trait::async_trait; use futures::{executor, future, Future}; use lazy_static::lazy_static; @@ -113,7 +112,6 @@ impl MockAuthorityDiscovery { } } -#[async_trait] impl AuthorityDiscovery for MockAuthorityDiscovery { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/network/protocol/Cargo.toml b/polkadot/node/network/protocol/Cargo.toml index 379334ded24a..a126e3c59eb8 100644 --- a/polkadot/node/network/protocol/Cargo.toml +++ b/polkadot/node/network/protocol/Cargo.toml @@ -8,7 +8,6 @@ description = "Primitives types for the Node-side" [dependencies] async-channel = "1.8.0" -async-trait = "0.1.57" hex = "0.4.3" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } diff --git a/polkadot/node/network/protocol/src/authority_discovery.rs b/polkadot/node/network/protocol/src/authority_discovery.rs index beb5409d4ac0..a12846a0cf64 100644 --- a/polkadot/node/network/protocol/src/authority_discovery.rs +++ b/polkadot/node/network/protocol/src/authority_discovery.rs @@ -18,8 +18,6 @@ use std::{collections::HashSet, fmt::Debug}; -use async_trait::async_trait; - use sc_authority_discovery::Service as AuthorityDiscoveryService; use polkadot_primitives::AuthorityDiscoveryId; @@ -28,7 +26,6 @@ use sc_network::{Multiaddr, PeerId}; /// An abstraction over the authority discovery service. /// /// Needed for mocking in tests mostly. -#[async_trait] pub trait AuthorityDiscovery: Send + Debug + 'static { /// Get the addresses for the given [`AuthorityDiscoveryId`] from the local address cache. async fn get_addresses_by_authority_id( @@ -42,7 +39,6 @@ pub trait AuthorityDiscovery: Send + Debug + 'static { ) -> Option>; } -#[async_trait] impl AuthorityDiscovery for AuthorityDiscoveryService { async fn get_addresses_by_authority_id( &mut self, diff --git a/polkadot/node/overseer/Cargo.toml b/polkadot/node/overseer/Cargo.toml index 376ebe0375b8..47c4addd6812 100644 --- a/polkadot/node/overseer/Cargo.toml +++ b/polkadot/node/overseer/Cargo.toml @@ -19,7 +19,6 @@ polkadot-primitives = { path = "../../primitives" } orchestra = { version = "0.3.3", default-features = false, features=["futures_channel"] } gum = { package = "tracing-gum", path = "../gum" } sp-core = { path = "../../../substrate/primitives/core" } -async-trait = "0.1.57" tikv-jemalloc-ctl = { version = "0.5.0", optional = true } [dev-dependencies] diff --git a/polkadot/node/overseer/examples/minimal-example.rs b/polkadot/node/overseer/examples/minimal-example.rs index cffdfd9f8aa1..e4a37d565228 100644 --- a/polkadot/node/overseer/examples/minimal-example.rs +++ b/polkadot/node/overseer/examples/minimal-example.rs @@ -20,7 +20,6 @@ use futures::{channel::oneshot, pending, pin_mut, select, stream, FutureExt, StreamExt}; use futures_timer::Delay; -use orchestra::async_trait; use std::time::Duration; use ::test_helpers::{dummy_candidate_descriptor, dummy_hash}; @@ -36,7 +35,6 @@ use polkadot_primitives::{CandidateReceipt, Hash, PvfExecTimeoutKind}; struct AlwaysSupportsParachains; -#[async_trait] impl HeadSupportsParachains for AlwaysSupportsParachains { async fn head_supports_parachains(&self, _head: &Hash) -> bool { true diff --git a/polkadot/node/overseer/src/lib.rs b/polkadot/node/overseer/src/lib.rs index 6802426d3c70..1f2ff9a7cc89 100644 --- a/polkadot/node/overseer/src/lib.rs +++ b/polkadot/node/overseer/src/lib.rs @@ -153,13 +153,11 @@ impl crate::gen::Spawner for SpawnGlue { } /// Whether a header supports parachain consensus or not. -#[async_trait::async_trait] pub trait HeadSupportsParachains { /// Return true if the given header supports parachain consensus. Otherwise, false. async fn head_supports_parachains(&self, head: &Hash) -> bool; } -#[async_trait::async_trait] impl HeadSupportsParachains for Arc where Client: RuntimeApiSubsystemClient + Sync + Send, @@ -429,7 +427,6 @@ pub async fn forward_events>(client: Arc

, mut hand /// /// struct AlwaysSupportsParachains; /// -/// #[async_trait::async_trait] /// impl HeadSupportsParachains for AlwaysSupportsParachains { /// async fn head_supports_parachains(&self, _head: &Hash) -> bool { true } /// } diff --git a/polkadot/node/overseer/src/tests.rs b/polkadot/node/overseer/src/tests.rs index c17613fb7ea5..f6a00f380b4b 100644 --- a/polkadot/node/overseer/src/tests.rs +++ b/polkadot/node/overseer/src/tests.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use async_trait::async_trait; use futures::{executor, pending, pin_mut, poll, select, stream, FutureExt}; use std::{collections::HashMap, sync::atomic, task::Poll}; @@ -147,7 +146,6 @@ where struct MockSupportsParachains; -#[async_trait] impl HeadSupportsParachains for MockSupportsParachains { async fn head_supports_parachains(&self, _head: &Hash) -> bool { true diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index 3429f4e0a3a4..4608eb2b1b25 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -74,7 +74,6 @@ frame-benchmarking-cli = { path = "../../../substrate/utils/frame/benchmarking-c frame-benchmarking = { path = "../../../substrate/frame/benchmarking" } # External Crates -async-trait = "0.1.57" futures = "0.3.21" hex-literal = "0.4.1" is_executable = "1.0.1" diff --git a/polkadot/node/service/src/relay_chain_selection.rs b/polkadot/node/service/src/relay_chain_selection.rs index 5fae6a96de4e..2cee9f2f6278 100644 --- a/polkadot/node/service/src/relay_chain_selection.rs +++ b/polkadot/node/service/src/relay_chain_selection.rs @@ -189,7 +189,6 @@ where } } -#[async_trait::async_trait] impl SelectChain for SelectRelayChain where B: sc_client_api::Backend + 'static, @@ -309,12 +308,10 @@ enum Error { /// Decoupling trait for the overseer handle. /// /// Required for testing purposes. -#[async_trait::async_trait] pub trait OverseerHandleT: Clone + Send + Sync { async fn send_msg>(&mut self, msg: M, origin: &'static str); } -#[async_trait::async_trait] impl OverseerHandleT for Handle { async fn send_msg>(&mut self, msg: M, origin: &'static str) { Handle::send_msg(self, msg, origin).await diff --git a/polkadot/node/service/src/tests.rs b/polkadot/node/service/src/tests.rs index 86119662d9bc..4ec237ffc1e1 100644 --- a/polkadot/node/service/src/tests.rs +++ b/polkadot/node/service/src/tests.rs @@ -48,7 +48,6 @@ use polkadot_overseer::{SubsystemContext, SubsystemSender}; type VirtualOverseer = test_helpers::TestSubsystemContextHandle; -#[async_trait::async_trait] impl OverseerHandleT for TestSubsystemSender { async fn send_msg>(&mut self, msg: M, _origin: &'static str) { TestSubsystemSender::send_message(self, msg.into()).await; diff --git a/polkadot/node/subsystem-test-helpers/Cargo.toml b/polkadot/node/subsystem-test-helpers/Cargo.toml index 9087ca11f5d2..d739a40c5076 100644 --- a/polkadot/node/subsystem-test-helpers/Cargo.toml +++ b/polkadot/node/subsystem-test-helpers/Cargo.toml @@ -8,7 +8,6 @@ edition.workspace = true license.workspace = true [dependencies] -async-trait = "0.1.57" futures = "0.3.21" parking_lot = "0.12.0" polkadot-node-subsystem = { path = "../subsystem" } diff --git a/polkadot/node/subsystem-test-helpers/src/lib.rs b/polkadot/node/subsystem-test-helpers/src/lib.rs index 3f92513498c4..8c9fac8a4da3 100644 --- a/polkadot/node/subsystem-test-helpers/src/lib.rs +++ b/polkadot/node/subsystem-test-helpers/src/lib.rs @@ -150,7 +150,6 @@ pub fn sender_receiver() -> (TestSubsystemSender, mpsc::UnboundedReceiver overseer::SubsystemSender for TestSubsystemSender where AllMessages: From, @@ -189,7 +188,6 @@ pub struct TestSubsystemContext { spawn: S, } -#[async_trait::async_trait] impl overseer::SubsystemContext for TestSubsystemContext where M: overseer::AssociateOutgoing + std::fmt::Debug + Send + 'static, diff --git a/polkadot/node/subsystem-types/Cargo.toml b/polkadot/node/subsystem-types/Cargo.toml index a1c00cb0652e..27e77f4c3441 100644 --- a/polkadot/node/subsystem-types/Cargo.toml +++ b/polkadot/node/subsystem-types/Cargo.toml @@ -24,4 +24,3 @@ sc-transaction-pool-api = { path = "../../../substrate/client/transaction-pool/a smallvec = "1.8.0" substrate-prometheus-endpoint = { path = "../../../substrate/utils/prometheus" } thiserror = "1.0.48" -async-trait = "0.1.57" diff --git a/polkadot/node/subsystem-types/src/runtime_client.rs b/polkadot/node/subsystem-types/src/runtime_client.rs index f7adcf9862b5..b1e4d16b1fdb 100644 --- a/polkadot/node/subsystem-types/src/runtime_client.rs +++ b/polkadot/node/subsystem-types/src/runtime_client.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use async_trait::async_trait; use polkadot_primitives::{ async_backing, runtime_api::ParachainHost, slashing, Block, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, @@ -30,7 +29,6 @@ use sp_consensus_babe::{BabeApi, Epoch}; use std::{collections::BTreeMap, sync::Arc}; /// Exposes all runtime calls that are used by the runtime API subsystem. -#[async_trait] pub trait RuntimeApiSubsystemClient { /// Parachain host API version async fn api_version_parachain_host(&self, at: Hash) -> Result, ApiError>; @@ -277,7 +275,6 @@ impl DefaultSubsystemClient { } } -#[async_trait] impl RuntimeApiSubsystemClient for DefaultSubsystemClient where Client: ProvideRuntimeApi + Send + Sync, diff --git a/polkadot/node/subsystem-util/Cargo.toml b/polkadot/node/subsystem-util/Cargo.toml index d9364e2c2c0f..bff5d4681f08 100644 --- a/polkadot/node/subsystem-util/Cargo.toml +++ b/polkadot/node/subsystem-util/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true license.workspace = true [dependencies] -async-trait = "0.1.57" futures = "0.3.21" futures-channel = "0.3.23" itertools = "0.10" diff --git a/substrate/client/authority-discovery/Cargo.toml b/substrate/client/authority-discovery/Cargo.toml index ef2fdcfd485f..923ecb1ea91a 100644 --- a/substrate/client/authority-discovery/Cargo.toml +++ b/substrate/client/authority-discovery/Cargo.toml @@ -36,7 +36,6 @@ sp-blockchain = { path = "../../primitives/blockchain" } sp-core = { path = "../../primitives/core" } sp-keystore = { path = "../../primitives/keystore" } sp-runtime = { path = "../../primitives/runtime" } -async-trait = "0.1.56" [dev-dependencies] quickcheck = { version = "1.0.3", default-features = false } diff --git a/substrate/client/authority-discovery/src/worker.rs b/substrate/client/authority-discovery/src/worker.rs index a29e74df9acc..ffbe33b3b188 100644 --- a/substrate/client/authority-discovery/src/worker.rs +++ b/substrate/client/authority-discovery/src/worker.rs @@ -150,7 +150,6 @@ pub struct Worker { /// Wrapper for [`AuthorityDiscoveryApi`](sp_authority_discovery::AuthorityDiscoveryApi). Can be /// be implemented by any struct without dependency on the runtime. -#[async_trait::async_trait] pub trait AuthorityDiscovery { /// Retrieve authority identifiers of the current and next authority set. async fn authorities(&self, at: Block::Hash) @@ -160,7 +159,6 @@ pub trait AuthorityDiscovery { async fn best_hash(&self) -> std::result::Result; } -#[async_trait::async_trait] impl AuthorityDiscovery for T where T: ProvideRuntimeApi + HeaderBackend + Send + Sync, diff --git a/substrate/client/consensus/aura/Cargo.toml b/substrate/client/consensus/aura/Cargo.toml index bc9648f683a8..f7d2b4b7624e 100644 --- a/substrate/client/consensus/aura/Cargo.toml +++ b/substrate/client/consensus/aura/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" log = "0.4.17" diff --git a/substrate/client/consensus/aura/src/import_queue.rs b/substrate/client/consensus/aura/src/import_queue.rs index a8777ef8788c..c5d43faccb38 100644 --- a/substrate/client/consensus/aura/src/import_queue.rs +++ b/substrate/client/consensus/aura/src/import_queue.rs @@ -162,7 +162,6 @@ where } } -#[async_trait::async_trait] impl Verifier for AuraVerifier> where C: ProvideRuntimeApi + Send + Sync + sc_client_api::backend::AuxStore, diff --git a/substrate/client/consensus/aura/src/lib.rs b/substrate/client/consensus/aura/src/lib.rs index 2ed451ef663e..bc53d5ed8a75 100644 --- a/substrate/client/consensus/aura/src/lib.rs +++ b/substrate/client/consensus/aura/src/lib.rs @@ -322,7 +322,6 @@ struct AuraWorker { _phantom: PhantomData P>, } -#[async_trait::async_trait] impl sc_consensus_slots::SimpleSlotWorker for AuraWorker> where diff --git a/substrate/client/consensus/babe/Cargo.toml b/substrate/client/consensus/babe/Cargo.toml index c8cff0981b36..7c7685a40b39 100644 --- a/substrate/client/consensus/babe/Cargo.toml +++ b/substrate/client/consensus/babe/Cargo.toml @@ -14,7 +14,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } futures = "0.3.21" log = "0.4.17" diff --git a/substrate/client/consensus/babe/rpc/src/lib.rs b/substrate/client/consensus/babe/rpc/src/lib.rs index bffe026ea6ef..360a059ed33b 100644 --- a/substrate/client/consensus/babe/rpc/src/lib.rs +++ b/substrate/client/consensus/babe/rpc/src/lib.rs @@ -22,7 +22,7 @@ use std::{collections::HashMap, sync::Arc}; use futures::TryFutureExt; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::{error::CallError, ErrorObject}, }; @@ -78,7 +78,6 @@ impl Babe { } } -#[async_trait] impl BabeApiServer for Babe where B: BlockT, diff --git a/substrate/client/consensus/babe/src/lib.rs b/substrate/client/consensus/babe/src/lib.rs index ccf72939631a..ef0b97d997a2 100644 --- a/substrate/client/consensus/babe/src/lib.rs +++ b/substrate/client/consensus/babe/src/lib.rs @@ -713,7 +713,6 @@ struct BabeSlotWorker { telemetry: Option, } -#[async_trait::async_trait] impl sc_consensus_slots::SimpleSlotWorker for BabeSlotWorker where @@ -1110,7 +1109,6 @@ where } } -#[async_trait::async_trait] impl Verifier for BabeVerifier where @@ -1387,7 +1385,6 @@ where } } -#[async_trait::async_trait] impl BlockImport for BabeBlockImport where Block: BlockT, diff --git a/substrate/client/consensus/babe/src/tests.rs b/substrate/client/consensus/babe/src/tests.rs index 02882d8baaed..4973967b7ee0 100644 --- a/substrate/client/consensus/babe/src/tests.rs +++ b/substrate/client/consensus/babe/src/tests.rs @@ -137,7 +137,6 @@ thread_local! { #[derive(Clone)] pub struct PanickingBlockImport(B); -#[async_trait::async_trait] impl> BlockImport for PanickingBlockImport where B: Send, @@ -187,7 +186,6 @@ pub struct TestVerifier { mutator: Mutator, } -#[async_trait::async_trait] impl Verifier for TestVerifier { /// Verify the given data and return the BlockImportParams and an optional /// new set of validators to import. If not, err with an Error-Message diff --git a/substrate/client/consensus/beefy/Cargo.toml b/substrate/client/consensus/beefy/Cargo.toml index aae5a44d7fa2..af113fc32d2c 100644 --- a/substrate/client/consensus/beefy/Cargo.toml +++ b/substrate/client/consensus/beefy/Cargo.toml @@ -11,7 +11,6 @@ homepage = "https://substrate.io" [dependencies] array-bytes = "6.1" async-channel = "1.8.0" -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } fnv = "1.0.6" futures = "0.3" diff --git a/substrate/client/consensus/beefy/rpc/src/lib.rs b/substrate/client/consensus/beefy/rpc/src/lib.rs index f5c0ff32627d..1485b023293e 100644 --- a/substrate/client/consensus/beefy/rpc/src/lib.rs +++ b/substrate/client/consensus/beefy/rpc/src/lib.rs @@ -28,7 +28,7 @@ use sp_runtime::traits::Block as BlockT; use futures::{task::SpawnError, FutureExt, StreamExt}; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::{error::CallError, ErrorObject, SubscriptionResult}, SubscriptionSink, @@ -132,7 +132,6 @@ where } } -#[async_trait] impl BeefyApiServer for Beefy where diff --git a/substrate/client/consensus/beefy/src/import.rs b/substrate/client/consensus/beefy/src/import.rs index 5b2abb20aced..55f84729caa5 100644 --- a/substrate/client/consensus/beefy/src/import.rs +++ b/substrate/client/consensus/beefy/src/import.rs @@ -113,7 +113,6 @@ where } } -#[async_trait::async_trait] impl BlockImport for BeefyBlockImport where Block: BlockT, diff --git a/substrate/client/consensus/common/Cargo.toml b/substrate/client/consensus/common/Cargo.toml index f269e3752d43..17e320f68838 100644 --- a/substrate/client/consensus/common/Cargo.toml +++ b/substrate/client/consensus/common/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" futures = { version = "0.3.21", features = ["thread-pool"] } futures-timer = "3.0.1" libp2p-identity = { version = "0.1.3", features = ["peerid", "ed25519"] } diff --git a/substrate/client/consensus/common/src/block_import.rs b/substrate/client/consensus/common/src/block_import.rs index a451692ad478..8e99dcfcc796 100644 --- a/substrate/client/consensus/common/src/block_import.rs +++ b/substrate/client/consensus/common/src/block_import.rs @@ -301,7 +301,6 @@ impl BlockImportParams { } /// Block import trait. -#[async_trait::async_trait] pub trait BlockImport { /// The error type. type Error: std::error::Error + Send + 'static; @@ -319,7 +318,6 @@ pub trait BlockImport { ) -> Result; } -#[async_trait::async_trait] impl BlockImport for crate::import_queue::BoxBlockImport { type Error = sp_consensus::error::Error; @@ -340,7 +338,6 @@ impl BlockImport for crate::import_queue::BoxBlockImport { } } -#[async_trait::async_trait] impl BlockImport for Arc where for<'r> &'r T: BlockImport, @@ -364,7 +361,6 @@ where } /// Justification import trait -#[async_trait::async_trait] pub trait JustificationImport { type Error: std::error::Error + Send + 'static; diff --git a/substrate/client/consensus/common/src/import_queue.rs b/substrate/client/consensus/common/src/import_queue.rs index 39d5bf8ed35d..0f4e2458296c 100644 --- a/substrate/client/consensus/common/src/import_queue.rs +++ b/substrate/client/consensus/common/src/import_queue.rs @@ -92,7 +92,6 @@ pub struct IncomingBlock { } /// Verify a justification of a block -#[async_trait::async_trait] pub trait Verifier: Send { /// Verify the given block data and return the `BlockImportParams` to /// continue the block import process. @@ -117,7 +116,6 @@ pub trait ImportQueueService: Send { ); } -#[async_trait::async_trait] pub trait ImportQueue: Send { /// Get a copy of the handle to [`ImportQueueService`]. fn service(&self) -> Box>; diff --git a/substrate/client/consensus/common/src/import_queue/basic_queue.rs b/substrate/client/consensus/common/src/import_queue/basic_queue.rs index 1cc7ec26fd19..ea77ce3d95c0 100644 --- a/substrate/client/consensus/common/src/import_queue/basic_queue.rs +++ b/substrate/client/consensus/common/src/import_queue/basic_queue.rs @@ -162,7 +162,6 @@ impl ImportQueueService for BasicQueueHandle { } } -#[async_trait::async_trait] impl ImportQueue for BasicQueue { /// Get handle to [`ImportQueueService`]. fn service(&self) -> Box> { @@ -507,7 +506,6 @@ mod tests { use futures::{executor::block_on, Future}; use sp_test_primitives::{Block, BlockNumber, Hash, Header}; - #[async_trait::async_trait] impl Verifier for () { async fn verify( &mut self, @@ -517,7 +515,6 @@ mod tests { } } - #[async_trait::async_trait] impl BlockImport for () { type Error = sp_consensus::Error; @@ -536,7 +533,6 @@ mod tests { } } - #[async_trait::async_trait] impl JustificationImport for () { type Error = sp_consensus::Error; diff --git a/substrate/client/consensus/common/src/import_queue/mock.rs b/substrate/client/consensus/common/src/import_queue/mock.rs index 64ac532ded85..f67b508064d2 100644 --- a/substrate/client/consensus/common/src/import_queue/mock.rs +++ b/substrate/client/consensus/common/src/import_queue/mock.rs @@ -36,7 +36,6 @@ mockall::mock! { mockall::mock! { pub ImportQueue {} - #[async_trait::async_trait] impl ImportQueue for ImportQueue { fn service(&self) -> Box>; fn service_ref(&mut self) -> &mut dyn ImportQueueService; diff --git a/substrate/client/consensus/common/src/longest_chain.rs b/substrate/client/consensus/common/src/longest_chain.rs index f27cde4982de..35f2f8a866df 100644 --- a/substrate/client/consensus/common/src/longest_chain.rs +++ b/substrate/client/consensus/common/src/longest_chain.rs @@ -132,7 +132,6 @@ where } } -#[async_trait::async_trait] impl SelectChain for LongestChain where B: backend::Backend, diff --git a/substrate/client/consensus/grandpa/Cargo.toml b/substrate/client/consensus/grandpa/Cargo.toml index 472bdd1c5b82..f40ed69f4b44 100644 --- a/substrate/client/consensus/grandpa/Cargo.toml +++ b/substrate/client/consensus/grandpa/Cargo.toml @@ -16,7 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] ahash = "0.8.2" array-bytes = "6.1" -async-trait = "0.1.57" dyn-clone = "1.0" finality-grandpa = { version = "0.16.2", features = ["derive-codec"] } futures = "0.3.21" diff --git a/substrate/client/consensus/grandpa/rpc/src/lib.rs b/substrate/client/consensus/grandpa/rpc/src/lib.rs index c6298bff969b..c8131c66e2a3 100644 --- a/substrate/client/consensus/grandpa/rpc/src/lib.rs +++ b/substrate/client/consensus/grandpa/rpc/src/lib.rs @@ -23,12 +23,7 @@ use futures::{FutureExt, StreamExt}; use log::warn; use std::sync::Arc; -use jsonrpsee::{ - core::{async_trait, RpcResult}, - proc_macros::rpc, - types::SubscriptionResult, - SubscriptionSink, -}; +use jsonrpsee::{core::RpcResult, proc_macros::rpc, types::SubscriptionResult, SubscriptionSink}; mod error; mod finality; @@ -89,7 +84,6 @@ impl } } -#[async_trait] impl GrandpaApiServer> for Grandpa diff --git a/substrate/client/consensus/grandpa/src/import.rs b/substrate/client/consensus/grandpa/src/import.rs index ca5b7c400bfb..cb4d80bd3c2e 100644 --- a/substrate/client/consensus/grandpa/src/import.rs +++ b/substrate/client/consensus/grandpa/src/import.rs @@ -87,7 +87,6 @@ impl Clone } } -#[async_trait::async_trait] impl JustificationImport for GrandpaBlockImport where @@ -507,7 +506,6 @@ where } } -#[async_trait::async_trait] impl BlockImport for GrandpaBlockImport where NumberFor: finality_grandpa::BlockNumberOps, diff --git a/substrate/client/consensus/grandpa/src/tests.rs b/substrate/client/consensus/grandpa/src/tests.rs index 0175f7d1b473..f85b83a72ca0 100644 --- a/substrate/client/consensus/grandpa/src/tests.rs +++ b/substrate/client/consensus/grandpa/src/tests.rs @@ -20,7 +20,6 @@ use super::*; use assert_matches::assert_matches; -use async_trait::async_trait; use environment::HasVoted; use futures_timer::Delay; use parking_lot::{Mutex, RwLock}; @@ -230,7 +229,6 @@ impl MockSelectChain { } } -#[async_trait] impl SelectChain for MockSelectChain { async fn leaves(&self) -> Result, ConsensusError> { Ok(self.leaves.lock().take().unwrap()) diff --git a/substrate/client/consensus/manual-seal/Cargo.toml b/substrate/client/consensus/manual-seal/Cargo.toml index a6430fdf1dee..90fb2337eb5b 100644 --- a/substrate/client/consensus/manual-seal/Cargo.toml +++ b/substrate/client/consensus/manual-seal/Cargo.toml @@ -15,7 +15,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"] } assert_matches = "1.3.0" -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" futures-timer = "3.0.1" diff --git a/substrate/client/consensus/manual-seal/src/consensus/babe.rs b/substrate/client/consensus/manual-seal/src/consensus/babe.rs index 26fa81459808..8e3346334e95 100644 --- a/substrate/client/consensus/manual-seal/src/consensus/babe.rs +++ b/substrate/client/consensus/manual-seal/src/consensus/babe.rs @@ -89,7 +89,6 @@ impl BabeVerifier { } /// The verifier for the manual seal engine; instantly finalizes. -#[async_trait::async_trait] impl Verifier for BabeVerifier where B: BlockT, diff --git a/substrate/client/consensus/manual-seal/src/consensus/timestamp.rs b/substrate/client/consensus/manual-seal/src/consensus/timestamp.rs index dbffb2fbba82..f14f7691a49c 100644 --- a/substrate/client/consensus/manual-seal/src/consensus/timestamp.rs +++ b/substrate/client/consensus/manual-seal/src/consensus/timestamp.rs @@ -136,7 +136,6 @@ impl SlotTimestampProvider { } } -#[async_trait::async_trait] impl InherentDataProvider for SlotTimestampProvider { async fn provide_inherent_data( &self, diff --git a/substrate/client/consensus/manual-seal/src/lib.rs b/substrate/client/consensus/manual-seal/src/lib.rs index e3608f6716c2..368f2cff7dc3 100644 --- a/substrate/client/consensus/manual-seal/src/lib.rs +++ b/substrate/client/consensus/manual-seal/src/lib.rs @@ -62,7 +62,6 @@ pub const MANUAL_SEAL_ENGINE_ID: ConsensusEngineId = [b'm', b'a', b'n', b'l']; /// The verifier for the manual seal engine; instantly finalizes. struct ManualSealVerifier; -#[async_trait::async_trait] impl Verifier for ManualSealVerifier { async fn verify( &mut self, diff --git a/substrate/client/consensus/manual-seal/src/rpc.rs b/substrate/client/consensus/manual-seal/src/rpc.rs index c0b3af69bedf..4a8427e3bc96 100644 --- a/substrate/client/consensus/manual-seal/src/rpc.rs +++ b/substrate/client/consensus/manual-seal/src/rpc.rs @@ -24,7 +24,7 @@ use futures::{ SinkExt, }; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, }; use sc_consensus::ImportedAux; @@ -108,7 +108,6 @@ impl ManualSeal { } } -#[async_trait] impl ManualSealApiServer for ManualSeal { async fn create_block( &self, diff --git a/substrate/client/consensus/pow/Cargo.toml b/substrate/client/consensus/pow/Cargo.toml index ef32425685b6..5d6f1df48c7c 100644 --- a/substrate/client/consensus/pow/Cargo.toml +++ b/substrate/client/consensus/pow/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.1" diff --git a/substrate/client/consensus/pow/src/lib.rs b/substrate/client/consensus/pow/src/lib.rs index ee5c1dfc6f11..18e6f3fa855e 100644 --- a/substrate/client/consensus/pow/src/lib.rs +++ b/substrate/client/consensus/pow/src/lib.rs @@ -297,7 +297,6 @@ where } } -#[async_trait::async_trait] impl BlockImport for PowBlockImport where B: BlockT, @@ -435,7 +434,6 @@ impl PowVerifier { } } -#[async_trait::async_trait] impl Verifier for PowVerifier where Algorithm: PowAlgorithm + Send + Sync, diff --git a/substrate/client/consensus/slots/Cargo.toml b/substrate/client/consensus/slots/Cargo.toml index 52c528c3028a..330ae301d63a 100644 --- a/substrate/client/consensus/slots/Cargo.toml +++ b/substrate/client/consensus/slots/Cargo.toml @@ -14,7 +14,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" futures-timer = "3.0.1" diff --git a/substrate/client/consensus/slots/src/lib.rs b/substrate/client/consensus/slots/src/lib.rs index 12636aae7a44..5d5ecac5e4c7 100644 --- a/substrate/client/consensus/slots/src/lib.rs +++ b/substrate/client/consensus/slots/src/lib.rs @@ -68,7 +68,6 @@ pub struct SlotResult { /// /// The implementation should not make any assumptions of the slot being bound to the time or /// similar. The only valid assumption is that the slot number is always increasing. -#[async_trait::async_trait] pub trait SlotWorker { /// Called when a new slot is triggered. /// @@ -80,7 +79,6 @@ pub trait SlotWorker { /// A skeleton implementation for `SlotWorker` which tries to claim a slot at /// its beginning and tries to produce a block if successfully claimed, timing /// out if block production takes too long. -#[async_trait::async_trait] pub trait SimpleSlotWorker { /// A handle to a `BlockImport`. type BlockImport: BlockImport + Send + 'static; @@ -455,7 +453,6 @@ pub trait SimpleSlotWorker { /// that would prevent downstream users to implement [`SlotWorker`] for their own types. pub struct SimpleSlotWorkerToSlotWorker(pub T); -#[async_trait::async_trait] impl + Send + Sync, B: BlockT> SlotWorker>::Proof> for SimpleSlotWorkerToSlotWorker { diff --git a/substrate/client/merkle-mountain-range/rpc/src/lib.rs b/substrate/client/merkle-mountain-range/rpc/src/lib.rs index 5be82b600d91..82edcdc9262a 100644 --- a/substrate/client/merkle-mountain-range/rpc/src/lib.rs +++ b/substrate/client/merkle-mountain-range/rpc/src/lib.rs @@ -24,7 +24,7 @@ use std::{marker::PhantomData, sync::Arc}; use codec::{Codec, Decode, Encode}; use jsonrpsee::{ - core::{async_trait, RpcResult}, + core::RpcResult, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; @@ -143,7 +143,6 @@ impl Mmr { } } -#[async_trait] impl MmrApiServer<::Hash, NumberFor, MmrHash> for Mmr where diff --git a/substrate/client/network/Cargo.toml b/substrate/client/network/Cargo.toml index 8b188176fc5e..4148332ea8af 100644 --- a/substrate/client/network/Cargo.toml +++ b/substrate/client/network/Cargo.toml @@ -16,7 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = "6.1" async-channel = "1.8.0" -async-trait = "0.1" asynchronous-codec = "0.6" bytes = "1" codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } diff --git a/substrate/client/network/common/Cargo.toml b/substrate/client/network/common/Cargo.toml index 65c8e1d71c72..60c4c720a5c8 100644 --- a/substrate/client/network/common/Cargo.toml +++ b/substrate/client/network/common/Cargo.toml @@ -16,7 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"] prost-build = "0.11" [dependencies] -async-trait = "0.1.57" bitflags = "1.3.2" codec = { package = "parity-scale-codec", version = "3.6.1", features = [ "derive", diff --git a/substrate/client/network/common/src/sync.rs b/substrate/client/network/common/src/sync.rs index 4ca21221f87f..62ecc9c2cbe3 100644 --- a/substrate/client/network/common/src/sync.rs +++ b/substrate/client/network/common/src/sync.rs @@ -251,13 +251,11 @@ impl fmt::Debug for OpaqueStateResponse { } /// Provides high-level status of syncing. -#[async_trait::async_trait] pub trait SyncStatusProvider: Send + Sync { /// Get high-level view of the syncing status. async fn status(&self) -> Result, ()>; } -#[async_trait::async_trait] impl SyncStatusProvider for Arc where T: ?Sized, diff --git a/substrate/client/network/src/request_responses.rs b/substrate/client/network/src/request_responses.rs index 5af072aaddc6..765283c4c969 100644 --- a/substrate/client/network/src/request_responses.rs +++ b/substrate/client/network/src/request_responses.rs @@ -855,7 +855,6 @@ pub struct GenericCodec { max_response_size: u64, } -#[async_trait::async_trait] impl Codec for GenericCodec { type Protocol = Vec; type Request = Vec; diff --git a/substrate/client/network/src/service.rs b/substrate/client/network/src/service.rs index c1df48ad7858..048f913d4d6e 100644 --- a/substrate/client/network/src/service.rs +++ b/substrate/client/network/src/service.rs @@ -831,7 +831,6 @@ where } } -#[async_trait::async_trait] impl NetworkStatusProvider for NetworkService where B: BlockT + 'static, @@ -1075,7 +1074,6 @@ where } } -#[async_trait::async_trait] impl NetworkRequest for NetworkService where B: BlockT + 'static, @@ -1132,7 +1130,6 @@ pub struct NotificationSender { notification_size_metric: Option, } -#[async_trait::async_trait] impl NotificationSenderT for NotificationSender { async fn ready( &self, diff --git a/substrate/client/network/src/service/traits.rs b/substrate/client/network/src/service/traits.rs index bed325ede4a8..37fcd0d05e46 100644 --- a/substrate/client/network/src/service/traits.rs +++ b/substrate/client/network/src/service/traits.rs @@ -106,7 +106,6 @@ pub struct NetworkStatus { } /// Provides high-level status information about network. -#[async_trait::async_trait] pub trait NetworkStatusProvider { /// High-level network status information. /// @@ -114,23 +113,6 @@ pub trait NetworkStatusProvider { async fn status(&self) -> Result; } -// Manual implementation to avoid extra boxing here -impl NetworkStatusProvider for Arc -where - T: ?Sized, - T: NetworkStatusProvider, -{ - fn status<'life0, 'async_trait>( - &'life0 self, - ) -> Pin> + Send + 'async_trait>> - where - 'life0: 'async_trait, - Self: 'async_trait, - { - T::status(self) - } -} - /// Provides low-level API for manipulating network peers. pub trait NetworkPeers { /// Set authorized peers. @@ -361,7 +343,6 @@ pub trait NotificationSenderReady { } /// A `NotificationSender` allows for sending notifications to a peer with a chosen protocol. -#[async_trait::async_trait] pub trait NotificationSender: Send + Sync + 'static { /// Returns a future that resolves when the `NotificationSender` is ready to send a /// notification. @@ -478,7 +459,7 @@ pub trait NetworkNotification { &self, target: PeerId, protocol: ProtocolName, - ) -> Result, NotificationSenderError>; + ) -> Result; /// Set handshake for the notification protocol. fn set_notification_handshake(&self, protocol: ProtocolName, handshake: Vec); @@ -497,7 +478,7 @@ where &self, target: PeerId, protocol: ProtocolName, - ) -> Result, NotificationSenderError> { + ) -> Result { T::notification_sender(self, target, protocol) } @@ -507,7 +488,6 @@ where } /// Provides ability to send network requests. -#[async_trait::async_trait] pub trait NetworkRequest { /// Sends a single targeted request to a specific peer. On success, returns the response of /// the peer. @@ -554,38 +534,6 @@ pub trait NetworkRequest { ); } -// Manual implementation to avoid extra boxing here -impl NetworkRequest for Arc -where - T: ?Sized, - T: NetworkRequest, -{ - fn request<'life0, 'async_trait>( - &'life0 self, - target: PeerId, - protocol: ProtocolName, - request: Vec, - connect: IfDisconnected, - ) -> Pin, RequestFailure>> + Send + 'async_trait>> - where - 'life0: 'async_trait, - Self: 'async_trait, - { - T::request(self, target, protocol, request, connect) - } - - fn start_request( - &self, - target: PeerId, - protocol: ProtocolName, - request: Vec, - tx: oneshot::Sender, RequestFailure>>, - connect: IfDisconnected, - ) { - T::start_request(self, target, protocol, request, tx, connect) - } -} - /// Provides ability to announce blocks to the network. pub trait NetworkBlock { /// Make sure an important block is propagated to peers. diff --git a/substrate/client/network/sync/Cargo.toml b/substrate/client/network/sync/Cargo.toml index 39312cc4b327..79396e0cfc92 100644 --- a/substrate/client/network/sync/Cargo.toml +++ b/substrate/client/network/sync/Cargo.toml @@ -18,7 +18,6 @@ prost-build = "0.11" [dependencies] array-bytes = "6.1" async-channel = "1.8.0" -async-trait = "0.1.58" codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.2" diff --git a/substrate/client/network/sync/src/block_relay_protocol.rs b/substrate/client/network/sync/src/block_relay_protocol.rs index 7a313458bf03..9a999117ae22 100644 --- a/substrate/client/network/sync/src/block_relay_protocol.rs +++ b/substrate/client/network/sync/src/block_relay_protocol.rs @@ -25,7 +25,6 @@ use std::sync::Arc; /// The serving side of the block relay protocol. It runs a single instance /// of the server task that processes the incoming protocol messages. -#[async_trait::async_trait] pub trait BlockServer: Send { /// Starts the protocol processing. async fn run(&mut self); @@ -33,7 +32,6 @@ pub trait BlockServer: Send { /// The client side stub to download blocks from peers. This is a handle /// that can be used to initiate concurrent downloads. -#[async_trait::async_trait] pub trait BlockDownloader: Send + Sync { /// Performs the protocol specific sequence to fetch the blocks from the peer. /// Output: if the download succeeds, the response is a `Vec` which is diff --git a/substrate/client/network/sync/src/block_request_handler.rs b/substrate/client/network/sync/src/block_request_handler.rs index c24083f63287..d3479c129b28 100644 --- a/substrate/client/network/sync/src/block_request_handler.rs +++ b/substrate/client/network/sync/src/block_request_handler.rs @@ -460,7 +460,6 @@ where } } -#[async_trait::async_trait] impl BlockServer for BlockRequestHandler where B: BlockT, @@ -562,7 +561,6 @@ impl FullBlockDownloader { } } -#[async_trait::async_trait] impl BlockDownloader for FullBlockDownloader { async fn download_blocks( &self, diff --git a/substrate/client/network/sync/src/mock.rs b/substrate/client/network/sync/src/mock.rs index ed7c647c7977..104a8d3b6f1d 100644 --- a/substrate/client/network/sync/src/mock.rs +++ b/substrate/client/network/sync/src/mock.rs @@ -86,7 +86,6 @@ mockall::mock! { mockall::mock! { pub BlockDownloader {} - #[async_trait::async_trait] impl BlockDownloaderT for BlockDownloader { async fn download_blocks( &self, diff --git a/substrate/client/network/sync/src/service/chain_sync.rs b/substrate/client/network/sync/src/service/chain_sync.rs index f9e0e401fdf8..5ea2d845a6c7 100644 --- a/substrate/client/network/sync/src/service/chain_sync.rs +++ b/substrate/client/network/sync/src/service/chain_sync.rs @@ -188,7 +188,6 @@ impl JustificationSyncLink for SyncingService { } } -#[async_trait::async_trait] impl SyncStatusProvider for SyncingService { /// Get high-level view of the syncing status. async fn status(&self) -> Result, ()> { diff --git a/substrate/client/network/sync/src/service/mock.rs b/substrate/client/network/sync/src/service/mock.rs index 885eb1f8da59..6cd4aa010646 100644 --- a/substrate/client/network/sync/src/service/mock.rs +++ b/substrate/client/network/sync/src/service/mock.rs @@ -107,7 +107,6 @@ mockall::mock! { fn sync_num_connected(&self) -> usize; } - #[async_trait::async_trait] impl NetworkRequest for Network { async fn request( &self, diff --git a/substrate/client/network/test/Cargo.toml b/substrate/client/network/test/Cargo.toml index 09f8f1fa9efb..9cb5d0ba98d5 100644 --- a/substrate/client/network/test/Cargo.toml +++ b/substrate/client/network/test/Cargo.toml @@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] tokio = "1.22.0" -async-trait = "0.1.57" futures = "0.3.21" futures-timer = "3.0.1" libp2p = "0.51.3" diff --git a/substrate/client/network/test/src/lib.rs b/substrate/client/network/test/src/lib.rs index 11505903e35d..6dc71a348b2a 100644 --- a/substrate/client/network/test/src/lib.rs +++ b/substrate/client/network/test/src/lib.rs @@ -111,7 +111,6 @@ impl PassThroughVerifier { } /// This `Verifier` accepts all data as valid. -#[async_trait::async_trait] impl Verifier for PassThroughVerifier { async fn verify( &mut self, @@ -205,7 +204,6 @@ impl PeersClient { } } -#[async_trait::async_trait] impl BlockImport for PeersClient { type Error = ConsensusError; @@ -578,7 +576,6 @@ impl BlockImportAdapter { } } -#[async_trait::async_trait] impl BlockImport for BlockImportAdapter where I: BlockImport + Send + Sync, @@ -606,7 +603,6 @@ struct VerifierAdapter { failed_verifications: Arc>>, } -#[async_trait::async_trait] impl Verifier for VerifierAdapter { async fn verify( &mut self, @@ -693,7 +689,6 @@ pub struct FullPeerConfig { pub target_block: Option<::Header>, } -#[async_trait::async_trait] pub trait TestNetFactory: Default + Sized + Send { type Verifier: 'static + Verifier; type BlockImport: BlockImport + Clone + Send + Sync + 'static; @@ -1147,7 +1142,6 @@ impl TestNetFactory for TestNet { pub struct ForceFinalized(PeersClient); -#[async_trait::async_trait] impl JustificationImport for ForceFinalized { type Error = ConsensusError; diff --git a/substrate/client/network/test/src/service.rs b/substrate/client/network/test/src/service.rs index 62d7f9f9d1bb..9af7ba5a8150 100644 --- a/substrate/client/network/test/src/service.rs +++ b/substrate/client/network/test/src/service.rs @@ -131,7 +131,6 @@ impl TestNetworkBuilder { #[derive(Clone)] struct PassThroughVerifier(bool); - #[async_trait::async_trait] impl sc_consensus::Verifier for PassThroughVerifier { async fn verify( &mut self, diff --git a/substrate/client/rpc-spec-v2/src/archive/archive.rs b/substrate/client/rpc-spec-v2/src/archive/archive.rs index bded842d8fd0..f46f451f013a 100644 --- a/substrate/client/rpc-spec-v2/src/archive/archive.rs +++ b/substrate/client/rpc-spec-v2/src/archive/archive.rs @@ -25,7 +25,7 @@ use crate::{ }; use codec::Encode; -use jsonrpsee::core::{async_trait, RpcResult}; +use jsonrpsee::core::RpcResult; use sc_client_api::{ Backend, BlockBackend, BlockchainEvents, CallExecutor, ExecutorProvider, StorageProvider, }; @@ -76,7 +76,6 @@ fn parse_hex_param(param: String) -> Result, ArchiveError> { array_bytes::hex2bytes(¶m).map_err(|_| ArchiveError::InvalidParam(param)) } -#[async_trait] impl ArchiveApiServer for Archive where Block: BlockT + 'static, diff --git a/substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs b/substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs index a8c1c4f7e083..318a33f66410 100644 --- a/substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs +++ b/substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs @@ -36,7 +36,7 @@ use crate::{ use codec::Encode; use futures::future::FutureExt; use jsonrpsee::{ - core::{async_trait, RpcResult}, + core::RpcResult, types::{SubscriptionEmptyError, SubscriptionId, SubscriptionResult}, SubscriptionSink, }; @@ -179,7 +179,6 @@ fn parse_hex_param(param: String) -> Result, ChainHeadRpcError> { } } -#[async_trait] impl ChainHeadApiServer for ChainHead where Block: BlockT + 'static, diff --git a/substrate/client/rpc-spec-v2/src/transaction/transaction.rs b/substrate/client/rpc-spec-v2/src/transaction/transaction.rs index fe16310aeffa..e286e5f9021a 100644 --- a/substrate/client/rpc-spec-v2/src/transaction/transaction.rs +++ b/substrate/client/rpc-spec-v2/src/transaction/transaction.rs @@ -30,7 +30,6 @@ use crate::{ SubscriptionTaskExecutor, }; use jsonrpsee::{ - core::async_trait, types::{ error::{CallError, ErrorObject}, SubscriptionResult, @@ -82,7 +81,6 @@ const TX_SOURCE: TransactionSource = TransactionSource::External; /// This is similar to the old `author` API error code. const BAD_FORMAT: i32 = 1001; -#[async_trait] impl TransactionApiServer> for Transaction where Pool: TransactionPool + Sync + Send + 'static, diff --git a/substrate/client/rpc/src/author/mod.rs b/substrate/client/rpc/src/author/mod.rs index 55d0a504aa67..9c7b28da7bb5 100644 --- a/substrate/client/rpc/src/author/mod.rs +++ b/substrate/client/rpc/src/author/mod.rs @@ -28,7 +28,7 @@ use crate::SubscriptionTaskExecutor; use codec::{Decode, Encode}; use futures::{FutureExt, TryFutureExt}; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{Error as JsonRpseeError, RpcResult}, types::SubscriptionResult, SubscriptionSink, }; @@ -82,7 +82,6 @@ impl Author { /// some unique transactions via RPC and have them included in the pool. const TX_SOURCE: TransactionSource = TransactionSource::External; -#[async_trait] impl AuthorApiServer, BlockHash

> for Author where P: TransactionPool + Sync + Send + 'static, diff --git a/substrate/client/rpc/src/mixnet/mod.rs b/substrate/client/rpc/src/mixnet/mod.rs index 3f3d9c5aa452..adee99fde9f1 100644 --- a/substrate/client/rpc/src/mixnet/mod.rs +++ b/substrate/client/rpc/src/mixnet/mod.rs @@ -18,7 +18,7 @@ //! Substrate mixnet API. -use jsonrpsee::core::{async_trait, RpcResult}; +use jsonrpsee::core::RpcResult; use sc_mixnet::Api; use sc_rpc_api::mixnet::error::Error; pub use sc_rpc_api::mixnet::MixnetApiServer; @@ -34,7 +34,6 @@ impl Mixnet { } } -#[async_trait] impl MixnetApiServer for Mixnet { async fn submit_extrinsic(&self, extrinsic: Bytes) -> RpcResult<()> { // We only hold the lock while pushing the request into the requests channel diff --git a/substrate/client/rpc/src/offchain/mod.rs b/substrate/client/rpc/src/offchain/mod.rs index de711accdcc1..c37310606802 100644 --- a/substrate/client/rpc/src/offchain/mod.rs +++ b/substrate/client/rpc/src/offchain/mod.rs @@ -22,7 +22,7 @@ mod tests; use self::error::Error; -use jsonrpsee::core::{async_trait, Error as JsonRpseeError, RpcResult}; +use jsonrpsee::core::{Error as JsonRpseeError, RpcResult}; use parking_lot::RwLock; /// Re-export the API for backward compatibility. pub use sc_rpc_api::offchain::*; @@ -48,7 +48,6 @@ impl Offchain { } } -#[async_trait] impl OffchainApiServer for Offchain { fn set_local_storage(&self, kind: StorageKind, key: Bytes, value: Bytes) -> RpcResult<()> { self.deny_unsafe.check_if_safe()?; diff --git a/substrate/client/rpc/src/state/mod.rs b/substrate/client/rpc/src/state/mod.rs index 057661d6ec7f..33a0d61ec0d3 100644 --- a/substrate/client/rpc/src/state/mod.rs +++ b/substrate/client/rpc/src/state/mod.rs @@ -29,7 +29,7 @@ use std::sync::Arc; use crate::SubscriptionTaskExecutor; use jsonrpsee::{ - core::{async_trait, server::rpc_module::SubscriptionSink, Error as JsonRpseeError, RpcResult}, + core::{server::rpc_module::SubscriptionSink, Error as JsonRpseeError, RpcResult}, types::SubscriptionResult, }; @@ -54,7 +54,6 @@ use sp_blockchain::{HeaderBackend, HeaderMetadata}; const STORAGE_KEYS_PAGED_MAX_COUNT: u32 = 1000; /// State backend API. -#[async_trait] pub trait StateBackend: Send + Sync + 'static where Block: BlockT + 'static, @@ -201,7 +200,6 @@ pub struct State { deny_unsafe: DenyUnsafe, } -#[async_trait] impl StateApiServer for State where Block: BlockT + 'static, diff --git a/substrate/client/rpc/src/state/state_full.rs b/substrate/client/rpc/src/state/state_full.rs index 9604d9165f98..7127750ed162 100644 --- a/substrate/client/rpc/src/state/state_full.rs +++ b/substrate/client/rpc/src/state/state_full.rs @@ -28,10 +28,7 @@ use super::{ use crate::{DenyUnsafe, SubscriptionTaskExecutor}; use futures::{future, stream, FutureExt, StreamExt}; -use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError}, - SubscriptionSink, -}; +use jsonrpsee::{core::Error as JsonRpseeError, SubscriptionSink}; use sc_client_api::{ Backend, BlockBackend, BlockchainEvents, CallExecutor, ExecutorProvider, ProofProvider, StorageProvider, @@ -168,7 +165,6 @@ where } } -#[async_trait] impl StateBackend for FullState where Block: BlockT + 'static, diff --git a/substrate/client/rpc/src/statement/mod.rs b/substrate/client/rpc/src/statement/mod.rs index b4f432bbbb0e..c6e2a457b73c 100644 --- a/substrate/client/rpc/src/statement/mod.rs +++ b/substrate/client/rpc/src/statement/mod.rs @@ -19,7 +19,7 @@ //! Substrate statement store API. use codec::{Decode, Encode}; -use jsonrpsee::core::{async_trait, RpcResult}; +use jsonrpsee::core::RpcResult; /// Re-export the API for backward compatibility. pub use sc_rpc_api::statement::{error::Error, StatementApiServer}; use sc_rpc_api::DenyUnsafe; @@ -43,7 +43,6 @@ impl StatementStore { } } -#[async_trait] impl StatementApiServer for StatementStore { fn dump(&self) -> RpcResult> { self.deny_unsafe.check_if_safe()?; diff --git a/substrate/client/rpc/src/system/mod.rs b/substrate/client/rpc/src/system/mod.rs index 0da4f8d0e211..7d542f4f71bc 100644 --- a/substrate/client/rpc/src/system/mod.rs +++ b/substrate/client/rpc/src/system/mod.rs @@ -23,7 +23,7 @@ mod tests; use futures::channel::oneshot; use jsonrpsee::{ - core::{async_trait, error::Error as JsonRpseeError, JsonValue, RpcResult}, + core::{error::Error as JsonRpseeError, JsonValue, RpcResult}, types::error::{CallError, ErrorCode, ErrorObject}, }; use sc_rpc_api::DenyUnsafe; @@ -82,7 +82,6 @@ impl System { } } -#[async_trait] impl SystemApiServer::Number> for System { fn system_name(&self) -> RpcResult { Ok(self.info.impl_name.clone()) diff --git a/substrate/client/service/Cargo.toml b/substrate/client/service/Cargo.toml index 2386bebf24d2..6fc16782554c 100644 --- a/substrate/client/service/Cargo.toml +++ b/substrate/client/service/Cargo.toml @@ -77,7 +77,6 @@ sc-tracing = { path = "../tracing" } sc-sysinfo = { path = "../sysinfo" } tracing = "0.1.29" tracing-futures = { version = "0.2.4" } -async-trait = "0.1.57" tokio = { version = "1.22.0", features = ["time", "rt-multi-thread", "parking_lot"] } tempfile = "3.1.0" directories = "5.0.1" diff --git a/substrate/client/service/src/client/client.rs b/substrate/client/service/src/client/client.rs index da4a4f66e2af..fda66566068d 100644 --- a/substrate/client/service/src/client/client.rs +++ b/substrate/client/service/src/client/client.rs @@ -1753,7 +1753,6 @@ where /// NOTE: only use this implementation when you are sure there are NO consensus-level BlockImport /// objects. Otherwise, importing blocks directly into the client would be bypassing /// important verification work. -#[async_trait::async_trait] impl sc_consensus::BlockImport for &Client where B: backend::Backend, @@ -1862,7 +1861,6 @@ where } } -#[async_trait::async_trait] impl sc_consensus::BlockImport for Client where B: backend::Backend, diff --git a/substrate/client/sync-state-rpc/src/lib.rs b/substrate/client/sync-state-rpc/src/lib.rs index dda8a7edfa9b..61077bf1ba59 100644 --- a/substrate/client/sync-state-rpc/src/lib.rs +++ b/substrate/client/sync-state-rpc/src/lib.rs @@ -44,7 +44,7 @@ use std::sync::Arc; use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, + core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::{error::CallError, ErrorObject}, }; @@ -187,7 +187,6 @@ where } } -#[async_trait] impl SyncStateApiServer for SyncState where Block: BlockT, diff --git a/substrate/client/transaction-pool/Cargo.toml b/substrate/client/transaction-pool/Cargo.toml index b893dc839edd..3b3a3b3e47e1 100644 --- a/substrate/client/transaction-pool/Cargo.toml +++ b/substrate/client/transaction-pool/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" futures-timer = "3.0.2" diff --git a/substrate/client/transaction-pool/api/Cargo.toml b/substrate/client/transaction-pool/api/Cargo.toml index 5ff5a4149ca9..f19247598edf 100644 --- a/substrate/client/transaction-pool/api/Cargo.toml +++ b/substrate/client/transaction-pool/api/Cargo.toml @@ -9,7 +9,6 @@ repository.workspace = true description = "Transaction pool client facing API." [dependencies] -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" log = "0.4.17" diff --git a/substrate/client/transaction-pool/api/src/lib.rs b/substrate/client/transaction-pool/api/src/lib.rs index a795917528f9..ca62884c1a6e 100644 --- a/substrate/client/transaction-pool/api/src/lib.rs +++ b/substrate/client/transaction-pool/api/src/lib.rs @@ -21,7 +21,6 @@ pub mod error; -use async_trait::async_trait; use codec::Codec; use futures::{Future, Stream}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; @@ -322,7 +321,6 @@ impl ChainEvent { } /// Trait for transaction pool maintenance. -#[async_trait] pub trait MaintainedTransactionPool: TransactionPool { /// Perform maintenance async fn maintain(&self, event: ChainEvent); diff --git a/substrate/client/transaction-pool/src/lib.rs b/substrate/client/transaction-pool/src/lib.rs index faa3f455a580..76e6b2fdfc09 100644 --- a/substrate/client/transaction-pool/src/lib.rs +++ b/substrate/client/transaction-pool/src/lib.rs @@ -32,7 +32,6 @@ mod revalidation; mod tests; pub use crate::api::FullChainApi; -use async_trait::async_trait; use enactment_state::{EnactmentAction, EnactmentState}; use futures::{ channel::oneshot, @@ -720,7 +719,6 @@ where } } -#[async_trait] impl MaintainedTransactionPool for BasicPool where Block: BlockT, diff --git a/substrate/primitives/consensus/aura/Cargo.toml b/substrate/primitives/consensus/aura/Cargo.toml index 26f02bc31199..39d7be6d6ae4 100644 --- a/substrate/primitives/consensus/aura/Cargo.toml +++ b/substrate/primitives/consensus/aura/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } sp-api = { path = "../../api", default-features = false} @@ -27,7 +26,6 @@ sp-timestamp = { path = "../../timestamp", default-features = false} [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "scale-info/std", "sp-api/std", diff --git a/substrate/primitives/consensus/aura/src/inherents.rs b/substrate/primitives/consensus/aura/src/inherents.rs index 1ef25feb0ad6..54696a5db44b 100644 --- a/substrate/primitives/consensus/aura/src/inherents.rs +++ b/substrate/primitives/consensus/aura/src/inherents.rs @@ -78,7 +78,6 @@ impl sp_std::ops::Deref for InherentDataProvider { } #[cfg(feature = "std")] -#[async_trait::async_trait] impl sp_inherents::InherentDataProvider for InherentDataProvider { async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { inherent_data.put_data(INHERENT_IDENTIFIER, &self.slot) diff --git a/substrate/primitives/consensus/babe/Cargo.toml b/substrate/primitives/consensus/babe/Cargo.toml index db8bb8cb1540..a2e4e27ec00b 100644 --- a/substrate/primitives/consensus/babe/Cargo.toml +++ b/substrate/primitives/consensus/babe/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true } @@ -29,7 +28,6 @@ sp-timestamp = { path = "../../timestamp", optional = true} [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "scale-info/std", "serde/std", diff --git a/substrate/primitives/consensus/babe/src/inherents.rs b/substrate/primitives/consensus/babe/src/inherents.rs index b01bd1c9221f..d55549ce82e4 100644 --- a/substrate/primitives/consensus/babe/src/inherents.rs +++ b/substrate/primitives/consensus/babe/src/inherents.rs @@ -84,7 +84,6 @@ impl sp_std::ops::Deref for InherentDataProvider { } #[cfg(feature = "std")] -#[async_trait::async_trait] impl sp_inherents::InherentDataProvider for InherentDataProvider { async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { inherent_data.put_data(INHERENT_IDENTIFIER, &self.slot) diff --git a/substrate/primitives/consensus/common/Cargo.toml b/substrate/primitives/consensus/common/Cargo.toml index e8f6b806f8c6..b5ef4fcc01f8 100644 --- a/substrate/primitives/consensus/common/Cargo.toml +++ b/substrate/primitives/consensus/common/Cargo.toml @@ -14,7 +14,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1.57" futures = { version = "0.3.21", features = ["thread-pool"] } log = "0.4.17" thiserror = "1.0.48" diff --git a/substrate/primitives/consensus/common/src/select_chain.rs b/substrate/primitives/consensus/common/src/select_chain.rs index d387cc1ade09..6e641eae606e 100644 --- a/substrate/primitives/consensus/common/src/select_chain.rs +++ b/substrate/primitives/consensus/common/src/select_chain.rs @@ -32,7 +32,6 @@ use sp_runtime::traits::{Block as BlockT, NumberFor}; /// some implementations. /// /// Non-deterministically finalizing chains may only use the `_authoring` functions. -#[async_trait::async_trait] pub trait SelectChain: Sync + Send + Clone { /// Get all leaves of the chain, i.e. block hashes that have no children currently. /// Leaves that can never be finalized will not be returned. diff --git a/substrate/primitives/inherents/Cargo.toml b/substrate/primitives/inherents/Cargo.toml index 4a511c653fd7..c67b131015c4 100644 --- a/substrate/primitives/inherents/Cargo.toml +++ b/substrate/primitives/inherents/Cargo.toml @@ -14,7 +14,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } impl-trait-for-tuples = "0.2.2" @@ -28,7 +27,6 @@ futures = "0.3.21" [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "scale-info/std", "sp-runtime/std", diff --git a/substrate/primitives/inherents/src/client_side.rs b/substrate/primitives/inherents/src/client_side.rs index 27479de136f2..40d5aa7d0d3c 100644 --- a/substrate/primitives/inherents/src/client_side.rs +++ b/substrate/primitives/inherents/src/client_side.rs @@ -26,7 +26,6 @@ use sp_runtime::traits::Block as BlockT; /// The crate already provides some convience implementations of this trait for /// `Box` and closures. So, it should not be required to implement /// this trait manually. -#[async_trait::async_trait] pub trait CreateInherentDataProviders: Send + Sync { /// The inherent data providers that will be created. type InherentDataProviders: InherentDataProvider; @@ -39,7 +38,6 @@ pub trait CreateInherentDataProviders: Send + Sync { ) -> Result>; } -#[async_trait::async_trait] impl CreateInherentDataProviders for F where Block: BlockT, @@ -61,7 +59,6 @@ where } } -#[async_trait::async_trait] impl CreateInherentDataProviders for Box> @@ -78,7 +75,6 @@ impl } /// Something that provides inherent data. -#[async_trait::async_trait] pub trait InherentDataProvider: Send + Sync { /// Convenience function for creating [`InherentData`]. /// @@ -105,7 +101,6 @@ pub trait InherentDataProvider: Send + Sync { } #[impl_trait_for_tuples::impl_for_tuples(30)] -#[async_trait::async_trait] impl InherentDataProvider for Tuple { for_tuples!( where #( Tuple: Send + Sync )* ); async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { diff --git a/substrate/primitives/inherents/src/lib.rs b/substrate/primitives/inherents/src/lib.rs index dd7c294f1e24..41c7d0f2f27f 100644 --- a/substrate/primitives/inherents/src/lib.rs +++ b/substrate/primitives/inherents/src/lib.rs @@ -54,7 +54,6 @@ //! /// Some custom inherent data provider //! struct InherentDataProvider; //! -//! #[async_trait::async_trait] //! impl sp_inherents::InherentDataProvider for InherentDataProvider { //! async fn provide_inherent_data( //! &self, @@ -104,7 +103,6 @@ //! # type Block = sp_runtime::testing::Block>; //! # const INHERENT_IDENTIFIER: InherentIdentifier = *b"testinh0"; //! # struct InherentDataProvider; -//! # #[async_trait::async_trait] //! # impl sp_inherents::InherentDataProvider for InherentDataProvider { //! # async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), sp_inherents::Error> { //! # inherent_data.put_data(INHERENT_IDENTIFIER, &"hello") @@ -441,7 +439,6 @@ mod tests { const ERROR_TO_STRING: &str = "Found error!"; - #[async_trait::async_trait] impl InherentDataProvider for TestInherentDataProvider { async fn provide_inherent_data(&self, data: &mut InherentData) -> Result<(), Error> { data.put_data(TEST_INHERENT_0, &42) diff --git a/substrate/primitives/timestamp/Cargo.toml b/substrate/primitives/timestamp/Cargo.toml index 44b0fdd831c0..ecde7c5c76e0 100644 --- a/substrate/primitives/timestamp/Cargo.toml +++ b/substrate/primitives/timestamp/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } thiserror = { version = "1.0.48", optional = true } sp-inherents = { path = "../inherents", default-features = false} @@ -23,7 +22,6 @@ sp-std = { path = "../std", default-features = false} [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "sp-inherents/std", "sp-runtime/std", diff --git a/substrate/primitives/timestamp/src/lib.rs b/substrate/primitives/timestamp/src/lib.rs index d1bd2a3446e6..3714550c73dc 100644 --- a/substrate/primitives/timestamp/src/lib.rs +++ b/substrate/primitives/timestamp/src/lib.rs @@ -228,7 +228,6 @@ impl sp_std::ops::Deref for InherentDataProvider { } #[cfg(feature = "std")] -#[async_trait::async_trait] impl sp_inherents::InherentDataProvider for InherentDataProvider { async fn provide_inherent_data( &self, diff --git a/substrate/primitives/transaction-storage-proof/Cargo.toml b/substrate/primitives/transaction-storage-proof/Cargo.toml index 5a35dd8f11f7..cc08216fef30 100644 --- a/substrate/primitives/transaction-storage-proof/Cargo.toml +++ b/substrate/primitives/transaction-storage-proof/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = { version = "0.1.57", optional = true } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } sp-core = { path = "../core", optional = true} @@ -25,7 +24,6 @@ sp-trie = { path = "../trie", optional = true} [features] default = [ "std" ] std = [ - "async-trait", "codec/std", "scale-info/std", "sp-core/std", diff --git a/substrate/primitives/transaction-storage-proof/src/lib.rs b/substrate/primitives/transaction-storage-proof/src/lib.rs index 9d540ae68d16..e8293399e710 100644 --- a/substrate/primitives/transaction-storage-proof/src/lib.rs +++ b/substrate/primitives/transaction-storage-proof/src/lib.rs @@ -85,7 +85,6 @@ impl InherentDataProvider { } #[cfg(feature = "std")] -#[async_trait::async_trait] impl sp_inherents::InherentDataProvider for InherentDataProvider { async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { if let Some(proof) = &self.proof { diff --git a/substrate/test-utils/client/Cargo.toml b/substrate/test-utils/client/Cargo.toml index 12863ac184c1..1b497bb8136c 100644 --- a/substrate/test-utils/client/Cargo.toml +++ b/substrate/test-utils/client/Cargo.toml @@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = "6.1" -async-trait = "0.1.57" codec = { package = "parity-scale-codec", version = "3.6.1" } futures = "0.3.21" serde = "1.0.188" diff --git a/substrate/test-utils/client/src/client_ext.rs b/substrate/test-utils/client/src/client_ext.rs index 8efa7b5f07f8..c44a7de5622d 100644 --- a/substrate/test-utils/client/src/client_ext.rs +++ b/substrate/test-utils/client/src/client_ext.rs @@ -37,7 +37,6 @@ pub trait ClientExt: Sized { } /// Extension trait for a test client around block importing. -#[async_trait::async_trait] pub trait ClientBlockImportExt: Sized { /// Import block to the chain. No finality. async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError>; @@ -86,7 +85,6 @@ where } /// This implementation is required, because of the weird api requirements around `BlockImport`. -#[async_trait::async_trait] impl ClientBlockImportExt for std::sync::Arc where for<'r> &'r T: BlockImport, @@ -145,7 +143,6 @@ where } } -#[async_trait::async_trait] impl ClientBlockImportExt for Client where Self: BlockImport, diff --git a/substrate/test-utils/client/src/lib.rs b/substrate/test-utils/client/src/lib.rs index 90e15e0f8d53..9375a893ff81 100644 --- a/substrate/test-utils/client/src/lib.rs +++ b/substrate/test-utils/client/src/lib.rs @@ -310,7 +310,6 @@ impl std::fmt::Display for RpcTransactionError { } /// An extension trait for `RpcHandlers`. -#[async_trait::async_trait] pub trait RpcHandlersExt { /// Send a transaction through the RpcHandlers. async fn send_transaction( @@ -319,7 +318,6 @@ pub trait RpcHandlersExt { ) -> Result; } -#[async_trait::async_trait] impl RpcHandlersExt for RpcHandlers { async fn send_transaction( &self, diff --git a/substrate/utils/frame/rpc/client/Cargo.toml b/substrate/utils/frame/rpc/client/Cargo.toml index d0f323c096ff..71a45e95ad09 100644 --- a/substrate/utils/frame/rpc/client/Cargo.toml +++ b/substrate/utils/frame/rpc/client/Cargo.toml @@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] jsonrpsee = { version = "0.16.2", features = ["ws-client"] } sc-rpc-api = { path = "../../../../client/rpc-api" } -async-trait = "0.1.57" serde = "1" sp-runtime = { path = "../../../../primitives/runtime" } log = "0.4" diff --git a/substrate/utils/frame/rpc/client/src/lib.rs b/substrate/utils/frame/rpc/client/src/lib.rs index a6a667bef568..ca510ccf74fd 100644 --- a/substrate/utils/frame/rpc/client/src/lib.rs +++ b/substrate/utils/frame/rpc/client/src/lib.rs @@ -37,7 +37,6 @@ //! } //! ``` -use async_trait::async_trait; use serde::de::DeserializeOwned; use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; use std::collections::VecDeque; @@ -71,7 +70,6 @@ pub async fn ws_client(uri: impl AsRef) -> Result { } /// Abstraction over RPC calling for headers. -#[async_trait] pub trait HeaderProvider where Block::Header: HeaderT, @@ -80,7 +78,6 @@ where async fn get_header(&self, hash: Block::Hash) -> Block::Header; } -#[async_trait] impl HeaderProvider for WsClient where Block::Header: DeserializeOwned, @@ -94,7 +91,6 @@ where } /// Abstraction over RPC subscription for finalized headers. -#[async_trait] pub trait HeaderSubscription where Block::Header: HeaderT, @@ -106,7 +102,6 @@ where async fn next_header(&mut self) -> Option; } -#[async_trait] impl HeaderSubscription for Subscription where Block::Header: DeserializeOwned, @@ -219,7 +214,6 @@ mod tests { headers } - #[async_trait] impl HeaderProvider for MockHeaderProvider { async fn get_header(&self, _hash: Hash) -> Header { let height = self.0.lock().await.pop_front().unwrap(); @@ -229,7 +223,6 @@ mod tests { struct MockHeaderSubscription(pub VecDeque); - #[async_trait] impl HeaderSubscription for MockHeaderSubscription { async fn next_header(&mut self) -> Option

{ self.0.pop_front().map(|h| headers()[h as usize].clone()) diff --git a/substrate/utils/frame/rpc/system/src/lib.rs b/substrate/utils/frame/rpc/system/src/lib.rs index f467a8798904..74400c5189e2 100644 --- a/substrate/utils/frame/rpc/system/src/lib.rs +++ b/substrate/utils/frame/rpc/system/src/lib.rs @@ -21,7 +21,7 @@ use std::{fmt::Display, sync::Arc}; use codec::{self, Codec, Decode, Encode}; use jsonrpsee::{ - core::{async_trait, RpcResult}, + core::RpcResult, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; @@ -84,7 +84,6 @@ impl System { } } -#[async_trait] impl SystemApiServer<::Hash, AccountId, Nonce> for System where diff --git a/substrate/utils/frame/try-runtime/cli/Cargo.toml b/substrate/utils/frame/try-runtime/cli/Cargo.toml index 65380a22ce6e..35a9abe7a573 100644 --- a/substrate/utils/frame/try-runtime/cli/Cargo.toml +++ b/substrate/utils/frame/try-runtime/cli/Cargo.toml @@ -34,7 +34,6 @@ sp-weights = { path = "../../../../primitives/weights" } frame-try-runtime = { path = "../../../../frame/try-runtime", optional = true} substrate-rpc-client = { path = "../../rpc/client" } -async-trait = "0.1.57" clap = { version = "4.4.6", features = ["derive"] } hex = { version = "0.4.3", default-features = false } log = "0.4.17" diff --git a/substrate/utils/frame/try-runtime/cli/src/block_building_info.rs b/substrate/utils/frame/try-runtime/cli/src/block_building_info.rs index db24d06ef0a1..2ab6204670d1 100644 --- a/substrate/utils/frame/try-runtime/cli/src/block_building_info.rs +++ b/substrate/utils/frame/try-runtime/cli/src/block_building_info.rs @@ -34,7 +34,6 @@ use sp_timestamp::TimestampInherentData; /// /// This module already provides some convenience implementation of this trait for closures. So, it /// should not be required to implement it directly. -#[async_trait::async_trait] pub trait BlockBuildingInfoProvider { type InherentDataProviders: InherentDataProvider; @@ -45,7 +44,6 @@ pub trait BlockBuildingInfoProvider { ) -> Result<(Self::InherentDataProviders, Vec)>; } -#[async_trait::async_trait] impl BlockBuildingInfoProvider for F where Block: BlockT,