Skip to content

Commit

Permalink
main.into()
Browse files Browse the repository at this point in the history
  • Loading branch information
kianenigma committed Sep 30, 2023
2 parents aa0d292 + c86afcc commit 9dd5388
Show file tree
Hide file tree
Showing 265 changed files with 26,578 additions and 21,689 deletions.
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ rustflags = [
"-Aclippy::needless_option_as_deref", # false positives
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
]
"-Aclippy::extra-unused-type-parameters", # stylistic
]
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cargo.lock linguist-generated=true
relay/**/src/weights/*.rs linguist-generated=true
system-parachains/**/**/src/weights/*.rs linguist-generated=true
32 changes: 32 additions & 0 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
rules:
- name: CI Files
condition:
include:
- ^\.github/.*
type: fellows
minRank: 4
minApprovals: 2
- name: Relay and system files
condition:
include:
- ^relay\/kusama\/.*
- ^relay\/polkadot\/.*
- ^system-parachains\/.*
- ^CHANGELOG$
exclude:
- ^relay\/.+\.adoc$
type: fellows
minRank: 3
minApprovals: 4
- name: General Files
condition:
include:
- '.*'
exclude:
- ^relay\/kusama\/.*
- ^relay\/polkadot\/.*
- ^\.github/.*
- ^system-parachains\/.*
- ^target\/.*
type: fellows
minRank: 2
4 changes: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
uses: actions/checkout@v3

- name: Fetch cache
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0

- name: Clippy
run: cargo +nightly clippy --all-targets
run: cargo +nightly clippy --all-targets --locked -q
env:
SKIP_WASM_BUILD: 1
10 changes: 10 additions & 0 deletions .github/workflows/release-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{ "name": "polkadot", "package": "polkadot-runtime", "path": "relay/polkadot" },
{ "name": "kusama", "package": "staging-kusama-runtime", "path": "relay/kusama" },
{ "name": "glutton-kusama", "package": "glutton-kusama-runtime", "path": "system-parachains/gluttons/glutton-kusama" },
{ "name": "asset-hub-kusama", "package": "asset-hub-kusama-runtime", "path": "system-parachains/asset-hubs/asset-hub-kusama" },
{ "name": "asset-hub-polkadot", "package": "asset-hub-polkadot-runtime", "path": "system-parachains/asset-hubs/asset-hub-polkadot" },
{ "name": "bridge-hub-kusama", "package": "bridge-hub-kusama-runtime", "path": "system-parachains/bridge-hubs/bridge-hub-kusama" },
{ "name": "bridge-hub-polkadot", "package": "bridge-hub-polkadot-runtime", "path": "system-parachains/bridge-hubs/bridge-hub-polkadot" },
{ "name": "collectives-polkadot", "package": "collectives-polkadot-runtime", "path": "system-parachains/collectives/collectives-polkadot" }
]
75 changes: 34 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,73 @@ name: Create Draft Release

on:
push:
branches:
- main
paths:
- CHANGELOG
branches: [ "main" ]
paths: [ "CHANGELOG.md" ]
workflow_dispatch:

jobs:
enumerate:
runtime-matrix:
runs-on: ubuntu-latest
outputs:
runtime: ${{ steps.generate-matrix.outputs.runtime }}
runtime: ${{ steps.runtime.outputs.runtime }}
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Generate runtime matrix
id: generate-matrix
- uses: actions/checkout@v2
- id: runtime
run: |
>>$GITHUB_OUTPUT echo runtime="[$(find * -name "lib.rs" -not -path "*/common/*" -not -path "*/constants/*" | awk -F/ '{sub("/src/lib.rs",""); print "[\"" gensub("/" $NF "$", "", "g") "\",\"" $NF "\"],"}' | tr -d $'\n')]"
TASKS=$(echo $(cat .github/workflows/release-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
build-runtimes:
needs: [ runtime-matrix ]
continue-on-error: true
runs-on: ubuntu-latest
needs:
- enumerate
strategy:
matrix:
runtime: ${{ fromJSON(needs.enumerate.outputs.runtime) }}
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Cache target dir
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/${{ matrix.runtime[0] }}/${{ matrix.runtime[1] }}/target"
key: srtool-target-${{ matrix.runtime[0] }}-${{ matrix.runtime[1] }}-${{ github.sha }}
path: "${{ github.workspace }}/${{ matrix.runtime.path }}/target"
key: srtool-target-${{ matrix.runtime.path }}-${{ matrix.runtime.name }}-${{ github.sha }}
restore-keys: |
srtool-target-${{ matrix.runtime[0] }}-${{ matrix.runtime[1] }}-
srtool-target-${{ matrix.runtime[0] }}-
srtool-target-${{ matrix.runtime.path }}-${{ matrix.runtime.name }}-
srtool-target-${{ matrix.runtime.path }}-
- name: Build ${{ matrix.runtime[1] }}
- name: Build ${{ matrix.runtime.name }}
id: srtool_build
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features on-chain-release-build"
with:
chain: ${{ matrix.runtime[1] }}
runtime_dir: "${{ matrix.runtime[0] }}/${{ matrix.runtime[1] }}"
chain: ${{ matrix.runtime.name }}
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
profile: "production"

- name: Store ${{ matrix.runtime[1] }} srtool digest to disk
- name: Store ${{ matrix.runtime.name }} srtool digest to disk
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime[1] }}_srtool_output.json
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime.name }}_srtool_output.json
- name: Upload ${{ matrix.runtime[1] }} srtool json
- name: Upload ${{ matrix.runtime.name }} srtool json
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.runtime[1] }}-srtool-json
path: ${{ matrix.runtime[1] }}_srtool_output.json
name: ${{ matrix.runtime.name }}-srtool-json
path: ${{ matrix.runtime.name }}_srtool_output.json

- name: Upload ${{ matrix.runtime[1] }}
- name: Upload ${{ matrix.runtime.name }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.runtime[1] }}
name: ${{ matrix.runtime.name }}
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}
publish-draft-release:
runs-on: ubuntu-latest
needs:
- build-runtimes
needs: [ build-runtimes ]
outputs:
release_url: ${{ steps.create-release.outputs.html_url }}
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
Expand All @@ -99,7 +94,7 @@ jobs:
tee -a DRAFT <<-EOF
## Changelog
EOF
tee -a DRAFT <CHANGELOG
tee -a DRAFT <CHANGELOG.md
tee -a DRAFT <<-EOF
## Runtime info
*These runtimes were built with **$(SRTOOL rustc)** using **[$(SRTOOL gen)](https://github.com/paritytech/srtool)***
Expand Down Expand Up @@ -132,16 +127,14 @@ jobs:
draft: true

publish-runtimes:
needs: [ runtime-matrix, publish-draft-release ]
continue-on-error: true
runs-on: ubuntu-latest
env:
RUNTIME_DIR: runtime
needs:
- publish-draft-release
- enumerate
strategy:
matrix:
runtime: ${{ fromJSON(needs.enumerate.outputs.runtime) }}
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -151,18 +144,18 @@ jobs:

- name: Get runtime info
env:
JSON: release-notes-context/${{ matrix.runtime[1] }}-srtool-json/${{ matrix.runtime[1] }}_srtool_output.json
JSON: release-notes-context/${{ matrix.runtime.name }}-srtool-json/${{ matrix.runtime.name }}_srtool_output.json
run: |
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.runtime[1] }} -name '*.compact.compressed.wasm')
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.runtime.name }} -name '*.compact.compressed.wasm')
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
>>$GITHUB_ENV echo TXVER=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.transactionVersion)
- name: Upload compressed ${{ matrix.runtime[1] }} v${{ env.SPEC }} tx${{ env.TXVER }} wasm
- name: Upload compressed ${{ matrix.runtime.name }} v${{ env.SPEC }} tx${{ env.TXVER }} wasm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ matrix.runtime[1] }}_runtime-v${{ env.SPEC }}.tx${{ env.TXVER }}.compact.compressed.wasm
asset_name: ${{ matrix.runtime.name }}_runtime-v${{ env.SPEC }}.tx${{ env.TXVER }}.compact.compressed.wasm
asset_content_type: application/wasm
32 changes: 32 additions & 0 deletions .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Review PR
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:

permissions:
contents: read
checks: write

jobs:
review-approvals:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: team_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
checks-token: ${{ steps.team_token.outputs.token }}
16 changes: 14 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -38,9 +49,10 @@ jobs:
uses: actions/checkout@v3

- name: Fetch cache
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0

- name: Test all features
run: cargo test --workspace --release --locked --features=runtime-benchmarks,runtime-metrics,try-runtime
run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1
45 changes: 36 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
**/target/
**/*.rs.bk
*.swp
.wasm-binaries
runtime/wasm/target/
**/._*
!polkadot.service
.cargo-remote.toml
.direnv/
.DS_Store
.env*
.idea
.local
.vscode
.wasm-binaries
*.adoc
*.bin
*.iml
*.orig
*.rej
*.swp
**/._*
**/.criterion/
**/*.rs.bk
**/chains/
**/hfuzz_target/
**/hfuzz_workspace/
**/node_modules
**/target/
**/wip/*.stderr
/.cargo/config
/.envrc
artifacts
bin/node-template/Cargo.lock
nohup.out
polkadot_argument_parsing
polkadot.*
!polkadot.service
.DS_Store
.env
pwasm-alloc/Cargo.lock
pwasm-libc/Cargo.lock
release-artifacts
release.json
rls*.log
runtime/wasm/target/
substrate.code-workspace
target/
8 changes: 4 additions & 4 deletions rustfmt.toml → .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Basic
edition = "2021"
hard_tabs = true
max_width = 100
use_small_heuristics = "Max"
Expand All @@ -18,7 +19,6 @@ match_block_trailing_comma = true
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true
ignore = [
"bridges",
]
edition = "2021"
# Format comments
comment_width = 100
wrap_comments = true
1 change: 0 additions & 1 deletion CHANGELOG

This file was deleted.

42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

Changelog for the runtimes governed by the Polkadot Fellowship.

## [1.0.0]

### Changed

- Treasury deprecate `propose_spend` dispatchable ([paritytech/substrate#14538](https://github.com/paritytech/substrate/pull/14538))
- Use benchmarked weights for `XCM` ([paritytech/polkadot#7077](https://github.com/paritytech/polkadot/pull/7077))
- Put HRMP Channel Management on General Admin Track ([paritytech/polkadot#7477](https://github.com/paritytech/polkadot/pull/7477))
- Improve locking mechanism for parachains ([paritytech/polkadot-sdk#1290](https://github.com/paritytech/polkadot-sdk/pull/1290))
- Allow Root to initiate auctions ([paritytech/polkadot#7449](https://github.com/paritytech/polkadot/pull/7449))
- Remark: Allow any kind of origin ([paritytech/substrate#14260](https://github.com/paritytech/substrate/pull/14260))
- Im-Online: Remove network state from heartbeats ([paritytech/substrate#14251](https://github.com/paritytech/substrate/pull/14251))
- Nomination pools: disallow setting above global max commission ([paritytech/substrate#14496](https://github.com/paritytech/substrate/pull/14496))
- Rename Statemint/Statemine to Asset Hub ([paritytech/cumulus#2633](https://github.com/paritytech/cumulus/pull/2633))
- Fellowship: Voters can initiate proposals on their votable tracks ([paritytech/cumulus#2725](https://github.com/paritytech/cumulus/pull/2725))
- Root can promote on Polkadot Collectives ([paritytech/cumulus#2781](https://github.com/paritytech/cumulus/pull/2781))
- Add New Assets Privileged Functions to Appropriate Proxy Types ([paritytech/cumulus#2839](https://github.com/paritytech/cumulus/pull/2839))
- Better Handling of Candidates Who Become Invulnerable ([paritytech/cumulus#2801](https://github.com/paritytech/cumulus/pull/2801))

### Added

- Implement dynamic number of nominators ([paritytech/substrate#12970](https://github.com/paritytech/substrate/pull/12970) & [paritytech/polkadot#6807](https://github.com/paritytech/polkadot/pull/6807))
- Upgrade Kusama to Society V2 ([paritytech/polkadot#7356](https://github.com/paritytech/polkadot/pull/7356))
- Kusama state version switch and migration ([paritytech/polkadot#7015](https://github.com/paritytech/polkadot/pull/7015))
- Add Nomination Pools and Voters List to Staking Proxy ([paritytech/polkadot#7448](https://github.com/paritytech/polkadot/pull/7448))
- Add minting price to the pre-signed mint object ([paritytech/substrate#14242](https://github.com/paritytech/substrate/pull/14242))
- Add mint price to the witness object on mint and confirm it ([paritytech/substrate#14257](https://github.com/paritytech/substrate/pull/14257))
- Stabilize Metadata V15 ([paritytech/substrate#14481](https://github.com/paritytech/substrate/pull/14481))
- Add Ability to Add/Remove Invulnerable Collators ([paritytech/cumulus#2596](https://github.com/paritytech/cumulus/pull/2596))
- Polkadot Fellowship promotion/demotion periods, members activity and salaries ([paritytech/cumulus#2607](https://github.com/paritytech/cumulus/pull/2607))

### Fixed

- Unlock/unreserve Gov v1 balances and remove kvs ([paritytech/polkadot#7314](https://github.com/paritytech/polkadot/pull/7314))
- Polkadot 28 days as conviction voting period ([paritytech/polkadot#7595](https://github.com/paritytech/polkadot/pull/7595))
- XCM: Fix issue with RequestUnlock ([paritytech/polkadot#7278](https://github.com/paritytech/polkadot/pull/7278))
- Clear Existing HRMP Channel Request When Force Opening ([paritytech/polkadot#7389](https://github.com/paritytech/polkadot/pull/7389))
- Prune upgrade cooldowns ([paritytech/polkadot#7470](https://github.com/paritytech/polkadot/pull/7470))
- Assets `destroy_accounts` releases the deposit ([paritytech/substrate#14443](https://github.com/paritytech/substrate/pull/14443))
Loading

0 comments on commit 9dd5388

Please sign in to comment.