Skip to content

Commit

Permalink
Merge branch 'main' into cis-parent-or-siblings
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoaguirre authored Jan 17, 2024
2 parents c34ad83 + 7515fc0 commit 916d3b3
Show file tree
Hide file tree
Showing 329 changed files with 27,588 additions and 13,607 deletions.
23 changes: 20 additions & 3 deletions .github/changelog-processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,38 @@
help="Should a release be made? Prints `1` or `0`.",
action="store_true"
)
group.add_argument(
"--print-changelog-from-last-release",
dest="changelog_last_release",
help="Print the changelog from the last release.",
action="store_true"
)

args = parser.parse_args()

with open(args.changelog, "r") as changelog:
lines = changelog.readlines()

changelog_last_release = ""
found_last_version = False

# Find the latest version
for line in lines:
if not line.startswith("## ["):
changelog_last_release += line
continue
elif not found_last_version:
changelog_last_release += line
found_last_version = True
version = line.strip().removeprefix("## [").split("]")[0]
else:
break

version = line.strip().removeprefix("## [").split("]")[0]
break

if args.print_latest_version:
if args.changelog_last_release:
print(changelog_last_release, end = "")
sys.exit(0)
elif args.print_latest_version:
print(version, end = "")
sys.exit(0)
elif args.should_release:
Expand Down
42 changes: 32 additions & 10 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- name: Download try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.2/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
- name: Install Protoc
Expand All @@ -60,21 +60,43 @@ jobs:

- name: Build ${{ matrix.runtime.name }}
run: |
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked
- name: Check migrations
run: |
PACKAGE_NAME=${{ matrix.runtime.package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
# When running on relay, we don't need weight checks.
NO_WEIGHT_WARNINGS_FLAG=""
EXTRA_FLAGS=""
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then
NO_WEIGHT_WARNINGS_FLAG="--no-weight-warnings"
EXTRA_FLAGS+="--no-weight-warnings"
echo "Disabling weight checks since we are on a relay"
else
echo "Enabling weight checks since we are not on a relay"
fi
# Disable the spec version check when we dont want to release.
if ! .github/changelog-processor.py CHANGELOG.md --should-release ; then
EXTRA_FLAGS+=" --disable-spec-version-check"
echo "Disabling the spec version check since we are not releasing"
else
echo "Enabling the spec version check since we are releasing"
fi
# Disable idempotency checks for now because the Scheduler pallet MigrateToV1 migration is
# non-idempotent at its root in Polkadot SDK V1.2.0. In V1.3.0 we can re-enable
# idempotency checks.
EXTRA_ARGS="--disable-spec-version-check --disable-idempotency-checks"
# Disable idemepotency checks on Polkadot until we enact them.
if [[ "${{ matrix.runtime.name }}" == "polkadot" ]]; then
echo "Disabling the idempotency check since we are on Polkadot"
EXTRA_FLAGS+=" --disable-idempotency-checks"
else
echo "Enabling the idempotency check since we are not on Polkadot"
fi
echo "Flags: $EXTRA_FLAGS"
./try-runtime \
--runtime ./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME \
on-runtime-upgrade --checks=pre-and-post $EXTRA_ARGS $NO_WEIGHT_WARNINGS_FLAG live --uri ${{ matrix.runtime.uri }}
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --checks=pre-and-post \
$EXTRA_FLAGS \
live --uri ${{ matrix.runtime.uri }}
2 changes: 2 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache"

- name: Clippy
run: cargo +nightly clippy --all-targets --locked -q
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,38 @@ jobs:
CONTEXT=$(find . -name '*_srtool_output.json')
SRTOOL() { <$(<<<$CONTEXT head -n1) jq -r .$1; }
WASM() { <${JSON} jq -r ".runtimes.compressed.subwasm.$1"; }
# Copy the relevant parts of the changelog
.github/changelog-processor.py CHANGELOG.md --print-changelog-from-last-release > DRAFT
tee -a DRAFT <<-EOF
EOF
tee -a DRAFT <CHANGELOG.md
tee -a DRAFT <<-EOF
## Runtime info
# Runtime info
*These runtimes were built with **$(SRTOOL rustc)** using **[$(SRTOOL gen)](https://github.com/paritytech/srtool)***
To replicate the build, use the following command:
```sh
srtool build \
--root --profile production \
--package CRATE_NAME --runtime-dir PATH_TO_CRATE \
--build-opts="--features=on-chain-release-build"
```
EOF
for JSON in $(<<<$CONTEXT sort -sr)
do tee -a DRAFT <<-EOF
do
SPEC_NAME=$(WASM 'core_version.specName')
# Check for spec names and adjust the heading accordingly
if [[ "$SPEC_NAME" == "statemint" ]]; then
HEADING="Asset Hub Polkadot (previously Statemint)"
elif [[ "$SPEC_NAME" == "statemine" ]]; then
HEADING="Asset Hub Kusama (previously Statemine)"
else
HEADING=$(WASM 'core_version.specName / "-" | map(. / "" | first |= ascii_upcase | add) | join(" ")')
fi
tee -a DRAFT <<-EOF
### $(WASM 'core_version.specName / "-" | map(. / "" | first |= ascii_upcase | add) | join(" ")')
## $HEADING
~~~
🏋️ Runtime Size: $(numfmt --to iec-i --format "%.2f" $(WASM size)) ($(WASM size) bytes)
🗜 Compressed: $(WASM 'compression | if .compressed then "Yes: \(1 - .size_compressed / .size_decompressed | . * 10000 | round / 100)%" else "No" end')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/[email protected].0
uses: paritytech/[email protected].1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@
"path": "system-parachains/collectives/collectives-polkadot",
"uri": "wss://polkadot-collectives-rpc.polkadot.io:443",
"is_relay": false
},
{
"name": "encointer-kusama",
"package": "encointer-kusama-runtime",
"path": "system-parachains/encointer",
"uri": "wss://kusama.api.encointer.org:443",
"is_relay": false
}
]
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ jobs:

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache"

- name: Test
run: cargo test --workspace --release --locked -q --features=runtime-metrics,try-runtime
env:
RUSTFLAGS: "-C debug-assertions -D warnings"

- name: Test all features
run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/up-to-date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Keep PR up to date

on:
push:
branches:
- main

jobs:
updatePullRequests:
runs-on: ubuntu-latest
environment: master
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.MERGE_APP_ID }}
private_key: ${{ secrets.MERGE_APP_KEY }}
- name: Update all the PRs
uses: paritytech/[email protected]
with:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added

