Skip to content

Commit 8df4bfd

Browse files
authored
Merge pull request #876 from KILTprotocol/release-1.15.2
Release 1.15.2
2 parents c1dc94c + 32cae95 commit 8df4bfd

594 files changed

Lines changed: 28983 additions & 10659 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo-deny.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ignore = [
1515
{ id = "RUSTSEC-2024-0336", reason = "`rustls` vulnerability. Re-verify upon next polkadot-sdk updates." },
1616
{ id = "RUSTSEC-2024-0344", reason = "`curve25519-dalek` vulnerability. Re-verify upon next polkadot-sdk updates." },
1717
{ id = "RUSTSEC-2024-0370", reason = "`proc-macro-error` is unmaintained but a Substrate dependency. Re-verify upon next polkadot-sdk updates." },
18+
{ id = "RUSTSEC-2024-0384", reason = "`instant` is unmaintained but a Substrate dependency. Re-verify upon next polkadot-sdk updates." },
19+
{ id = "RUSTSEC-2024-0388", reason = "`derivative` is unmaintained but a Substrate dependency. Re-verify upon next polkadot-sdk updates." },
20+
{ id = "RUSTSEC-2024-0421", reason = "`idna` has a security vulnerability but a Substrate dependency. Re-verify upon next polkadot-sdk updates." },
1821
]
1922
yanked = "deny"
2023

.cargo/config.toml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Unfortunately we cannot add any lints based on `cfg(test)` nor `cfg(feature = "feat")`: https://github.com/rust-lang/cargo/issues/8170.
2+
# Hence, we can only define lints that are applied codebase-wide (including tests), and lints that are applied only to runtime code.
3+
4+
# Codebase-wide lints.
5+
[target.'cfg(all())']
6+
rustflags = [
7+
# We need to deny warnings here instead of with the `RUSTFLAGS` env since the env variable would completely override these settings -> https://github.com/rust-lang/cargo/issues/5376.
8+
"-Dwarnings",
9+
"-Wclippy::as_underscore",
10+
"-Wclippy::assertions_on_result_states",
11+
"-Wclippy::branches_sharing_code",
12+
"-Wclippy::clear_with_drain",
13+
"-Wclippy::clone_on_ref_ptr",
14+
"-Wclippy::collection_is_never_read",
15+
"-Wclippy::derive_partial_eq_without_eq",
16+
"-Wclippy::else_if_without_else",
17+
"-Wclippy::empty_drop",
18+
"-Wclippy::empty_structs_with_brackets",
19+
"-Wclippy::equatable_if_let",
20+
"-Wclippy::if_then_some_else_none",
21+
"-Wclippy::impl_trait_in_params",
22+
"-Wclippy::iter_on_empty_collections",
23+
"-Wclippy::iter_on_single_items",
24+
"-Wclippy::iter_with_drain",
25+
"-Wclippy::needless_collect",
26+
"-Wclippy::needless_pass_by_ref_mut",
27+
"-Wclippy::negative_feature_names",
28+
"-Wclippy::option_if_let_else",
29+
"-Wclippy::or_fun_call",
30+
"-Wclippy::pub_without_shorthand",
31+
"-Wclippy::redundant_clone",
32+
"-Wclippy::redundant_type_annotations",
33+
"-Wclippy::ref_patterns",
34+
"-Wclippy::rest_pat_in_fully_bound_structs",
35+
"-Wclippy::suspicious_operation_groupings",
36+
"-Wclippy::tests_outside_test_module",
37+
"-Wclippy::type_repetition_in_bounds",
38+
"-Wclippy::unnecessary_self_imports",
39+
"-Wclippy::unnecessary_struct_initialization",
40+
"-Wclippy::unneeded_field_pattern",
41+
"-Wclippy::unused_peekable",
42+
"-Wclippy::useless_let_if_seq",
43+
"-Wclippy::wildcard_dependencies",
44+
# TODO: Add after upgrading to 1.76
45+
# "-Wclippy::infinite_loop",
46+
# TODO: Add after upgrading to 1.77
47+
#"-Wclippy::empty_enum_variants_with_brackets"
48+
# TODO: Add after upgrading to 1.80
49+
#"-Wclippy::renamed_function_params"
50+
# TODO: Add after upgrading to 1.81
51+
#"-Wclippy::cfg_not_test"
52+
#"-Wclippy::allow_attributes",
53+
# "-Wclippy::allow_attributes_without_reason",
54+
# TODO: Add after upgrading to 1.83
55+
#"-Wclippy::unused_trait_names"
56+
]
57+
58+
# Deployment runtime lints.
59+
[target.'cfg(target_arch = "wasm32")']
60+
rustflags = [
61+
"-Dclippy::arithmetic_side_effects",
62+
"-Dclippy::as_conversions",
63+
"-Dclippy::assertions_on_result_states",
64+
"-Dclippy::cast_possible_wrap",
65+
"-Dclippy::dbg_macro",
66+
"-Dclippy::expect_used",
67+
"-Dclippy::float_arithmetic",
68+
"-Dclippy::float_cmp_const",
69+
"-Dclippy::index_refutable_slice",
70+
"-Dclippy::indexing_slicing",
71+
"-Dclippy::lossy_float_literal",
72+
"-Dclippy::modulo_arithmetic",
73+
"-Dclippy::panic",
74+
"-Dclippy::string_slice",
75+
"-Dclippy::todo",
76+
"-Dclippy::unimplemented",
77+
"-Dclippy::unreachable",
78+
"-Dclippy::unwrap_used",
79+
"-Funsafe_code",
80+
"-Wclippy::alloc_instead_of_core",
81+
"-Wclippy::decimal_literal_representation",
82+
"-Wclippy::default_numeric_fallback",
83+
"-Wclippy::error_impl_error",
84+
"-Wclippy::integer_division",
85+
"-Wclippy::let_underscore_must_use",
86+
"-Wclippy::let_underscore_untyped",
87+
"-Wclippy::missing_const_for_fn",
88+
"-Wclippy::mixed_read_write_in_expression",
89+
"-Wclippy::print_stderr",
90+
"-Wclippy::print_stdout",
91+
"-Wclippy::shadow_reuse",
92+
"-Wclippy::shadow_same",
93+
"-Wclippy::shadow_unrelated",
94+
"-Wclippy::str_to_string",
95+
"-Wclippy::string_slice",
96+
"-Wclippy::string_to_string",
97+
]

