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

`fatxpool`: report_invalid: do not ban Future/Stale txs from re-entering the view (#7777)

#### Description

Avoid banning future/stale transactions reported as invalid by the
authorship module.

#### Note for reviewers
When re-org is handled by transaction pool, the view for new fork
(`Bn'`) is cloned from the tip of the other existing fork (`Bn`). The
new view is not entirely re-validated during the maintain process (it
will be revalidated in the background), so it may happen that it
contains transactions that are ready on (`Bn`) but actually are not
ready on (`Bn'`). All required (which are expected to be in retracted
set) transactions are submitted to the new view, but order of txs in
ready iterator is not updated.

The proper fix would require to re-build the the iterator - which is not
trivial as we do not have tags for transactions for block `Bn'` yet. We
could force retracted txs to be before ready transactions but it also
does not feel to be a good solution - it still would be best effort
trial.

For now allowing future transactions to re-enter the view immediately is
in my opinion a good compromise. This PR is a quick fix and actually
brings back behavior of txpool from before merging #6008. The bad thing
is that incorrect transactions are detected during block authorship, but
this situation to happen requires some specific pre-conditions which
should be rare.

If this PR is not merged, some transaction will get included into
blocks, only after
[`DEFAULT_BAN_TIME_SECS`](https://github.com/paritytech/polkadot-sdk/blob/4b39ff00

/substrate/client/transaction-pool/src/graph/rotator.rs#L37),
which is pretty bad.

---------

Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent 21927dd4
No related merge requests found
Pipeline #519659 waiting for manual action with stages
in 1 hour, 37 minutes, and 41 seconds