Skip to content
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

Fork aware tx pool + no training wheels = 🚀🚀🚀 [rebased] #4775

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
4965180
txpool: internal crate reorg
michalkucharczyk May 23, 2024
e6ca18e
References to transaction pool are now Unsized
michalkucharczyk May 23, 2024
3a65f84
transaction pool type option added + txpool::builder used
michalkucharczyk May 23, 2024
5b998cc
make clippy happy: more fixes here and there
michalkucharczyk May 23, 2024
e451a82
version bumps
michalkucharczyk May 24, 2024
cd3717d
prdoc added
michalkucharczyk May 24, 2024
8d98809
license added
michalkucharczyk May 24, 2024
4f73653
Cargo.lock updated
michalkucharczyk May 24, 2024
11e16e6
Revert "version bumps"
michalkucharczyk May 27, 2024
2232372
Cargo.lock
michalkucharczyk May 27, 2024
5fea9a4
Revert "txpool: internal crate reorg"
michalkucharczyk May 29, 2024
0905129
there must be some starting point
michalkucharczyk Nov 29, 2023
3d8bf46
sketch
michalkucharczyk Dec 1, 2023
993eb11
txpool: test api: support for nonces per hash added
michalkucharczyk Dec 11, 2023
1bd6f76
txpool: test api: support for stale transactions
michalkucharczyk Dec 12, 2023
866137b
fork_aware_pool: some initial impl + tests
michalkucharczyk Dec 12, 2023
fb2b7fa
txpool: tests: fixes
michalkucharczyk Dec 12, 2023
aeee697
txpool: api: Hash -> HashAndNumber + get rid of Result
michalkucharczyk Dec 12, 2023
77419c4
txpool(fap): api: Hash -> HashAndNumber + get rid of Result
michalkucharczyk Dec 12, 2023
fdd1ef4
sumbit_at: at not used
michalkucharczyk Dec 18, 2023
00b9949
TransactionPool API: ready/ready_at/future at added
michalkucharczyk Jan 8, 2024
b015be1
Pool: deep_clone added
michalkucharczyk Jan 8, 2024
fc7a6be
txpool: test api: tx tag contains also account info
michalkucharczyk Jan 8, 2024
cc92ba4
fmt
michalkucharczyk Jan 8, 2024
3437a0a
TransactionPool API: ChainEvent derives Debug
michalkucharczyk Jan 8, 2024
c508b20
some progress
michalkucharczyk Jan 8, 2024
f705e13
tests added
michalkucharczyk Jan 9, 2024
6df33b0
multi_view_listener: some ideas
michalkucharczyk Jan 19, 2024
5923f49
finalization: tests added
michalkucharczyk Jan 19, 2024
374d9b1
fork_aware_pool: finalization + tree_route bug fixed
michalkucharczyk Jan 19, 2024
83f397a
logs here and there...
michalkucharczyk Jan 23, 2024
4505e3d
validated_pool: bug fix
michalkucharczyk Jan 23, 2024
c8aefbb
validated_pool + listener: util functions
michalkucharczyk Jan 23, 2024
f82bb36
submit_and_watch: somethig is working
michalkucharczyk Jan 23, 2024
3e9792e
forks + finalization tweaks
michalkucharczyk Feb 6, 2024
4b1cb4c
debugs
michalkucharczyk Feb 6, 2024
ea6905b
debugs
michalkucharczyk Feb 8, 2024
3143192
events and finalization works fine
michalkucharczyk Feb 8, 2024
b714f31
debug
michalkucharczyk Feb 8, 2024
a6f48fb
some fixes for no-views scenario
michalkucharczyk Mar 6, 2024
b5ed3dd
revalidation: initial implementation
michalkucharczyk Mar 8, 2024
24760ac
submit_and_watch: handling error fixed
michalkucharczyk Mar 12, 2024
9d77eaa
debug messages
michalkucharczyk Mar 12, 2024
65598f4
puring on finalization
michalkucharczyk Mar 21, 2024
cab4ac6
mempool / purging in background
michalkucharczyk Mar 25, 2024
b65e914
little cleanup
michalkucharczyk Mar 28, 2024
0d73839
some progress
michalkucharczyk Apr 4, 2024
27ec53d
...
michalkucharczyk Apr 8, 2024
cd9349e
rebase fixes
michalkucharczyk Apr 8, 2024
555db3c
txpool naive test for parachain ressurected
michalkucharczyk Apr 15, 2024
933d612
Hash: Unpin added where needed
michalkucharczyk Apr 15, 2024
655998e
client integration: bounds
michalkucharczyk Apr 15, 2024
0cd5b60
client integration: rpc
michalkucharczyk Apr 15, 2024
8392a0f
client integration: basic authorship
michalkucharczyk Apr 15, 2024
3b265ba
client integration: txpool: hacks
michalkucharczyk Apr 15, 2024
2879e7a
import notification sink added
michalkucharczyk Apr 22, 2024
cf79425
tests for sink
michalkucharczyk Apr 22, 2024
57c14a3
make old tests working
michalkucharczyk Apr 22, 2024
da84b80
multi_view: tests added
michalkucharczyk Apr 23, 2024
505b7a6
tests adjusted
michalkucharczyk May 6, 2024
4a9d676
chain-api: mutex removed, timings added
michalkucharczyk May 6, 2024
82276ca
client: tx import: timings added
michalkucharczyk May 6, 2024
f175784
network-transactions: received debug added
michalkucharczyk May 6, 2024
ce2f7da
import_sink_notiifcation: debugs
michalkucharczyk May 6, 2024
9d733a7
multi_view_listener: better debugs
michalkucharczyk May 6, 2024
686fa44
network-transactions: error + debugs added
michalkucharczyk May 6, 2024
4033075
txpool: debug level changed
michalkucharczyk May 6, 2024
168b368
validated_pool: debugs + timings added
michalkucharczyk May 6, 2024
adcc9a8
graph::pool: debugs + timings added
michalkucharczyk May 6, 2024
a76ad77
basic-authorship: debugs
michalkucharczyk May 6, 2024
5adbf57
fork-pool: debugs + timings added
michalkucharczyk May 6, 2024
d292b48
fork-pool: view: accept_xts added
michalkucharczyk May 6, 2024
beffdf2
fork-pool: view: ready transactions fixed
michalkucharczyk May 6, 2024
f485974
fork-pool: stats
michalkucharczyk May 6, 2024
effa85a
fork-pool: panic -> error
michalkucharczyk May 6, 2024
14474ba
fork-pool: view: accept_xts added - disabling views
michalkucharczyk May 6, 2024
8362c47
fork-pool: find_view - dir reversed
michalkucharczyk May 6, 2024
1ccb5c8
fork-pool: ref added
michalkucharczyk May 6, 2024
1d612bf
fork-pool: revalidation disabled
michalkucharczyk May 6, 2024
04c1cb5
fork-pool: todo added
michalkucharczyk May 6, 2024
df44d92
view_revalidation: debugs
michalkucharczyk May 6, 2024
cb5a34c
zombienet spam test
michalkucharczyk May 6, 2024
55f2166
multi_view_listener: finalization support added
michalkucharczyk May 6, 2024
bc899d3
tests adjusted again
michalkucharczyk May 6, 2024
3e3053a
fork-pool: finalization simplified
michalkucharczyk May 6, 2024
63f87d4
fork-pool: debugs aligned
michalkucharczyk May 16, 2024
a49201e
graph: type exposed
michalkucharczyk May 16, 2024
b1db4ed
graph: stats added
michalkucharczyk May 16, 2024
0ed9b75
tests: adjusted for new revalidation
michalkucharczyk May 16, 2024
7876a19
fork-pool: yet another revalidation approach
michalkucharczyk May 16, 2024
b7bfa13
fork-pool: view revalidation removed
michalkucharczyk May 16, 2024
fc64ad5
txpool: itertools added
michalkucharczyk May 16, 2024
92c42a1
plots: some tooling
michalkucharczyk May 16, 2024
6ea0547
spamming-zombie: debug levels fixed
michalkucharczyk May 16, 2024
77f666e
minors improvements
michalkucharczyk May 20, 2024
a0a73b5
crate structure improved
michalkucharczyk May 20, 2024
447ea3b
format + warnings + small fix
michalkucharczyk May 20, 2024
d348087
some groundwork for selecting implementation
michalkucharczyk May 23, 2024
b0f72e9
reference to transaction pool in now Unsized
michalkucharczyk May 23, 2024
4df5e44
txpool builder: integrated
michalkucharczyk May 23, 2024
196382e
fixing merging leftovers
michalkucharczyk May 29, 2024
3eff3db
debugs reverted
michalkucharczyk May 29, 2024
06eb6de
api fixes
michalkucharczyk May 29, 2024
23fd102
fixing clippy and warnings
michalkucharczyk May 29, 2024
c4e3ad6
adding fork_aware_txpool to builder
michalkucharczyk May 29, 2024
7c92b01
substrate-frame-rpc-system: test reverted to single-state pool
michalkucharczyk May 29, 2024
3b64ac4
Merge branch 'master' into mku-fork-aware-tx-pool
michalkucharczyk Jun 3, 2024
d848913
clippy happy
michalkucharczyk Jun 3, 2024
7099f2a
rename
michalkucharczyk May 30, 2024
34ee227
fork-aware: options handled
michalkucharczyk May 30, 2024
1b26803
wip - cleanup / zombie
michalkucharczyk Jun 3, 2024
303e7d6
Remove the training wheels
bkchr Jun 4, 2024
7bec303
Merge remote-tracking branch 'origin/master' into bkchr-fork-aware-tx…
bkchr Jun 4, 2024
fefea7f
create/build new view unified
michalkucharczyk Jun 10, 2024
426119a
stuck transaction unit test
michalkucharczyk Jun 10, 2024
fe4f16e
dbg added
michalkucharczyk Jun 10, 2024
22a8fc3
test_api: better debug
michalkucharczyk Jun 10, 2024
2ead9c7
little revert
michalkucharczyk Jun 10, 2024
72eb765
fork-aware: support for pruning future transactions
michalkucharczyk Jun 10, 2024
db8379f
fork-aware: tests for stuck transaction
michalkucharczyk Jun 10, 2024
008df84
single-state: test fixes
michalkucharczyk Jun 10, 2024
59385bb
clippy
michalkucharczyk Jun 10, 2024
f4eb24d
taplo
michalkucharczyk Jun 10, 2024
7b28b86
fatp: tests fixed
michalkucharczyk Jun 11, 2024
093ff26
debug msgs cleanup
michalkucharczyk Jun 11, 2024
c09bf79
comment removed
michalkucharczyk Jun 11, 2024
f4393a1
debug msgs cleanup
michalkucharczyk Jun 11, 2024
7943d8d
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jun 12, 2024
5716b00
tools
michalkucharczyk Jun 13, 2024
ff82cb7
sc-service: logs
michalkucharczyk Jun 13, 2024
7441d75
sc-basic-authorship: logs
michalkucharczyk Jun 13, 2024
b98724a
tools
michalkucharczyk Jun 13, 2024
11e88e9
logs improved
michalkucharczyk Jun 13, 2024
8a1bc21
debug removed
michalkucharczyk Jun 14, 2024
2cd05e3
basic-authorship: hash added to debug
michalkucharczyk Jun 17, 2024
204a5c3
graph::ready: debug improved
michalkucharczyk Jun 17, 2024
9246a0e
tools: fix
michalkucharczyk Jun 17, 2024
8c47a71
fatp: ready_at + trigger debugs added
michalkucharczyk Jun 17, 2024
c3583ca
fatp: triggered moved
michalkucharczyk Jun 17, 2024
35ee1fc
fatp: verirification after maintain added
michalkucharczyk Jun 17, 2024
a1c1d14
fatp: dbg removed
michalkucharczyk Jun 17, 2024
758908a
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jun 17, 2024
efa584f
Merge branch 'master' into mku-fork-aware-tx-pool-without-training-wh…
michalkucharczyk Jun 17, 2024
b64120a
fatp: split into files
michalkucharczyk Jun 18, 2024
62b08b0
fatp: avoid some of empty blocks
michalkucharczyk Jun 18, 2024
1a1baac
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jun 18, 2024
88808ce
fatp: polishing code
michalkucharczyk Jun 19, 2024
167b24a
fatp: more of polishing code
michalkucharczyk Jun 19, 2024
f3cf06d
fmt
michalkucharczyk Jun 19, 2024
73ac18b
one more approach to revalidation
michalkucharczyk Jun 20, 2024
fc62af3
fatp: revalidation remove from mempool
michalkucharczyk Jun 20, 2024
5f65be5
fatp: support for clearing recently pruned
michalkucharczyk Jun 20, 2024
2be6a01
fatp: test fixed
michalkucharczyk Jun 20, 2024
d60b9a3
fmt
michalkucharczyk Jun 20, 2024
4b2148e
fatp: maintenance on every block imported
michalkucharczyk Sep 5, 2023
eec54e7
revalidation: debugs
michalkucharczyk Jun 21, 2024
c8fb1ad
fmt
michalkucharczyk Jun 21, 2024
8830c58
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jun 21, 2024
cd53eb1
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jun 21, 2024
e6622d0
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-p…
bkchr Jun 24, 2024
3b8646f
Pull the slot duration on demand
bkchr Jun 24, 2024
58fd91b
cleaning: send errors + unwraps
michalkucharczyk Jul 1, 2024
70cee13
cleaning: tracing_unbounded used + mvl/ins internal naming
michalkucharczyk Jul 2, 2024
197846c
fatp::ready - improvements
michalkucharczyk Jul 2, 2024
79745f9
txpool: api: ready/future: removed at parameter
michalkucharczyk Jul 2, 2024
c863d64
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 3, 2024
77610ce
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jul 3, 2024
d16d1f9
Cargo.lock
michalkucharczyk Jul 3, 2024
6583718
fix
michalkucharczyk Jul 3, 2024
5532979
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 3, 2024
3a29c79
clippy
michalkucharczyk Jul 3, 2024
aa4b46f
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 3, 2024
1d47a9b
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jul 3, 2024
0d5072d
txpool: api: ready/future: removed at parameter: leftovers
michalkucharczyk Jul 3, 2024
90ffa72
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 3, 2024
626c248
debug symbols enabled in release profile
michalkucharczyk Jul 4, 2024
88d352a
logs added
michalkucharczyk Jul 5, 2024
cb366b3
logs
michalkucharczyk Jul 5, 2024
5462728
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jul 5, 2024
f960d49
trying to trigger CI job
michalkucharczyk Jul 5, 2024
ac98b3d
clippy
michalkucharczyk Jul 5, 2024
0ba4d1d
fixes
michalkucharczyk Jul 5, 2024
4bcc7a2
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 5, 2024
05d4547
tool: parse-log improvements
michalkucharczyk Jul 8, 2024
b04ff0a
light-maintain: working poc
michalkucharczyk Jul 8, 2024
9b26612
light-maintain: api + impl
michalkucharczyk Jul 8, 2024
5a0373c
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 8, 2024
228f7b3
light-maintain: improvements
michalkucharczyk Jul 8, 2024
f7d85b5
Revert "fatp: maintenance on every block imported"
michalkucharczyk Jul 8, 2024
5f93de2
fatp: on_broadcasted added
michalkucharczyk Jul 8, 2024
57577e7
fatp: avoid empty block for light maintain
michalkucharczyk Jul 8, 2024
ff3c02b
fatp::update_view: filter-out invalid txs
michalkucharczyk Jul 9, 2024
6d6ccf5
fatp::ready_pollers: removed cancelled senders
michalkucharczyk Jul 9, 2024
e0721b9
minor changes: logs / comments
michalkucharczyk Jul 9, 2024
f6e8daa
light-maintain: minor improvements
michalkucharczyk Jul 9, 2024
83de56b
import_sink_notiifcation: switch to parking_lock:rwlock
michalkucharczyk Jul 9, 2024
380a326
fatp: is_validator cleanup
michalkucharczyk Jul 9, 2024
bd0386d
minor methods rename
michalkucharczyk Jul 9, 2024
b1c61ab
fmt
michalkucharczyk Jul 9, 2024
be5e95c
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 9, 2024
3620176
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 9, 2024
bae7e29
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jul 9, 2024
e656e33
mergin master: fixing leftovers
michalkucharczyk Jul 9, 2024
614fca2
fapt: metrics added
michalkucharczyk Jul 10, 2024
f3ea112
fatp: metrics added, missing file
michalkucharczyk Jul 11, 2024
8bad061
tool: parse-log improvement
michalkucharczyk Jul 11, 2024
ed2662a
testing: prometheus port is fixed
michalkucharczyk Jul 11, 2024
4c82906
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 11, 2024
65da894
Merge remote-tracking branch 'upstream/master' into mku-fork-aware-tx…
michalkucharczyk Jul 11, 2024
379a35b
fatp: metrics, duration buckets adjusted
michalkucharczyk Jul 11, 2024
3551a52
Merge remote-tracking branch 'upstream/mku-fork-aware-tx-pool' into m…
michalkucharczyk Jul 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,8 @@ zstd = { version = "0.12.4", default-features = false }
# Polkadot runtime requires unwinding.
panic = "unwind"
opt-level = 3
debug = true


# make sure dev builds with backtrace do not slow us down
[profile.dev.package.backtrace]
Expand Down
6 changes: 1 addition & 5 deletions cumulus/client/consensus/aura/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,7 @@ where
None,
(parachain_inherent_data, other_inherent_data),
params.authoring_duration,
// Set the block limit to 50% of the maximum PoV size.
//
// TODO: If we got benchmarking that includes the proof size,
// we should be able to use the maximum pov size.
(validation_data.max_pov_size / 2) as usize,
validation_data.max_pov_size as usize,
)
.await
{
Expand Down
4 changes: 3 additions & 1 deletion cumulus/client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,13 @@ pub struct BuildNetworkParams<
IQ,
> where
Client::Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>,
<Block as BlockT>::Hash: std::marker::Unpin,
{
pub parachain_config: &'a Configuration,
pub net_config:
sc_network::config::FullNetworkConfiguration<Block, <Block as BlockT>::Hash, Network>,
pub client: Arc<Client>,
pub transaction_pool: Arc<sc_transaction_pool::FullPool<Block, Client>>,
pub transaction_pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, Client>>,
pub para_id: ParaId,
pub relay_chain_interface: RCInterface,
pub spawn_handle: SpawnTaskHandle,
Expand Down Expand Up @@ -446,6 +447,7 @@ pub async fn build_network<'a, Block, Client, RCInterface, IQ, Network>(
)>
where
Block: BlockT,
<Block as BlockT>::Hash: std::marker::Unpin,
Client: UsageProvider<Block>
+ HeaderBackend<Block>
+ sp_consensus::block_validation::Chain<Block>
Expand Down
10 changes: 5 additions & 5 deletions cumulus/polkadot-parachain/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer
/// A type representing all RPC extensions.
pub type RpcExtension = jsonrpsee::RpcModule<()>;

pub(crate) trait BuildRpcExtensions<Client, Backend, Pool> {
pub(crate) trait BuildRpcExtensions<Client, Backend, Pool: ?Sized> {
fn build_rpc_extensions(
deny_unsafe: DenyUnsafe,
client: Arc<Client>,
Expand All @@ -50,7 +50,7 @@ impl<RuntimeApi>
BuildRpcExtensions<
ParachainClient<RuntimeApi>,
ParachainBackend,
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>,
> for BuildEmptyRpcExtensions<RuntimeApi>
where
RuntimeApi: ConstructNodeRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
Expand All @@ -59,7 +59,7 @@ where
_deny_unsafe: DenyUnsafe,
_client: Arc<ParachainClient<RuntimeApi>>,
_backend: Arc<ParachainBackend>,
_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
_pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
) -> sc_service::error::Result<RpcExtension> {
Ok(RpcExtension::new(()))
}
Expand All @@ -71,7 +71,7 @@ impl<RuntimeApi>
BuildRpcExtensions<
ParachainClient<RuntimeApi>,
ParachainBackend,
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>,
> for BuildParachainRpcExtensions<RuntimeApi>
where
RuntimeApi: ConstructNodeRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
Expand All @@ -82,7 +82,7 @@ where
deny_unsafe: DenyUnsafe,
client: Arc<ParachainClient<RuntimeApi>>,
backend: Arc<ParachainBackend>,
pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
) -> sc_service::error::Result<RpcExtension> {
let build = || -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>> {
let mut module = RpcExtension::new(());
Expand Down
29 changes: 15 additions & 14 deletions cumulus/polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use cumulus_client_service::{
};
use cumulus_primitives_core::{relay_chain::ValidationCode, ParaId};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use sc_transaction_pool::TransactionPoolImpl;

use crate::{
common::{
Expand Down Expand Up @@ -60,7 +61,6 @@ use sc_network::{config::FullNetworkConfiguration, service::traits::NetworkBacke
use sc_service::{Configuration, Error, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_sysinfo::HwBench;
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sc_transaction_pool::FullPool;
use sp_api::ProvideRuntimeApi;
use sp_keystore::KeystorePtr;
use sp_runtime::{app_crypto::AppCrypto, traits::Header as HeaderT};
Expand Down Expand Up @@ -88,7 +88,7 @@ pub type Service<RuntimeApi> = PartialComponents<
ParachainBackend,
(),
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>,
(ParachainBlockImport<RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
>;

Expand All @@ -113,7 +113,7 @@ where
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand All @@ -132,7 +132,7 @@ pub(crate) trait NodeSpec {
type BuildRpcExtensions: BuildRpcExtensions<
ParachainClient<Self::RuntimeApi>,
ParachainBackend,
sc_transaction_pool::FullPool<Block, ParachainClient<Self::RuntimeApi>>,
TransactionPoolImpl<Block, ParachainClient<Self::RuntimeApi>>,
> + 'static;

type StartConsensus: StartConsensus<Self::RuntimeApi> + 'static;
Expand Down Expand Up @@ -183,13 +183,14 @@ pub(crate) trait NodeSpec {
telemetry
});

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);
let transaction_pool = sc_transaction_pool::Builder::new()
.with_options(config.transaction_pool.clone())
.build(
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());

Expand Down Expand Up @@ -555,7 +556,7 @@ impl StartConsensus<FakeRuntimeApi> for StartRelayChainConsensus {
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block, ParachainClient<FakeRuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<FakeRuntimeApi>>>,
_keystore: KeystorePtr,
_relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -637,7 +638,7 @@ where
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block, ParachainClient<RuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -741,7 +742,7 @@ where
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block, ParachainClient<RuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/service/benches/transaction_throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughpu
use cumulus_client_cli::get_raw_genesis_header;
use cumulus_test_runtime::{AccountId, BalancesCall, ExistentialDeposit, SudoCall};
use futures::{future, StreamExt};
use sc_transaction_pool_api::{TransactionPool as _, TransactionSource, TransactionStatus};
use sc_transaction_pool_api::{TransactionSource, TransactionStatus};
use sp_core::{crypto::Pair, sr25519};
use sp_runtime::OpaqueExtrinsic;

Expand Down
19 changes: 10 additions & 9 deletions cumulus/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub type Backend = TFullBackend<Block>;
pub type ParachainBlockImport = TParachainBlockImport<Block, Arc<Client>, Backend>;

/// Transaction pool type used by the test service
pub type TransactionPool = Arc<sc_transaction_pool::FullPool<Block, Client>>;
pub type TransactionPool = Arc<sc_transaction_pool::TransactionPoolImpl<Block, Client>>;

/// Recovery handle that fails regularly to simulate unavailable povs.
pub struct FailingRecoveryHandle {
Expand Down Expand Up @@ -181,7 +181,7 @@ pub type Service = PartialComponents<
Backend,
(),
sc_consensus::import_queue::BasicQueue<Block>,
sc_transaction_pool::FullPool<Block, Client>,
sc_transaction_pool::TransactionPoolImpl<Block, Client>,
ParachainBlockImport,
>;

Expand Down Expand Up @@ -216,13 +216,14 @@ pub fn new_partial(

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);
let transaction_pool = sc_transaction_pool::Builder::new()
.with_options(config.transaction_pool.clone())
.build(
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let import_queue = cumulus_client_consensus_aura::import_queue::<AuthorityPair, _, _, _, _, _>(
Expand Down
18 changes: 18 additions & 0 deletions cumulus/zombienet/tests/0008-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Allows to manually submit extrinsic to collator.
// Usage:
// zombienet-linux -p native spwan 0008-parachain-extrinsic-gets-finalized.toml
// node 0008-main.js <path-to-generated-tmpdir/zombie.json>

global.zombie = null

const fs = require('fs');
const test = require('./0008-transaction_gets_finalized.js');

if (process.argv.length == 2) {
console.error('Path to zombie.json (generated by zombienet-linux spawn command shall be given)!');
process.exit(1);
}

let networkInfo = JSON.parse(fs.readFileSync(process.argv[2]));

test.run("charlie", networkInfo).then(process.exit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[relaychain]
default_image = "{{RELAY_IMAGE}}"
default_command = "polkadot"
chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[parachains]]
id = 2000
cumulus_based = true
chain = "asset-hub-rococo-local"

# run charlie as parachain collator
[[parachains.collators]]
name = "charlie"
validator = true
image = "{{POLKADOT_PARACHAIN_IMAGE}}"
command = "polkadot-parachain"
args = ["--force-authoring", "-ltxpool=trace"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Block building
Network: ./0008-parachain_extrinsic_gets_finalized.toml
Creds: config

alice: reports node_roles is 4
bob: reports node_roles is 4
charlie: reports node_roles is 4

alice: reports peers count is at least 1
bob: reports peers count is at least 1

alice: reports block height is at least 5 within 60 seconds
bob: reports block height is at least 5 within 60 seconds
charlie: reports block height is at least 2 within 120 seconds

alice: count of log lines containing "error" is 0 within 2 seconds
bob: count of log lines containing "error" is 0 within 2 seconds
charlie: count of log lines containing "error" is 0 within 2 seconds

charlie: js-script ./0008-transaction_gets_finalized.js within 600 seconds
Loading
Loading