* Change copyright year to 2023 from 2022
* Fix incorrect update of copyright year
* Remove years from copy right header
* Fix remaining files
* Fix typo in a header and remove update-copyright.sh
This is a minor clean up.
There was a minor bug in TestApi::add_block: the best block flag for
given number was not cleared when the new best block with the same
number was added.
The usage of is_best_block argument in add_block method in txpool tests
were aligned with the BestBlock event.
It changes the arguments of `Backend::body` method from: `BlockId<Block>` to: `&Block::Hash`
This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
Co-authored-by: parity-processbot <>
* Remove transaction-pool `test-helpers` feature
`test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in
the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.
Contributes towards: https://github.com/paritytech/substrate/issues/9727
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Fix benches
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Transaction pool: Ensure that we prune transactions properly
There was a bug in the transaction pool that we didn't pruned
transactions properly because we called `prune_known`, instead of `prune`.
This bug was introduced by:
https://github.com/paritytech/substrate/pull/4629
This is required to have stale extrinsics being removed properly, so
that they don't fill up the tx pool.
* Fix compilation
* Fix benches
* ...
* Revalidate transactions only on latest best block
We should revalidate transactions only on the latest best block and not
on any arbitrary block. The revalidation before failed when there were
multiple blocks on the height given to the revalidation function, but no
block was imported as best block.
* Update test-utils/runtime/transaction-pool/src/lib.rs
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
* Fix tests
* Only process best blocks in the transaction pool
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
* Fix tx-pool returning the same transaction multiple times
This fixes a bug that lead to returning the same transaction multiple
times when iterating the `ready` iterator. Internally the transaction
was kept in the `best` list and could be duplicated in that list be
re-inserting it again. This `best` list is using a `TransactionRef`
which internally uses a `insertion_id`. This `insertion_id` could lead
to the same transaction being inserted multiple times into the `best`
list.
* Update client/transaction-pool/src/testing/pool.rs
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* 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>
* Don't remove invalid transactions when skipping.
* Use a special kind of extrinsic instead of arbitrary limit.
* Fix txpool tests.
* Attempt to create more blocks.
* Bump lock
Co-authored-by: Gavin Wood <github@gavwood.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>