.github/workflows/check-code.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,19 @@ jobs:
3939
env:
4040
# Configured by the Docker image. We can't change this unless the image does it.
4141
CARGO_HOME: /usr/local/cargo
42-
RUSTFLAGS: -D warnings
4342
SKIP_WASM_BUILD: 1
4443
needs: get-commit-head
4544
if: ${{ !contains(needs.get-commit-head.outputs.headCommitMsg, 'ci-skip-rust') }}
4645

4746
strategy:
4847
matrix:
49-
features:
50-
-
51-
- --all-features
48+
cargo-flags:
49+
# Generic clippy checks for all features
50+
- --all-targets --all-features
51+
# Generic clippy checks for no features (catches some missing `no_std`-only lints)
52+
- --all-targets
53+
# Clippy lints specifically for all runtime code, excluding all test and binary crates
54+
- --target wasm32-unknown-unknown --no-default-features --workspace --exclude kilt-parachain --exclude standalone-node --exclude xcm-integration-tests --exclude 'dip-provider*' --exclude 'dip-consumer*'
5255
fail-fast: false
5356

5457
steps:
@@ -63,11 +66,11 @@ jobs:
6366
${{ env.CARGO_HOME }}/registry/index/
6467
${{ env.CARGO_HOME }}/registry/cache/
6568
${{ env.CARGO_HOME }}/git/db/
66-
key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}
69+
key: ${{ github.job }}-${{ github.ref }}-${{ matrix.cargo-flags }}-${{ hashFiles('**/Cargo.lock') }}
6770
save-always: true
6871

6972
- name: Run `cargo clippy`
70-
run: cargo clippy --all-targets --locked ${{ matrix.features }}
73+
run: cargo clippy --locked --no-deps ${{ matrix.cargo-flags }}
7174

7275
cargo-fmt:
7376
name: Check formatting
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Docs PR Check
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref_name }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
check-docs-pr:
12+
runs-on: ubuntu-latest
13+
env:
14+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Check for Skip Label
21+
run: |
22+
if gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels | .[].name' | grep -q 'ci-skip-docs-pr'; then
23+
echo "SKIP_DOCS_PR_CHECK=true" >> $GITHUB_ENV
24+
else
25+
echo "SKIP_DOCS_PR_CHECK=false" >> $GITHUB_ENV
26+
fi
27+
28+
- name: Ensure Linked Docs PR
29+
if: env.SKIP_DOCS_PR_CHECK == 'false'
30+
env:
31+
DOCS_REPO: KILTprotocol/docs
32+
PR_NO: ${{ github.event.pull_request.number }}
33+
run: |
34+
DOCS_PRS=$(gh pr list --repo $DOCS_REPO --json number,body,title --jq '.[]')
35+
36+
MATCHING_PR=$(echo "$DOCS_PRS" | jq -r "select(.body | contains(\"#${PR_NO}\") or .title | contains(\"#${PR_NO}\"))")
37+
38+
if [ -z "$MATCHING_PR" ]; then
39+
echo "Please link a docs PR for code PR #${PR_NO} or apply the 'ci-skip-docs-pr' label."
40+
exit 1
41+
else
42+
echo "Matching docs PR found for code PR #${PR_NOPR_NO}."
43+
fi

