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 transaction pool added #4639

Merged
merged 381 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
381 commits
Select commit Hold shift + click to select a range
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
b64120a
fatp: split into files
michalkucharczyk Jun 18, 2024
62b08b0
fatp: avoid some of empty blocks
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
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
6583718
fix
michalkucharczyk Jul 3, 2024
3a29c79
clippy
michalkucharczyk Jul 3, 2024
0d5072d
txpool: api: ready/future: removed at parameter: leftovers
michalkucharczyk Jul 3, 2024
0ba4d1d
fixes
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
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
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
379a35b
fatp: metrics, duration buckets adjusted
michalkucharczyk Jul 11, 2024
956b63e
basic-authorship: remove_invalid: debug -> info
michalkucharczyk Jul 12, 2024
a9c0a37
fatp: general cleanups
michalkucharczyk Jul 12, 2024
1c6ff0f
sp_runtime: TransactionSource is Hashable
michalkucharczyk Jul 12, 2024
757790d
txpool: notification_future moved to common
michalkucharczyk Jul 12, 2024
63313a3
fatp: metrics: non-cloned views tracked
michalkucharczyk Jul 12, 2024
3c0a8d3
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Jul 12, 2024
a02ab55
clippy + format
michalkucharczyk Jul 12, 2024
7d96084
Cargo.lock
michalkucharczyk Jul 12, 2024
605c7ca
tools: graphs
michalkucharczyk Jul 15, 2024
c53405e
tools: graphs histogram added
michalkucharczyk Jul 17, 2024
24b294d
fmt
michalkucharczyk Jul 15, 2024
5944738
dbg + fmt + removed todos
michalkucharczyk Jul 15, 2024
7dcaced
poc: arc(tx)
michalkucharczyk Jul 16, 2024
469d303
poc: arc(tx) - continued
michalkucharczyk Jul 16, 2024
acc53d0
types cleanup
michalkucharczyk Jul 16, 2024
f0214c8
types cleanup - cont.
michalkucharczyk Jul 16, 2024
cd58437
poc: arc(tx) fix
michalkucharczyk Jul 16, 2024
af4d91b
review comments applied
michalkucharczyk Jul 17, 2024
766ae6b
todos removed
michalkucharczyk Jul 17, 2024
e14d69c
mempool: validated_at stored
michalkucharczyk Jul 17, 2024
bc16e34
Update substrate/client/transaction-pool/src/fork_aware_txpool/txmemp…
michalkucharczyk Jul 17, 2024
e88bc20
Update substrate/client/transaction-pool/src/fork_aware_txpool/txmemp…
michalkucharczyk Jul 17, 2024
c2c7f9e
Update substrate/client/transaction-pool/src/fork_aware_txpool/txmemp…
michalkucharczyk Jul 17, 2024
c2d117d
Update substrate/client/transaction-pool/src/fork_aware_txpool/multi_…
michalkucharczyk Jul 17, 2024
8e94f04
review comments applied
michalkucharczyk Jul 17, 2024
13156dd
mempool: better name: xts2 -> transactions
michalkucharczyk Jul 17, 2024
6f6f9f1
tools
michalkucharczyk Jul 17, 2024
3a22201
rename: txmempool -> tx_mem_pool
michalkucharczyk Jul 17, 2024
606685d
mempool: entry -> insert
michalkucharczyk Jul 17, 2024
ff0fadf
fixes
michalkucharczyk Jul 17, 2024
843c08d
fatp: fmt
michalkucharczyk Jul 18, 2024
434ec4d
fatp: is_validator fix
michalkucharczyk Jul 18, 2024
fd96498
graph::pool: submit_at preserves order
michalkucharczyk Jul 18, 2024
f818060
some minor renames
michalkucharczyk Jul 18, 2024
911d0f8
mempool: limits implemented
michalkucharczyk Jul 18, 2024
cda165b
Cargo.lock
michalkucharczyk Jul 18, 2024
8bf2c89
WIP/revert: mempool: removing invalid transaction
michalkucharczyk Jul 22, 2024
3ddd3f4
mempool: limits implemented - continued
michalkucharczyk Jul 24, 2024
ba8d3ee
mempool: removing dropped transactions + event
michalkucharczyk Aug 7, 2024
5164be3
tools
michalkucharczyk Aug 7, 2024
a7f021c
zombienet: limits testing
michalkucharczyk Aug 7, 2024
7fa56e5
clippy
michalkucharczyk Aug 7, 2024
51431d8
tools: update
michalkucharczyk Aug 14, 2024
1d0efe1
removing redundant files
michalkucharczyk Aug 14, 2024
9138bba
wip: better docs
michalkucharczyk Aug 14, 2024
5a7be3f
some progress on the top level overview
michalkucharczyk Aug 16, 2024
2d8b197
more docs
michalkucharczyk Aug 16, 2024
c37bf8f
fatp: todos updated
michalkucharczyk Aug 16, 2024
b7be170
fatp: submit_one uses submit_at
michalkucharczyk Aug 16, 2024
140a365
doc: ...
michalkucharczyk Aug 16, 2024
3ad0a1b
fatp: submit_one uses submit_at -- cd.
michalkucharczyk Aug 16, 2024
a773791
fatp: todos cleanup
michalkucharczyk Aug 27, 2024
8e0a42b
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Aug 27, 2024
7229e6b
fatp: todos...
michalkucharczyk Aug 27, 2024
ca77eeb
review comments
michalkucharczyk Aug 27, 2024
6dfefcc
spell checker: typos
michalkucharczyk Aug 27, 2024
88458db
doc: some progress
michalkucharczyk Aug 28, 2024
947de9d
doc: more progress + some renaming
michalkucharczyk Aug 28, 2024
ca50e34
typos
michalkucharczyk Aug 28, 2024
728335a
doc + renaming
michalkucharczyk Aug 29, 2024
8fa24cf
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Aug 29, 2024
7c12f2b
after merge fixes
michalkucharczyk Aug 29, 2024
6d4570d
prdoc updated
michalkucharczyk Aug 29, 2024
1c39857
prdoc again
michalkucharczyk Aug 29, 2024
673341d
prdoc again
michalkucharczyk Aug 29, 2024
d2d9722
Merge branch 'master' into mku-fork-aware-tx-pool
michalkucharczyk Sep 2, 2024
b376723
minor doc/naming improvements
michalkucharczyk Sep 3, 2024
49ffe3a
fix
michalkucharczyk Sep 3, 2024
fcea4ff
prdoc again
michalkucharczyk Sep 3, 2024
767e586
debug -> trace
michalkucharczyk Sep 11, 2024
9df92ab
debug -> trace: fixes
michalkucharczyk Sep 11, 2024
3e4c479
info -> debug
michalkucharczyk Sep 11, 2024
7a85937
info -> debug: fixes
michalkucharczyk Sep 11, 2024
cc39147
TransactionPoolImpl is a Box
michalkucharczyk Sep 11, 2024
5a6afb7
Revert "References to transaction pool are now Unsized"
michalkucharczyk Sep 11, 2024
a46263b
Unsized: revert
michalkucharczyk Sep 12, 2024
c9504ec
?Sized saga ctd: now we have wrapper, still not perfect.
michalkucharczyk Sep 12, 2024
5e01d6f
?Sized saga ctd: Wrapper internally is just a Box.
michalkucharczyk Sep 12, 2024
8a3639f
pool_kbytes -> pool_bytes
michalkucharczyk Sep 12, 2024
5ff434e
builder: debug -> info
michalkucharczyk Sep 12, 2024
9143368
view_store: active_views / inactive_views
michalkucharczyk Sep 12, 2024
bd1cc5f
license added
michalkucharczyk Sep 12, 2024
ffda333
missing log_target
michalkucharczyk Sep 12, 2024
db10b51
cumulus: redundant Unpin bound removed
michalkucharczyk Sep 12, 2024
9cba3f0
?Sized saga ctd: templates...
michalkucharczyk Sep 12, 2024
ca2f49a
?Sized saga ctd: substrate-frame-rpc-system
michalkucharczyk Sep 12, 2024
29170b4
txpool log_target used
michalkucharczyk Sep 12, 2024
b9c5df0
Update substrate/test-utils/runtime/transaction-pool/src/lib.rs
michalkucharczyk Sep 12, 2024
44479fe
Update substrate/client/transaction-pool/src/fork_aware_txpool/fork_a…
michalkucharczyk Sep 12, 2024
4729119
removing comments
michalkucharczyk Sep 12, 2024
3003e13
removing comments
michalkucharczyk Sep 12, 2024
8e5b3f6
?Sized saga ctd: clippy failuers
michalkucharczyk Sep 12, 2024
593d8e9
fork_aware_txpool: review nits
michalkucharczyk Sep 13, 2024
845cb98
fork_aware_txpool: review nits: fixes
michalkucharczyk Sep 13, 2024
d9cd57d
FullPool: redundant type removed
michalkucharczyk Sep 13, 2024
78e45dc
test fix
michalkucharczyk Sep 13, 2024
53cee71
dropped_watcher: review comments
michalkucharczyk Sep 13, 2024
f6d42b8
dropped_watcher: review comments
michalkucharczyk Sep 16, 2024
4c1ee03
review nits
michalkucharczyk Sep 16, 2024
bc73a5f
fix test
michalkucharczyk Sep 16, 2024
1b7216d
tx_mem_pool: source getter
michalkucharczyk Sep 16, 2024
8c0976d
fatp: reduce_multi_view
michalkucharczyk Sep 16, 2024
dc3bafa
tx_mem_pool: nits
michalkucharczyk Sep 16, 2024
61f73b3
tx_mem_pool: remove_watched
michalkucharczyk Sep 16, 2024
b423ea3
warnings
michalkucharczyk Sep 16, 2024
13cd741
nits
michalkucharczyk Sep 16, 2024
894b81f
reduce_multiview_result: review comments
michalkucharczyk Sep 16, 2024
aa8f226
view_store: inactive_views are not removed from listener
michalkucharczyk Sep 11, 2024
44d1308
builder: builder pattern
michalkucharczyk Sep 16, 2024
b4dbfda
prdoc
michalkucharczyk Sep 16, 2024
3d71ed1
fmt
michalkucharczyk Sep 16, 2024
6ff4630
doc test fixed
michalkucharczyk Sep 16, 2024
125a240
review comments: doc improved
michalkucharczyk Sep 16, 2024
4c366c7
Update substrate/client/transaction-pool/src/fork_aware_txpool/multi_…
michalkucharczyk Sep 17, 2024
3237803
fatp: verify removed
michalkucharczyk Sep 17, 2024
7d3a487
review comments
michalkucharczyk Sep 17, 2024
b4cba58
view: let futures - removed
michalkucharczyk Sep 17, 2024
3b82c76
view_store: submit_at -> submit
michalkucharczyk Sep 17, 2024
0bf88e7
fatp: error -> debug
michalkucharczyk Sep 17, 2024
8e259b4
view: do not collect when not displaying
michalkucharczyk Sep 17, 2024
ae6a5a6
ready_at: do not trigger light if view already exists + tests
michalkucharczyk Sep 17, 2024
7705093
fmt
michalkucharczyk Sep 17, 2024
2f4b1d8
ready_at_light: two more tests added
michalkucharczyk Sep 18, 2024
02ee1a1
?Sized saga ctd: wrapper removed, using just Arc<dyn>
michalkucharczyk Sep 19, 2024
02ddf28
?Sized saga: wrapper removed, TranasctionPoolImpl -> TransactionPoolH…
michalkucharczyk Sep 19, 2024
3382208
enactment_state: doc clarified
michalkucharczyk Sep 19, 2024
6f39223
?Sized saga: wrapper removed (again) + fixes
michalkucharczyk Sep 19, 2024
71cbaca
Revert "?Sized saga: wrapper removed (again) + fixes"
michalkucharczyk Sep 20, 2024
e07b17e
Revert "?Sized saga: wrapper removed, TranasctionPoolImpl -> Transact…
michalkucharczyk Sep 20, 2024
77584d8
Revert "?Sized saga ctd: wrapper removed, using just Arc<dyn>"
michalkucharczyk Sep 20, 2024
764821b
better name: TransactionPoolImpl -> TransactionPoolHandle
michalkucharczyk Sep 20, 2024
1a1625f
fatp: review ready_at_with_timeout improved
michalkucharczyk Sep 20, 2024
700aeba
dropped_watcher: pending + fuse removed
michalkucharczyk Sep 20, 2024
288bcd7
import_notification_sink: pending + fuse removed
michalkucharczyk Sep 20, 2024
8be61ec
multi_view_listener: pending + fuse removed
michalkucharczyk Sep 20, 2024
5f46e4a
mvlisteners: pending added
michalkucharczyk Sep 23, 2024
b6c0d59
tx_mem_pool: ImmediatelyDropped fix
michalkucharczyk Sep 23, 2024
17aa061
fatp: ready_at_light improved
michalkucharczyk Sep 23, 2024
3ee444c
fmt
michalkucharczyk Sep 23, 2024
989a7a6
fatp: more docs
michalkucharczyk Sep 23, 2024
a31e242
fatp: update_view: error handling simplified
michalkucharczyk Sep 23, 2024
60f61c6
fatp: ready_at_with_timeout tests added
michalkucharczyk Sep 25, 2024
c28c1ee
minor fix
michalkucharczyk Sep 26, 2024
81e3ce2
tests: fmt / new minor test / comments
michalkucharczyk Sep 27, 2024
1f4f74b
fapt: better handling of dropped transaction during submission
michalkucharczyk Sep 27, 2024
0c4c8c0
fatp: handling limits: improvements
michalkucharczyk Sep 30, 2024
0b7bb1f
tests: limits testing added
michalkucharczyk Oct 1, 2024
672ff4a
fatp: handling limits: better implementation
michalkucharczyk Oct 1, 2024
e28d1f1
fatp: debugs
michalkucharczyk Oct 1, 2024
6e02d08
fatp: tests: reorg
michalkucharczyk Oct 1, 2024
bef72e7
fatp: tests
michalkucharczyk Oct 2, 2024
fbce60c
dropped_watcher: fix + tests
michalkucharczyk Oct 2, 2024
54215bf
fatp: info banner
michalkucharczyk Oct 4, 2024
42533b9
dropped_watcher: debugs
michalkucharczyk Oct 4, 2024
77ad3ee
tests: dead code warning
michalkucharczyk Oct 4, 2024
6c3cfa3
fatp: submit_and_watch improvements for limits scenarios + debugs
michalkucharczyk Oct 4, 2024
401e3a9
dbgs
michalkucharczyk Oct 4, 2024
7ffefb3
mvl: remove ctrls when sending termination events
michalkucharczyk Oct 4, 2024
30c7b5c
txmempool: debug on try_insert
michalkucharczyk Oct 4, 2024
afb2dcf
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Oct 7, 2024
999bfff
master merge fix
michalkucharczyk Oct 7, 2024
41a2f5f
review comments
michalkucharczyk Oct 7, 2024
2bea7e9
fatp: submit_at: review fix
michalkucharczyk Oct 7, 2024
b6e15cd
view: dbg msg: revalidate_later -> revalidate
michalkucharczyk Oct 7, 2024
571d598
revalidation_worker: basic test enabled
michalkucharczyk Oct 7, 2024
3be1b27
fix
michalkucharczyk Oct 7, 2024
e907c18
sync: log level
michalkucharczyk Oct 7, 2024
521ae88
reviews
michalkucharczyk Oct 7, 2024
5da82a6
zombie test for parachain tx finalizing
michalkucharczyk Oct 7, 2024
b16e949
basic-authorship: debugs
michalkucharczyk Oct 8, 2024
1e818dd
log_xt: cleanup
michalkucharczyk Oct 8, 2024
ac1aa80
ready_poll: race condition fixed
michalkucharczyk Oct 8, 2024
b65cd1f
single_state_txpool: LOG_TARGET
michalkucharczyk Oct 8, 2024
8b7c686
graph/listener: error on send failure
michalkucharczyk Oct 8, 2024
61bd99b
fatp: todos removed
michalkucharczyk Oct 8, 2024
50cced1
view_store: todo + log
michalkucharczyk Oct 8, 2024
4f1e458
view_store: insert_new_view: readability
michalkucharczyk Oct 8, 2024
c9ce3d5
view_store: idiomatic rust glupcze
michalkucharczyk Oct 8, 2024
0766199
basic-authorship: log levels
michalkucharczyk Oct 8, 2024
14dd439
tests: review nits
michalkucharczyk Oct 8, 2024
8bd1dce
tests: pool: revert
michalkucharczyk Oct 8, 2024
44d8dbd
common/api: reverts
michalkucharczyk Oct 8, 2024
cc5eca3
client: debug removed
michalkucharczyk Oct 8, 2024
5b8e409
tests: rename fatp2 -> fatp_limits
michalkucharczyk Oct 8, 2024
81849bc
single-state-pool: ready_at_with_timeout: simplified
michalkucharczyk Oct 10, 2024
69b0885
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Oct 10, 2024
545d28c
review comments
michalkucharczyk Oct 10, 2024
897a91e
prdoc update
michalkucharczyk Oct 10, 2024
82761ae
multi-view-listner: code review comments
michalkucharczyk Oct 10, 2024
2afb109
graph::listener: note added
michalkucharczyk Oct 10, 2024
b90e360
log_enabled used properly
michalkucharczyk Oct 10, 2024
fffc1fe
fatp: review comments: view.clone / extrinsics_included_since_finalized
michalkucharczyk Oct 10, 2024
5a5fb09
prdoc: fix
michalkucharczyk Oct 10, 2024
81273fd
network::transactions: debug removed
michalkucharczyk Oct 11, 2024
0b71552
fatp: panic/unimplemented removed
michalkucharczyk Oct 11, 2024
872cd88
fatp: code review + leftovers cleanup
michalkucharczyk Oct 14, 2024
888e426
multi-view-listener: pending events removed
michalkucharczyk Oct 14, 2024
a9f58a4
dropped_watcher: fix for flaky test
michalkucharczyk Oct 14, 2024
2a6757d
import_sink_notification: txs are removed when dropped
michalkucharczyk Oct 14, 2024
39b2c3a
view: revalidation TransactionValidityError::Unknown -> invalid
michalkucharczyk Oct 14, 2024
043a1e0
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Oct 15, 2024
9c547ff
Merge remote-tracking branch 'origin/master' into mku-fork-aware-tx-pool
michalkucharczyk Oct 15, 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
6 changes: 6 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion cumulus/client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub struct BuildNetworkParams<
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<Block: BlockT, RuntimeApi>
BuildRpcExtensions<
ParachainClient<Block, RuntimeApi>,
ParachainBackend<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>,
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>,
> for BuildEmptyRpcExtensions<Block, RuntimeApi>
where
RuntimeApi:
Expand All @@ -55,7 +55,9 @@ where
fn build_rpc_extensions(
_client: Arc<ParachainClient<Block, RuntimeApi>>,
_backend: Arc<ParachainBackend<Block>>,
_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>>,
_pool: Arc<
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>,
>,
) -> sc_service::error::Result<RpcExtension> {
Ok(RpcExtension::new(()))
}
Expand All @@ -67,7 +69,7 @@ impl<Block: BlockT, RuntimeApi>
BuildRpcExtensions<
ParachainClient<Block, RuntimeApi>,
ParachainBackend<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>,
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>,
> for BuildParachainRpcExtensions<Block, RuntimeApi>
where
RuntimeApi:
Expand All @@ -78,7 +80,9 @@ where
fn build_rpc_extensions(
client: Arc<ParachainClient<Block, RuntimeApi>>,
backend: Arc<ParachainBackend<Block>>,
pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>>,
pool: Arc<
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>,
>,
) -> sc_service::error::Result<RpcExtension> {
let build = || -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>> {
let mut module = RpcExtension::new(());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use sc_network::{config::FullNetworkConfiguration, NetworkBackend, NetworkBlock}
use sc_service::{Configuration, ImportQueue, PartialComponents, TaskManager};
use sc_sysinfo::HwBench;
use sc_telemetry::{TelemetryHandle, TelemetryWorker};
use sc_transaction_pool::FullPool;
use sc_transaction_pool::TransactionPoolImpl;
use sp_keystore::KeystorePtr;
use std::{future::Future, pin::Pin, sync::Arc, time::Duration};

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

type StartConsensus: StartConsensus<Self::Block, Self::RuntimeApi>;
Expand Down Expand Up @@ -156,12 +156,15 @@ 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 = Arc::from(
sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build(),
);

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use sc_consensus::DefaultImportQueue;
use sc_executor::WasmExecutor;
use sc_service::{PartialComponents, TFullBackend, TFullClient};
use sc_telemetry::{Telemetry, TelemetryWorkerHandle};
use sc_transaction_pool::FullPool;
use sc_transaction_pool::TransactionPoolImpl;
use sp_runtime::{generic, traits::BlakeTwo256};
use std::sync::Arc;

Expand Down Expand Up @@ -51,6 +51,6 @@ pub type ParachainService<Block, RuntimeApi> = PartialComponents<
ParachainBackend<Block>,
(),
DefaultImportQueue<Block>,
FullPool<Block, ParachainClient<Block, RuntimeApi>>,
TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>,
(ParachainBlockImport<Block, RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
>;
10 changes: 6 additions & 4 deletions cumulus/polkadot-parachain/polkadot-parachain-lib/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use sc_consensus::{
};
use sc_service::{Configuration, Error, TaskManager};
use sc_telemetry::TelemetryHandle;
use sc_transaction_pool::FullPool;
use sc_transaction_pool::TransactionPoolImpl;
use sp_api::ProvideRuntimeApi;
use sp_inherents::CreateInherentDataProviders;
use sp_keystore::KeystorePtr;
Expand Down Expand Up @@ -264,7 +264,9 @@ impl StartConsensus<Block<u32>, FakeRuntimeApi> for StartRelayChainConsensus {
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block<u32>, ParachainClient<Block<u32>, FakeRuntimeApi>>>,
transaction_pool: Arc<
TransactionPoolImpl<Block<u32>, ParachainClient<Block<u32>, FakeRuntimeApi>>,
>,
_keystore: KeystorePtr,
_relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -390,7 +392,7 @@ where
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block, ParachainClient<Block, RuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down Expand Up @@ -487,7 +489,7 @@ where
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<FullPool<Block, ParachainClient<Block, RuntimeApi>>>,
transaction_pool: Arc<TransactionPoolImpl<Block, ParachainClient<Block, RuntimeApi>>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
para_id: ParaId,
Expand Down
19 changes: 11 additions & 8 deletions cumulus/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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 @@ -182,7 +182,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 @@ -218,12 +218,15 @@ 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 = Arc::from(
sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build(),
);

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
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"]
michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved
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
77 changes: 77 additions & 0 deletions cumulus/zombienet/tests/0008-transaction_gets_finalized.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//based on: https://polkadot.js.org/docs/api/examples/promise/transfer-events

const assert = require("assert");

async function run(nodeName, networkInfo, args) {
// console.log('xxxxxxxxxxx 1');
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
// console.log('xxxxxxxxxxx 2');
// Create the API and wait until ready
var api = null;
var keyring = null;
if (zombie == null) {
const testKeyring = require('@polkadot/keyring/testing');
const { WsProvider, ApiPromise } = require('@polkadot/api');
const provider = new WsProvider(wsUri);
api = await ApiPromise.create({provider});
// Construct the keyring after the API (crypto has an async init)
keyring = testKeyring.createTestKeyring({ type: "sr25519" });
} else {
keyring = new zombie.Keyring({ type: "sr25519" });
// console.log('xxxxxxxxxxx 3');
api = await zombie.connect(wsUri, userDefinedTypes);
// console.log('xxxxxxxxxxx 4');
}


// Add Alice to our keyring with a hard-derivation path (empty phrase, so uses dev)
const alice = keyring.addFromUri('//Alice');
// console.log('xxxxxxxxxxx 5');
michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved

// Create a extrinsic:
const extrinsic = api.tx.system.remark("xxx");
// console.log('xxxxxxxxxxx 6');

let extrinsic_success_event = false;
try {
// console.log('xxxxxxxxxxx 7');
await new Promise( async (resolve, reject) => {
const unsubscribe = await extrinsic
.signAndSend(alice, { nonce: -1 }, ({ events = [], status }) => {
console.log('Extrinsic status:', status.type);

if (status.isInBlock) {
console.log('Included at block hash', status.asInBlock.toHex());
console.log('Events:');

events.forEach(({ event: { data, method, section }, phase }) => {
console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString());

if (section=="system" && method =="ExtrinsicSuccess") {
extrinsic_success_event = true;
}
});
} else if (status.isFinalized) {
console.log('Finalized block hash', status.asFinalized.toHex());
unsubscribe();
if (extrinsic_success_event) {
resolve();
} else {
reject("ExtrinsicSuccess has not been seen");
}
} else if (status.isError) {
unsubscribe();
reject("Extrinsic status.isError");
}

});
});
// console.log('xxxxxxxxxxx 8');
} catch (error) {
assert.fail("Transfer promise failed, error: " + error);
}

assert.ok("test passed");
}

module.exports = { run }
Loading
Loading