Skip to content

Commit 1547c30

Browse files
authored
Do not send both assign_cores calls in parallel (#10539)
The internal logic fetches the `nonce` of the sender and this will lead to both transaction using the same `nonce`. Ultimately this leads to the node rejecting one of the transactions because both transactions look like the same transaction to the node. Closes: #10536
1 parent 34034a9 commit 1547c30

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pub async fn assert_para_is_registered(
462462
/// To assign these extra `2` cores, the call would look like this:
463463
///
464464
/// ```ignore
465-
/// assign_core(&relay_client, PARA_ID, vec![0, 1])
465+
/// assign_cores(&relay_client, PARA_ID, vec![0, 1])
466466
/// ```
467467
///
468468
/// The cores `2` and `3` are assigned to the parachains by Zombienet.

polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,10 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> {
9292
let relay_client: OnlineClient<PolkadotConfig> = relay_node.wait_client().await?;
9393

9494
// Assign two extra cores to each parachain.
95-
let (r1, r2) = tokio::join!(
96-
assign_cores(&relay_client, 2100, vec![0, 1]),
97-
assign_cores(&relay_client, 2200, vec![2, 3])
98-
);
99-
r1?;
100-
r2?;
95+
// We need to execute both call one after another to ensure that the internal logic fetches the
96+
// correct nonce.
97+
assign_cores(&relay_client, 2100, vec![0, 1]).await?;
98+
assign_cores(&relay_client, 2200, vec![2, 3]).await?;
10199

102100
// Expect a backed candidate count of at least 39 for each parachain in 15 relay chain blocks
103101
// (2.6 candidates per para per relay chain block).

0 commit comments

Comments
 (0)