.gitlab-ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ build-production-wasm:
2020
- export PARACHAIN_PALLET_ID=0x50
2121
- export AUTHORIZE_UPGRADE_PREFIX=0x02
2222
- export AUTHORIZE_UPGRADE_CHECK_VERSION=true
23+
- export VERBOSE=true
24+
- export BUILD_OPTS="--features metadata-hash"
2325
- cp -r * /build
2426
- /srtool/build build
2527
- subwasm meta --format=json+scale /out/${RUNTIME}_runtime.compact.wasm > /out/${RUNTIME}-metadata.json
@@ -77,12 +79,9 @@ build-docker-images:
7779
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: "kiltprotocol/dip-provider-node-template"
7880
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: "kiltprotocol/dip-consumer-node-template"
7981
before_script:
80-
- aws --version
8182
- docker --version
8283
script:
8384
- echo -n $CI_REGISTRY_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
84-
- aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY
85-
- ./.maintain/docker-auth-config.sh
8685

8786
- ./.maintain/build-image.sh build
8887
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_SHORT_SHA}; fi"

.maintain/build-image.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ target_tag=$1
77
# Build the builder image and push it in the background
88
docker build \
99
--target builder \
10-
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
11-
-t $AWS_REGISTRY/kilt-parachain/collator:builder \
10+
--cache-from $CI_REGISTRY/$ORGANIZATION/kilt-node:builder \
11+
-t $CI_REGISTRY/$ORGANIZATION/kilt-node:builder \
1212
. &
13-
docker push $AWS_REGISTRY/kilt-parachain/collator:builder &
13+
docker push $CI_REGISTRY/$ORGANIZATION/kilt-node:builder &
1414

1515
wait
1616

@@ -21,19 +21,19 @@ build_and_tag() {
2121
local cache_image=$3
2222

2323
docker build \
24-
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
25-
--cache-from $AWS_REGISTRY/$cache_image:$target_tag \
24+
--cache-from $CI_REGISTRY/$ORGANIZATION/kilt-node:builder \
25+
--cache-from $CI_REGISTRY/$ORGANIZATION/$cache_image:$target_tag \
2626
--build-arg NODE_TYPE=$node_type \
2727
-t local/$image_name:$target_tag \
2828
.
2929
}
3030

31-
build_and_tag "kilt-parachain" "kilt-node" "kilt-parachain/collator" &
31+
build_and_tag "kilt-parachain" "kilt-node" "kilt-node" &
3232

33-
build_and_tag "standalone-node" "standalone-node" "kilt/prototype-chain" &
33+
build_and_tag "standalone-node" "standalone-node" "standalone-node" &
3434

35-
build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-parachain/collator" &
35+
build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-node" &
3636

37-
build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-parachain/collator" &
37+
build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-node" &
3838

3939
wait

.maintain/docker-auth-config.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.maintain/media/kilt.png

-34.7 KB
Binary file not shown.

.maintain/push-image.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,4 @@ tag_and_push local/kilt-node:$source_tag ${DOCKER_HUB_PARACHAIN}:$target_tag
2121
tag_and_push local/$PROVIDER_BIN_NAME:$source_tag ${DOCKER_HUB_DIP_PROVIDER_TEMPLATE}:$target_tag
2222
tag_and_push local/$CONSUMER_BIN_NAME:$source_tag ${DOCKER_HUB_DIP_CONSUMER_TEMPLATE}:$target_tag
2323

24-
# Tag and push to AWS
25-
tag_and_push local/standalone-node:$source_tag $AWS_REGISTRY/standalone-node:$target_tag
26-
tag_and_push local/kilt-node:$source_tag $AWS_REGISTRY/kilt-node:$target_tag
27-
tag_and_push local/$PROVIDER_BIN_NAME:$source_tag $AWS_REGISTRY/$PROVIDER_BIN_NAME:$target_tag
28-
tag_and_push local/$CONSUMER_BIN_NAME:$source_tag $AWS_REGISTRY/$CONSUMER_BIN_NAME:$target_tag
29-
3024
wait

.maintain/runtime-weight-template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
{{/each}}
1414

1515
#![cfg_attr(rustfmt, rustfmt_skip)]
16-
#![allow(unused_parens)]
1716
#![allow(unused_imports)]
17+
#![allow(clippy::as_conversions)]
1818

1919
use frame_support::{traits::Get, weights::Weight};
2020
use sp_std::marker::PhantomData;

0 commit comments

Comments
 (0)