Skip to content

Commit

Permalink
Merge branch 'master' into ao-fix-backing-filtering-on-disputes
Browse files Browse the repository at this point in the history
* master:
  Remove redundant minimal template workspace (#5330)
  approval-distribution: Fix handling of conclude (#5375)
  More logs in `is_potential_spam` from `dispute-coordinator` (#5252)
  Fix zombienet bridges test (#5373)
  Update Readme of the `polkadot` crate (#5326)
  allow for `u8` to be used as hold/freeze reason (#5348)
  Moving cargo check for runtimes to GHA (#5340)
  Update links in the documentation (#5175)
  fix visibility for `pallet_nfts` types used as call arguments (#3634)
  Correct some typos in crates' descriptions (#5262)
  Aura: Ensure we are building on each relay chain fork (#5352)
  Update Identity pallet README.md (#5183)
  Bump trie-db from 0.29.0 to 0.29.1 (#5231)
  [Coretime] Always include UnpaidExecution, not just when revenue is > 0 (#5369)
  [Pools] fix derivation of pool account (#4999)
  • Loading branch information
ordian committed Aug 16, 2024
2 parents e946580 + 7426788 commit 6563fe2
Show file tree
Hide file tree
Showing 39 changed files with 543 additions and 205 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
19 changes: 4 additions & 15 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ members = [
"substrate/utils/prometheus",
"substrate/utils/substrate-bip39",
"substrate/utils/wasm-builder",
"templates/minimal",
"templates/minimal/node",
"templates/minimal/pallets/template",
"templates/minimal/runtime",
Expand Down Expand Up @@ -1319,7 +1318,7 @@ tracing-log = { version = "0.2.0" }
tracing-subscriber = { version = "0.3.18" }
tracking-allocator = { path = "polkadot/node/tracking-allocator", default-features = false, package = "staging-tracking-allocator" }
trie-bench = { version = "0.39.0" }
trie-db = { version = "0.29.0", default-features = false }
trie-db = { version = "0.29.1", default-features = false }
trie-root = { version = "0.18.0", default-features = false }
trie-standardmap = { version = "0.16.0" }
trybuild = { version = "1.0.89" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ case "$1" in
"//Alice" \
1000 \
"ws://127.0.0.1:9910" \
"$(jq --null-input '{ "parents": 2, "interior": { "X1": { "GlobalConsensus": "Westend" } } }')" \
"$(jq --null-input '{ "parents": 2, "interior": { "X1": [{ "GlobalConsensus": "Westend" }] } }')" \
"$GLOBAL_CONSENSUS_WESTEND_SOVEREIGN_ACCOUNT" \
10000000000 \
true
Expand Down Expand Up @@ -329,7 +329,7 @@ case "$1" in
"//Alice" \
1000 \
"ws://127.0.0.1:9010" \
"$(jq --null-input '{ "parents": 2, "interior": { "X1": { "GlobalConsensus": "Rococo" } } }')" \
"$(jq --null-input '{ "parents": 2, "interior": { "X1": [{ "GlobalConsensus": "Rococo" }] } }')" \
"$GLOBAL_CONSENSUS_ROCOCO_SOVEREIGN_ACCOUNT" \
10000000000 \
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function run(nodeName, networkInfo, args) {
const bridgedNetworkName = args[2];
while (true) {
const foreignAssetAccount = await api.query.foreignAssets.account(
{ parents: 2, interior: { X1: { GlobalConsensus: bridgedNetworkName } } },
{ parents: 2, interior: { X1: [{ GlobalConsensus: bridgedNetworkName }] } },
accountAddress
);
if (foreignAssetAccount.isSome) {
Expand Down
8 changes: 6 additions & 2 deletions cumulus/client/consensus/aura/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ where
};

let mut last_processed_slot = 0;
let mut last_relay_chain_block = Default::default();

while let Some(request) = collation_requests.next().await {
macro_rules! reject_with_error {
Expand Down Expand Up @@ -215,11 +216,13 @@ where
//
// Most parachains currently run with 12 seconds slots and thus, they would try to
// produce multiple blocks per slot which very likely would fail on chain. Thus, we have
// this "hack" to only produce on block per slot.
// this "hack" to only produce one block per slot per relay chain fork.
//
// With https://github.com/paritytech/polkadot-sdk/issues/3168 this implementation will be
// obsolete and also the underlying issue will be fixed.
if last_processed_slot >= *claim.slot() {
if last_processed_slot >= *claim.slot() &&
last_relay_chain_block < *relay_parent_header.number()
{
continue
}

Expand Down Expand Up @@ -261,6 +264,7 @@ where
}

last_processed_slot = *claim.slot();
last_relay_chain_block = *relay_parent_header.number();
}
}
}
2 changes: 1 addition & 1 deletion cumulus/client/pov-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cumulus-client-pov-recovery"
version = "0.7.0"
authors.workspace = true
description = "Cumulus-specific networking protocol"
description = "Parachain PoV recovery"
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

Expand Down
2 changes: 1 addition & 1 deletion cumulus/pallets/aura-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Cumulus extension pallet for AuRa
//!
//! This pallets extends the Substrate AuRa pallet to make it compatible with parachains. It
//! This pallet extends the Substrate AuRa pallet to make it compatible with parachains. It
//! provides the [`Pallet`], the [`Config`] and the [`GenesisConfig`].
//!
//! It is also required that the parachain runtime uses the provided [`BlockExecutor`] to properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "bridge-hub-rococo-runtime"
version = "0.5.0"
authors.workspace = true
edition.workspace = true
description = "Rococo's BridgeHub parachain runtime"
description = "Rococo's BridgeHub parachain runtime"
license = "Apache-2.0"

[lints]
Expand Down
1 change: 1 addition & 0 deletions docs/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ frame = { features = [
"runtime",
], workspace = true, default-features = true }
pallet-examples = { workspace = true }
pallet-contracts = { workspace = true }
pallet-default-config-example = { workspace = true, default-features = true }
pallet-example-offchain-worker = { workspace = true, default-features = true }

Expand Down
18 changes: 9 additions & 9 deletions docs/sdk/src/guides/your_first_pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! this guide, namely the crate/package names, based on which template you use.
//!
//! > Be aware that you can read the entire source code backing this tutorial by clicking on the
//! > [`source`](./mod.rs.html) button at the top right of the page.
//! > `source` button at the top right of the page.
//!
//! You should have studied the following modules as a prelude to this guide:
//!
Expand All @@ -45,7 +45,7 @@
//! Consider the following as a "shell pallet". We continue building the rest of this pallet based
//! on this template.
//!
//! [`pallet::config`] and [`pallet::pallet`](frame_support::pallet) are both mandatory parts of any
//! [`pallet::config`] and [`pallet::pallet`] are both mandatory parts of any
//! pallet. Refer to the documentation of each to get an overview of what they do.
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", shell_pallet)]
//!
Expand Down Expand Up @@ -319,13 +319,13 @@
//! - Learn more about the individual pallet items/macros, such as event and errors and call, in
//! [`frame::pallet_macros`].
//!
//! [`pallet::storage`]: ../../../frame_support/pallet_macros/attr.config.html
//! [`pallet::call`]: ../../../frame_support/pallet_macros/attr.call.html
//! [`pallet::event`]: ../../../frame_support/pallet_macros/attr.event.html
//! [`pallet::error`]: ../../../frame_support/pallet_macros/attr.error.html
//! [`pallet::pallet`]: ../../../frame_support/pallet_macros/attr.pallet.html
//! [`pallet::config`]: ../../../frame_support/pallet_macros/attr.config.html
//! [`pallet::generate_deposit`]: ../../../frame_support/pallet_macros/attr.generate_deposit.html
//! [`pallet::storage`]: frame_support::pallet_macros::storage
//! [`pallet::call`]: frame_support::pallet_macros::call
//! [`pallet::event`]: frame_support::pallet_macros::event
//! [`pallet::error`]: frame_support::pallet_macros::error
//! [`pallet::pallet`]: frame_support::pallet
//! [`pallet::config`]: frame_support::pallet_macros::config
//! [`pallet::generate_deposit`]: frame_support::pallet_macros::generate_deposit

#[docify::export]
#[frame::pallet(dev_mode)]
Expand Down
1 change: 0 additions & 1 deletion docs/sdk/src/reference_docs/chain_spec_genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
//! [`pallet::genesis_build`]: frame_support::pallet_macros::genesis_build
//! [`pallet::genesis_config`]: frame_support::pallet_macros::genesis_config
//! [`BuildGenesisConfig`]: frame_support::traits::BuildGenesisConfig
//! [`chain_spec_builder`]: ../../../staging_chain_spec_builder/index.html
//! [`serde`]: https://serde.rs/field-attrs.html
//! [`get_storage_for_patch`]: sc_chain_spec::GenesisConfigBuilderRuntimeCaller::get_storage_for_patch
//! [`GenesisBuilder::get_preset`]: sp_genesis_builder::GenesisBuilder::get_preset
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/src/reference_docs/runtime_vs_smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//! #### Smart Contracts in Substrate
//! Smart Contracts are autonomous, programmable constructs deployed on the blockchain.
//! In [FRAME](frame), Smart Contracts infrastructure is implemented by the
//! [`pallet_contracts`](../../../pallet_contracts/index.html) for WASM-based contracts or the
//! [`pallet_evm`](../../../pallet_evm/index.html) for EVM-compatible contracts. These pallets
//! [`pallet_contracts`] for WASM-based contracts or the
//! [`pallet_evm`](https://github.com/polkadot-evm/frontier/tree/master/frame/evm) for EVM-compatible contracts. These pallets
//! enable Smart Contract developers to build applications and systems on top of a Substrate-based
//! blockchain.
//!
Expand Down Expand Up @@ -108,7 +108,7 @@
//! - **Deployment and Iteration**: Smart Contracts, by nature, are designed for more
//! straightforward deployment and iteration. Developers can quickly deploy contracts.
//! - **Contract Code Updates**: Once deployed, although typically immutable, Smart Contracts can be
//! upgraded, but lack of migration logic. The [pallet_contracts](../../../pallet_contracts/index.html)
//! upgraded, but lack of migration logic. The [`pallet_contracts`]
//! allows for contracts to be upgraded by exposing the `set_code` dispatchable. More details on this
//! can be found in [Ink! documentation on upgradeable contracts](https://use.ink/basics/upgradeable-contracts).
//! - **Isolated Impact**: Upgrades or changes to a smart contract generally impact only that
Expand Down
Loading

0 comments on commit 6563fe2

Please sign in to comment.