Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into snowbridge
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/CODEOWNERS
#	.github/scripts/common/lib.sh
#	bridges/snowbridge/pallets/ethereum-client/src/tests.rs
#	bridges/snowbridge/pallets/inbound-queue/fixtures/src/register_token_with_insufficient_fee.rs
#	cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
  • Loading branch information
claravanstaden authored and claravanstaden committed Mar 28, 2024
2 parents aa3a75a + 5d314eb commit 7fd2ea4
Show file tree
Hide file tree
Showing 658 changed files with 7,051 additions and 3,934 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/subsystem-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# The actions takes json file as input and runs github-action-benchmark for it.

on:
workflow_dispatch:
inputs:
benchmark-data-dir-path:
description: "Path to the benchmark data directory"
required: true
type: string
output-file-path:
description: "Path to the benchmark data file"
required: true
type: string

jobs:
subsystem-benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/[email protected]
with:
fetch-depth: 0
ref: "gh-pages"

- name: Copy bench results
id: step_one
run: |
cp bench/gitlab/${{ github.event.inputs.output-file-path }} ${{ github.event.inputs.output-file-path }}
- name: Switch branch
id: step_two
run: |
git checkout master
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "customSmallerIsBetter"
output-file-path: ${{ github.event.inputs.output-file-path }}
benchmark-data-dir-path: "bench/${{ github.event.inputs.benchmark-data-dir-path }}"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ default:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues

.publish-gh-pages-refs:
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master"

# handle the specific case where benches could store incorrect bench data because of the downstream staging runs
# exclude cargo-check-benches from such runs
.test-refs-check-benches:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ build-runtimes-polkavm:
- .run-immediately
# - .collect-artifact
variables:
# this variable gets overriden by "rusty-cachier environment inject", use the value as default
# this variable gets overridden by "rusty-cachier environment inject", use the value as default
CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target"
before_script:
- mkdir -p ./artifacts/subkey
Expand Down
76 changes: 70 additions & 6 deletions .gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

