Skip to content
Snippets Groups Projects
Unverified Commit 24a4b55e authored by Michal Kucharczyk's avatar Michal Kucharczyk Committed by GitHub
Browse files

`fatxpool`: improved handling of finality stalls (#7639)

#### PR Description

This pull request introduces measures to handle finality stalls by :
- notifying outdated transactions with a
[`FinalityTimeout`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/api/src/lib.rs#L145-L147)
event.
- removing outdated views from the `view_store`

An item is considered _outdated_ when the difference between its
associated block and the current block exceeds a pre-defined threshold.

#### Note for Reviewers
The core logic is provided in the following small commits:
- `ViewStore`: new method
[`finality_stall_view_cleanup`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs#L869-L903)
for removing stale views was added: 64267000
- `ForkAwareTransactionPool`: core logic for tracking finality stalls
added here: 7b37ea6f. Entry point in
[`finality_stall_cleanup`](https://github.com/paritytech/polkadot-sdk/blob/d821c84d/substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs#L1096-L1136)
- Some related renaming was made to better reflect purpose/shorten the
names: 1a3a1284, a511601f. Also new method
[`transactions_finality_timeout`](https://github.com/paritytech/polkadot-sdk/blob/a511601f/substrate/client/transaction-pool/src/fork_aware_txpool/multi_view_listener.rs#L771-L790)
for triggering external events was added for `MultiViewListener`.
- `included_transactions` which basically is mapping `block hash ->
included transactions hashes`, is also used to find to included
transactions.

I also sneaked in some minor improvements:
- fixed per-transaction logging: 1572f721
- `handle_pre_finalized` method was removed, it was some old leftover
which is no longer needed: a6f84ad0

,

closes: #5482

---------

Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: default avatarSebastian Kunert <skunert49@gmail.com>
Co-authored-by: default avatarIulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
parent ff2e5091
Pipeline #518247 waiting for manual action with stages
in 30 minutes and 23 seconds
Showing
with 622 additions and 156 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment