mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Make transaction pool prune transactions only of canonical blocks (#6123)
* Make tx pool aware of retracted fork blocks * Make it compile * Update client/transaction-pool/src/lib.rs Co-authored-by: Nikolay Volf <nikvolf@gmail.com> * Fix doc test * Simplify the implementation * Send tree route as arc to prevent heavy clones * Switch to use `ExtrinsicHash` to make it more clear * Fix benchmark Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -67,8 +67,10 @@ pub struct ImportSummary<Block: BlockT> {
|
||||
pub is_new_best: bool,
|
||||
/// Optional storage changes.
|
||||
pub storage_changes: Option<(StorageCollection, ChildStorageCollection)>,
|
||||
/// Blocks that got retracted because of this one got imported.
|
||||
pub retracted: Vec<Block::Hash>,
|
||||
/// Tree route from old best to new best.
|
||||
///
|
||||
/// If `None`, there was no re-org while importing.
|
||||
pub tree_route: Option<sp_blockchain::TreeRoute<Block>>,
|
||||
}
|
||||
|
||||
/// Import operation wrapper
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! A set of APIs supported by the client along with their primitives.
|
||||
|
||||
use std::{fmt, collections::HashSet};
|
||||
use std::{fmt, collections::HashSet, sync::Arc};
|
||||
use sp_core::storage::StorageKey;
|
||||
use sp_runtime::{
|
||||
traits::{Block as BlockT, NumberFor},
|
||||
@@ -234,8 +234,10 @@ pub struct BlockImportNotification<Block: BlockT> {
|
||||
pub header: Block::Header,
|
||||
/// Is this the new best block.
|
||||
pub is_new_best: bool,
|
||||
/// List of retracted blocks ordered by block number.
|
||||
pub retracted: Vec<Block::Hash>,
|
||||
/// Tree route from old best to new best.
|
||||
///
|
||||
/// If `None`, there was no re-org while importing.
|
||||
pub tree_route: Option<Arc<sp_blockchain::TreeRoute<Block>>>,
|
||||
}
|
||||
|
||||
/// Summary of a finalized block.
|
||||
|
||||
Reference in New Issue
Block a user