Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 9a16cda

Browse files
michalkucharczykAnk4n
authored andcommitted
zombienet: warp-sync tests for validators (#13078)
* zombienet validators warp sync draft Sketch of warp-sync test for validators. Not tested. Follow-up of: #12769 * yet another warp-sync scenario added - all validators are synced from DB, - some full nodes are synced from DB, - full-node is warp-synced * fixes * fixes * missing files * path fixed --------- Co-authored-by: parity-processbot <>
1 parent e372e51 commit 9a16cda

9 files changed

Lines changed: 553 additions & 0 deletions

File tree

scripts/ci/gitlab/pipeline/zombienet.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,21 @@ zombienet-0001-basic-warp-sync:
5050
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
5151
--github-remote-dir="${GH_DIR}/0001-basic-warp-sync"
5252
--test="test-warp-sync.zndsl"
53+
54+
55+
zombienet-0002-validators-warp-sync:
56+
extends:
57+
- .zombienet-common
58+
script:
59+
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
60+
--github-remote-dir="${GH_DIR}/0002-validators-warp-sync"
61+
--test="test-validators-warp-sync.zndsl"
62+
63+
64+
zombienet-0003-block-building-warp-sync:
65+
extends:
66+
- .zombienet-common
67+
script:
68+
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
69+
--github-remote-dir="${GH_DIR}/0003-block-building-warp-sync"
70+
--test="test-block-building-warp-sync.zndsl"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Refer to ../0001-basic-warp-sync/README.md for more details. This test is nearly a clone. We want to warp-sync validators and make sure they can build blocks.
2+
0001-basic-warp-sync chainspec (copied) and database are reused in this test.
3+
4+

zombienet/0002-validators-warp-sync/chain-spec.json

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[settings]
2+
enable_tracing = false
3+
4+
[relaychain]
5+
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
6+
default_command = "substrate"
7+
8+
chain = "gen-db"
9+
chain_spec_path = "zombienet/0002-validators-warp-sync/chain-spec.json"
10+
11+
[[relaychain.nodes]]
12+
name = "alice"
13+
validator = true
14+
args = ["--sync warp"]
15+
16+
[[relaychain.nodes]]
17+
name = "bob"
18+
validator = true
19+
args = ["--sync warp"]
20+
21+
#we need at least 3 nodes for warp sync
22+
[[relaychain.nodes]]
23+
name = "charlie"
24+
validator = false
25+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
26+
27+
[[relaychain.nodes]]
28+
name = "dave"
29+
validator = false
30+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
31+
32+
[[relaychain.nodes]]
33+
name = "eve"
34+
validator = false
35+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Description: Warp sync
2+
Network: ./test-validators-warp-sync.toml
3+
Creds: config
4+
5+
alice: is up within 30 seconds
6+
bob: is up within 30 seconds
7+
charlie: is up within 30 seconds
8+
dave: is up within 30 seconds
9+
eve: is up within 30 seconds
10+
11+
alice: reports node_roles is 4
12+
bob: reports node_roles is 4
13+
charlie: reports node_roles is 1
14+
dave: reports node_roles is 1
15+
eve: reports node_roles is 1
16+
17+
alice: reports peers count is at least 4 within 60 seconds
18+
bob: reports peers count is at least 4 within 60 seconds
19+
charlie: reports peers count is at least 4 within 60 seconds
20+
dave: reports peers count is at least 4 within 60 seconds
21+
eve: reports peers count is at least 4 within 60 seconds
22+
23+
# db snapshot has 12133 blocks
24+
charlie: reports block height is at least 12133 within 60 seconds
25+
dave: reports block height is at least 12133 within 60 seconds
26+
eve: reports block height is at least 12133 within 60 seconds
27+
28+
alice: log line matches "Warp sync is complete" within 60 seconds
29+
bob: log line matches "Warp sync is complete" within 60 seconds
30+
31+
# workaround for: https://github.com/paritytech/zombienet/issues/580
32+
alice: count of log lines containing "Block history download is complete" is 1 within 60 seconds
33+
bob: count of log lines containing "Block history download is complete" is 1 within 60 seconds
34+
35+
alice: reports block height is at least 12133 within 10 seconds
36+
bob: reports block height is at least 12133 within 10 seconds
37+
38+
alice: count of log lines containing "error" is 0 within 10 seconds
39+
bob: count of log lines containing "verification failed" is 0 within 10 seconds
40+
41+
# new block were built
42+
alice: reports block height is at least 12136 within 90 seconds
43+
bob: reports block height is at least 12136 within 90 seconds
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Refer to ../0001-basic-warp-sync/README.md for more details. This test is nearly a clone. We want to warp-sync full nodes in the presence of validators.
2+
0001-basic-warp-sync chainspec (copied) and database are reused in this test.
3+
4+

zombienet/0003-block-building-warp-sync/chain-spec.json

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[settings]
2+
enable_tracing = false
3+
4+
[relaychain]
5+
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
6+
default_command = "substrate"
7+
8+
chain = "gen-db"
9+
chain_spec_path = "zombienet/0003-block-building-warp-sync/chain-spec.json"
10+
11+
#we need at least 3 nodes for warp sync
12+
[[relaychain.nodes]]
13+
name = "alice"
14+
validator = true
15+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
16+
17+
[[relaychain.nodes]]
18+
name = "bob"
19+
validator = true
20+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
21+
22+
[[relaychain.nodes]]
23+
name = "charlie"
24+
validator = false
25+
db_snapshot="https://storage.googleapis.com/zombienet-db-snaps/substrate/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz"
26+
27+
[[relaychain.nodes]]
28+
name = "dave"
29+
validator = false
30+
args = ["--sync warp"]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Description: Warp sync
2+
Network: ./test-block-building-warp-sync.toml
3+
Creds: config
4+
5+
alice: is up
6+
bob: is up
7+
charlie: is up
8+
dave: is up
9+
10+
alice: reports node_roles is 4
11+
bob: reports node_roles is 4
12+
charlie: reports node_roles is 1
13+
dave: reports node_roles is 1
14+
15+
alice: reports peers count is at least 3 within 60 seconds
16+
bob: reports peers count is at least 3 within 60 seconds
17+
charlie: reports peers count is at least 3 within 60 seconds
18+
dave: reports peers count is at least 3 within 60 seconds
19+
20+
21+
# db snapshot has 12133 blocks
22+
dave: reports block height is at least 1 within 60 seconds
23+
dave: reports block height is at least 12132 within 60 seconds
24+
dave: reports block height is at least 12133 within 60 seconds
25+
26+
alice: reports block height is at least 12133 within 60 seconds
27+
bob: reports block height is at least 12133 within 60 seconds
28+
charlie: reports block height is at least 12133 within 60 seconds
29+
30+
dave: log line matches "Warp sync is complete" within 60 seconds
31+
# workaround for: https://github.com/paritytech/zombienet/issues/580
32+
dave: count of log lines containing "Block history download is complete" is 1 within 10 seconds
33+
34+
dave: count of log lines containing "error" is 0 within 10 seconds
35+
dave: count of log lines containing "verification failed" is 0 within 10 seconds

0 commit comments

Comments
 (0)