-
Notifications
You must be signed in to change notification settings - Fork 40
Add KAGOME minority tests for PVF preparation and BEEFY voting #2441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kamilsa
wants to merge
7
commits into
master
Choose a base branch
from
test/kagome-minority
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ebd3d6b
Add KAGOME minority tests for PVF preparation and BEEFY voting
kamilsa 123ff86
Rename test for KAGOME minority in functional tests
kamilsa 5e55698
Update BEEFY voting test description to include KAGOME minority
kamilsa c4c0b44
Update BEEFY RPC test to include additional validator
kamilsa 3fb9646
Update MMR proof validation to include additional validator
kamilsa 2eaf0bf
Update zombienet/polkadot/functional/0001-parachains-pvf-kagome-minor…
kamilsa 54a1c6a
Merge remote-tracking branch 'origin/master' into test/kagome-minority
kamilsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| test-polkadot-functional-0001-parachains-pvf: | ||
| $(call run_test, "kagome/zombienet/polkadot/functional/0001-parachains-pvf.zndsl") | ||
|
|
||
| test-polkadot-functional-0001-parachains-pvf-kagome-minority: | ||
| $(call run_test, "kagome/zombienet/polkadot/functional/0001-parachains-pvf-kagome-minority.zndsl") | ||
|
|
||
| test-polkadot-functional-0002-parachains-disputes: | ||
| $(call run_test, "kagome/zombienet/polkadot/functional/0002-parachains-disputes.zndsl") | ||
|
|
||
| test-polkadot-functional-0003-beefy-and-mmr: | ||
| $(call run_test, "kagome/zombienet/polkadot/functional/0003-beefy-and-mmr.zndsl") | ||
| test-polkadot-functional-0003-beefy-and-mmr-kagome-minority: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe in this case it would also be a good idea to specify '0003a'. |
||
| $(call run_test, "kagome/zombienet/polkadot/functional/0003-beefy-and-mmr-kagome-minority.zndsl") | ||
|
|
||
| test-polkadot-functional-0004-parachains-garbage-candidate: | ||
| $(call run_test, "kagome/zombienet/polkadot/functional/0004-parachains-garbage-candidate.zndsl") | ||
|
|
||
130 changes: 130 additions & 0 deletions
130
zombienet/polkadot/functional/0001-parachains-pvf-kagome-minority.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| [settings] | ||
| timeout = 1000 | ||
|
|
||
| [relaychain] | ||
| chain = "rococo-local" | ||
|
|
||
| [relaychain.default_resources] | ||
| limits = { memory = "4G", cpu = "2" } | ||
| requests = { memory = "2G", cpu = "1" } | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "alice" | ||
| args = [ "--alice", "-lparachain=debug,runtime=debug" ] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "bob" | ||
| args = [ "--bob", "-lparachain=debug,runtime=debug" ] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "charlie" | ||
| args = [ "--charlie", "-lparachain=debug,runtime=debug" ] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "dave" | ||
| args = [ "--dave", "-lparachain=debug,runtime=debug" ] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "ferdie" | ||
| args = [ "--ferdie", "-lparachain=debug,runtime=debug"] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "eve" | ||
| args = [ "--eve", "-lparachain=debug,runtime=debug"] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "one" | ||
| command = "kagome" | ||
| prometheus_prefix = "kagome" | ||
| args = [ "--one", "--wasm-execution=Compiled", "-lparachain=debug", "-lnetwork=debug"] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "two" | ||
| command = "kagome" | ||
| prometheus_prefix = "kagome" | ||
| args = [ "--two", "--wasm-execution=Compiled", "-lparachain=debug", "-lruntime=debug", "-lreq_chunk_protocol=trace"] | ||
|
|
||
| [[parachains]] | ||
| id = 2000 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=1" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator01" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--pvf-complexity=1", "--parachain-id=2000"] | ||
|
|
||
| [[parachains]] | ||
| id = 2001 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=10" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator02" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--parachain-id=2001", "--pvf-complexity=10"] | ||
|
|
||
| [[parachains]] | ||
| id = 2002 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=100" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator03" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--parachain-id=2002", "--pvf-complexity=100"] | ||
|
|
||
| [[parachains]] | ||
| id = 2003 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=20000 --pvf-complexity=300" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator04" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=20000", "--parachain-id=2003", "--pvf-complexity=300"] | ||
|
|
||
| [[parachains]] | ||
| id = 2004 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=300" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator05" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--parachain-id=2004", "--pvf-complexity=300"] | ||
|
|
||
| [[parachains]] | ||
| id = 2005 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=20000 --pvf-complexity=400" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator06" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=20000", "--pvf-complexity=400", "--parachain-id=2005"] | ||
|
|
||
| [[parachains]] | ||
| id = 2006 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=300" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator07" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--pvf-complexity=300", "--parachain-id=2006"] | ||
|
|
||
| [[parachains]] | ||
| id = 2007 | ||
| addToGenesis = true | ||
| genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=300" | ||
|
|
||
| [parachains.collator] | ||
| name = "collator08" | ||
| command = "undying-collator" | ||
| args = ["-lparachain=debug", "--pov-size=100000", "--pvf-complexity=300", "--parachain-id=2007"] | ||
|
|
||
| [types.Header] | ||
| number = "u64" | ||
| parent_hash = "Hash" | ||
| post_state = "Hash" |
84 changes: 84 additions & 0 deletions
84
zombienet/polkadot/functional/0001-parachains-pvf-kagome-minority.zndsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| Description: PVF preparation & execution time | ||
| Network: ./0001-parachains-pvf-kagome-minority.toml | ||
| Creds: config | ||
|
|
||
| # Check authority status. | ||
| alice: reports node_roles is 4 | ||
| bob: reports node_roles is 4 | ||
| charlie: reports node_roles is 4 | ||
| dave: reports node_roles is 4 | ||
| eve: reports node_roles is 4 | ||
| ferdie: reports node_roles is 4 | ||
| one: reports node_roles is 4 | ||
| two: reports node_roles is 4 | ||
|
|
||
| # Ensure parachains are registered. | ||
| alice: parachain 2000 is registered within 60 seconds | ||
| bob: parachain 2001 is registered within 60 seconds | ||
| charlie: parachain 2002 is registered within 60 seconds | ||
| dave: parachain 2003 is registered within 60 seconds | ||
| ferdie: parachain 2004 is registered within 60 seconds | ||
| eve: parachain 2005 is registered within 60 seconds | ||
| one: parachain 2006 is registered within 60 seconds | ||
| two: parachain 2007 is registered within 60 seconds | ||
|
|
||
| # Ensure parachains made progress. | ||
| alice: parachain 2000 block height is at least 10 within 300 seconds | ||
| alice: parachain 2001 block height is at least 10 within 300 seconds | ||
| alice: parachain 2002 block height is at least 10 within 300 seconds | ||
| alice: parachain 2003 block height is at least 10 within 300 seconds | ||
| alice: parachain 2004 block height is at least 10 within 300 seconds | ||
| alice: parachain 2005 block height is at least 10 within 300 seconds | ||
| alice: parachain 2006 block height is at least 10 within 300 seconds | ||
| alice: parachain 2007 block height is at least 10 within 300 seconds | ||
|
|
||
| alice: reports substrate_block_height{status="finalized"} is at least 30 within 400 seconds | ||
|
|
||
| # Check preparation time is under 10s. | ||
| # Check all buckets <= 10. | ||
| alice: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| bob: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| charlie: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| dave: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| ferdie: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| eve: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| one: reports histogram kagome_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
| two: reports histogram kagome_pvf_preparation_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2", "3", "10"] within 10 seconds | ||
|
|
||
| # Check all buckets >= 20. | ||
| alice: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| bob: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| charlie: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| dave: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| ferdie: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| eve: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| one: reports histogram kagome_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
| two: reports histogram kagome_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds | ||
|
|
||
| # Check execution time. | ||
| # There are two different timeout conditions: DEFAULT_BACKING_EXECUTION_TIMEOUT(2s) and | ||
| # DEFAULT_APPROVAL_EXECUTION_TIMEOUT(12s). Currently these are not differentiated by metrics | ||
| # because the metrics are defined in `polkadot-node-core-pvf` which is a level below | ||
| # the relevant subsystems. | ||
| # That being said, we will take the simplifying assumption of testing only the | ||
| # 2s timeout. | ||
| # We do this check by ensuring all executions fall into bucket le="2" or lower. | ||
| # First, check if we have at least 1 sample, but we should have many more. | ||
| alice: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| bob: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| charlie: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| dave: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| ferdie: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| eve: reports histogram polkadot_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| one: reports histogram kagome_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
| two: reports histogram kagome_pvf_execution_time has at least 1 samples in buckets ["0.1", "0.5", "1", "2"] within 10 seconds | ||
|
|
||
| # Check if we have no samples > 2s. | ||
| alice: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| bob: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| charlie: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| dave: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| ferdie: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| eve: reports histogram polkadot_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| one: reports histogram kagome_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds | ||
| two: reports histogram kagome_pvf_execution_time has 0 samples in buckets ["3", "4", "5", "6", "+Inf"] within 10 seconds |
22 changes: 22 additions & 0 deletions
22
zombienet/polkadot/functional/0003-beefy-and-mmr-kagome-minority.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [settings] | ||
| timeout = 1000 | ||
|
|
||
| [relaychain] | ||
| chain = "rococo-local" | ||
| command = "polkadot" | ||
|
|
||
| [[relaychain.node_groups]] | ||
| name = "validator" | ||
| count = 3 | ||
| args = ["--log=beefy=debug", "--enable-offchain-indexing=true"] | ||
|
|
||
| [[relaychain.node_groups]] | ||
| name = "kagome-validator" | ||
| command = "kagome" | ||
| prometheus_prefix = "kagome" | ||
| count = 1 | ||
| args = ["--log=beefy=debug", "--enable-offchain-indexing=true", "--wasm-execution=Compiled"] | ||
|
|
||
| [[relaychain.nodes]] | ||
| name = "validator-unstable" | ||
| args = ["--log=beefy=debug", "--enable-offchain-indexing=true"] |
42 changes: 42 additions & 0 deletions
42
zombienet/polkadot/functional/0003-beefy-and-mmr-kagome-minority.zndsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| Description: Test BEEFY voting and finality, test MMR proofs. Assumes Rococo sessions of 1 minute. | ||
| Network: ./0003-beefy-and-mmr-kagome-minority.toml | ||
| Creds: config | ||
|
|
||
| # Check authority status. | ||
| validator: reports node_roles is 4 | ||
| validator-unstable: reports node_roles is 4 | ||
|
|
||
| # BEEFY sanity checks. | ||
| validator: reports substrate_beefy_validator_set_id is 0 | ||
| validator-unstable: reports substrate_beefy_validator_set_id is 0 | ||
|
|
||
| # Verify voting happens and 1st mandatory block is finalized within 1st session. | ||
| validator: reports substrate_beefy_best_block is at least 1 within 60 seconds | ||
| validator-unstable: reports substrate_beefy_best_block is at least 1 within 60 seconds | ||
|
|
||
| # Pause validator-unstable and test chain is making progress without it. | ||
| validator-unstable: pause | ||
|
|
||
| # Verify validator sets get changed on new sessions. | ||
| validator: reports substrate_beefy_validator_set_id is at least 1 within 70 seconds | ||
| kagome-validator: reports kagome_beefy_validator_set_id is at least 1 within 70 seconds | ||
| # Check next session too. | ||
| validator: reports substrate_beefy_validator_set_id is at least 2 within 130 seconds | ||
| kagome-validator: reports kagome_beefy_validator_set_id is at least 2 within 130 seconds | ||
|
|
||
| # Verify voting happens and blocks are being finalized for new sessions too: | ||
| # since we verified we're at least in the 3rd session, verify BEEFY finalized mandatory #21. | ||
| validator: reports substrate_beefy_best_block is at least 21 within 130 seconds | ||
| kagome-validator: reports kagome_beefy_best_block is at least 21 within 130 seconds | ||
|
|
||
| # Custom JS to test BEEFY RPCs. | ||
| validator-0: js-script ./0003-beefy-finalized-heads.js with "validator-0,validator-1,validator-2,kagome-validator-0" return is 1 within 5 seconds | ||
|
|
||
| # Custom JS to test MMR RPCs. | ||
| validator: js-script ./0003-mmr-leaves.js with "21" return is 1 within 5 seconds | ||
| validator: js-script ./0003-mmr-generate-and-verify-proof.js with "validator-0,validator-1,validator-2,kagome-validator-0" return is 1 within 5 seconds | ||
|
|
||
| # Resume validator-unstable and verify it imports all BEEFY justification and catches up. | ||
| validator-unstable: resume | ||
| validator-unstable: reports substrate_beefy_validator_set_id is at least 2 within 30 seconds | ||
| validator-unstable: reports substrate_beefy_best_block is at least 21 within 30 seconds |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case it's better to name the test with an additional identifier, for example '0003a' instead of just '0003', so that they can be quickly distinguished by name in the UI