Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
1ea0bcf
test/malus: craft the first maliciously disputing actor
drahnr Aug 12, 2021
64b5769
initial draft
drahnr Aug 13, 2021
54bfb57
Add Dockerfile and instructions how to use it to build malus image lo…
radupopa2010 Aug 16, 2021
6493fb6
Forgot one flag for the build cmd
radupopa2010 Aug 16, 2021
84bdc32
we are not docker specific, we are happy to use any containerruntime
drahnr Aug 16, 2021
49f6b83
shuffle things around
drahnr Aug 16, 2021
f03474e
add initial tera based integration test
drahnr Aug 16, 2021
8f7390a
chores
drahnr Aug 16, 2021
765c466
fixins
drahnr Aug 17, 2021
5f4c020
simple setup to start
drahnr Aug 17, 2021
433ac96
other samples (WIP)
drahnr Aug 17, 2021
47a2ecc
add Docker version with cargo-chef
radupopa2010 Aug 17, 2021
5882374
update substarte and small change of orders in commands in the contai…
radupopa2010 Aug 18, 2021
fc4dc08
metrics one
drahnr Aug 17, 2021
3cee6a0
fmt
drahnr Aug 17, 2021
1165add
minor
drahnr Aug 18, 2021
ed9d983
fixin
drahnr Aug 18, 2021
22ba0a3
fix metric names
drahnr Aug 18, 2021
5286ebd
-d
drahnr Aug 18, 2021
3830275
add open gauge
drahnr Aug 18, 2021
dc37848
fmt
drahnr Aug 18, 2021
d3e370c
spellcheck
drahnr Aug 18, 2021
99fb7f9
fix test
drahnr Aug 18, 2021
d889a9a
adjust to changed error messages
drahnr Aug 18, 2021
7a5f424
refactor, more malus impls
drahnr Aug 19, 2021
71a5006
more malus changes
drahnr Aug 19, 2021
e0835bb
foo
drahnr Aug 19, 2021
f1d67eb
minor cleanup
drahnr Aug 19, 2021
de2c4e6
suggest garbage candidate
drahnr Aug 19, 2021
b06b8e9
chore
drahnr Aug 19, 2021
a61fad8
fix suggest garabge malus
drahnr Aug 19, 2021
0ac0a75
malus: back garbage candidate
drahnr Aug 20, 2021
a94cd01
Merge remote-tracking branch 'origin/master' into bernhard-malus-fx
drahnr Aug 20, 2021
246cfa4
cargo lock
drahnr Aug 20, 2021
45b4418
re-introduce metrics
drahnr Aug 20, 2021
5227e3a
chore: cargo fmt
drahnr Aug 20, 2021
bb7f696
undoe 1.54.0 output, CI uses 1.53.0 rustc
drahnr Aug 21, 2021
edb2144
Merge remote-tracking branch 'origin/master' into bernhard-malus-fx
drahnr Aug 21, 2021
7e171f4
update location of js types
radupopa2010 Aug 22, 2021
70338d7
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Aug 22, 2021
2b71ebe
Fix trybuild
bkchr Aug 23, 2021
8e21ba2
add tag to image name also; this will be replaced in the prod version
radupopa2010 Aug 24, 2021
de58741
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Aug 24, 2021
9b499f2
Tests fixed
grbIzl Aug 24, 2021
5ce4261
Merge branch 'master' into bernhard-malus-fx
ordian Aug 24, 2021
f371b1d
add some fix me
radupopa2010 Aug 24, 2021
43a288c
add dockerfile for ci
radupopa2010 Aug 24, 2021
c826f29
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Aug 24, 2021
55d7aae
Add docker file for malus for ci
radupopa2010 Aug 24, 2021
5738e1d
use variables in .toml file
radupopa2010 Aug 25, 2021
a68906d
add chnages for malus test
radupopa2010 Aug 25, 2021
987e4e9
some fixes
ordian Aug 25, 2021
4b98f7e
some more fixes
ordian Aug 25, 2021
26a808f
Update .gitlab-ci.yml
ordian Aug 25, 2021
2926a80
add local build for polkadot and malus
radupopa2010 Aug 26, 2021
77574c8
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Aug 26, 2021
497cf40
Merge branch 'master' into bernhard-malus-fx
ordian Aug 27, 2021
4818242
some fixes
ordian Aug 27, 2021
d854fa8
enable disputes feature in CI
ordian Aug 27, 2021
67ddae5
ok, ok
ordian Aug 27, 2021
7449c86
Merge branch 'master' into bernhard-malus-fx
ordian Aug 27, 2021
eb2171a
rename: MsgFilter -> MessageInterceptor
drahnr Aug 30, 2021
08f97bd
remove TODO that would not have worked
drahnr Aug 30, 2021
22b5558
intercept
drahnr Aug 30, 2021
4ff6d8f
refactor
drahnr Aug 30, 2021
8994728
fix README and containers
drahnr Aug 30, 2021
e410fbb
fix
drahnr Aug 30, 2021
d4a3a49
chore: cargo fmt
drahnr Aug 30, 2021
93878de
avoid some more malus-$VARIANT references
drahnr Aug 31, 2021
38ef732
fix argument order
drahnr Aug 31, 2021
a11fe9c
chore: add about
drahnr Aug 31, 2021
970647f
Update sanity check in relay chain selection
Lldenaurois Aug 31, 2021
139ecf9
fix order, add dispute-unavailable-block malus
drahnr Aug 31, 2021
336cbe2
fixup: avoid underflow issue
drahnr Aug 31, 2021
6b3ae25
it's all u32
drahnr Aug 31, 2021
8d4a792
fix conditional use
drahnr Aug 31, 2021
ebdbafa
Revert "it's all u32"
drahnr Aug 31, 2021
4a93c46
Revert "fixup: avoid underflow issue"
drahnr Aug 31, 2021
faa96ff
Revert "Update sanity check in relay chain selection"
drahnr Aug 31, 2021
4bcd239
update the malus bin
radupopa2010 Aug 31, 2021
adbbd66
Update node/malus/integrationtests/0003-dispute-unavailable-block.fea…
drahnr Sep 1, 2021
8f0f646
add some FIXME reminders
radupopa2010 Sep 1, 2021
01b3f47
update path to index.js
radupopa2010 Sep 1, 2021
6d30765
Update .gitlab-ci.yml
ordian Sep 1, 2021
09c4136
Update node/malus/integrationtests/0001-dispute-valid-block.toml
ordian Sep 1, 2021
27665ac
try 1: make malus test run
radupopa2010 Sep 1, 2021
508fe73
merge recent changes
radupopa2010 Sep 1, 2021
ed8d1c2
chore: cargo fmt
drahnr Sep 2, 2021
6e96143
temporary fix
ordian Sep 2, 2021
20bff53
use subcommand syntax from latest gurke
ordian Sep 2, 2021
c3a8205
cargo +nightly fmt
ordian Sep 2, 2021
7edc660
Merge branch 'master' into bernhard-malus-fx
ordian Sep 2, 2021
6f7666c
add collator to a a test
ordian Sep 3, 2021
7a352be
docs: add env vars to README
drahnr Sep 6, 2021
6723967
update ci to run dispute-valid-block test
radupopa2010 Sep 6, 2021
d87f0e7
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Sep 6, 2021
f01c3c1
needs the polkadot image
radupopa2010 Sep 6, 2021
ee0d312
Fix path for nodejs container
grbIzl Sep 6, 2021
720c91a
Merge branch 'master' into bernhard-malus-fx
ordian Sep 6, 2021
68ea3a5
post merge fix
ordian Sep 6, 2021
186bff4
download proper dir containg configs for malus test
radupopa2010 Sep 6, 2021
4081d02
Merge branch 'bernhard-malus-fx' of github.com:paritytech/polkadot in…
radupopa2010 Sep 6, 2021
87c48f3
update the malus ci job
radupopa2010 Sep 9, 2021
45cb0e1
merge master, keep my chnages
radupopa2010 Sep 9, 2021
1f6ae66
rm a whitespace
radupopa2010 Sep 9, 2021
1d155fe
temp build for malus
radupopa2010 Sep 14, 2021
72c1426
use correct build command for temp malus
radupopa2010 Sep 14, 2021
5d8292b
remove subcommands for now
ordian Sep 14, 2021
99cb6e0
Merge branch 'master' into bernhard-malus-fx
ordian Sep 14, 2021
76a0837
set max validators per core in the default HostConfig
ordian Sep 14, 2021
0d162b6
tabs
ordian Sep 14, 2021
93c6d06
Merge branch 'master' into bernhard-malus-fx
ordian Sep 17, 2021
f0f9551
Merge branch 'master' into bernhard-malus-fx
ordian Sep 17, 2021
a5f8b8b
update beefy
ordian Sep 17, 2021
f8de68a
fixup
ordian Sep 17, 2021
cd65b53
fixup II
ordian Sep 17, 2021
5827196
Merge branch 'master' into bernhard-malus-fx
ordian Sep 20, 2021
e0f8223
Merge branch 'master' into bernhard-malus-fx
ordian Oct 3, 2021
718301f
make one variant compile
ordian Oct 3, 2021
1b9ad32
make other variants compile
ordian Oct 3, 2021
2823592
revert changes to chain_spec
ordian Oct 3, 2021
f2e6e03
fmt
ordian Oct 3, 2021
e91d5a1
build malus image from polkadot-test-malus again
ordian Oct 3, 2021
e1bfca4
revert unrelated changes
ordian Oct 3, 2021
7bf62a9
try fixing build-malus job
ordian Oct 3, 2021
e04bcc9
Merge branch 'master' into bernhard-malus-fx
ordian Oct 3, 2021
9c3bf47
Revert "remove subcommands for now"
ordian Oct 3, 2021
a1b345c
try fixing build-malus job II
ordian Oct 3, 2021
d5cd103
Merge branch 'master' into bernhard-malus-fx
ordian Oct 3, 2021
bbbaa66
MVP working dispute-ancestor
ordian Oct 4, 2021
d356678
renames
ordian Oct 4, 2021
98389e4
Merge branch 'master' into bernhard-malus-fx
ordian Oct 4, 2021
e4bbd30
Merge branch 'master' into bernhard-malus-fx
ordian Oct 4, 2021
d0a17b2
fix PVF execution on malus
ordian Oct 4, 2021
e86c1ba
fix test
ordian Oct 4, 2021
e4a05e0
fix typo
ordian Oct 4, 2021
6c52998
fmt
ordian Oct 4, 2021
aa6695f
checkmate
ordian Oct 4, 2021
52b8864
try something
ordian Oct 4, 2021
fca9deb
make it actually work
ordian Oct 4, 2021
7e8626e
some tweaks to 01 feature test
ordian Oct 4, 2021
c504eb7
fmt
ordian Oct 4, 2021
8bef2c2
sleep a bit more
ordian Oct 4, 2021
517859b
complete wococoization
ordian Oct 5, 2021
2ff7637
some tweaks to 01 feature test
ordian Oct 5, 2021
42474af
typo fix
ordian Oct 5, 2021
b4e639e
use correct metric names
ordian Oct 5, 2021
8e345e9
fix
ordian Oct 5, 2021
6002ba1
ffs
ordian Oct 5, 2021
7aabc4f
.
ordian Oct 5, 2021
45dbef6
try some rearrangement
ordian Oct 5, 2021
efb7cd3
Attempt to wait till initial node bootstrap in test
grbIzl Oct 5, 2021
3bf9f49
Fix test syntax
grbIzl Oct 5, 2021
6cee882
Run malus tests with v2 script
grbIzl Oct 14, 2021
b3ef403
Merge branch 'master' into bernhard-malus-fx
ordian Oct 14, 2021
c46e26a
Proper symlink created
grbIzl Oct 14, 2021
06ac937
simnet v14
radupopa2010 Oct 15, 2021
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
128 changes: 114 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ variables:
CI_SERVER_NAME: "GitLab CI"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
SIMNET_IMAGE: "europe-west3-docker.pkg.dev/parity-simnet/simnet-images/simnet:v14"
VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io"
VAULT_AUTH_PATH: "gitlab-parity-io-jwt"
VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}"
Expand Down Expand Up @@ -198,7 +199,8 @@ test-build-linux-stable:
script:
- ./scripts/gitlab/test_linux_stable.sh
# we're using the bin built here, instead of having a parallel `build-linux-release`
- time cargo build --release --verbose --bin polkadot
# disputes feature is needed for simnet parachains malus test
- time cargo build --release --verbose --bin polkadot --features disputes
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
Expand Down Expand Up @@ -269,6 +271,26 @@ build-adder-collator:
- echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r scripts/* ./artifacts

build-malus:
stage: test
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
- time cargo build --release --verbose -p polkadot-test-malus --features disputes
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/release/malus ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r scripts/* ./artifacts

#### stage: build

.check-dependent-project: &check-dependent-project
Expand Down Expand Up @@ -439,6 +461,32 @@ publish-adder-collator-image:
# this artifact is used in simnet-tests job
dotenv: ./artifacts/collator.env

publish-malus-image:
# service image for Simnet
stage: build
<<: *build-push-image
variables:
<<: *image-variables
# scripts/dockerfiles/malus.Dockerfile
DOCKERFILE: dockerfiles/malus.Dockerfile
IMAGE_NAME: docker.io/paritypr/malus
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
needs:
- job: build-malus
artifacts: true
after_script:
- buildah logout "$IMAGE_NAME"
# pass artifacts to the simnet-tests job
- echo "MALUS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/malus.env
- echo "MALUS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/malus.env
artifacts:
reports:
# this artifact is used in simnet-tests job
dotenv: ./artifacts/malus.env

.update_weights: &update-weights
stage: build
when: manual
Expand Down Expand Up @@ -566,9 +614,8 @@ deploy-polkasync-kusama:
allow_failure: true
trigger: "parity/infrastructure/parity-testnet"

simnet-tests:
simnet-tests-parachains-smoketest:
stage: deploy
image: "docker.io/paritytech/simnet:${SIMNET_REF}"
<<: *kubernetes-env
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
Expand All @@ -578,25 +625,78 @@ simnet-tests:
needs:
- job: publish-polkadot-image
- job: publish-adder-collator-image

image: "${SIMNET_IMAGE}"
variables:
GH_DIR: 'https://github.com/paritytech/polkadot/tree/bernhard-malus-fx/simnet_tests'
# FIXME: use the master after the merge of the malus pr
# GH_DIR: 'https://github.com/paritytech/polkadot/tree/master/simnet_tests'
NETWORK_CONFIG: 'simnet_tests/configs/simple_rococo_testnet.toml'
# `parachains.env` brings here `$PARACHAINS_IMAGE_NAME` and `$PARACHAINS_IMAGE_TAG`
# (`$EXTRATAG` here, # i.e. `2643-0.8.29-5f689e0a-6b24dc54`).
# `collator.env` brings here `$COLLATOR_IMAGE_NAME` and `$COLLATOR_IMAGE_TAG`
# For local tests with docker `$PARACHAINS_IMAGE_TAG` and `$COLLATOR_IMAGE_TAG`
# can be replaced with `master` tag.

# SIMNET_REF is a gitlab variable
before_script:
- echo "Simnet Tests Config
${SIMNET_IMAGE_NAME} ${SIMNET_REF}
${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}
${COLLATOR_IMAGE_NAME} ${COLLATOR_IMAGE_TAG}"
- echo "Simnet Tests Config"
- echo "${SIMNET_IMAGE_NAME}"
- echo "${SIMNET_IMAGE_TAG}"
- echo "${PARACHAINS_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- echo "${NETWORK_CONFIG}"
script:
- /home/nonroot/simnet/gurke/scripts/run-test-environment-manager.sh
--github-remote-dir="https://github.com/paritytech/polkadot/tree/master/simnet_tests"
--config="simnet_tests/configs/simple_rococo_testnet.toml"
- /home/nonroot/simnet/scripts/run-test-environment-manager.sh
--github-remote-dir="${GH_DIR}"
--config="${NETWORK_CONFIG}"
--image="${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
--image-2="${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}"
--image-simnet="docker.io/paritytech/simnet:${SIMNET_REF}"
-e "SYNTHIMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
-e "COLIMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}"
-e "SCRIPTSIMAGE=${SIMNET_IMAGE_NAME}:${SIMNET_IMAGE_TAG}"
allow_failure: true
retry: 2
tags:
- parity-simnet

simnet-tests-malus-dispute-valid:
stage: deploy
image: "${SIMNET_IMAGE}"
<<: *kubernetes-env
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
needs:
- job: publish-polkadot-image
- job: publish-malus-image
- job: publish-adder-collator-image

variables:
GH_DIR: 'https://github.com/paritytech/polkadot/tree/bernhard-malus-fx/simnet_tests'
# FIXME: use the master after the merge of the malus pr
# GH_DIR: 'https://github.com/paritytech/polkadot/tree/master/simnet_tests'
# FIXME: copy config of tests in simnet_test and use proper values
# `malus.env` brings here `$MALUS_IMAGE_NAME` and `$MALUS_IMAGE_TAG`
# (`$EXTRATAG` here, # i.e. `2643-0.8.29-5f689e0a-6b24dc54`).
# For local tests with docker `$MALUS_IMAGE_TAG` can be replaced with `master` tag.

before_script:
- echo "Simnet Tests Config"
- echo "${SIMNET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}"
- echo "${GH_DIR}"

script:
- /home/nonroot/simnet/scripts/run-test-environment-manager-v2.sh
--github-remote-dir="${GH_DIR}"
--tag=malus
--image="PARACHAINSIMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
--image="SYNTHIMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
--image="COLIMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}"
--image="SCRIPTSIMAGE=${SIMNET_IMAGE}"
--image="MALUSIMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}"
allow_failure: true
retry: 2
tags:
Expand Down
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ fn ensure_dev(spec: &Box<dyn service::ChainSpec>) -> std::result::Result<(), Str
/// accepts an alternative overseer generator, to adjust behavior
/// for integration tests as needed.
#[cfg(feature = "malus")]
pub fn run_node(cli: Cli, overseer_gen: impl service::OverseerGen) -> Result<()> {
run_node_inner(cli, overseer_gen)
pub fn run_node(run: Cli, overseer_gen: impl service::OverseerGen) -> Result<()> {
run_node_inner(run, overseer_gen)
}

fn run_node_inner(cli: Cli, overseer_gen: impl service::OverseerGen) -> Result<()> {
Expand Down
25 changes: 17 additions & 8 deletions node/malus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[lib]
name = "malus"
path = "src/lib.rs"

[[bin]]
name = "malus-variant-a"
path = "src/variant-a.rs"

[package]
name = "polkadot-test-malus"
description = "Misbehaving nodes for local testnets, system and Simnet tests."
Expand All @@ -16,17 +8,34 @@ edition = "2018"
readme = "README.md"
publish = false

[[bin]]
name = "malus"
path = "src/malus.rs"

[dependencies]
polkadot-cli = { path = "../../cli", default-features = false, features = [ "cli", "malus" ] }
polkadot-node-subsystem = { path = "../subsystem" }
polkadot-node-subsystem-util = { path = "../subsystem-util" }
polkadot-node-subsystem-types = { path = "../subsystem-types" }
polkadot-node-core-dispute-coordinator = { path = "../core/dispute-coordinator" }
polkadot-node-core-candidate-validation = { path = "../core/candidate-validation" }
polkadot-node-core-backing = { path = "../core/backing" }
polkadot-node-primitives = { path = "../primitives" }
polkadot-primitives = { path = "../../primitives" }
polkadot-node-core-pvf = { path = "../core/pvf" }
parity-util-mem = { version = "0.10.0", default-features = false, features = ["jemalloc-global"] }
color-eyre = { version = "0.5.11", default-features = false }
assert_matches = "1.5"
structopt = "0.3.23"
async-trait = "0.1.51"
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
futures = "0.3.16"
futures-timer = "3.0.2"
tracing = "0.1.26"

[features]
default = [] # we do not enable disputes by default to avoid feature leak
disputes = ["polkadot-cli/disputes"]

[dev-dependencies]
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
Expand Down
58 changes: 57 additions & 1 deletion node/malus/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# malus

Create nemesis nodes with alternate, at best fault, at worst intentionally destructive behavior traits.
Create nemesis nodes with alternate, at best faulty, at worst intentionally destructive behavior traits.

The first argument determines the behavior strain. The currently supported are:

* `suggest-garbage-candidate`
* `back-garbage-candidate`
* `dispute-ancestor`

## Integration test cases

To define integration tests create file
in the toml format as used with [gurke][gurke]
under `./integrationtests` with either extension
`.toml` or `.toml.tera` depending on if you use
tera based templating.

> For the time being non-templated variants should be preferred!
## Usage

> Assumes you already gained permissiones, followed the [GKE access guide][gke],
> and you installed [gurke][gurke].

To launch a test case in the development cluster use (e.g. for the ./node/malus/integrationtests/0001-dispute-valid-block.toml):

```sh
# declare the containers pulled in by gurke test definitions
export SYNTHIMAGE=paritypr/synth-wave:3639-0.9.9-7edc6602-ed5fb773
export COLIMAGE=paritypr/colander:3639-7edc6602
export MALUSIMAGE=paritypr/malus:3639-7edc6602
export SCRIPTSIMAGE=paritytech/simnet:v9

# login chore, once, with the values as provided in the above guide
gcloud auth login
gcloud config set project "parity-simnet"
gcloud container clusters get-credentials "parity-simnet-devtest" --zone "europe-west3-b"

# launching the actual test
gurke run -c ./node/malus/integrationtests/0001-dispute-valid-block.toml -n parity-simnet-devtest ./node/malus/integrationtests/0001-dispute-valid-block.feature

# Access individual logs
kubectl -n parity-simnet-devtest logs mal
```

This will also teardown the cluster after completion.

## Container Image Building Note

In order to build the container image you need to have the latest changes from
polkadot and substrate master branches.

```sh
pwd # run this from the current dir
podman build -t paritypr/malus:v1 -f Containerfile ../../..
```

[gurke]: https://github.com/paritytech/gurke
[gke]: (https://github.com/paritytech/gurke/blob/main/docs/How-to-setup-access-to-gke-k8s-cluster.md)
Loading