mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Improve transaction submission (#6599)
* Improve transaction submission Before this pr the transaction pool validated each transaction, even if the transaction was already known to the pool. This pr changes the behavior to first check if we are already aware of a transaction and thus, to only validate them if we don't know them yet. However, there is still the possibility that a given transaction is validated multiple times. This can happen if the transaction is added the first time, but is not yet validated and added to the validated pool. Besides that, this pr fixes the wrong metrics of gossiped transactions in the network. It also moves some metrics to the transaction pool api, to better track when a transaction actually is scheduled for validation. * Make sure we don't submit the same transaction twice from the network concurrently * Remove added listener call * Feedback * Ignore banned on resubmit
This commit is contained in:
@@ -361,7 +361,7 @@ mod tests {
|
||||
let txpool = Arc::new(
|
||||
BasicPool::new(
|
||||
Default::default(),
|
||||
Arc::new(FullChainApi::new(client.clone())),
|
||||
Arc::new(FullChainApi::new(client.clone(), None)),
|
||||
None,
|
||||
).0
|
||||
);
|
||||
@@ -414,7 +414,7 @@ mod tests {
|
||||
let txpool = Arc::new(
|
||||
BasicPool::new(
|
||||
Default::default(),
|
||||
Arc::new(FullChainApi::new(client.clone())),
|
||||
Arc::new(FullChainApi::new(client.clone(), None)),
|
||||
None,
|
||||
).0
|
||||
);
|
||||
@@ -449,7 +449,7 @@ mod tests {
|
||||
let txpool = Arc::new(
|
||||
BasicPool::new(
|
||||
Default::default(),
|
||||
Arc::new(FullChainApi::new(client.clone())),
|
||||
Arc::new(FullChainApi::new(client.clone(), None)),
|
||||
None,
|
||||
).0
|
||||
);
|
||||
@@ -511,7 +511,7 @@ mod tests {
|
||||
let txpool = Arc::new(
|
||||
BasicPool::new(
|
||||
Default::default(),
|
||||
Arc::new(FullChainApi::new(client.clone())),
|
||||
Arc::new(FullChainApi::new(client.clone(), None)),
|
||||
None,
|
||||
).0
|
||||
);
|
||||
|
||||
@@ -31,7 +31,11 @@
|
||||
//! # };
|
||||
//! # use sc_transaction_pool::{BasicPool, FullChainApi};
|
||||
//! # let client = Arc::new(substrate_test_runtime_client::new());
|
||||
//! # let txpool = Arc::new(BasicPool::new(Default::default(), Arc::new(FullChainApi::new(client.clone())), None).0);
|
||||
//! # let txpool = Arc::new(BasicPool::new(
|
||||
//! # Default::default(),
|
||||
//! # Arc::new(FullChainApi::new(client.clone(), None)),
|
||||
//! # None).0,
|
||||
//! # );
|
||||
//! // The first step is to create a `ProposerFactory`.
|
||||
//! let mut proposer_factory = ProposerFactory::new(client.clone(), txpool.clone(), None);
|
||||
//!
|
||||
|
||||
Reference in New Issue
Block a user