diff --git a/substrate/bin/node/bench/Cargo.toml b/substrate/bin/node/bench/Cargo.toml index 447f947107c1..f5218397da03 100644 --- a/substrate/bin/node/bench/Cargo.toml +++ b/substrate/bin/node/bench/Cargo.toml @@ -25,6 +25,7 @@ kitchensink-runtime = { workspace = true } sc-client-api = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } sp-state-machine = { workspace = true, default-features = true } +sp-blockchain = { workspace = true, default-features = true } serde = { workspace = true, default-features = true } serde_json = { workspace = true, default-features = true } derive_more = { features = ["display"], workspace = true } diff --git a/substrate/bin/node/bench/src/construct.rs b/substrate/bin/node/bench/src/construct.rs index 22129c6a1d69..6e34cb499a8a 100644 --- a/substrate/bin/node/bench/src/construct.rs +++ b/substrate/bin/node/bench/src/construct.rs @@ -271,7 +271,11 @@ impl sc_transaction_pool_api::TransactionPool for Transactions { unimplemented!() } - fn remove_invalid(&self, _hashes: &[TxHash]) -> Vec> { + fn report_invalid( + &self, + _at: Option, + _invalid_tx_errors: &[(TxHash, Option)], + ) -> Vec> { Default::default() } diff --git a/substrate/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs b/substrate/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs index a543969a89b8..124029121253 100644 --- a/substrate/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs +++ b/substrate/client/rpc-spec-v2/src/transaction/tests/middleware_pool.rs @@ -137,8 +137,12 @@ impl TransactionPool for MiddlewarePool { Ok(watcher.boxed()) } - fn remove_invalid(&self, hashes: &[TxHash]) -> Vec> { - self.inner_pool.remove_invalid(hashes) + fn report_invalid( + &self, + at: Option<::Hash>, + invalid_tx_errors: &[(TxHash, Option)], + ) -> Vec> { + self.inner_pool.report_invalid(at, invalid_tx_errors) } fn status(&self) -> PoolStatus { diff --git a/substrate/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs b/substrate/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs index 2fd4ce245456..2e077ef4bfac 100644 --- a/substrate/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs +++ b/substrate/client/rpc-spec-v2/src/transaction/transaction_broadcast.rs @@ -228,7 +228,7 @@ where } // Best effort pool removal (tx can already be finalized). - pool.remove_invalid(&[broadcast_state.tx_hash]); + pool.report_invalid(None, &[(broadcast_state.tx_hash, None)]); }); // Keep track of this entry and the abortable handle. diff --git a/substrate/client/rpc/src/author/mod.rs b/substrate/client/rpc/src/author/mod.rs index 6afc871e565a..d6bb8863b8e9 100644 --- a/substrate/client/rpc/src/author/mod.rs +++ b/substrate/client/rpc/src/author/mod.rs @@ -164,17 +164,17 @@ where let hashes = bytes_or_hash .into_iter() .map(|x| match x { - hash::ExtrinsicOrHash::Hash(h) => Ok(h), + hash::ExtrinsicOrHash::Hash(h) => Ok((h, None)), hash::ExtrinsicOrHash::Extrinsic(bytes) => { let xt = Decode::decode(&mut &bytes[..])?; - Ok(self.pool.hash_of(&xt)) + Ok((self.pool.hash_of(&xt), None)) }, }) .collect::>>()?; Ok(self .pool - .remove_invalid(&hashes) + .report_invalid(None, &hashes) .into_iter() .map(|tx| tx.hash().clone()) .collect())