Skip to content

Commit

Permalink
Merge branch 'master' into fix-zombienet-bridge-test
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 authored Aug 16, 2024
2 parents cf137ee + 843c4db commit ba71a33
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 14 deletions.
22 changes: 22 additions & 0 deletions .github/actions/cargo-check-runtimes/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'cargo check runtimes'
description: 'Runs `cargo check` for every directory in provided root.'
inputs:
root:
description: "Root directory. Expected to contain several cargo packages inside."
required: true
runs:
using: "composite"
steps:
- name: Check
shell: bash
run: |
mkdir -p ~/.forklift
cp .forklift/config.toml ~/.forklift/config.toml
cd ${{ inputs.root }}
for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 forklift cargo check --locked;
cd ..;
done
136 changes: 136 additions & 0 deletions .github/workflows/check-cargo-check-runtimes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Check Cargo Check Runtimes

on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review, labeled ]


# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers

jobs:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
set-image:
if: contains(github.event.label.name, 'GHA-migration') || contains(github.event.pull_request.labels.*.name, 'GHA-migration')
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
check-runtime-assets:
runs-on: arc-runners-polkadot-sdk-beefy
needs: [set-image]
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/assets

check-runtime-collectives:
runs-on: arc-runners-polkadot-sdk-beefy
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/collectives

check-runtime-coretime:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/coretime

check-runtime-bridge-hubs:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/bridge-hubs

check-runtime-contracts:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-collectives, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/contracts

check-runtime-starters:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-assets, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/starters

check-runtime-testing:
runs-on: arc-runners-polkadot-sdk-beefy
container:
image: ${{ needs.set-image.outputs.IMAGE }}
needs: [check-runtime-starters, set-image]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: cumulus/parachains/runtimes/testing

confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All check-runtime-* tests passed
# If any new job gets added, be sure to add it to this array
needs:
- check-runtime-assets
- check-runtime-collectives
- check-runtime-coretime
- check-runtime-bridge-hubs
- check-runtime-contracts
- check-runtime-starters
- check-runtime-testing
steps:
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY
25 changes: 11 additions & 14 deletions polkadot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ Connect to the global Polkadot Mainnet network by running:
../target/release/polkadot --chain=polkadot
```

You can see your node on [telemetry] (set a custom name with `--name "my custom name"`).

[telemetry](https://telemetry.polkadot.io/#list/Polkadot): https://telemetry.polkadot.io/#list/Polkadot
You can see your node on [Polkadot telemetry](https://telemetry.polkadot.io/#list/0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3)
(set a custom name with `--name "my custom name"`).

### Connect to the "Kusama" Canary Network

Expand All @@ -115,9 +114,8 @@ Connect to the global Kusama canary network by running:
../target/release/polkadot --chain=kusama
```

You can see your node on [telemetry] (set a custom name with `--name "my custom name"`).

[telemetry](https://telemetry.polkadot.io/#list/Kusama): https://telemetry.polkadot.io/#list/Kusama
You can see your node on [Kusama telemetry](https://telemetry.polkadot.io/#list/0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe)
(set a custom name with `--name "my custom name"`).

### Connect to the Westend Testnet

Expand All @@ -127,9 +125,8 @@ Connect to the global Westend testnet by running:
../target/release/polkadot --chain=westend
```

You can see your node on [telemetry] (set a custom name with `--name "my custom name"`).

[telemetry](https://telemetry.polkadot.io/#list/Westend): https://telemetry.polkadot.io/#list/Westend
You can see your node on [Westend telemetry](https://telemetry.polkadot.io/#list/0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e)
(set a custom name with `--name "my custom name"`).

### Obtaining DOTs

Expand All @@ -147,7 +144,7 @@ Then, grab the Polkadot source code:

```bash
git clone https://github.com/paritytech/polkadot-sdk.git
cd polkadot
cd polkadot-sdk
```

Then build the code. You will need to build in release mode (`--release`) to start a network. Only
Expand Down Expand Up @@ -185,7 +182,7 @@ You can run a simple single-node development "network" on your machine by runnin
cargo run --bin polkadot --release -- --dev
```

You can muck around by heading to <https://polkadot.js.org/apps> and choose "Local Node" from the
You can muck around by heading to <https://polkadot.js.org/apps> and choosing "Local Node" from the
Settings menu.

### Local Two-node Testnet
Expand Down Expand Up @@ -214,11 +211,11 @@ that we currently maintain.

### Using Docker

[Using Docker](../docs/contributor/docker.md)
[Using Docker](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/docker.md)

### Shell Completion

[Shell Completion](doc/shell-completion.md)
[Shell Completion](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/doc/shell-completion.md)

## Contributing

Expand All @@ -232,4 +229,4 @@ that we currently maintain.

## License

Polkadot is [GPL 3.0 licensed](LICENSE).
Polkadot is [GPL 3.0 licensed](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/LICENSE).
13 changes: 13 additions & 0 deletions prdoc/pr_5326.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Update Readme of the `polkadot` crate

doc:
- audience: Node Operator
description: |
Updated Readme of the `polkadot` crate.

crates:
- name: polkadot
bump: patch
13 changes: 13 additions & 0 deletions prdoc/pr_5348.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: allow for u8 to be used as hold/freeze reason

doc:
- audience: Runtime Dev
description: |
Allows for `u8` type to be configured as `HoldReason` and `FreezeReason`

crates:
- name: frame-support
bump: patch
4 changes: 4 additions & 0 deletions substrate/frame/support/src/traits/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ impl VariantCount for () {
const VARIANT_COUNT: u32 = 0;
}

impl VariantCount for u8 {
const VARIANT_COUNT: u32 = 256;
}

/// Adapter for `Get<u32>` to access `VARIANT_COUNT` from `trait pub trait VariantCount {`.
pub struct VariantCountOf<T: VariantCount>(core::marker::PhantomData<T>);
impl<T: VariantCount> Get<u32> for VariantCountOf<T> {
Expand Down

0 comments on commit ba71a33

Please sign in to comment.