Skip to content

Commit

Permalink
Add Collectives Parachain (#1346)
Browse files Browse the repository at this point in the history
* add new runtime and remove unnecessary pallets

* make runtime build

* add collectives to collator node

* sketch alliance config in runtime

* Slash handler was supposed to be commented out (for now)

* correct signature

* move to impls

* add alliance to runtime

* rustfmt

* IsReserve, remove Ping, update fn deposit

* add transaction_payment event

* Update parachains/runtimes/collectives/collectives-polkadot/src/lib.rs

Co-authored-by: Squirrel <gilescope@gmail.com>

* fmt

* add genesis config to chain spec

* fix merge

* local and dev configs only (for now)

* remove duplicate imports

* Collectives polkadot runtime to cargo workspace members (#1397)

* Collectives polkadot runtime: use unit type impl for identity verifier (#1398)

* apply fn rename

* fmt

* one less todo

* Less code in magic macros (#1407)

* Less code in magic macros

* cargo fmt

* Bench alliance (#1427)

* add benchmarks

* call one script from the other

* shebang changes so works on nixos too.

* bench in parallel as separate jobs

* hyphens can turn into underscores

* remove workaround to trigger bench

Co-authored-by: alvicsam <alvicsam@gmail.com>
Co-authored-by: paritytech-ci <paritytech-ci@parity.io>

* enable ci jobs

* fix publish bench results jobs

* chainspecs for collectives-westend (#1441)

* initial chainspecs for collections relay chain

* plumb in the collectives-westend chainspec

* add Runtime::CollectivesWestend

* lock

* Collectives: teleport slashed assets  (#1433)

* Collectives: teleport slashed assets

* fmt

* Cargo.lock > polkadot-parachain 0.9.25

* create temp account for imbalance

* treasury acc id from pallet id

* move accounts into constants, use here junction for assets

* assets location is relay chain, accounts as parameters

* fix typos

* fix typo

* Update parachains/runtimes/collectives/collectives-polkadot/src/constants.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Move alliance proposal provider to impls.rs (#1464)

* Move to impls alliance proposal provider

* rustfmt

* Bumping spec version

(so that we can redeploy with slashing change.)

* cargo lock

* slurp collectives digest to make appear in release notes (#1473)

* add slurp

* Slurp better :)

* Bring some order

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Wilfried Kopp <wilfried@parity.io>

* reorder barrier

* Update parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* address review

* clean construct runtime

* fmt

* looks pretty but brings in too much

Co-authored-by: Squirrel <gilescope@gmail.com>
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
Co-authored-by: alvicsam <alvicsam@gmail.com>
Co-authored-by: paritytech-ci <paritytech-ci@parity.io>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Wilfried Kopp <wilfried@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
  • Loading branch information
8 people authored Aug 11, 2022
1 parent 4d62048 commit 0e83ad2
Show file tree
Hide file tree
Showing 37 changed files with 3,419 additions and 127 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release-30_create-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: collectives
runtime: collectives-polkadot
- category: contracts
runtime: contracts-rococo
- category: starters
Expand Down Expand Up @@ -148,6 +150,7 @@ jobs:
WESTMINT_DIGEST: ${{ github.workspace}}/westmint-srtool-json/westmint-srtool-digest.json
STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine-srtool-digest.json
STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json
COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json
ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json
CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json
REF1: ${{ github.event.inputs.ref1 }}
Expand All @@ -162,6 +165,7 @@ jobs:
ls -al $WESTMINT_DIGEST || true
ls -al $STATEMINE_DIGEST || true
ls -al $STATEMINT_DIGEST || true
ls -al $COLLECTIVES_POLKADOT_DIGEST || true
ls -al $ROCOCO_PARA_DIGEST || true
ls -al $CANVAS_KUSAMA_DIGEST || true
fi
Expand Down Expand Up @@ -212,6 +216,8 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: collectives
runtime: collectives-polkadot
- category: contracts
runtime: contracts-rococo
- category: starters
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
runtime: statemint
- category: assets
runtime: westmint
- category: collectives
runtime: collectives-polkadot
- category: contracts
runtime: contracts-rococo
- category: starters
Expand Down
67 changes: 48 additions & 19 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,46 +299,69 @@ benchmarks-build:
- mkdir -p artifacts
- cp target/production/polkadot-parachain ./artifacts/

benchmarks:
.git-commit-push: &git-commit-push
- git status
# Set git config
- rm -rf .git/config
- git config --global user.email "${GITHUB_EMAIL}"
- git config --global user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
# push results to github
- git checkout -b $BRANCHNAME
- git add parachains/*
- git commit -m "[benchmarks] pr with weights"
- git push origin $BRANCHNAME

benchmarks-statemint:
stage: benchmarks-run
before_script:
- *rust-info-script
<<: *collect-artifacts
<<: *benchmarks-refs
timeout: 1d
script:
- ./scripts/benchmarks-ci.sh assets statemine
- ./scripts/benchmarks-ci.sh assets statemint
- ./scripts/benchmarks-ci.sh assets westmint
- git status
- export BRANCHNAME="weights-${CI_COMMIT_BRANCH}"
# Set git config
- ./scripts/benchmarks-ci.sh assets statemine ./artifacts
- ./scripts/benchmarks-ci.sh assets statemint ./artifacts
- ./scripts/benchmarks-ci.sh assets westmint ./artifacts
- export BRANCHNAME="weights-statemint-${CI_COMMIT_BRANCH}"
- *git-commit-push
# create PR
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
after_script:
- rm -rf .git/config
- git config --global user.email "${GITHUB_EMAIL}"
- git config --global user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
# push results to github
- git checkout -b $BRANCHNAME
- git add parachains/*
- git commit -m "[benchmarks] pr with weights"
- git push origin $BRANCHNAME
tags:
- weights

benchmarks-collectives:
stage: benchmarks-run
before_script:
- *rust-info-script
<<: *collect-artifacts
<<: *benchmarks-refs
script:
- ./scripts/benchmarks-ci.sh collectives collectives-polkadot ./artifacts
- git status
- export BRANCHNAME="weights-collectives-${CI_COMMIT_BRANCH}"
- *git-commit-push
# create PR
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-d '{"title":"[benchmarks] Update weights for collectives","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
after_script:
- rm -rf .git/config
tags:
- weights

publish-benchmarks-s3:
publish-benchmarks-statemint-s3: &publish-benchmarks
stage: publish
<<: *kubernetes-env
image: paritytech/awscli:latest
<<: *benchmarks-refs
needs:
- job: benchmarks
- job: benchmarks-statemint
artifacts: true
variables:
GIT_STRATEGY: none
Expand All @@ -352,6 +375,12 @@ publish-benchmarks-s3:
after_script:
- aws s3 ls s3://${BUCKET}/${PREFIX}/ --recursive --human-readable --summarize

publish-benchmarks-collectives-s3:
<<: *publish-benchmarks
needs:
- job: benchmarks-collectives
artifacts: true

# Ref: https://github.com/paritytech/opstooling/issues/111
update-parachain-template:
stage: publish
Expand Down
87 changes: 87 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ members = [
"parachains/runtimes/assets/statemint",
"parachains/runtimes/assets/statemine",
"parachains/runtimes/assets/westmint",
"parachains/runtimes/collectives/collectives-polkadot",
"parachains/runtimes/contracts/contracts-rococo",
"parachains/runtimes/testing/penpal",
"test/client",
Expand Down
84 changes: 84 additions & 0 deletions parachains/chain-specs/collectives-polkadot.json

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions parachains/chain-specs/collectives-westend.json

Large diffs are not rendered by default.

Loading

0 comments on commit 0e83ad2

Please sign in to comment.