publish-rustdoc:
stage: publish
extends: .kubernetes-env
extends:
- .kubernetes-env
- .publish-gh-pages-refs
variables:
CI_IMAGE: node:18
GIT_DEPTH: 100
RUSTDOCS_DEPLOY_REFS: "master"
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master"
needs:
- job: build-rustdoc
artifacts: true
Expand Down Expand Up @@ -60,9 +57,76 @@ publish-rustdoc:
- git commit -m "___Updated docs for ${CI_COMMIT_REF_NAME}___" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
# artificial sleep to publish gh-pages
- sleep 300
after_script:
- rm -rf .git/ ./*

publish-subsystem-benchmarks:
stage: publish
variables:
CI_IMAGE: "paritytech/tools:latest"
extends:
- .kubernetes-env
- .publish-gh-pages-refs
needs:
- job: subsystem-regression-tests
artifacts: true
- job: publish-rustdoc
artifacts: false
script:
# setup ssh
- eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Set git config
- rm -rf .git/config
- git config user.email "[email protected]"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "[email protected]:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Push result to github
- git checkout gh-pages --force
- mkdir -p bench/gitlab/ || echo "Directory exists"
- rm -rf bench/gitlab/*.json || echo "No json files"
- cp -r charts/*.json bench/gitlab/
- git add bench/gitlab/
- git commit -m "Add json files with benchmark results for ${CI_COMMIT_REF_NAME}"
- git push origin gh-pages
# artificial sleep to publish gh-pages
- sleep 300
allow_failure: true
after_script:
- rm -rf .git/ ./*

trigger_workflow:
stage: deploy
extends:
- .kubernetes-env
- .publish-gh-pages-refs
needs:
- job: publish-subsystem-benchmarks
artifacts: false
- job: subsystem-regression-tests
artifacts: true
script:
- echo "Triggering workflow"
- |
for benchmark in $(ls charts/*.json); do
export bencmark_name=$(basename $benchmark)
echo "Benchmark: $bencmark_name"
export benchmark_dir=$(echo $bencmark_name | sed 's/\.json//')
curl -q -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/actions/workflows/subsystem-benchmarks.yml/dispatches \
-d '{"ref":"refs/heads/master","inputs":{"benchmark-data-dir-path":"'$benchmark_dir'","output-file-path":"'$bencmark_name'"}}'
sleep 300
done
allow_failure: true

# note: images are used not only in zombienet but also in rococo, wococo and versi
.build-push-image:
image: $BUILDAH_IMAGE
Expand Down
7 changes: 7 additions & 0 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,19 @@ test-syscalls:

subsystem-regression-tests:
stage: test
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 days
paths:
- charts/
extends:
- .docker-env
- .common-refs
- .run-immediately
script:
- cargo bench --profile=testnet -p polkadot-availability-recovery --bench availability-recovery-regression-bench --features subsystem-benchmarks
- cargo bench --profile=testnet -p polkadot-availability-distribution --bench availability-distribution-regression-bench --features subsystem-benchmarks
tags:
- benchmark
allow_failure: true
2 changes: 1 addition & 1 deletion .gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.zombienet-refs:
extends: .build-refs
variables:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.95"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.98"

include:
# substrate tests
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/rust-features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# The steps of this script:
# 1. Check that all required dependencies are installed.
# 2. Check that all rules are fullfilled for the whole workspace. If not:
# 2. Check that all rules are fulfilled for the whole workspace. If not:
# 4. Check all crates to find the offending ones.
# 5. Print all offending crates and exit with code 1.
#
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

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

25 changes: 13 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ resolver = "2"

members = [
"bridges/bin/runtime-common",
"bridges/chains/chain-asset-hub-rococo",
"bridges/chains/chain-asset-hub-westend",
"bridges/chains/chain-bridge-hub-cumulus",
"bridges/chains/chain-bridge-hub-kusama",
"bridges/chains/chain-bridge-hub-polkadot",
"bridges/chains/chain-bridge-hub-rococo",
"bridges/chains/chain-bridge-hub-westend",
"bridges/chains/chain-kusama",
"bridges/chains/chain-polkadot",
"bridges/chains/chain-polkadot-bulletin",
"bridges/chains/chain-rococo",
"bridges/chains/chain-westend",
"bridges/modules/grandpa",
"bridges/modules/messages",
"bridges/modules/parachains",
"bridges/modules/relayers",
"bridges/modules/xcm-bridge-hub",
"bridges/modules/xcm-bridge-hub-router",
"bridges/primitives/chain-asset-hub-rococo",
"bridges/primitives/chain-asset-hub-westend",
"bridges/primitives/chain-bridge-hub-cumulus",
"bridges/primitives/chain-bridge-hub-kusama",
"bridges/primitives/chain-bridge-hub-polkadot",
"bridges/primitives/chain-bridge-hub-rococo",
"bridges/primitives/chain-bridge-hub-westend",
"bridges/primitives/chain-kusama",
"bridges/primitives/chain-polkadot",
"bridges/primitives/chain-polkadot-bulletin",
"bridges/primitives/chain-rococo",
"bridges/primitives/chain-westend",
"bridges/primitives/header-chain",
"bridges/primitives/messages",
"bridges/primitives/parachains",
Expand Down Expand Up @@ -214,6 +214,7 @@ members = [
"polkadot/xcm/xcm-builder",
"polkadot/xcm/xcm-executor",
"polkadot/xcm/xcm-executor/integration-tests",
"polkadot/xcm/xcm-fee-payment-runtime-api",
"polkadot/xcm/xcm-simulator",
"polkadot/xcm/xcm-simulator/example",
"polkadot/xcm/xcm-simulator/fuzzer",
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
hash-db = { version = "0.16.0", default-features = false }
log = { workspace = true }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.0", default-features = false, features = ["derive"] }
static_assertions = { version = "1.1", optional = true }

# Bridge dependencies
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/messages_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

//! Helpers for implementing various message-related runtime API mthods.
//! Helpers for implementing various message-related runtime API methods.
use bp_messages::{
InboundMessageDetails, LaneId, MessageNonce, MessagePayload, OutboundMessageDetails,
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/messages_xcm_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<H: XcmBlobHauler> LocalXcmQueueManager<H> {
sender_and_lane: &SenderAndLane,
enqueued_messages: MessageNonce,
) {
// skip if we dont want to handle congestion
// skip if we don't want to handle congestion
if !H::supports_congestion_detection() {
return
}
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Chain for BridgedUnderlyingChain {
impl ChainWithGrandpa for BridgedUnderlyingChain {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = "";
const MAX_AUTHORITIES_COUNT: u32 = 16;
const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 = 8;
const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 = 8;
const MAX_MANDATORY_HEADER_SIZE: u32 = 256;
const AVERAGE_HEADER_SIZE: u32 = 64;
}
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/priority_calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod integrity_tests {
{
// just an estimation of extra transaction bytes that are added to every transaction
// (including signature, signed extensions extra and etc + in our case it includes
// all call arguments extept the proof itself)
// all call arguments except the proof itself)
let base_tx_size = 512;
// let's say we are relaying similar small messages and for every message we add more trie
// nodes to the proof (x0.5 because we expect some nodes to be reused)
Expand Down
4 changes: 2 additions & 2 deletions bridges/bin/runtime-common/src/refund_relayer_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ mod tests {
}

#[test]
fn validate_boosts_priority_of_message_delivery_transactons() {
fn validate_boosts_priority_of_message_delivery_transactions() {
run_test(|| {
initialize_environment(100, 100, 100);

Expand Down Expand Up @@ -1568,7 +1568,7 @@ mod tests {
}

#[test]
fn validate_does_not_boost_priority_of_message_delivery_transactons_with_too_many_messages() {
fn validate_does_not_boost_priority_of_message_delivery_transactions_with_too_many_messages() {
run_test(|| {
initialize_environment(100, 100, 100);

Expand Down
Loading

0 comments on commit 7fd2ea4

Please sign in to comment.