- Introduce chain spec generator ([polkadot-fellows/runtimes#127](https://github.com/polkadot-fellows/runtimes/pull/127))
- Add [Encointer](https://encointer.org) system parachain runtime, completing [RFC22](https://github.com/polkadot-fellows/RFCs/blob/main/text/0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80))

## [1.1.0] 10.01.2024

### Changed

- Upgrade parachains runtime API from v5 to v7 in Polkadot and Kusama ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Upgrade Preimage pallet's config implementations to adapt the new `Consideration` API ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Remove `experimental` feature flag for `pallet-society`, `pallet-xcm`, and `runtime-common` crates imports ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Election provider: use a geometric deposit base calculation for EPM signed submissions in Polkadot and Kusama ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Make `IdentityInfo` generic in `pallet-identity` ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1661
- Whitelist `force_default_xcm_version` in XCM call filter ([polkadot-fellows/runtimes#45](https://github.com/polkadot-fellows/runtimes/pull/45))
- Update the fellowship salary budget amount in alignment with the Fellowship Salary [RFC](https://github.com/polkadot-fellows/RFCs/pull/50) ([polkadot-fellows/runtimes#121](https://github.com/polkadot-fellows/runtimes/pull/121))
- Set up an account ID for the local root location on Polkadot Collectives ([polkadot-fellows/runtimes#125](https://github.com/polkadot-fellows/runtimes/pull/125))
- Increase confirmation period for treasury spend tracks on Polkadot & Kusama ([polkadot-fellows/runtimes#119](https://github.com/polkadot-fellows/runtimes/pull/119))

### Added

Expand All @@ -21,13 +32,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- XCM transport fees are now exponential and are sent to a treasury account ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1234
- System parachains are now trusted teleporters of each other ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1368
- Treasury is able to spend various asset kinds ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87))
- Add BEEFY to Polkadot ([polkadot-fellows/runtimes#65](https://github.com/polkadot-fellows/runtimes/pull/65))
- Fellowship Treasury pallet on Polkadot Collectives ([polkadot-fellows/runtimes#109](https://github.com/polkadot-fellows/runtimes/pull/109))
- Added Polkadot <> Kusama bridge to support asset transfers between Asset Hubs ([polkadot-fellows/runtimes#108](https://github.com/polkadot-fellows/runtimes/pull/108))

### Fixed

- Add missing weight functions for `runtime_parachains_hrmp` and `preimage` pallets ([polkadot-fellows/runtimes#56](https://github.com/polkadot-fellows/runtimes/pull/56))
- Fix for Reward Deficit in the pool ([polkadot-fellows/runtimes#87](https://github.com/polkadot-fellows/runtimes/pull/87)). Context: https://github.com/paritytech/polkadot-sdk/pull/1255

## [1.0.1] 22.10.2023
## [1.0.1] 14.11.2023

### Changed

Expand Down
Loading

0 comments on commit 916d3b3

Please sign in to comment.