Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
dir restructure to support more CGP (#1266)
Browse files Browse the repository at this point in the history
* rerame res to chain-specs

* split polkadot-parachains dir

* rename dir parachains-common to common

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Wilfried Kopp <wilfried@parity.io>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
  • Loading branch information
4 people committed May 20, 2022
1 parent 820153b commit 9405a96
Show file tree
Hide file tree
Showing 138 changed files with 197 additions and 151 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Until #631 is done, running the benchmarks is a manual process:
5. From the root directory run `nohup ./scripts/benchmarks.sh &` (it will take quite a few hours)
6. Checkout in your local machine to the branch of cumulus that has the version of Statemine you want to release
7. `scp` from the host to your local machine the weights for Statemine, Westmint and Statemint you'll find in:
- `/polkadot-parachains/statemine/src/weights`
- `/polkadot-parachains/westmint/src/weights`
- `/polkadot-parachains/statemint/src/weights`
- `/parachains/runtimes/assets/statemine/src/weights`
- `/parachains/runtimes/assets/statemint/src/weights`
- `/parachains/runtimes/assets/westmint/src/weights`
8. Commit the changes in your local and create a PR
4 changes: 2 additions & 2 deletions .github/pr-custom-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ action-review-team: ci
rules:
- name: Runtime files
check_type: changed_files
condition: ^polkadot-parachains/(statemine|statemint)/src/[^/]+\.rs$
condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$
all_distinct:
- min_approvals: 1
teams:
Expand All @@ -20,7 +20,7 @@ rules:
condition:
include: .*
# excluding files from 'Runtime files' and 'CI team' rules
exclude: ^polkadot-parachains/(statemine|statemint)/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.*
exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.*
min_approvals: 2
teams:
- core-devs
Expand Down
48 changes: 38 additions & 10 deletions .github/workflows/release-02_create-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
inputs:
ref1:
description: The 'from' tag to use for the diff
default: parachains-v7.0.0
default: parachains-v9.0.0
required: true
ref2:
description: The 'to' tag to use for the diff
default: release-parachains-v8.0.0
default: release-parachains-v10.0.0
required: true
release_type:
description: Pass "client" for client releases, leave empty otherwise
Expand Down Expand Up @@ -42,8 +42,22 @@ jobs:
build-runtimes:
runs-on: ubuntu-latest
strategy:
matrix:
runtime: ["shell", "statemine", "statemint", "westmint", "rococo-parachain", "contracts-rococo"]
matrix:
include:
- category: assets
runtime: statemine
- category: assets
runtime: statemint
- category: assets
runtime: westmint
- category: contracts
runtime: contracts-rococo
- category: starters
runtime: seedling
- category: starters
runtime: shell
- category: testing
runtime: rococo-parachain
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -67,7 +81,7 @@ jobs:
with:
image: paritytech/srtool
chain: ${{ matrix.runtime }}
runtime_dir: polkadot-parachains/${{ matrix.runtime }}
runtime_dir: parachains/runtimes/${{ matrix.category }}/${{ matrix.runtime }}

- name: Store srtool digest to disk
if: ${{ github.event.inputs.release_type != 'client' }}
Expand Down Expand Up @@ -188,10 +202,24 @@ jobs:
runs-on: ubuntu-latest
needs: ["publish-draft-release"]
env:
RUNTIME_DIR: polkadot-parachains
RUNTIME_DIR: parachains/runtimes
strategy:
matrix:
runtime: ["shell", "statemine", "statemint", "westmint", "rococo-parachain", "contracts-rococo"]
matrix:
include:
- category: assets
runtime: statemine
- category: assets
runtime: statemint
- category: assets
runtime: westmint
- category: contracts
runtime: contracts-rococo
- category: starters
runtime: seedling
- category: starters
runtime: shell
- category: testing
runtime: rococo-parachain
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -209,10 +237,10 @@ jobs:
id: get-runtime-ver
run: |
echo "require './scripts/ci/github/runtime-version.rb'" > script.rb
echo "puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR\")" >> script.rb
echo "puts get_runtime(runtime: \"${{ matrix.runtime }}\", runtime_dir: \"$RUNTIME_DIR/${{ matrix.category }}\")" >> script.rb
echo "Current folder: $PWD"
ls "$RUNTIME_DIR/${{ matrix.runtime }}"
ls "$RUNTIME_DIR/${{ matrix.category }}/${{ matrix.runtime }}"
runtime_ver=$(ruby script.rb)
echo "Found version: >$runtime_ver<"
echo "::set-output name=runtime_ver::$runtime_ver"
Expand Down
65 changes: 41 additions & 24 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
tags:
- "*"

paths-ignore:
- "docker"
- "docs"
- "scripts"
- "test"
# paths-ignore:
# - "docker"
# - "docs"
# - "scripts"
# - "test"
# - "client"
paths:
- parachains/runtimes/**/*

branches:
- "release*"
Expand All @@ -27,7 +30,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["statemine", "westmint", "statemint", "rococo-parachain", "shell", "contracts-rococo"]
include:
- category: assets
runtime: statemine
- category: assets
runtime: statemint
- category: assets
runtime: westmint
- category: contracts
runtime: contracts-rococo
- category: starters
runtime: seedling
- category: starters
runtime: shell
- category: testing
runtime: rococo-parachain
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -37,25 +54,25 @@ jobs:
id: srtool_build
uses: chevdor/srtool-actions@v0.4.0
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}
chain: ${{ matrix.runtime }}
runtime_dir: parachains/runtimes/${{ matrix.category }}/${{ matrix.runtime }}

- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json
cat ${{ matrix.chain }}-srtool-digest.json
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}-srtool-digest.json
cat ${{ matrix.runtime }}-srtool-digest.json
echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}"
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
# it takes a while to build the runtime, so let's save the artifact as soon as we have it
- name: Archive Artifacts for ${{ matrix.chain }}
- name: Archive Artifacts for ${{ matrix.runtime }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime
name: ${{ matrix.runtime }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.chain }}-srtool-digest.json
${{ matrix.runtime }}-srtool-digest.json
# We now get extra information thanks to subwasm
- name: Install subwasm
Expand All @@ -69,29 +86,29 @@ jobs:
run: |
subwasm info ${{ steps.srtool_build.outputs.wasm }}
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }}
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-compressed-info.json
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime }}-info.json
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.runtime }}-compressed-info.json
- name: Extract the metadata
shell: bash
run: |
subwasm meta ${{ steps.srtool_build.outputs.wasm }}
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime }}-metadata.json
- name: Check the metadata diff
shell: bash
# the following subwasm call will error for chains that are not known and/or live, that includes shell for instance
run: |
subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} || \
echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | \
tee ${{ matrix.chain }}-diff.txt
subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.runtime }} || \
echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.runtime }} is not known by subwasm" | \
tee ${{ matrix.runtime }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime
name: ${{ matrix.runtime }}-runtime
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-compressed-info.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt
${{ matrix.runtime }}-info.json
${{ matrix.runtime }}-compressed-info.json
${{ matrix.runtime }}-metadata.json
${{ matrix.runtime }}-diff.txt
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ benchmarks:
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
# push results to github
- git checkout -b $BRANCHNAME
- git add polkadot-parachains/*
- git add parachains/*
- git commit -m "[benchmarks] pr with weights"
- git push origin $BRANCHNAME
# create PR
Expand Down
21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ members = [
"primitives/parachain-inherent",
"primitives/timestamp",
"primitives/utility",
"polkadot-parachains/",
"polkadot-parachains/pallets/parachain-info",
"polkadot-parachains/pallets/ping",
"polkadot-parachains/rococo-parachain",
"polkadot-parachains/shell",
"polkadot-parachains/parachains-common",
"polkadot-parachains/statemint",
"polkadot-parachains/statemine",
"polkadot-parachains/westmint",
"polkadot-parachains/contracts-rococo",
"polkadot-parachain/",
"parachains/common",
"parachains/pallets/parachain-info",
"parachains/pallets/ping",
"parachains/runtimes/testing/rococo-parachain",
"parachains/runtimes/starters/shell",
"parachains/runtimes/starters/seedling",
"parachains/runtimes/assets/statemint",
"parachains/runtimes/assets/statemine",
"parachains/runtimes/assets/westmint",
"parachains/runtimes/contracts/contracts-rococo",
"test/client",
"test/relay-sproof-builder",
"test/relay-validation-worker-provider",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Refer to the [setup instructions below](#local-setup) to run a local network for

## Contracts 📝

See [the `contracts-rococo` readme](polkadot-parachains/contracts-rococo/README.md) for details.
See [the `contracts-rococo` readme](parachains/runtimes/contracts/contracts-rococo/README.md) for details.

## Rococo 👑

Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
volumes:
- "polkadot-data-alice:/data"
- type: bind
source: ./test/parachain/res/polkadot_chainspec.json
source: ./test/parachain/chain-specs/polkadot_chainspec.json
target: /chainspec.json
read_only: true
command: >
Expand Down Expand Up @@ -38,7 +38,7 @@ services:
volumes:
- "polkadot-data-bob:/data"
- type: bind
source: ./test/parachain/res/polkadot_chainspec.json
source: ./test/parachain/chain-specs/polkadot_chainspec.json
target: /chainspec.json
read_only: true
command: >
Expand Down
2 changes: 1 addition & 1 deletion docker/injected.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN apt-get update && \
COPY ./target/release/polkadot-parachain /usr/local/bin
COPY ./target/release/polkadot-parachain.asc /usr/local/bin
COPY ./target/release/polkadot-parachain.sha256 /usr/local/bin
COPY ./polkadot-parachains/res/*.json /specs/
COPY ./parachains/chain-specs/*.json /specs/

USER polkadot

Expand Down
2 changes: 1 addition & 1 deletion parachain-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cumulus-primitives-core = { path = "../../primitives/core", default-features = f
cumulus-primitives-timestamp = { path = "../../primitives/timestamp", default-features = false }
cumulus-primitives-utility = { path = "../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../polkadot-parachains/pallets/parachain-info", default-features = false }
parachain-info = { path = "../../parachains/pallets/parachain-info", default-features = false }

[features]
default = [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }

# Cumulus
cumulus-pallet-aura-ext = { path = "../../pallets/aura-ext", default-features = false }
cumulus-pallet-dmp-queue = { path = "../../pallets/dmp-queue", default-features = false }
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false }
cumulus-pallet-session-benchmarking = {path = "../../pallets/session-benchmarking", default-features = false, version = "3.0.0"}
cumulus-pallet-xcm = { path = "../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../pallets/xcmp-queue", default-features = false }
cumulus-ping = { path = "../pallets/ping", default-features = false }
cumulus-primitives-core = { path = "../../primitives/core", default-features = false }
cumulus-primitives-timestamp = { path = "../../primitives/timestamp", default-features = false }
cumulus-primitives-utility = { path = "../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../pallets/parachain-info", default-features = false }
parachains-common = { path = "../parachains-common", default-features = false }
cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false }
cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false }
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false }
cumulus-pallet-session-benchmarking = {path = "../../../../pallets/session-benchmarking", default-features = false, version = "3.0.0"}
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
cumulus-ping = { path = "../../../pallets/ping", default-features = false }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }


[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }

# Cumulus
cumulus-pallet-aura-ext = { path = "../../pallets/aura-ext", default-features = false }
cumulus-pallet-dmp-queue = { path = "../../pallets/dmp-queue", default-features = false }
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false }
cumulus-pallet-session-benchmarking = { path = "../../pallets/session-benchmarking", default-features = false, version = "3.0.0" }
cumulus-pallet-xcm = { path = "../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../pallets/xcmp-queue", default-features = false }
cumulus-ping = { path = "../pallets/ping", default-features = false }
cumulus-primitives-core = { path = "../../primitives/core", default-features = false }
cumulus-primitives-timestamp = { path = "../../primitives/timestamp", default-features = false }
cumulus-primitives-utility = { path = "../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../pallets/parachain-info", default-features = false }
parachains-common = { path = "../parachains-common", default-features = false }
cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false }
cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false }
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false }
cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false, version = "3.0.0" }
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
cumulus-ping = { path = "../../../pallets/ping", default-features = false }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }

[dev-dependencies]
hex-literal = "0.3.4"
Expand Down
Loading

0 comments on commit 9405a96

Please sign in to comment.