Skip to content

Commit 86a2f2b

Browse files
committed
Merge remote-tracking branch 'origin/main' into A0-1350
2 parents 82ac847 + 4a817b9 commit 86a2f2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3069
-11191
lines changed

.github/actions/run-e2e-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ runs:
4343
- name: Run consensus party
4444
shell: bash
4545
run: ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }}
46-
46+
4747
- name: Sleep
4848
shell: bash
4949
run: sleep 60
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

3-
RPC_HOST=127.0.0.1
4-
RPC_PORT=9933
3+
RPC_HOST=${RPC_HOST:-127.0.0.1}
4+
RPC_PORT=${RPC_PORT:-9933}
55
LAST_FINALIZED=""
6-
VALIDATOR=damian
6+
VALIDATOR=${VALIDATOR:-damian}
77

88
while [[ "$LAST_FINALIZED" =~ "0x0" ]] || [[ -z "$LAST_FINALIZED" ]]; do
9-
block_hash=$(docker run --network container:$VALIDATOR appropriate/curl:latest \
9+
block_hash=$(docker run --rm --network container:$VALIDATOR appropriate/curl:latest \
1010
-H "Content-Type: application/json" \
1111
-d '{"id":1, "jsonrpc":"2.0", "method": "chain_getFinalizedHead"}' http://$RPC_HOST:$RPC_PORT | jq '.result')
1212
ret_val=$?
@@ -15,7 +15,7 @@ while [[ "$LAST_FINALIZED" =~ "0x0" ]] || [[ -z "$LAST_FINALIZED" ]]; do
1515
continue
1616
fi
1717

18-
finalized_block=$(docker run --network container:$VALIDATOR appropriate/curl:latest \
18+
finalized_block=$(docker run --rm --network container:$VALIDATOR appropriate/curl:latest \
1919
-H "Content-Type: application/json" \
2020
-d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlock", "params": ['$block_hash']}' http://$RPC_HOST:$RPC_PORT | jq '.result.block.header.number')
2121

@@ -25,9 +25,9 @@ while [[ "$LAST_FINALIZED" =~ "0x0" ]] || [[ -z "$LAST_FINALIZED" ]]; do
2525
continue
2626
else
2727
LAST_FINALIZED=$finalized_block
28-
echo "Last finalized block number: $LAST_FINALIZED"
2928
fi
3029

3130
done
3231

32+
echo "Last finalized block number: $LAST_FINALIZED"
3333
exit $?
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
Node0:
3+
environment:
4+
- ONLY_LEGACY_PROTOCOL=true
5+
6+
Node1:
7+
environment:
8+
- ONLY_LEGACY_PROTOCOL=true

.github/scripts/run_consensus.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -euo pipefail
66
# change when increasing the number of node containers
77
NODE_COUNT=5
88
MIN_VALIDATOR_COUNT=4
9+
DOCKER_COMPOSE=${DOCKER_COMPOSE:-"docker/docker-compose.yml"}
10+
OVERRIDE_DOCKER_COMPOSE=${OVERRIDE_DOCKER_COMPOSE:-""}
911

1012
# default minimum validator count
1113
MIN_VALIDATOR_COUNT=4
@@ -82,14 +84,20 @@ function generate_bootnode_peer_id {
8284

8385
function run_containers {
8486
local authorities_count="$1"
87+
local docker_compose_file="$2"
88+
local override_file="$3"
8589

8690
echo "Running ${authorities_count} containers..."
87-
docker-compose -f docker/docker-compose.yml up -d
91+
if [[ -z ${override_file} ]]; then
92+
docker-compose -f "${docker_compose_file}" up -d
93+
else
94+
docker-compose -f "${docker_compose_file}" -f "${override_file}" up -d
95+
fi
8896
}
8997

9098
authorities=$(generate_authorities ${NODE_COUNT})
9199
generate_chainspec "${authorities[@]}" "${MIN_VALIDATOR_COUNT}"
92100
generate_bootnode_peer_id ${authorities[0]}
93-
run_containers ${NODE_COUNT}
101+
run_containers ${NODE_COUNT} "${DOCKER_COMPOSE}" "${OVERRIDE_DOCKER_COMPOSE}"
94102

95103
exit $?

.github/scripts/run_e2e_test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ fi
101101

102102
if [[ -n "${UPGRADE_VERSION:-}" && -n "${UPGRADE_SESSION:-}" && -n "${UPGRADE_FINALIZATION_WAIT_SESSIONS:-}" ]]; then
103103
ARGS+=(
104-
-e "${UPGRADE_VERSION}"
105-
-e "${UPGRADE_SESSION}"
106-
-e "${UPGRADE_FINALIZATION_WAIT_SESSIONS}"
104+
-e UPGRADE_VERSION
105+
-e UPGRADE_SESSION
106+
-e UPGRADE_FINALIZATION_WAIT_SESSIONS
107107
)
108108
fi
109109

110+
if [[ -n "${ONLY_LEGACY:-}" ]]; then
111+
ARGS+=(-e ONLY_LEGACY)
112+
fi
113+
110114
docker run -v $(pwd)/docker/data:/data "${ARGS[@]}" aleph-e2e-client:latest
111115

112116
exit $?

.github/workflows/build-node-and-runtime.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
retention-days: 7
5858

5959
- name: Build test binary
60-
run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals"
60+
run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals only_legacy"
6161

6262
- name: Upload test binary
6363
uses: actions/upload-artifact@v2

.github/workflows/deploy-testnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
DOCKERHUB_TESTNET_IMAGE: cardinalcryptography/aleph-zero:testnet-${{ steps.vars.outputs.branch }}
7373
DOCKERHUB_TESTNET_LATEST_IMAGE: cardinalcryptography/aleph-zero:testnet-latest
7474
run: |
75-
echo "FROM ${{ env.DOCKERHUB_TESTNET_IMAGE }}" > Dockerfile.dockerhub
75+
echo "FROM ${{ env.TESTNET_IMAGE }}" > Dockerfile.dockerhub
7676
echo 'ENTRYPOINT ["/usr/local/bin/aleph-node"]' >> Dockerfile.dockerhub
7777
docker build -t ${{ env.DOCKERHUB_TESTNET_IMAGE }} -f Dockerfile.dockerhub .
7878
docker tag ${{ env.DOCKERHUB_TESTNET_IMAGE }} ${{ env.DOCKERHUB_TESTNET_LATEST_IMAGE }}

.github/workflows/e2e-tests-main-devnet.yml

Lines changed: 158 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,45 @@ jobs:
5454
retention-days: 7
5555

5656

57+
build-cliain-image:
58+
name: Build docker image for cliain
59+
runs-on: ubuntu-20.04
60+
steps:
61+
- name: GIT | Checkout source code
62+
uses: actions/checkout@v2
63+
64+
- name: Install Rust toolchain
65+
uses: actions-rs/toolchain@v1
66+
67+
- name: Restore cache
68+
uses: ./.github/actions/restore-cache
69+
with:
70+
target-key: cliain
71+
cache-version: v2
72+
cargo-targets: bin/cliain/target/
73+
74+
- name: Cargo | Build release binary
75+
run: |
76+
cd bin/cliain && cargo build --release
77+
78+
- name: Build docker image
79+
run: |
80+
cd bin/cliain
81+
docker build --tag cliain:latest -f ./Dockerfile .
82+
docker save -o cliain.tar cliain:latest
83+
84+
- name: Upload test docker image
85+
uses: actions/upload-artifact@v2
86+
with:
87+
name: cliain-docker
88+
path: ./bin/cliain/cliain.tar
89+
if-no-files-found: error
90+
retention-days: 7
91+
92+
- name: Cleanup cache
93+
uses: ./.github/actions/post-cache
94+
95+
5796
check-determinism:
5897
needs: [build-new-node]
5998
name: Verify runtime build determinism
@@ -279,6 +318,7 @@ jobs:
279318
test-case: fee_calculation
280319
timeout-minutes: 2
281320

321+
282322
run-e2e-validators-rotate:
283323
needs: [build-test-docker, build-test-client]
284324
name: Run validators rotation test
@@ -417,6 +457,21 @@ jobs:
417457
follow-up-finalization-check: true
418458
timeout-minutes: 15
419459

460+
run-e2e-ban-manual:
461+
needs: [build-test-docker, build-test-client]
462+
name: Run ban manual test
463+
runs-on: ubuntu-20.04
464+
steps:
465+
- name: Checkout source code
466+
uses: actions/checkout@v2
467+
468+
- name: Run e2e test
469+
uses: ./.github/actions/run-e2e-test
470+
with:
471+
test-case: ban_manual
472+
follow-up-finalization-check: true
473+
timeout-minutes: 15
474+
420475
run-e2e-ban-counter-clearing:
421476
needs: [build-test-docker, build-test-client]
422477
name: Run ban counter clearing test
@@ -432,6 +487,21 @@ jobs:
432487
follow-up-finalization-check: true
433488
timeout-minutes: 15
434489

490+
run-e2e-ban-threshold:
491+
needs: [build-test-docker, build-test-client]
492+
name: Run ban threshold test
493+
runs-on: ubuntu-20.04
494+
steps:
495+
- name: Checkout source code
496+
uses: actions/checkout@v2
497+
498+
- name: Run e2e test
499+
uses: ./.github/actions/run-e2e-test
500+
with:
501+
test-case: ban_threshold
502+
follow-up-finalization-check: true
503+
timeout-minutes: 15
504+
435505
run-e2e-version-upgrade:
436506
needs: [build-test-docker, build-test-client]
437507
name: Run basic (positive) version-upgrade test
@@ -445,11 +515,91 @@ jobs:
445515
with:
446516
test-case: version_upgrade
447517
env:
448-
UPGRADE_VERSION: 1,
449-
UPGRADE_SESSION: 3,
450-
UPGRADE_FINALIZATION_WAIT_SESSIONS: 2,
518+
UPGRADE_VERSION: 1
519+
UPGRADE_SESSION: 3
520+
UPGRADE_FINALIZATION_WAIT_SESSIONS: 2
521+
timeout-minutes: 10
522+
523+
run-e2e-failing-version-upgrade:
524+
needs: [build-test-docker, build-test-client]
525+
name: Run basic (failing) version-upgrade test
526+
runs-on: ubuntu-20.04
527+
steps:
528+
- name: Checkout source code
529+
uses: actions/checkout@v2
530+
531+
- name: Run e2e test
532+
uses: ./.github/actions/run-e2e-test
533+
with:
534+
test-case: doomed_version_upgrade
535+
env:
536+
OVERRIDE_DOCKER_COMPOSE: ./.github/scripts/docker-compose.no_quorum_without_old.override.yml
537+
UPGRADE_VERSION: 1
538+
UPGRADE_SESSION: 3
539+
UPGRADE_FINALIZATION_WAIT_SESSIONS: 2
540+
ONLY_LEGACY: true
451541
timeout-minutes: 10
452542

543+
run-e2e-version-upgrade-catchup:
544+
needs: [build-test-docker, build-cliain-image]
545+
name: Run series of tests where some of the nodes need to do version-upgrade during catch-up
546+
runs-on: ubuntu-20.04
547+
strategy:
548+
matrix:
549+
include:
550+
- nodes: "Node1"
551+
ports: "9934"
552+
ext_status: "finalized"
553+
upgrade_before_disable: "true"
554+
555+
- nodes: "Node1"
556+
ports: "9934"
557+
ext_status: "finalized"
558+
upgrade_before_disable: "false"
559+
560+
- nodes: "Node1:Node2"
561+
ports: "9934:9935"
562+
ext_status: "in-block"
563+
upgrade_before_disable: "true"
564+
565+
- nodes: "Node1:Node2"
566+
ports: "9934:9935"
567+
ext_status: "in-block"
568+
upgrade_before_disable: "false"
569+
steps:
570+
- name: Checkout source code
571+
uses: actions/checkout@v2
572+
573+
- name: Download artifact with docker image for aleph-node
574+
uses: actions/download-artifact@v2
575+
with:
576+
name: aleph-test-docker
577+
578+
- name: Load node docker image
579+
shell: bash
580+
run: docker load -i aleph-node.tar
581+
582+
- name: Download artifact with docker image for cliain
583+
uses: actions/download-artifact@v2
584+
with:
585+
name: cliain-docker
586+
587+
- name: Load cliain docker image
588+
shell: bash
589+
run: docker load -i cliain.tar
590+
591+
- name: Call catchup_test.sh
592+
env:
593+
UPGRADE_BLOCK: 31
594+
NODES: ${{ matrix.nodes }}
595+
PORTS: ${{ matrix.ports }}
596+
EXT_STATUS: ${{ matrix.ext_status }}
597+
UPGRADE_BEFORE_DISABLE: ${{ matrix.upgrade_before_disable }}
598+
DOCKER_COMPOSE: docker/docker-compose.bridged.yml
599+
600+
run: |
601+
./scripts/catchup_version_upgrade_test.sh
602+
453603
check-e2e-test-suite-completion:
454604
needs: [
455605
run-e2e-finalization-test,
@@ -470,9 +620,13 @@ jobs:
470620
run-e2e-rewards-change-stake-force-new-era,
471621
run-e2e-rewards-points-basic,
472622
run-e2e-authorities-are-staking,
623+
run-e2e-ban-automatic,
624+
run-e2e-ban-manual,
473625
run-e2e-ban-counter-clearing,
626+
run-e2e-ban-threshold,
474627
run-e2e-version-upgrade,
475-
run-e2e-ban-automatic,
628+
run-e2e-failing-version-upgrade,
629+
run-e2e-version-upgrade-catchup,
476630
]
477631
name: Check e2e test suite completion
478632
runs-on: ubuntu-20.04

0 commit comments

Comments
 (0)