forked from Manta-Network/Manta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manta runtime - add governance pallets (Manta-Network#1087)
* add governance pallets Signed-off-by: Georgi Zlatarev <[email protected]> * Update configs for manta Signed-off-by: Georgi Zlatarev <[email protected]> * taplo fmt/lint Signed-off-by: Georgi Zlatarev <[email protected]> * fmt Signed-off-by: Georgi Zlatarev <[email protected]> * Update weights Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime ugprade test Signed-off-by: Georgi Zlatarev <[email protected]> * Updat runtime upgrade test Signed-off-by: Georgi Zlatarev <[email protected]> * Update paths Signed-off-by: Georgi Zlatarev <[email protected]> * enable external propose and external propose manjority Signed-off-by: Georgi Zlatarev <[email protected]> * taplo fmt/lint Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime upgrade test workflow Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime upgrade test workflow Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime upgrade test workflow Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime upgrade test workflow Signed-off-by: Georgi Zlatarev <[email protected]> * Update weights Signed-off-by: Georgi Zlatarev <[email protected]> * Use tag for srtool Signed-off-by: Georgi Zlatarev <[email protected]> * Make chain-spec a manual entry field in rtu CI Signed-off-by: Georgi Zlatarev <[email protected]> * Fix runtime upgrade test workflow Signed-off-by: Georgi Zlatarev <[email protected]> * Fix ymallint Signed-off-by: Georgi Zlatarev <[email protected]> * Reduce workflwo Signed-off-by: Georgi Zlatarev <[email protected]> * Make runtime name a user in put Signed-off-by: Georgi Zlatarev <[email protected]> * Uppdate Signed-off-by: Georgi Zlatarev <[email protected]> * Uppdate Signed-off-by: Georgi Zlatarev <[email protected]> * Uppdate Signed-off-by: Georgi Zlatarev <[email protected]> * Use 1 council member in local testnets Signed-off-by: Georgi Zlatarev <[email protected]> * add print Signed-off-by: Georgi Zlatarev <[email protected]> * Cleanup Signed-off-by: Georgi Zlatarev <[email protected]> * Update prices by 10x Signed-off-by: Georgi Zlatarev <[email protected]> * add integraiton tests duped Signed-off-by: Georgi Zlatarev <[email protected]> * Dedupe Signed-off-by: Georgi Zlatarev <[email protected]> * Add missing test and cleanup Signed-off-by: Georgi Zlatarev <[email protected]> * Fix linters Signed-off-by: Georgi Zlatarev <[email protected]> --------- Signed-off-by: Georgi Zlatarev <[email protected]> Co-authored-by: ferrell-code <[email protected]> Co-authored-by: Jamie <[email protected]>
- Loading branch information
1 parent
fcad226
commit 40e1157
Showing
18 changed files
with
2,129 additions
and
473 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,6 +2,10 @@ name: runtime upgrade test | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
runtime: | ||
description: The runtime for which an upgrade will be tested - manta, calamari or dolphin | ||
default: manta | ||
required: true | ||
manta_base_url: | ||
description: The base manta binary url, that will be upgraded | ||
required: true | ||
|
@@ -17,66 +21,49 @@ env: | |
AWS_SUBNET_ID: subnet-08c26caf0a52b7c19 | ||
AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b | ||
AWS_INSTANCE_TYPE: c5.9xlarge | ||
AWS_INSTANCE_ROOT_VOLUME_SIZE: 32 | ||
AWS_INSTANCE_ROOT_VOLUME_SIZE: 128 | ||
AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* | ||
AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' | ||
RUNTIME: ${{github.event.inputs.runtime}} | ||
RUNTIME_SPEC: ${{github.event.inputs.runtime}}-local | ||
POLKADOT_BINARY: ${{github.event.inputs.polkadot_url}} | ||
MANTA_BINARY: ${{github.event.inputs.manta_base_url}} | ||
jobs: | ||
print-rust-versions: | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: paritytech/ci-linux:production | ||
outputs: | ||
rustc-stable: ${{ steps.get-rust-versions.outputs.stable }} | ||
rustc-nightly: ${{ steps.get-rust-versions.outputs.nightly }} | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- id: get-rust-versions | ||
run: | | ||
echo "::set-output name=stable::$(rustc +stable --version)" | ||
echo "::set-output name=nightly::$(rustc +nightly --version)" | ||
build-runtimes: | ||
needs: check-for-runtime-upgrade | ||
runs-on: ubuntu-20.04 | ||
env: | ||
CARGO_TERM_COLOR: always | ||
strategy: | ||
matrix: | ||
runtime: | ||
- name: calamari | ||
- name: manta | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: cache target dir | ||
uses: actions/cache@v2 | ||
with: | ||
path: "${{ github.workspace }}/runtime/${{ matrix.runtime.name }}/target" | ||
key: srtool-target-${{ matrix.runtime.name }}-${{ github.sha }} | ||
path: "${{ github.workspace }}/runtime/${{ env.RUNTIME }}/target" | ||
key: srtool-target-${{ env.RUNTIME }}-${{ github.sha }} | ||
restore-keys: | | ||
srtool-target-${{ matrix.runtime.name }} | ||
srtool-target-${{ env.RUNTIME }} | ||
- name: build runtime | ||
id: srtool-build | ||
uses: chevdor/[email protected] | ||
with: | ||
image: paritytech/srtool | ||
chain: ${{ matrix.runtime.name }} | ||
tag: 1.66.1 | ||
chain: ${{ env.RUNTIME }} | ||
- name: persist srtool digest | ||
run: > | ||
echo '${{ steps.srtool-build.outputs.json }}' | | ||
jq > ${{ matrix.runtime.name }}-srtool-output.json | ||
jq > ${{ env.RUNTIME }}-srtool-output.json | ||
- if: always() | ||
name: upload srtool json | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.runtime.name }}-srtool-json | ||
path: ${{ matrix.runtime.name }}-srtool-output.json | ||
name: ${{ env.RUNTIME }}-srtool-json | ||
path: ${{ env.RUNTIME }}-srtool-output.json | ||
- if: always() | ||
name: upload runtime | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.runtime.name }}-runtime | ||
name: ${{ env.RUNTIME }}-runtime | ||
path: | | ||
${{ steps.srtool-build.outputs.wasm }} | ||
${{ steps.srtool-build.outputs.wasm_compressed }} | ||
|
@@ -87,21 +74,13 @@ jobs: | |
name: config-for-runtime-upgrade-test | ||
path: .github/resources/config-for-runtime-upgrade-test.json | ||
runtime-upgrade-test: | ||
needs: [build-runtimes, start-runtime-upgrade-tester, check-for-runtime-upgrade, parse-runtimes] | ||
needs: [build-runtimes, start-runtime-upgrade-tester] | ||
runs-on: ${{ needs.start-runtime-upgrade-tester.outputs.runner-label }} | ||
timeout-minutes: 90 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runtime: | ||
- name: manta | ||
chain-spec: manta-local | ||
- name: calamari | ||
chain-spec: calamari-local | ||
steps: | ||
- run: | | ||
ls -ahl ${{ github.workspace }}/ | ||
mkdir -p $HOME/.local/share/${{ matrix.runtime.name }}-pc | ||
mkdir -p $HOME/.local/share/${{ env.RUNTIME }}-pc | ||
mkdir -p $HOME/.local/bin | ||
echo "${HOME}/.nvm/versions/node/v16.3.0/bin" >> $GITHUB_PATH | ||
echo "${HOME}/.local/bin" >> $GITHUB_PATH | ||
|
@@ -120,20 +99,20 @@ jobs: | |
ls -ahl $HOME/.local/bin/ | ||
- id: create-chainspec | ||
run: | | ||
manta-base build-spec --chain ${{ matrix.runtime.chain-spec }} --disable-default-bootnode --raw > $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-spec.json | ||
manta-base build-spec --chain ${{ env.RUNTIME_SPEC }} --disable-default-bootnode --raw > $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-spec.json | ||
jq \ | ||
--sort-keys \ | ||
--arg name "${{ matrix.runtime.name }} testnet base" \ | ||
--arg id ${{ matrix.runtime.chain-spec }}-base \ | ||
--arg name "${{ env.RUNTIME }} testnet base" \ | ||
--arg id ${{ env.RUNTIME_SPEC }}-base \ | ||
--arg relay_chain rococo-local-base \ | ||
'. | | ||
.name = $name | | ||
.id = $id | | ||
.relay_chain = $relay_chain | | ||
.telemetryEndpoints = [["/dns/api.telemetry.manta.systems/tcp/443/x-parity-wss/%2Fsubmit%2F", 0]] | ||
' $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-spec.json > $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-spec.json | ||
ls -ahl $HOME/.local/share/${{ matrix.runtime.name }}-pc/ | ||
manta-base export-state --chain $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-spec.json > $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-state.json || true | ||
' $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-spec.json > $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-spec.json | ||
ls -ahl $HOME/.local/share/${{ env.RUNTIME }}-pc/ | ||
manta-base export-state --chain $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-spec.json > $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-state.json || true | ||
- name: fetch config-for-runtime-upgrade-test | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
@@ -147,16 +126,16 @@ jobs: | |
--arg relaychain_id rococo-local-base \ | ||
--arg relaychain_name "rococo local base" \ | ||
--arg parachains_bin $HOME/.local/bin/manta-base \ | ||
--arg parachains_spec $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-spec.json \ | ||
--arg parachains_spec $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-spec.json \ | ||
'. | ||
| .relaychain.bin = $relaychain_bin | ||
| .relaychain.mutation.id = $relaychain_id | ||
| .relaychain.mutation.name = $relaychain_name | ||
| .parachains[].bin = $parachains_bin | ||
| .parachains[].chain = $parachains_spec | ||
' > $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-launch-config.json | ||
jq . $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-launch-config.json | ||
ls -ahl $HOME/.local/share/${{ matrix.runtime.name }}-pc/ | ||
' > $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-launch-config.json | ||
jq . $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-launch-config.json | ||
ls -ahl $HOME/.local/share/${{ env.RUNTIME }}-pc/ | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: paritytech/polkadot-launch | ||
|
@@ -172,30 +151,30 @@ jobs: | |
yarn build | ||
pm2 start dist/cli.js \ | ||
--name polkadot-launch \ | ||
--output ${{ github.workspace }}/polkadot-launch-for-${{ matrix.runtime.chain-spec }}-stdout.log \ | ||
--error ${{ github.workspace }}/polkadot-launch-for-${{ matrix.runtime.chain-spec }}-stderr.log \ | ||
--output ${{ github.workspace }}/polkadot-launch-for-${{ env.RUNTIME_SPEC }}-stdout.log \ | ||
--error ${{ github.workspace }}/polkadot-launch-for-${{ env.RUNTIME_SPEC }}-stderr.log \ | ||
--no-autorestart \ | ||
-- $HOME/.local/share/${{ matrix.runtime.name }}-pc/${{ matrix.runtime.chain-spec }}-base-launch-config.json | ||
- name: fetch new ${{ matrix.runtime.name }}_runtime.compact.compressed.wasm | ||
-- $HOME/.local/share/${{ env.RUNTIME }}-pc/${{ env.RUNTIME_SPEC }}-base-launch-config.json | ||
- name: fetch new ${{ env.RUNTIME }}_runtime.compact.compressed.wasm | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ matrix.runtime.name }}-runtime | ||
name: ${{ env.RUNTIME }}-runtime | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: Manta-Network/Manta | ||
path: Manta | ||
- name: run test suites | ||
run: | | ||
sleep 120 | ||
cp ${{ github.workspace }}/${{ matrix.runtime.name }}_runtime.compact.compressed.wasm ${{ github.workspace }}/Manta/tests/calamari.wasm | ||
cp ${{ github.workspace }}/${{ env.RUNTIME }}_runtime.compact.compressed.wasm ${{ github.workspace }}/Manta/tests/calamari.wasm | ||
cd ${{ github.workspace }}/Manta/tests | ||
yarn install | ||
yarn | ||
yarn runtime_upgrade_test --address=ws://127.0.0.1:9921 --exit | ||
if [ $? != 0 ]; then echo "Runtime upgrade failed!"; exit 1; fi | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.chain-spec.id }}-alice.log | ||
name: ${{ env.RUNTIME_SPEC }}-alice.log | ||
path: ${{ github.workspace }}/polkadot-launch/9921.log | ||
# HELPER JOBS BELOW | ||
start-runtime-upgrade-tester: | ||
|
@@ -214,15 +193,13 @@ jobs: | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
aws-subnet-id: ${{ env.AWS_SUBNET_ID }} | ||
aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} | ||
aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} | ||
aws-instance-root-volume-size: 64 | ||
aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} | ||
aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} | ||
aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} | ||
stop-runtime-upgrade-tester: | ||
if: ${{ always() }} | ||
needs: [runtime-upgrade-test, check-for-runtime-upgrade, start-runtime-upgrade-tester] | ||
needs: [runtime-upgrade-test, start-runtime-upgrade-tester] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- continue-on-error: true | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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
Oops, something went wrong.