mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
Adds fork-awareness and finalization notifications to transaction pool watchers. (#4740)
* adds finalization support to sc-transaction-pool using MaintainedTransactionPool for finalization events * adds TransactionStatus::Retracted, notify watchers of retracted blocks, finalized now finalizes, transactions for current finalized -> last finalized block * adds last_finalized to ChainApi, use generic BlockT for ChainEvent * fix tests * Apply suggestions from code review Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * tests * fix tests, docs, lazily dedupe pruned hashes * fix tests, Cargo.lock * Apply suggestions from code review Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * remove tree_route, last_finalized from ChainApi, add block hash to Finalization and Retracted events * prune finality watchers * fix tests * remove HeaderBackend bound from FullChainApi * code style nits, terminate stream in finality_timeout Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
@@ -135,8 +135,8 @@ fn bench_configured(pool: Pool<TestApi>, number: u64) {
|
||||
let res = block_on(futures::future::join_all(futures.into_iter()));
|
||||
assert!(res.iter().all(Result::is_ok));
|
||||
|
||||
assert_eq!(pool.status().future, 0);
|
||||
assert_eq!(pool.status().ready, number as usize);
|
||||
assert_eq!(pool.validated_pool().status().future, 0);
|
||||
assert_eq!(pool.validated_pool().status().ready, number as usize);
|
||||
|
||||
// Prune all transactions.
|
||||
let block_num = 6;
|
||||
@@ -147,8 +147,8 @@ fn bench_configured(pool: Pool<TestApi>, number: u64) {
|
||||
)).expect("Prune failed");
|
||||
|
||||
// pool is empty
|
||||
assert_eq!(pool.status().ready, 0);
|
||||
assert_eq!(pool.status().future, 0);
|
||||
assert_eq!(pool.validated_pool().status().ready, 0);
|
||||
assert_eq!(pool.validated_pool().status().future, 0);
|
||||
}
|
||||
|
||||
fn benchmark_main(c: &mut Criterion) {
|
||||
|
||||
Reference in New Issue
Block a user