Skip to content

Commit

Permalink
less flaky dispute slashing test (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian authored Aug 28, 2023
1 parent c58db69 commit 7125f65
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ bootnode = true

[relaychain.genesis.runtime.configuration.config]
max_validators_per_core = 1
needed_approvals = 3
group_rotation_frequency = 4
needed_approvals = 2
group_rotation_frequency = 3

[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
Expand All @@ -16,15 +16,16 @@ default_command = "polkadot"
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

[[relaychain.nodes]]
name = "alice"
[[relaychain.node_groups]]
name = "honest-flaky-validator"
invulnerable = true # it will go offline, we don't want to disable it
args = ["-lparachain=debug,runtime=debug"]
count = 2
args = ["-lparachain=debug"]

[[relaychain.node_groups]]
name = "honest-validator"
count = 2
args = ["-lruntime=debug,sync=trace"]
count = 1
args = ["-lparachain=debug"]

[[relaychain.node_groups]]
image = "{{MALUS_IMAGE}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,52 @@ Description: Past-session dispute slashing
Network: ./0004-parachains-disputes-past-session.toml
Creds: config

alice: reports node_roles is 4
# Ensure nodes are up and running
honest-flaky-validator: reports node_roles is 4

# pause alice so that disputes don't conclude
alice: pause
# Stop issuing disputes for now
malus-validator: pause

# Ensure parachain is registered.
honest-validator-0: parachain 1000 is registered within 100 seconds
# Ensure parachain is registered
honest-validator: parachain 1000 is registered within 100 seconds

# Ensure parachain made progress.
honest-validator-0: parachain 1000 block height is at least 1 within 300 seconds
# Ensure parachain made progress
honest-validator: parachain 1000 block height is at least 1 within 300 seconds

# There should be disputes initiated
honest-validator-0: reports polkadot_parachain_candidate_disputes_total is at least 2 within 200 seconds
# Start issuing disputes
malus-validator: resume

# Stop issuing disputes
malus-validator-0: pause
# Wait for malus to back garbage candidate
malus-validator: log line matches "Suggesting malicious candidate" within 200 seconds

# Pause first flaky node
# Availability and finality will continue with 3/4 nodes online (incl. malus)
honest-flaky-validator-0: pause

# Wait for the dispute
honest-flaky-validator-1: reports parachain_candidate_disputes_total is at least 1 within 40 seconds

# Pause second flaky node so that we do not revert blocks due to f+1 invalid votes
# Availability and finality will stop
honest-flaky-validator-1: pause

# wait for the next session
# Wait for 1 full session to pass after the last unconcluded dispute.
sleep 120 seconds

# But should not resolve
honest-validator-0: reports block height minus finalised block is at least 10 within 100 seconds
# Now resume flaky validators
honest-flaky-validator: resume

# Now resume alice
alice: resume
# Stop issuing disputes
malus-validator: pause

# Disputes should start concluding now
honest-validator-0: reports polkadot_parachain_candidate_dispute_concluded{validity="invalid"} is at least 1 within 200 seconds
honest-validator: reports polkadot_parachain_candidate_dispute_concluded{validity="invalid"} is at least 1 within 200 seconds

# Disputes should always end as "invalid"
honest-validator-0: reports polkadot_parachain_candidate_dispute_concluded{validity="valid"} is 0
honest-validator: reports polkadot_parachain_candidate_dispute_concluded{validity="valid"} is 0

# Check an unsigned extrinsic is submitted
honest-validator: log line contains "Successfully reported pending slash" within 180 seconds

# Finality should not lag after dispute resolution
honest-validator: reports block height minus finalised block is lower than 8 within 100 seconds

0 comments on commit 7125f65

Please sign in to comment.