Skip to content

Commit

Permalink
Merge branch 'master' into feat/state-diff-guard
Browse files Browse the repository at this point in the history
  • Loading branch information
dastansam authored Apr 18, 2024
2 parents c7fad3f + 88a2f36 commit 064c27f
Show file tree
Hide file tree
Showing 258 changed files with 10,730 additions and 5,845 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/auto-add-parachain-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# If there are new issues related to the async backing feature,
# add it to the parachain team's board and set a custom "meta" field.

name: Add selected issues to Parachain team board
on:
issues:
types:
- labeled

jobs:
add-parachain-issues:
if: github.event.label.name == 'T16-async_backing'
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.PROJECT_APP_ID }}
private_key: ${{ secrets.PROJECT_APP_KEY }}
- name: Sync issues
uses: paritytech/github-issue-sync@v0.3.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ steps.generate_token.outputs.token }}
project: 119 # Parachain team board
project_field: 'meta'
project_value: 'async backing'
labels: |
T16-async_backing
2 changes: 1 addition & 1 deletion .github/workflows/fmt-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
container:
image: docker.io/paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240109
image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
URL=https://github.com/chevdor/tera-cli/releases/download/v0.2.4/tera-cli_linux_amd64.deb
wget $URL -O tera.deb
sudo dpkg -i tera.deb
tera --version
- name: Download artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
Expand Down Expand Up @@ -70,7 +69,7 @@ jobs:
export REF1=$(get_latest_release_tag)
if [[ -z "${{ inputs.version }}" ]]; then
export REF2="${{ github.ref }}"
export REF2="${{ github.ref_name }}"
else
export REF2="${{ inputs.version }}"
fi
Expand All @@ -79,10 +78,6 @@ jobs:
./scripts/release/build-changelogs.sh
echo "Checking the folder state"
pwd
ls -la scripts/release
- name: Archive artifact context.json
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
Expand Down Expand Up @@ -151,5 +146,5 @@ jobs:
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
**New version of polkadot tagged**: ${{ github.ref }}<br/>
**New version of polkadot tagged**: ${{ github.ref_name }}<br/>
Draft release created: ${{ needs.publish-release-draft.outputs.release_url }}
37 changes: 37 additions & 0 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,43 @@ jobs:
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Get PR data
id: comments
run: |
echo "bodies=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '[.comments[].body]')" >> "$GITHUB_OUTPUT"
echo "reviews=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews --jq '[.[].state]')" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Fail when author pushes new code
# Require new reviews when the author is pushing and he is not a member
if: |
contains(fromJson(steps.comments.outputs.reviews), 'APPROVED') &&
github.event_name == 'pull_request_target' &&
github.event.action == 'synchronize' &&
github.event.sender.login == github.event.pull_request.user.login &&
github.event.pull_request.author_association != 'CONTRIBUTOR' &&
github.event.pull_request.author_association != 'MEMBER'
run: |
echo "User's association is ${{ github.event.pull_request.author_association }}"
# We get the list of reviewers who approved the PR
REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
--jq '{reviewers: [.[] | select(.state == "APPROVED") | .user.login]}')
# We request them to review again
echo $REVIEWERS | gh api --method POST repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers --input -
echo "::error::Project needs to be reviewed again"
exit 1
env:
GH_TOKEN: ${{ github.token }}
- name: Comment requirements
# If the previous step failed and github-actions hasn't commented yet we comment instructions
if: failure() && !contains(fromJson(steps.comments.outputs.bodies), 'Review required! Latest push from author must always be reviewed')
run: |
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Review required! Latest push from author must always be reviewed"
env:
GH_TOKEN: ${{ github.token }}
COMMENTS: ${{ steps.comments.outputs.users }}
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
jobs:
sync-templates:
runs-on: ubuntu-latest
environment: master
strategy:
fail-fast: false
matrix:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/test-github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: test-github-actions

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:
test-linux-stable-int:
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 30
container:
image: "docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408"
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: WASM_BUILD_NO_COLOR=1 time cargo test -p staging-node-cli --release --locked -- --ignored
quick-benchmarks:
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 30
container:
image: "docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408"
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: time cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks --quiet -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
68 changes: 67 additions & 1 deletion Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ members = [
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo",
"cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend",
"cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend",
"cumulus/parachains/integration-tests/emulated/tests/people/people-rococo",
"cumulus/parachains/integration-tests/emulated/tests/people/people-westend",
"cumulus/parachains/pallets/collective-content",
Expand Down Expand Up @@ -300,6 +301,7 @@ members = [
"substrate/frame",
"substrate/frame/alliance",
"substrate/frame/asset-conversion",
"substrate/frame/asset-conversion/ops",
"substrate/frame/asset-rate",
"substrate/frame/assets",
"substrate/frame/atomic-swap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::messages_call_ext::{
CallHelper as MessagesCallHelper, CallInfo as MessagesCallInfo, MessagesCallSubType,
};
use bp_messages::{LaneId, MessageNonce};
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
use bp_relayers::{ExplicitOrAccountParams, RewardsAccountOwner, RewardsAccountParams};
use bp_runtime::{Chain, Parachain, ParachainIdOf, RangeInclusiveExt, StaticStrProvider};
use codec::{Codec, Decode, Encode};
use frame_support::{
Expand Down Expand Up @@ -589,7 +589,10 @@ where
);
},
RelayerAccountAction::Slash(relayer, slash_account) =>
RelayersPallet::<T::Runtime>::slash_and_deregister(&relayer, slash_account),
RelayersPallet::<T::Runtime>::slash_and_deregister(
&relayer,
ExplicitOrAccountParams::Params(slash_account),
),
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ benchmarks! {
let slash_destination = RewardsAccountParams::new(lane, *b"test", RewardsAccountOwner::ThisChain);
T::prepare_rewards_account(slash_destination, Zero::zero());
}: {
crate::Pallet::<T>::slash_and_deregister(&relayer, slash_destination)
crate::Pallet::<T>::slash_and_deregister(&relayer, slash_destination.into())
}
verify {
assert!(!crate::Pallet::<T>::is_registration_active(&relayer));
Expand Down
Loading

0 comments on commit 064c27f

Please sign in to comment.