mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 12:11:02 +00:00
Elastic scaling: add e2e test (#3929)
On top of https://github.com/paritytech/polkadot-sdk/pull/3879 I've also moved the previous test where we ensure multiple cores per para doesn't break non elastic parachains. --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
[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 %}
|
||||
|
||||
@@ -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
|
||||
some-parachain-1: count of log lines containing "BlockData { state: 24, add: 2 }" is 0 within 10 seconds
|
||||
|
||||
+3
-2
@@ -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.
|
||||
@@ -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
|
||||
|
||||
+6
-2
@@ -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
|
||||
@@ -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(
|
||||
Reference in New Issue
Block a user