diff --git a/.github/workflows/cumulus-stack-overflow.yaml b/.github/workflows/cumulus-stack-overflow.yaml deleted file mode 100644 index e950bf6..0000000 --- a/.github/workflows/cumulus-stack-overflow.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: Daily Workflow - -on: - schedule: - - cron: '0 0 * * *' - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Get latest polkadot release info - id: latestrelease_polkadot - uses: abatilo/release-info-action@v2.0.0 - with: - owner: paritytech - repo: polkadot - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Fetch Github Release Asset from polkadot - uses: dsaltares/fetch-gh-release-asset@v0.0.5 - with: - repo: "paritytech/polkadot" - version: "tags/${{ steps.latestrelease_polkadot.outputs.tag_name }}" - file: "${{ steps.latestrelease_polkadot.outputs.assets[0].name }}" - target: "polkadot.bin" - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Get latest polkadot-parachains release info - id: latestrelease_parachains - uses: abatilo/release-info-action@v2.0.0 - with: - owner: paritytech - repo: polkadot-parachains - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Fetch Github Release Asset from polkadot-parachains - uses: dsaltares/fetch-gh-release-asset@v0.0.5 - with: - repo: "paritytech/polkadot-parachains" - version: "tags/${{ steps.latestrelease_parachains.outputs.tag_name }}" - file: "${{ steps.latestrelease_parachains.outputs.assets[0].name }}" - target: "polkadot-parachains.bin" - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Add binaries to PATH - run: | - echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - chmod +x polkadot.bin - chmod +x polkadot-parachains.bin - - - name: Get latest cumulus release info - id: latestrelease_cumulus - uses: abatilo/release-info-action@v2.0.0 - with: - owner: paritytech - repo: cumulus - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Fetch Github Release Asset from cumulus - uses: dsaltares/fetch-gh-release-asset@v0.0.5 - with: - repo: "paritytech/cumulus" - version: "tags/${{ steps.latestrelease_cumulus.outputs.tag_name }}" - file: "${{ steps.latestrelease_cumulus.outputs.assets[0].name }}" - target: "test.wasm" - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - - name: Setup Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - - name: Move test.wasm - run: mv test.wasm ../target/release/test.wasm - - - name: Run wasm_injector - run: | - cd ../target/release - ./wasm_injector stack-overflow test.wasm - - - name: Checkout zombienet repository - uses: actions/checkout@v2 - with: - repository: paritytech/zombienet - path: ./zombienet - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Install and build zombienet - run: | - cd ./zombienet - npm install - npm run build - - - name: Run zombienet - run: | - zombienet -p native test ../tests/0003-parachains-pvf-memory-allocation-bad.zndsl diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..1412d11 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,140 @@ +name: Daily Workflow + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + push: + branches: + - feat/cicd + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: oprypin/find-latest-tag@v1 + with: + repository: paritytech/cumulus # The repository to scan. + releases-only: true # We know that all relevant tags have a GitHub release for them. + prefix: 'v' + id: cumulus-binary-release-tag # The step ID to refer to later. + + - run: echo "Cumulus binary is at version ${{ steps.cumulus-binary-release-tag.outputs.tag }}" + + - uses: oprypin/find-latest-tag@v1 + with: + repository: paritytech/cumulus # The repository to scan. + releases-only: true # We know that all relevant tags have a GitHub release for them. + prefix: 'parachains' + id: cumulus-wasm-release-tag # The step ID to refer to later. + + - run: echo "Cumulus WASM is at version ${{ steps.cumulus-wasm-release-tag.outputs.tag }}" + + - name: Fetch Github Release Asset from polkadot + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "paritytech/polkadot" + file: "polkadot" + target: "polkadot" + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Fetch Github Release Asset from polkadot-parachain + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "paritytech/cumulus" + file: "polkadot-parachain" + target: "polkadot-parachain" + version: "tags/${{ steps.cumulus-binary-release-tag.outputs.tag }}" + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Fetch Github Release Asset from zombienet + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "paritytech/zombienet" + file: "zombienet-linux-x64" + target: "zombienet" + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Fetch Github Release Asset from cumulus + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "paritytech/cumulus" + file: "rococo-parachain_runtime(.*)wasm" + version: "tags/${{steps.cumulus-wasm-release-tag.outputs.tag}}" + target: "./" + regex: true + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - run: find . -type f -regex '.*/rococo-parachain_runtime.*wasm' -exec mv {} fetched.wasm \; + + - name: Fetch kagome + run: | + docker run -v $GITHUB_WORKSPACE:/kagome --rm soramitsu/kagome:latest sh -c "cp /usr/local/bin/kagome . && chmod +x kagome" + + - run : | + sudo apt-get update + sudo apt-get install -y --no-install-recommends software-properties-common curl gpg gpg-agent wget + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb http://deb.debian.org/debian/ experimental main" | sudo tee -a /etc/apt/sources.list.d/docker.list > /dev/null + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 + sudo add-apt-repository -y "deb http://deb.debian.org/debian/ testing main" + sudo apt-get update + sudo apt-get install --no-install-recommends -y libstdc++6 libc6 libnsl2 + + - name: Debugging + run: | + echo "Current directory:" + pwd + echo "List files:" + ls -la + echo "GLIBC version:" + ldd --version + echo "GITHUB_WORKSPACE value:" + echo "$GITHUB_WORKSPACE" + + - name: Add binaries to PATH + run: | + echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH + chmod +x polkadot + chmod +x polkadot-parachain + chmod +x zombienet + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + + - run: mv fetched.wasm ./target/debug/test.wasm + + - name: Run wasm_injector + run: | + ./target/debug/wasm_injector nothing ./target/debug/test.wasm ./wasm/orig.wasm.hex --hexified + ./target/debug/wasm_injector stack-overflow ./target/debug/test.wasm ./wasm/stack-overflow.wasm.hex --hexified + ./target/debug/wasm_injector heap-overflow ./target/debug/test.wasm ./wasm/heap-overflow.wasm.hex --hexified + ./target/debug/wasm_injector infinite-loop ./target/debug/test.wasm ./wasm/infinite-loop.wasm.hex --hexified + + - name: Set up Julia + uses: julia-actions/setup-julia@v1 + with: + version: '1.9.1' + + - name: Run Julia script + run: julia scripts/runTests.jl + + - uses: actions/cache@v3 + if: always() + with: + path: | + ./tests_output + key: test-output-${{github.run_number}} diff --git a/.gitignore b/.gitignore index a45375e..4d53b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ /target /Cargo.lock .DS_Store -*.log \ No newline at end of file +*.log +polkadot-parachain +polkadot +kagome \ No newline at end of file diff --git a/scripts/runTests.jl b/scripts/runTests.jl index 1ef7d3f..adea7cf 100644 --- a/scripts/runTests.jl +++ b/scripts/runTests.jl @@ -10,29 +10,18 @@ tests_dir::String = get(ENV ,"ZN_TESTS", "./tests") # Test output path tests_output::String = get(ENV, "ZN_TEST_OUTPUT", "./tests_output") -# Filter out the non-`.zndsl` files, just to be safe -tests::Vector{String} = filter(file -> endswith(file, ".zndsl"), readdir(tests_dir)) - # Arrays to accumulate passed and failed test names passed_tests::Vector{String} = [] failed_tests::Vector{String} = [] -# Helper for piping both outputs -function redirect_stdout_stderr(dofunc, outfile, errfile) - open(outfile, "w") do out - open(errfile, "w") do err - redirect_stdout(out) do - redirect_stderr(err) do - dofunc() - end - end - end - end -end - # For each host ... for host::String in hosts withenv("ZOMBIENET_DEFAULT_START_COMMAND" => host) do + # Get host tests directory + host_tests_dir::String = joinpath(tests_dir, host) + # Filter out the non-`.zndsl` files for each host + tests::Vector{String} = filter(file -> endswith(file, ".zndsl"), readdir(host_tests_dir)) + # ... run each test for test::String in tests if endswith(test, ".zndsl") @@ -42,25 +31,21 @@ for host::String in hosts test_name::String = match_captures[2] # Prepare the `zombienet test` command - command::Cmd = `zombienet -p native test $(joinpath(tests_dir, test))` - println("Running test [$(host)] $(test_name)") + command::Cmd = `zombienet -p native test $(joinpath(host_tests_dir, test))` + full_test_name::String = "[$(host)] $(test_name)" + println("Running test $(full_test_name)") # Try to run the test try - # Create the output files - output_stdout = joinpath(tests_output, "output_$(index)-$(test_name)_stdout.log") - output_stderr = joinpath(tests_output, "output_$(index)-$(test_name)_stderr.log") - - # Try to run the command and capture its output - redirect_stdout_stderr(output_stdout, output_stderr) do - run(command) - end + # Try to run the command + run(command) # Add the test name to the passed tests array - push!(passed_tests, test_name) + push!(passed_tests, full_test_name) catch e + showerror(stdout, e) # Add the test name to the failed tests array - push!(failed_tests, test_name) + push!(failed_tests, full_test_name) end end end @@ -73,3 +58,8 @@ println(passed_tests) println("Failed tests:") println(failed_tests) + +# Exit with an error code if any tests failed +if length(failed_tests) > 0 + exit(1) +end diff --git a/tests/0001-parachains-pvf-compilation-time-bad.toml b/tests/0001-parachains-pvf-compilation-time-bad.toml deleted file mode 100644 index aa3eebe..0000000 --- a/tests/0001-parachains-pvf-compilation-time-bad.toml +++ /dev/null @@ -1,32 +0,0 @@ -[settings] -timeout = 1000 - -[relaychain] -# default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" -default_args = [ "-lparachain=debug" ] - -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"] - -[[parachains]] -id = 2000 -genesis_wasm_path="./wasm/PATCHED_rococo_v9420.wasm.hex" - - [parachains.collator] - name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" - command = "polkadot-parachain" - args = ["-lparachain=debug"] diff --git a/tests/0001-parachains-pvf-compilation-time-bad.zndsl b/tests/0001-parachains-pvf-compilation-time-bad.zndsl deleted file mode 100644 index 7da9fe4..0000000 --- a/tests/0001-parachains-pvf-compilation-time-bad.zndsl +++ /dev/null @@ -1,19 +0,0 @@ -Description: PVF compilation time -Network: ./0001-parachains-pvf-compilation-time-bad.toml -Creds: config - -# Check authority status. -alice: reports node_roles is 4 - -# Ensure parachains are registered. -alice: parachain 2000 is registered within 60 seconds - -# Ensure parachains made progress. -alice: log line matches glob "*InvalidCandidate(HardTimeout)*" within 120 seconds -alice: parachain 2000 block height != 1 within 60 seconds - -# Check preparation time is under 10s. -# Check all buckets < 10. -alice: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["0.1", "0.5", "1", "2", "3"] within 20 seconds -# Check all buckets >= 10. -alice: reports histogram polkadot_pvf_preparation_time has at least 1 samples in buckets ["10", "20", "30", "60", "120", "+Inf"] within 20 seconds \ No newline at end of file diff --git a/tests/0001-parachains-pvf-compilation-time-good.zndsl b/tests/0001-parachains-pvf-compilation-time-good.zndsl deleted file mode 100644 index c7f807e..0000000 --- a/tests/0001-parachains-pvf-compilation-time-good.zndsl +++ /dev/null @@ -1,19 +0,0 @@ -Description: PVF execution time -Network: ./0001-parachains-pvf-compilation-time-good.toml -Creds: config - -# Check authority status. -alice: reports node_roles is 4 - -# Ensure parachains are registered. -alice: parachain 2000 is registered within 60 seconds - -# Ensure parachains made progress. -alice: parachain 2000 block height is at least 10 within 200 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 - -# Check all buckets >= 20. -alice: reports histogram polkadot_pvf_preparation_time has 0 samples in buckets ["20", "30", "60", "120", "+Inf"] within 10 seconds diff --git a/tests/0002-parachains-pvf-execution-time-bad.toml b/tests/kagome/0002-parachains-pvf-execution-time-bad.toml similarity index 71% rename from tests/0002-parachains-pvf-execution-time-bad.toml rename to tests/kagome/0002-parachains-pvf-execution-time-bad.toml index 78d4d54..a7ae09c 100644 --- a/tests/0002-parachains-pvf-execution-time-bad.toml +++ b/tests/kagome/0002-parachains-pvf-execution-time-bad.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -14,7 +13,9 @@ requests = { memory = "2G", cpu = "1" } [[relaychain.nodes]] name = "alice" + command = "kagome" args = [ "--alice", "-lparachain=debug,runtime=debug" ] + prometheus_prefix = "kagome" [[relaychain.nodes]] name = "bob" @@ -22,10 +23,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/PATCHED_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/infinite-loop.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/kagome/0002-parachains-pvf-execution-time-bad.zndsl b/tests/kagome/0002-parachains-pvf-execution-time-bad.zndsl new file mode 100644 index 0000000..54f4e80 --- /dev/null +++ b/tests/kagome/0002-parachains-pvf-execution-time-bad.zndsl @@ -0,0 +1,27 @@ +Description: PVF compilation time +Network: ./0002-parachains-pvf-execution-time-bad.toml +Creds: config + +# Check authority status. +alice: reports kagome_node_roles is 4 + +# Ensure parachains are registered. +alice: parachain 2000 is registered within 60 seconds + +# Ensure parachains made progress. +alice: parachain 2000 block height != 1 within 60 seconds + +# Check execution time. +# There are two different timeout conditions: BACKING_EXECUTION_TIMEOUT(2s) and +# APPROVAL_EXECUTION_TIMEOUT(6s). 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 kagome_block_verification_and_import_time_bucket has at least 0 samples in buckets ["0.005", "0.01", "0.025", "0.05", "0.1", "0.25", "0.5", "1", "2.5"] within 60 seconds + +# Check if we have no samples > 2s. +alice: reports histogram kagome_block_verification_and_import_time_bucket has at least 0 samples in buckets ["1", "2.5", "5", "10", "+Inf"] within 60 seconds diff --git a/tests/kagome/0003-parachains-pvf-memory-allocation-bad.toml b/tests/kagome/0003-parachains-pvf-memory-allocation-bad.toml new file mode 100644 index 0000000..a295dbd --- /dev/null +++ b/tests/kagome/0003-parachains-pvf-memory-allocation-bad.toml @@ -0,0 +1,31 @@ +[settings] +timeout = 1000 + +[relaychain] +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] + +chain = "rococo-local" + +[relaychain.default_resources] +limits = { memory = "4G", cpu = "2" } +requests = { memory = "2G", cpu = "1" } + + [[relaychain.nodes]] + name = "alice" + command = "kagome" + args = [ "--alice", "-lparachain=debug,runtime=debug" ] + prometheus_prefix = "kagome" + + [[relaychain.nodes]] + name = "bob" + args = [ "--bob", "-lparachain=debug,runtime=debug" ] + +[[parachains]] +id = 2000 +genesis_wasm_path="./wasm/heap-overflow.wasm.hex" + + [parachains.collator] + name = "collator01" + command = "polkadot-parachain" + args = ["-lparachain=debug"] diff --git a/tests/kagome/0003-parachains-pvf-memory-allocation-bad.zndsl b/tests/kagome/0003-parachains-pvf-memory-allocation-bad.zndsl new file mode 100644 index 0000000..2f9c92d --- /dev/null +++ b/tests/kagome/0003-parachains-pvf-memory-allocation-bad.zndsl @@ -0,0 +1,13 @@ +Description: PVF memory allocation +Network: ./0003-parachains-pvf-memory-allocation-bad.toml +Creds: config + +# Check authority status. +alice: reports node_roles is 4 + +# Ensure parachains are registered. +alice: parachain 2000 is registered within 60 seconds + +# Ensure parachains made progress. +alice: log line matches glob "*Trap: final > memory*" within 60 seconds +alice: parachain 2000 block height != 1 within 60 seconds \ No newline at end of file diff --git a/tests/0004-parachains-pvf-stack-allocation-bad.toml b/tests/kagome/0004-parachains-pvf-stack-allocation-bad.toml similarity index 71% rename from tests/0004-parachains-pvf-stack-allocation-bad.toml rename to tests/kagome/0004-parachains-pvf-stack-allocation-bad.toml index 3aa6e44..3b3a1f2 100644 --- a/tests/0004-parachains-pvf-stack-allocation-bad.toml +++ b/tests/kagome/0004-parachains-pvf-stack-allocation-bad.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -14,7 +13,9 @@ requests = { memory = "2G", cpu = "1" } [[relaychain.nodes]] name = "alice" + command = "kagome" args = [ "--alice", "-lparachain=debug,runtime=debug" ] + prometheus_prefix = "kagome" [[relaychain.nodes]] name = "bob" @@ -22,10 +23,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/PATCHED_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/stack-overflow.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/kagome/0004-parachains-pvf-stack-allocation-bad.zndsl b/tests/kagome/0004-parachains-pvf-stack-allocation-bad.zndsl new file mode 100644 index 0000000..5cf9a37 --- /dev/null +++ b/tests/kagome/0004-parachains-pvf-stack-allocation-bad.zndsl @@ -0,0 +1,13 @@ +Description: PVF stack allocation +Network: ./0004-parachains-pvf-stack-allocation-bad.toml +Creds: config + +# Check authority status. +alice: reports node_roles is 4 + +# Ensure parachains are registered. +alice: parachain 2000 is registered within 60 seconds + +# Ensure parachains made progress. +alice: log line matches glob "*Trap: offset > memory:*" within 60 seconds +alice: parachain 2000 block height != 1 within 60 seconds \ No newline at end of file diff --git a/tests/0001-parachains-pvf-compilation-time-good.toml b/tests/polkadot/0002-parachains-pvf-execution-time-bad.toml similarity index 71% rename from tests/0001-parachains-pvf-compilation-time-good.toml rename to tests/polkadot/0002-parachains-pvf-execution-time-bad.toml index 7fbeb8f..025fb5c 100644 --- a/tests/0001-parachains-pvf-compilation-time-good.toml +++ b/tests/polkadot/0002-parachains-pvf-execution-time-bad.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -22,10 +21,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/ORIGINAL_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/infinite-loop.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/0002-parachains-pvf-execution-time-bad.zndsl b/tests/polkadot/0002-parachains-pvf-execution-time-bad.zndsl similarity index 100% rename from tests/0002-parachains-pvf-execution-time-bad.zndsl rename to tests/polkadot/0002-parachains-pvf-execution-time-bad.zndsl diff --git a/tests/0002-parachains-pvf-execution-time-good.toml b/tests/polkadot/0002-parachains-pvf-execution-time-good.toml similarity index 71% rename from tests/0002-parachains-pvf-execution-time-good.toml rename to tests/polkadot/0002-parachains-pvf-execution-time-good.toml index 7fbeb8f..1d30c4c 100644 --- a/tests/0002-parachains-pvf-execution-time-good.toml +++ b/tests/polkadot/0002-parachains-pvf-execution-time-good.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -22,10 +21,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/ORIGINAL_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/orig.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/0002-parachains-pvf-execution-time-good.zndsl b/tests/polkadot/0002-parachains-pvf-execution-time-good.zndsl similarity index 100% rename from tests/0002-parachains-pvf-execution-time-good.zndsl rename to tests/polkadot/0002-parachains-pvf-execution-time-good.zndsl diff --git a/tests/0003-parachains-pvf-memory-allocation-bad.toml b/tests/polkadot/0003-parachains-pvf-memory-allocation-bad.toml similarity index 71% rename from tests/0003-parachains-pvf-memory-allocation-bad.toml rename to tests/polkadot/0003-parachains-pvf-memory-allocation-bad.toml index fcf4e5c..531eff8 100644 --- a/tests/0003-parachains-pvf-memory-allocation-bad.toml +++ b/tests/polkadot/0003-parachains-pvf-memory-allocation-bad.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -22,10 +21,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/PATCHED_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/heap-overflow.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/0003-parachains-pvf-memory-allocation-bad.zndsl b/tests/polkadot/0003-parachains-pvf-memory-allocation-bad.zndsl similarity index 100% rename from tests/0003-parachains-pvf-memory-allocation-bad.zndsl rename to tests/polkadot/0003-parachains-pvf-memory-allocation-bad.zndsl diff --git a/tests/0003-parachains-pvf-memory-allocation-good.toml b/tests/polkadot/0003-parachains-pvf-memory-allocation-good.toml similarity index 71% rename from tests/0003-parachains-pvf-memory-allocation-good.toml rename to tests/polkadot/0003-parachains-pvf-memory-allocation-good.toml index b52f22c..4a72ed5 100644 --- a/tests/0003-parachains-pvf-memory-allocation-good.toml +++ b/tests/polkadot/0003-parachains-pvf-memory-allocation-good.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -22,10 +21,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/ORIGINAL_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/orig.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/0003-parachains-pvf-memory-allocation-good.zndsl b/tests/polkadot/0003-parachains-pvf-memory-allocation-good.zndsl similarity index 100% rename from tests/0003-parachains-pvf-memory-allocation-good.zndsl rename to tests/polkadot/0003-parachains-pvf-memory-allocation-good.zndsl diff --git a/tests/polkadot/0004-parachains-pvf-stack-allocation-bad.toml b/tests/polkadot/0004-parachains-pvf-stack-allocation-bad.toml new file mode 100644 index 0000000..162d28c --- /dev/null +++ b/tests/polkadot/0004-parachains-pvf-stack-allocation-bad.toml @@ -0,0 +1,29 @@ +[settings] +timeout = 1000 + +[relaychain] +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] + +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"] + +[[parachains]] +id = 2000 +genesis_wasm_path="./wasm/stack-overflow.wasm.hex" + + [parachains.collator] + name = "collator01" + command = "polkadot-parachain" + args = ["-lparachain=debug"] diff --git a/tests/0004-parachains-pvf-stack-allocation-bad.zndsl b/tests/polkadot/0004-parachains-pvf-stack-allocation-bad.zndsl similarity index 100% rename from tests/0004-parachains-pvf-stack-allocation-bad.zndsl rename to tests/polkadot/0004-parachains-pvf-stack-allocation-bad.zndsl diff --git a/tests/0004-parachains-pvf-stack-allocation-good.toml b/tests/polkadot/0004-parachains-pvf-stack-allocation-good.toml similarity index 71% rename from tests/0004-parachains-pvf-stack-allocation-good.toml rename to tests/polkadot/0004-parachains-pvf-stack-allocation-good.toml index b52f22c..4a72ed5 100644 --- a/tests/0004-parachains-pvf-stack-allocation-good.toml +++ b/tests/polkadot/0004-parachains-pvf-stack-allocation-good.toml @@ -2,8 +2,7 @@ timeout = 1000 [relaychain] -default_image = "docker.io/parity/polkadot:latest" -default_command = "{{ZOMBIENET_DEFAULT_START_COMMAND}}" +default_command = "polkadot" default_args = [ "-lparachain=debug" ] chain = "rococo-local" @@ -22,10 +21,9 @@ requests = { memory = "2G", cpu = "1" } [[parachains]] id = 2000 -genesis_wasm_path="./wasm/ORIGINAL_rococo_v9420.wasm.hex" +genesis_wasm_path="./wasm/orig.wasm.hex" [parachains.collator] name = "collator01" - image = "docker.io/parity/polkadot-parachain:latest" command = "polkadot-parachain" args = ["-lparachain=debug"] diff --git a/tests/0004-parachains-pvf-stack-allocation-good.zndsl b/tests/polkadot/0004-parachains-pvf-stack-allocation-good.zndsl similarity index 100% rename from tests/0004-parachains-pvf-stack-allocation-good.zndsl rename to tests/polkadot/0004-parachains-pvf-stack-allocation-good.zndsl