Unverified Commit 944ff40d authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by GitHub
Browse files

Squashed 'bridges/' changes from b2099c5..23dda62 (#3369)

23dda62 Rococo <> Wococo messages relay (#1030)
bcde21d Update the wasm builder to substrate master (#1029)
a8318ce Make target signer optional when sending message. (#1018)
f8602e1 Fix insufficient balance when send message. (#1020)
d95c0a7 greedy relayer don't need message dispatch to be prepaid if dispatch is supposed to be paid at the target chain (#1016)
ad5876f Update types. (#1027)
116cbbc CI: fix starting the pipeline (#1022)
7e0fadd Add temporary `canary` job (#1019)
6787091 Update types to contain dispatch_fee_payment (#1017)
03f79ad Allow Root to assume SourceAccount. (#1011)
372d019 Return dispatch_fee_payment from message details RPC (#1014)
604eb1c Relay basic single-bit message dispatch results back to the source chain (#935)
bf52fff Use plain source_queue view when selecting nonces for delivery (#1010)
fc5cf7d pay dispatch fee at target chain (#911)
1e35477 Bump Substrate to `286d7ce` (#1006)
7ad07b3 Add --only-mandatory-headers mode (#1004)
5351dc9 Messages relayer operating mode (#995)
9bc29a7 Rococo <> Wococo relayer balance guard (#998)
bc17341 rename messages_dispatch_weight -> message_details (#996)
95be244 Bump Rococo and Wococo spec versions (#999)
c35567b Move ChainWithBalances::NativeBalance -> Chain::Balance (#990)
1bfece1 Fix some nits (#988)
334ea0f Increase pause before starting relays again (#989)
7fb8248 Fix clippy in test code (#993)
d60ae50 fix clippy issues (#991)
75ca813 Make sure GRANDPA shares state with RPC. (#987)
da2a38a Bump Substrate (#986)
5a9862f Update submit finality proof weight formula (#981)
69df513 Flag for rejecting all outbound messages (#982)
14d0506 Add script to setup bench machine. (#984)
e74e8ab Move CI from GitHub Actions to GitLab (#814)
c5ca5dd Custom justification verification (#979)
643f10d Always run on-demand headers relay in complex relay (#975)
a35b0ef Add JSON type definitions for Rococo<>Wococo bridge (#977)
0eb83f2 Update cargo.deny (#980)
e1d1f4c Bump Rococo/Wococo spec_version (#976)
deac90d increase pause before starting relays (#974)
68d6d79 Revert to use InspectCmd, bump substrate `6bef4f4` (#966)
66e1508 Avoid hashing headers twice in verify_justification (#973)
a31844f Bump `environmental` dependency (#972)
2a4c29a in auto-relays keep trying to connect to nodes until connection is established (#971)
0e767b3 removed stray file (#969)
b9545dc Serve multiple lanes with single complex relay instance (#964)
73419f4 Correct type error (#968)
bac256f Start finality relay spec-version guards for Rococo <> Wococo finality relays (#965)
bfd7037 pass source and target chain ids to account_ownership_proof (#963)
8436073 Upstream changes from Polkadot repo (#961)
e58d851 Increase account endowment amount (#960)

git-subtree-dir: bridges
git-subtree-split: 23dda6248236b27f20d76cbedc30e189cc6f736c
parent ababff4b
Pipeline #144446 passed with stages
in 40 minutes and 58 seconds
......@@ -711,6 +711,7 @@ dependencies = [
name = "bp-header-chain"
version = "0.1.0"
dependencies = [
"assert_matches",
"bp-test-utils",
"finality-grandpa",
"frame-support",
......@@ -726,10 +727,13 @@ dependencies = [
name = "bp-messages"
version = "0.1.0"
dependencies = [
"bitvec",
"bp-runtime",
"frame-support",
"frame-system",
"impl-trait-for-tuples",
"parity-scale-codec",
"serde",
"sp-std",
]
......@@ -754,11 +758,12 @@ dependencies = [
name = "bp-rococo"
version = "0.1.0"
dependencies = [
"bp-header-chain",
"bp-messages",
"bp-polkadot-core",
"bp-runtime",
"frame-support",
"parity-scale-codec",
"smallvec 1.6.1",
"sp-api",
"sp-runtime",
"sp-std",
......@@ -799,15 +804,14 @@ dependencies = [
name = "bp-wococo"
version = "0.1.0"
dependencies = [
"bp-header-chain",
"bp-messages",
"bp-polkadot-core",
"bp-rococo",
"bp-runtime",
"parity-scale-codec",
"sp-api",
"sp-runtime",
"sp-std",
"sp-version",
]
[[package]]
......
......@@ -12,6 +12,7 @@ args
aren
async
Best/MS
benchmarking/MS
BlockId
BFT/M
bitfield/MS
......
......@@ -2,6 +2,8 @@
lang = "en_US"
search_dirs = ["."]
extra_dictionaries = ["lingua.dic"]
skip_os_lookups = true
use_builtin = true
[hunspell.quirks]
# `Type`'s
......
name: Cargo deny
on:
pull_request:
schedule:
- cron: '0 0 * * *'
push:
branches:
- master
tags:
- v*
paths-ignore:
- '**.md'
- diagrams/*
- docs/*
jobs:
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing CI:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Cargo deny
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
name: Check style
on:
pull_request:
push:
branches:
- master
tags:
- v*
paths-ignore:
- '**.md'
- diagrams/*
- docs/*
schedule: # Weekly build
- cron: '0 0 * * 0'
jobs:
## Check stage
check-fmt:
name: Check RustFmt
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Add rustfmt
run: rustup component add rustfmt
- name: rust-fmt check
uses: actions-rs/cargo@master
with:
command: fmt
args: --all -- --check
check-spellcheck:
name: Check For Spelling and/or Grammar Mistakes
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Add cargo-spellcheck
run: cargo install cargo-spellcheck
- name: Run spellcheck
run: cargo spellcheck check -m 1 -vv $(find modules/currency-exchange/src -name "*.rs")
name: Publish Dependencies to Docker hub
on:
push:
tags:
- v*
paths-ignore:
- '**.md'
- diagrams/*
- docs/*
schedule: # Weekly build
- cron: '0 0 * * 0'
jobs:
## Publish to Docker hub
publish:
name: Publishing
runs-on: ubuntu-latest
container:
image: docker:git
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@v2
with:
fetch-depth: 5
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=paritytech/bridge-dependencies
VERSION=latest
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
fi
TAGS=${DOCKER_IMAGE}:${VERSION}
TAGS=$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}
echo ::set-output name=TAGS::${TAGS}
echo ::set-output name=DATE::$(date +%d-%m-%Y)
- name: Build and push
uses: docker/build-push-action@v2
with:
file: deployments/BridgeDeps.Dockerfile
push: true
cache-from: type=registry,ref=paritytech/bridge-dependencies:latest
cache-to: type=inline
tags: ${{ steps.prep.outputs.TAGS }}
labels: |
org.opencontainers.image.title=bridge-dependencies
org.opencontainers.image.description=bridge-dependencies - component of Parity Bridges Common
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.url=https://github.com/paritytech/parity-bridges-common
org.opencontainers.image.documentation=https://github.com/paritytech/parity-bridges-common/README.md
org.opencontainers.image.created=${{ steps.prep.outputs.DATE }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.authors=devops-team@parity.io
org.opencontainers.image.vendor=Parity Technologies
org.opencontainers.image.licenses=GPL-3.0 License
name: Publish images to Docker hub
on:
push:
tags:
- v*
paths-ignore:
- '**.md'
- diagrams/*
- docs/*
schedule: # Nightly build
- cron: '0 1 * * *'
jobs:
## Publish to Docker hub
publish:
name: Publishing
strategy:
matrix:
project:
- rialto-bridge-node
- millau-bridge-node
- ethereum-poa-relay
- substrate-relay
include:
- project: rialto-bridge-node
healthcheck: http://localhost:9933/health
- project: millau-bridge-node
healthcheck: http://localhost:9933/health
- project: ethereum-poa-relay
healthcheck: http://localhost:9616/metrics
- project: substrate-relay
healthcheck: http://localhost:9616/metrics
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@v2
with:
fetch-depth: 5
submodules: recursive
- name: Prepare
id: prep
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
fi
TAGS="${VERSION} sha-${GITHUB_SHA::8} latest"
echo ::set-output name=TAGS::${VERSION}
echo ::set-output name=TAGS::${TAGS}
echo ::set-output name=DATE::$(date +%d-%m-%Y)
- name: Workaround rootless build
run: |
sudo apt-get install fuse-overlayfs
mkdir -vp ~/.config/containers
printf "[storage.options]\nmount_program=\"/usr/bin/fuse-overlayfs\"" > ~/.config/containers/storage.conf
- name: Build image for ${{ matrix.project }}
uses: redhat-actions/buildah-build@v2.2
with:
image: ${{ matrix.project }}
tags: ${{ steps.prep.outputs.TAGS }}
dockerfiles: ./Dockerfile
build-args: |
PROJECT=${{ matrix.project }}
HEALTH=${{ matrix.healthcheck }}
VCS_REF=sha-${GITHUB_SHA::8}
BUILD_DATE=${{ steps.prep.outputs.DATE }}
VERSION=${{ steps.prep.outputs.VERSION }}
- name: Push ${{ matrix.project }} image to docker.io
id: push-to-dockerhub
uses: redhat-actions/push-to-registry@v2.1.1
with:
registry: docker.io/paritytech
image: ${{ matrix.project }}
tags: ${{ steps.prep.outputs.TAGS }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Check the image
run: |
echo "New image has been pushed to ${{ steps.push-to-dockerhub.outputs.registry-path }}"
name: Compilation and Testing Suite
on:
pull_request:
push:
branches:
- master
tags:
- v*
paths-ignore:
- '**.md'
- diagrams/*
- docs/*
schedule: # Weekly build
- cron: '0 0 * * 0'
jobs:
## Check Stage
check-test:
name: Check and test
strategy:
matrix:
toolchain:
- stable
#- beta
- nightly-2021-04-10
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Install Toolchain
run: rustup toolchain add $NIGHTLY
- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY
- name: Checking rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: --all --verbose
## Test Stage
- name: Testing rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
if: matrix.toolchain == 'stable'
with:
command: test
toolchain: ${{ matrix.toolchain }}
args: --all --verbose
## Check Node Benchmarks
- name: Check Rialto benchmarks runtime ${{ matrix.platform }} rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: -p rialto-runtime --features runtime-benchmarks --verbose
- name: Check Millau benchmarks runtime ${{ matrix.platform }} rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: -p millau-runtime --features runtime-benchmarks --verbose
## Build Stage
build:
name: Build
strategy:
matrix:
toolchain:
- stable
#- beta
- nightly-2021-04-10
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Install Toolchain
run: rustup toolchain add $NIGHTLY
- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY
- name: Building rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
if: github.ref == 'refs/heads/master'
with:
command: build
toolchain: ${{ matrix.toolchain }}
args: --all --verbose
- name: Prepare artifacts
if: github.ref == 'refs/heads/master'
run: |
mkdir -p ./artifacts;
mv -v target/debug/rialto-bridge-node ./artifacts/;
mv -v target/debug/millau-bridge-node ./artifacts/;
mv -v target/debug/ethereum-poa-relay ./artifacts/;
mv -v target/debug/substrate-relay ./artifacts/;
shell: bash
- name: Upload artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.toolchain }}.zip
path: artifacts/
## Linting Stage
clippy:
name: Clippy
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive
- name: Install Toolchain
run: rustup toolchain add $NIGHTLY
- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY
- name: Add clippy
run: rustup component add clippy --toolchain $NIGHTLY
- name: Rust Cache
uses: Swatinem/rust-cache@v1.2.0
- name: Clippy
uses: actions-rs/cargo@master
with:
command: clippy
toolchain: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
args: --all-targets -- -D warnings
stages:
- lint
- check
- test
- build
- publish
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
variables: &default-vars
GIT_STRATEGY: fetch
GIT_DEPTH: 100
CARGO_INCREMENTAL: 0
ARCH: "x86_64"
CI_IMAGE: "paritytech/bridges-ci:production"
RUST_BACKTRACE: full
default:
cache: {}
.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 7 days
paths:
- artifacts/
.kubernetes-build: &kubernetes-build
tags:
- kubernetes-parity-build
interruptible: true
.docker-env: &docker-env
image: "${CI_IMAGE}"
before_script:
- rustup show
- cargo --version
- rustup +nightly show
- cargo +nightly --version
- sccache -s
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- linux-docker
.test-refs: &test-refs
rules:
# FIXME: This is the cause why pipelines wouldn't start. The problem might be in our custom
# mirroring. This should be investigated further, but for now let's have the working
# pipeline.
# - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH
# changes:
# - '**.md'
# - diagrams/*
# - docs/*
# when: never
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
.build-refs: &build-refs
rules:
# won't run on the CI image update pipeline
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
# there are two types of nightly pipelines:
# 1. this one is triggered by the schedule with $PIPELINE == "nightly", it's for releasing.
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
- if: $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
.nightly-test: &nightly-test
rules:
# 2. another is triggered by scripts repo $CI_PIPELINE_SOURCE == "pipeline" it's for the CI image
# update, it also runs all the nightly checks.
- if: $CI_PIPELINE_SOURCE == "pipeline"
#### stage: lint
clippy-nightly:
stage: lint
<<: *docker-env
<<: *test-refs
variables: