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: add heavy load tests based on zombienet #7257

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0283ab9
wip: impl parachain network with zn-sdk
iulianbarbu Jan 16, 2025
67c2ee9
wip adding more stuff to the nodes to catch all network
iulianbarbu Jan 17, 2025
7afefe1
made network primitives more flexible
iulianbarbu Jan 19, 2025
6d10819
added todos for what's wip
iulianbarbu Jan 19, 2025
0e084ab
added network base_dir & the rest of the testing networks
iulianbarbu Jan 20, 2025
daba086
renames and added builder support
iulianbarbu Jan 20, 2025
f73874a
added todos
iulianbarbu Jan 20, 2025
21fda5f
fixed derive_builder erros
iulianbarbu Jan 20, 2025
ef9b658
wip
iulianbarbu Jan 23, 2025
90ab08d
wip: load zn tomls with zn-sdk
iulianbarbu Jan 23, 2025
94b8891
wip: add genesis config patches and path to runtime in zn tomls
iulianbarbu Jan 23, 2025
136b95a
wip
iulianbarbu Jan 27, 2025
5556573
merge with latest master
iulianbarbu Jan 27, 2025
13cffe6
wip testing zn patch from toml
iulianbarbu Jan 28, 2025
8ec35b9
Apply suggestions from code review
pepoviola Jan 29, 2025
0b81d99
Update Cargo.toml
pepoviola Jan 29, 2025
5f82daf
Update network-specs and zn-sdk/zn-config
iulianbarbu Jan 30, 2025
e90b9d6
resolve conflicts
iulianbarbu Jan 30, 2025
11fee80
remove unecessary deps
iulianbarbu Jan 30, 2025
fbc25ff
make tomls compatible with zn/cli
iulianbarbu Jan 31, 2025
b912e05
Merge branch 'master' into ib-zn-test-fatp
iulianbarbu Feb 4, 2025
bf02c0b
fix zn toml
iulianbarbu Feb 4, 2025
c30f602
added test - it fails though
iulianbarbu Feb 4, 2025
f275ba3
fix nonce incrementing
iulianbarbu Feb 4, 2025
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
127 changes: 114 additions & 13 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,8 @@ xcm-procedural = { path = "polkadot/xcm/procedural", default-features = false }
xcm-runtime-apis = { path = "polkadot/xcm/xcm-runtime-apis", default-features = false }
xcm-simulator = { path = "polkadot/xcm/xcm-simulator", default-features = false }
zeroize = { version = "1.7.0", default-features = false }
zombienet-sdk = { version = "0.2.20" }
zombienet-configuration = { version = "0.2.22" }
zombienet-sdk = { version = "0.2.22" }
zstd = { version = "0.12.4", default-features = false }

[profile.release]
Expand Down
13 changes: 13 additions & 0 deletions substrate/client/transaction-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,27 @@ tokio-stream = { workspace = true }
tracing = { workspace = true, default-features = true }

[dev-dependencies]
anyhow = { workspace = true }
array-bytes = { workspace = true, default-features = true }
assert_matches = { workspace = true }
async-trait = { workspace = true }
chrono = { workspace = true }
cmd_lib = { workspace = true }
criterion = { workspace = true, default-features = true }
cumulus-client-cli = { workspace = true, default-features = true }
env_logger = { workspace = true }
log = { workspace = true }
polkadot-cli = { workspace = true, default-features = true }
sc-block-builder = { workspace = true, default-features = true }
sp-consensus = { workspace = true, default-features = true }
strum = { workspace = true, features = ["derive"] }
substrate-test-runtime = { workspace = true }
substrate-test-runtime-client = { workspace = true }
substrate-test-runtime-transaction-pool = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
zombienet-configuration = { workspace = true }
zombienet-sdk = { workspace = true }

[[bench]]
name = "basics"
Expand Down
55 changes: 55 additions & 0 deletions substrate/client/transaction-pool/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

// Testsuite of fatp integration tests.

pub mod zombienet;

use std::time::Duration;

use tokio::join;
use zombienet::NetworkSpawner;
use zombienet_sdk::subxt::OnlineClient;

#[tokio::test(flavor = "multi_thread")]
async fn send_future_and_then_ready_from_single_account() {
let _ = env_logger::try_init_from_env(
env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info"),
);
let net = NetworkSpawner::init_from_asset_hub_fatp_low_pool_limit_spec().await.unwrap();
pepoviola marked this conversation as resolved.
Show resolved Hide resolved
let collator = net.get_node("charlie").unwrap();
let _client: OnlineClient<zombienet_sdk::subxt::SubstrateConfig> =
collator.wait_client_with_timeout(120u64).await.unwrap();
let ws = "ws://127.0.0.1:9933";
let mut nonce = 0;
for _ in 0..3 {
// Spawn future TXs.
let future_start = nonce + 5;
let handle1 = tokio::spawn(async move {
cmd_lib::run_cmd!(RUST_LOG=info ttxt tx --chain=sub --ws=$ws from-single-account --account 0 --count 5 --from $future_start)
});
tokio::time::sleep(Duration::from_secs(5)).await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it is kinda temporary - ideally if we could avoid timeouts. They cause a lot of troubles in CI.

I see two options:

  • we could ask nodes if they have enough txs in the pool - unluckily we don't have API for this. See discussion around: fatxpool: add pending_extrinsics_len RPC call #7138
  • but we could also add some status getter to ttxt API and check if txs were sent (or validated). (could be sth like get_validate_count). This seems to be a mid-term way to go.

let handle2 = tokio::spawn(async move {
cmd_lib::run_cmd!(RUST_LOG=info ttxt tx --chain=sub --ws=$ws from-single-account --account 0 --count 5 --from $nonce)
});
nonce = future_start + 5;
let (res1, res2) = join!(handle1, handle2);
assert!(res1.is_ok());
assert!(res2.is_ok());
}
}
Loading
Loading