Skip to content

Commit

Permalink
Merge branch 'master' into oty-try-runtime-mbm
Browse files Browse the repository at this point in the history
  • Loading branch information
ggwpez authored Oct 4, 2024
2 parents a31a03d + 111b244 commit dcca116
Show file tree
Hide file tree
Showing 44 changed files with 1,076 additions and 3,429 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ fetch_release_artifacts() {
# - GITHUB_TOKEN
# - REPO in the form paritytech/polkadot
fetch_release_artifacts_from_s3() {
BINARY=$1
echo "Version : $VERSION"
echo "Repo : $REPO"
echo "Binary : $BINARY"
Expand Down Expand Up @@ -461,7 +462,7 @@ function get_polkadot_node_version_from_code() {

validate_stable_tag() {
tag="$1"
pattern='^stable[0-9]+(-[0-9]+)?$'
pattern="^stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"

if [[ $tag =~ $pattern ]]; then
echo $tag
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/check-cargo-check-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,11 @@ jobs:
with:
root: cumulus/parachains/runtimes/contracts

check-runtime-starters:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [check-runtime-assets, preflight]
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: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [check-runtime-starters, preflight]
needs: [preflight]
timeout-minutes: 20
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

jobs:
test:
test-cmd-bot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
50 changes: 38 additions & 12 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Validate inputs
id: validate_inputs
Expand All @@ -111,7 +111,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

#TODO: this step will be needed when automated triggering will work
#this step runs only if the workflow is triggered automatically when new release is published
Expand All @@ -134,7 +134,14 @@ jobs:
. ./.github/scripts/common/lib.sh
VERSION="${{ needs.validate-inputs.outputs.VERSION }}"
fetch_release_artifacts_from_s3
if [[ ${{ inputs.binary }} == 'polkadot' ]]; then
bins=(polkadot polkadot-prepare-worker polkadot-execute-worker)
for bin in "${bins[@]}"; do
fetch_release_artifacts_from_s3 $bin
done
else
fetch_release_artifacts_from_s3 $BINARY
fi
- name: Fetch chain-spec-builder rc artifacts or release artifacts based on release id
#this step runs only if the workflow is triggered manually and only for chain-spec-builder
Expand All @@ -159,7 +166,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand Down Expand Up @@ -187,15 +194,14 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
release="release-${{ needs.validate-inputs.outputs.RELEASE_ID }}" && \
release="${{ needs.validate-inputs.outputs.stable_tag }}" && \
echo "release=${release}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
echo "commit=${commit}" >> $GITHUB_OUTPUT
tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) && \
[ "${tag}" != "undefined" ] && echo "tag=${tag}" >> $GITHUB_OUTPUT || \
echo "No tag, doing without"
tag="${{ needs.validate-inputs.outputs.version }}" && \
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Fetch release tags
working-directory: release-artifacts
Expand All @@ -215,8 +221,20 @@ jobs:
echo "release=${release}" >> $GITHUB_OUTPUT
echo "stable=${{ needs.validate-inputs.outputs.stable_tag }}" >> $GITHUB_OUTPUT
- name: Build Injected Container image for polkadot rc or chain-spec-builder
if: ${{ env.BINARY == 'polkadot' || env.BINARY == 'chain-spec-builder' }}
- name: Build Injected Container image for polkadot rc
if: ${{ env.BINARY == 'polkadot' }}
env:
ARTIFACTS_FOLDER: release-artifacts
IMAGE_NAME: ${{ env.BINARY }}
OWNER: ${{ env.DOCKER_OWNER }}
TAGS: ${{ join(steps.fetch_rc_refs.outputs.*, ',') || join(steps.fetch_release_refs.outputs.*, ',') }}
run: |
ls -al
echo "Building container for $BINARY"
./docker/scripts/polkadot/build-injected.sh $ARTIFACTS_FOLDER
- name: Build Injected Container image chain-spec-builder
if: ${{ env.BINARY == 'chain-spec-builder' }}
env:
ARTIFACTS_FOLDER: release-artifacts
IMAGE_NAME: ${{ env.BINARY }}
Expand All @@ -243,7 +261,15 @@ jobs:
echo "Building container for $BINARY"
./docker/scripts/build-injected.sh
- name: Login to Dockerhub
- name: Login to Dockerhub to publish polkadot
if: ${{ env.BINARY == 'polkadot' }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.POLKADOT_DOCKERHUB_USERNAME }}
password: ${{ secrets.POLKADOT_DOCKERHUB_TOKEN }}

- name: Login to Dockerhub to puiblish polkadot-parachain/chain-spec-builder
if: ${{ env.BINARY == 'polkadot-parachain' || env.BINARY == 'chain-spec-builder' }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.CUMULUS_DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -295,7 +321,7 @@ jobs:
environment: release
steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
Expand Down
13 changes: 2 additions & 11 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ build-test-parachain:
# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs
# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts
# DAG: build-runtime-assets -> build-runtime-coretime
# DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing
# DAG: build-runtime-assets -> build-runtime-testing
build-runtime-assets:
<<: *build-runtime-template
variables:
Expand Down Expand Up @@ -298,22 +298,13 @@ build-runtime-contracts:
- job: build-runtime-collectives
artifacts: false

build-runtime-starters:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "cumulus/parachains/runtimes/starters"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-assets
artifacts: false

build-runtime-testing:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "cumulus/parachains/runtimes/testing"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-starters
- job: build-runtime-assets
artifacts: false

build-short-benchmark-cumulus:
Expand Down
73 changes: 0 additions & 73 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ members = [
"cumulus/parachains/runtimes/glutton/glutton-westend",
"cumulus/parachains/runtimes/people/people-rococo",
"cumulus/parachains/runtimes/people/people-westend",
"cumulus/parachains/runtimes/starters/seedling",
"cumulus/parachains/runtimes/starters/shell",
"cumulus/parachains/runtimes/test-utils",
"cumulus/parachains/runtimes/testing/penpal",
"cumulus/parachains/runtimes/testing/rococo-parachain",
Expand Down Expand Up @@ -1187,7 +1185,6 @@ schnorrkel = { version = "0.11.4", default-features = false }
seccompiler = { version = "0.4.0" }
secp256k1 = { version = "0.28.0", default-features = false }
secrecy = { version = "0.8.0", default-features = false }
seedling-runtime = { path = "cumulus/parachains/runtimes/starters/seedling" }
separator = { version = "0.4.1" }
serde = { version = "1.0.210", default-features = false }
serde-big-array = { version = "0.3.2" }
Expand All @@ -1198,7 +1195,6 @@ serial_test = { version = "2.0.0" }
sha1 = { version = "0.10.6" }
sha2 = { version = "0.10.7", default-features = false }
sha3 = { version = "0.10.0", default-features = false }
shell-runtime = { path = "cumulus/parachains/runtimes/starters/shell" }
shlex = { version = "1.3.0" }
slot-range-helper = { path = "polkadot/runtime/common/slot_range_helper", default-features = false }
slotmap = { version = "1.0" }
Expand Down
1 change: 0 additions & 1 deletion bridges/relays/lib-substrate-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ num-traits = { workspace = true, default-features = true }
rbtag = { workspace = true }
structopt = { workspace = true }
strum = { features = ["derive"], workspace = true, default-features = true }
rustc-hex = { workspace = true }
thiserror = { workspace = true }

# Bridge dependencies
Expand Down
23 changes: 3 additions & 20 deletions bridges/relays/lib-substrate-relay/src/cli/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ use crate::{
parachains::SubstrateParachainsPipeline,
};
use bp_parachains::{RelayBlockHash, RelayBlockHasher, RelayBlockNumber};
use codec::{Codec, EncodeLike};
use messages_relay::Labeled;
use relay_substrate_client::{
Chain, ChainWithRuntimeVersion, ChainWithTransactions, Parachain, RelayChain,
};
use std::fmt::Debug;

/// Minimal bridge representation that can be used from the CLI.
/// It connects a source chain to a target chain.
Expand Down Expand Up @@ -102,22 +99,7 @@ where
/// Bridge representation that can be used from the CLI for relaying messages.
pub trait MessagesCliBridge: CliBridgeBase {
/// The Source -> Destination messages synchronization pipeline.
type MessagesLane: SubstrateMessageLane<
SourceChain = Self::Source,
TargetChain = Self::Target,
LaneId = Self::LaneId,
>;
/// Lane identifier type.
type LaneId: Clone
+ Copy
+ Debug
+ Codec
+ EncodeLike
+ Send
+ Sync
+ Labeled
+ TryFrom<Vec<u8>>
+ Default;
type MessagesLane: SubstrateMessageLane<SourceChain = Self::Source, TargetChain = Self::Target>;

/// Optional messages delivery transaction limits that the messages relay is going
/// to use. If it returns `None`, limits are estimated using `TransactionPayment` API
Expand All @@ -128,4 +110,5 @@ pub trait MessagesCliBridge: CliBridgeBase {
}

/// An alias for lane identifier type.
pub type MessagesLaneIdOf<B> = <B as MessagesCliBridge>::LaneId;
pub type MessagesLaneIdOf<B> =
<<B as MessagesCliBridge>::MessagesLane as SubstrateMessageLane>::LaneId;
Loading

0 comments on commit dcca116

Please sign in to comment.