-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockId
removal: tx-pool
refactor
#1678
Conversation
It changes following APIs: - trait ChainApi -- `validate_transaction` - trait `TransactionPool` --`submit_at` --`submit_one` --`submit_and_watch` and some implementation details, in particular: - impl `Pool` --`submit_at` --`resubmit_at` --`submit_one` --`submit_and_watch` --`prune_known` --`prune` --`prune_tags` --`resolve_block_number` --`verify` --`verify_one`A - revalidation queue All tests are also adjusted.
bot fmt |
@michalkucharczyk https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3775436 was started for your command Comment |
@michalkucharczyk Command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍
sc_transaction_pool_api::error::Error::InvalidBlockId(format!("{:?}", at)).into(), | ||
) | ||
}) | ||
.expect("hash to number should work"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh wait!
Move this above the let validation_results
. Print a debug message and return. Should not really happen. Just one thing to check, is it fine to drop batch
or are the tx still in the pool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this shall never happen. hash to block number shall always work - I can add debug and return.
Just one thing to check, is it fine to drop batch or are the tx still in the pool?
Did not get it, could you give me more details on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the batch
, that is passed in to this function, is dropped without it being processed and "re-added".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transactions will stay in validated_pool, so they can be resubmitted in the next batch.
Skipping re-validation sounds reasonable, otherwise the transactions could be invalidated (if the block is not available).
Done in 7c002a4.
I also added test for this case:
polkadot-sdk/substrate/client/transaction-pool/src/revalidation.rs
Lines 445 to 450 in 17e9cb0
// revalidation shall be skipped for unknown block: | |
block_on(queue.revalidate_later(unknown_block, uxt_hashes)); | |
// no revalidation shall be done | |
assert_eq!(api.validation_requests().len(), 4); | |
// number of ready shall not change | |
assert_eq!(pool.validated_pool().status().ready, 2); |
Co-authored-by: Bastian Köcher <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good!
* master: (61 commits) OpenGov in Westend and Rococo (#1177) Associated type Hasher for `QueryPreimage`, `StorePreimage` and `Bounded` (#1720) Migrate polkadot-primitives to v6 (#1543) genesis-builder: implemented for all runtimes (#1492) `BlockId` removal: `tx-pool` refactor (#1678) Bump directories from 4.0.1 to 5.0.1 (#1656) Allow debug_assertions in short-benchmarks CI job (#1711) chainHead/storage: Fix storage iteration using the query key (#1665) Implement more useful traits in `Slot` type (#1595) Make downloads in parallel and give more time to complete (#1699) Bump actions/checkout from 4.0.0 to 4.1.0 (#1688) contracts: Fix incorrect storage alias in mirgration (#1687) Fix documentation about justification and `finalized == true` requirement (#1607) tweak pallet macro (genesis_config etc) to cater for RA users as well. (#1689) Uncoupling pallet-xcm from frame-system's RuntimeCall (#1684) Bump aes-gcm from 0.10.2 to 0.10.3 (#1681) docs / Update PR template to reflect monorepo (#1674) update contributing guide and ui-tests scripts (#1668) pallet epm: add `TrimmingStatus` to the mined solution (#1659) Update HRMP pallet benchmarking to use benchmarks v2 (#1676) ...
* tsv-disabling-node-side: (69 commits) runtime-api: cleanup after v7 stabilization (#1729) Move requests-responses and polling from `ChainSync` to `SyncingEngine` (#1650) Add custom error message for `StorageNoopGuard` (#1727) Clarify docs cargo fmt add a CAVEAT comment implement disabled_validators correctly remove unnecessary hash string (#1722) OpenGov in Westend and Rococo (#1177) Associated type Hasher for `QueryPreimage`, `StorePreimage` and `Bounded` (#1720) Migrate polkadot-primitives to v6 (#1543) genesis-builder: implemented for all runtimes (#1492) `BlockId` removal: `tx-pool` refactor (#1678) Bump directories from 4.0.1 to 5.0.1 (#1656) Allow debug_assertions in short-benchmarks CI job (#1711) chainHead/storage: Fix storage iteration using the query key (#1665) Implement more useful traits in `Slot` type (#1595) Make downloads in parallel and give more time to complete (#1699) Bump actions/checkout from 4.0.0 to 4.1.0 (#1688) contracts: Fix incorrect storage alias in mirgration (#1687) ...
It changes following APIs: - trait `ChainApi` -- `validate_transaction` - trait `TransactionPool` --`submit_at` --`submit_one` --`submit_and_watch` and some implementation details, in particular: - impl `Pool` --`submit_at` --`resubmit_at` --`submit_one` --`submit_and_watch` --`prune_known` --`prune` --`prune_tags` --`resolve_block_number` --`verify` --`verify_one` - revalidation queue All tests are also adjusted. --------- Co-authored-by: command-bot <> Co-authored-by: Bastian Köcher <[email protected]>
It changes following APIs:
trait
ChainApi
--
validate_transaction
trait
TransactionPool
--
submit_at
--
submit_one
--
submit_and_watch
and some implementation details, in particular:
impl
Pool
--
submit_at
--
resubmit_at
--
submit_one
--
submit_and_watch
--
prune_known
--
prune
--
prune_tags
--
resolve_block_number
--
verify
--
verify_one
revalidation queue
All tests are also adjusted.
This PR is part of BlockId::Number refactoring analysis (#53)
Some ground work towards: (#1202)