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

Elastic scaling: add e2e test #3929

Merged
merged 27 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e3b5192
refactor: move claim queue fetch utils to utils crate
sandreim Mar 28, 2024
01ceb3b
cache all groups per para and remove para:group 1:1 assumption
sandreim Mar 28, 2024
5ed7841
Merge branch 'master' of github.com:paritytech/polkadot-sdk into sand…
sandreim Mar 28, 2024
5f0872f
typo
sandreim Mar 28, 2024
034b61a
fix test build
sandreim Mar 28, 2024
9c91193
testing some local test run weirdness
sandreim Mar 28, 2024
f87a624
fix doctest
sandreim Mar 28, 2024
70213c5
remove panic
sandreim Mar 28, 2024
4c66001
add new cluster test
sandreim Mar 29, 2024
21ae63d
add grid test
sandreim Mar 29, 2024
e923dac
Merge branch 'master' of github.com:paritytech/polkadot-sdk into sand…
sandreim Mar 29, 2024
27ee145
fmt
sandreim Mar 29, 2024
be1a2c7
explicit max_candidate_depth
sandreim Apr 1, 2024
b9f1afc
fix test comment
sandreim Apr 1, 2024
6340e32
Add elastic scaling zombienet test
sandreim Apr 1, 2024
8495e6f
js script
sandreim Apr 1, 2024
04dc5fd
move mvp test
sandreim Apr 1, 2024
bd431cb
fix cmd
sandreim Apr 1, 2024
1713be1
fix path
sandreim Apr 1, 2024
14fcb4b
rename mvp test
sandreim Apr 2, 2024
07b58a3
proper js args
sandreim Apr 2, 2024
2b2d2ab
non elast scaling para assert
sandreim Apr 2, 2024
332fda9
some tolerance
sandreim Apr 2, 2024
86c22a4
properly call assign-core.js
sandreim Apr 2, 2024
a32c2c7
Merge branch 'master' of github.com:paritytech/polkadot-sdk into sand…
sandreim Apr 3, 2024
7bde9d8
minor script change
sandreim Apr 3, 2024
a453123
Update polkadot/zombienet_tests/elastic_scaling/0001-basic-3cores-6s-…
pepoviola Apr 4, 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
14 changes: 11 additions & 3 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,21 @@ zombienet-polkadot-functional-0011-async-backing-6-seconds-rate:
--local-dir="${LOCAL_DIR}/functional"
--test="0011-async-backing-6-seconds-rate.zndsl"

zombienet-polkadot-functional-0012-elastic-scaling-mvp:
zombienet-polkadot-elastic-scaling-0001-basic-3cores-6s-blocks:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0012-elastic-scaling-mvp.zndsl"
--local-dir="${LOCAL_DIR}/elastic_scaling"
--test="0001-basic-3cores-6s-blocks.zndsl"

zombienet-polkadot-elastic-scaling-0002-elastic-scaling-doesnt-break-parachains:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/elastic_scaling"
--test="0002-elastic-scaling-doesnt-break-parachains.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[settings]
timeout = 1000

[relaychain.genesis.runtimeGenesis.patch.configuration.config.async_backing_params]
max_candidate_depth = 6
allowed_ancestry_len = 2

[relaychain.genesis.runtimeGenesis.patch.configuration.config.scheduler_params]
max_validators_per_core = 1
scheduling_lookahead = 2
num_cores = 3

[relaychain.genesis.runtimeGenesis.patch.configuration.config.approval_voting_params]
needed_approvals = 3
max_approval_coalesce_count = 5
sandreim marked this conversation as resolved.
Show resolved Hide resolved

[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
chain = "rococo-local"
default_command = "polkadot"

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

[[relaychain.node_groups]]
name = "elastic-validator"
count = 5
args = [ "-lparachain=debug,parachain::candidate-backing=trace,parachain::provisioner=trace,parachain::prospective-parachains=trace,runtime=debug"]

{% for id in range(2000,2002) %}
[[parachains]]
id = {{id}}
addToGenesis = true

[parachains.collator]
name = "some-parachain"
image = "{{COL_IMAGE}}"
command = "adder-collator"
args = ["-lparachain::collation-generation=trace,parachain::collator-protocol=trace,parachain=debug"]
{% endfor %}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Description: Test with adder collator using 3 cores and async backing
Network: ./0001-basic-3cores-6s-blocks.toml
Creds: config

# Check authority status.
elastic-validator-0: reports node_roles is 4
elastic-validator-1: reports node_roles is 4
elastic-validator-2: reports node_roles is 4
elastic-validator-3: reports node_roles is 4
elastic-validator-4: reports node_roles is 4


# Register 2 extra cores to this some-parachain.
elastic-validator-0: js-script ./assign-core.js with "2000,0" return is 0 within 600 seconds
elastic-validator-0: js-script ./assign-core.js with "2000,1" return is 0 within 600 seconds

# Wait for 10 relay chain blocks
elastic-validator-0: reports substrate_block_height{status="best"} is at least 20 within 120 seconds

# Parachain should progress with 3 blocks per relay chain block, so it's reasonable to expect state to be
# at least 50, assuming some tolerance
some-parachain: log line contains "BlockData { state: 50, add: 2 }" within 10 seconds
sandreim marked this conversation as resolved.
Show resolved Hide resolved
some-parachain-1: count of log lines containing "BlockData { state: 24, add: 2 }" is 0 within 10 seconds

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Description: Test that a paraid acquiring multiple cores does not brick itself if ElasticScalingMVP feature is enabled in genesis
Network: ./0012-elastic-scaling-mvp.toml
Network: ./0002-elastic-scaling-doesnt-break-parachains.toml
Creds: config

# Check authority status.
Expand All @@ -11,7 +11,8 @@ validator: reports substrate_block_height{status="finalized"} is at least 10 wit
validator: parachain 2000 block height is at least 10 within 200 seconds

# Register the second core assigned to this parachain.
alice: js-script ./0012-register-para.js return is 0 within 600 seconds
alice: js-script ./assign-core.js with "2000,0" return is 0 within 600 seconds
alice: js-script ./assign-core.js with "2000,1" return is 0 within 600 seconds

validator: reports substrate_block_height{status="finalized"} is at least 35 within 100 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
async function run(nodeName, networkInfo, _jsArgs) {
async function run(nodeName, networkInfo, args) {
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);

let para = Number(args[0]);
let core = Number(args[1]);
console.log(`Assigning para ${para} to core ${core}`);

await zombie.util.cryptoWaitReady();

// account to submit tx
Expand All @@ -10,7 +14,7 @@ async function run(nodeName, networkInfo, _jsArgs) {

await new Promise(async (resolve, reject) => {
const unsub = await api.tx.sudo
.sudo(api.tx.coretime.assignCore(0, 35, [[{ task: 2000 }, 57600]], null))
.sudo(api.tx.coretime.assignCore(core, 0, [[{ task: para }, 57600]], null))
.signAndSend(alice, ({ status, isError }) => {
if (status.isInBlock) {
console.log(
Expand Down
Loading