Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit d2404b0

Browse files
committed
Merge remote-tracking branch 'origin/master' into gui-doublemap
2 parents 831df57 + 29fa243 commit d2404b0

File tree

280 files changed

+4281
-2500
lines changed

Some content is hidden

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

280 files changed

+4281
-2500
lines changed

.gitlab-ci.yml

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ check-line-width:
127127
allow_failure: true
128128

129129

130+
check-polkadot:
131+
stage: build
132+
<<: *docker-env
133+
script:
134+
- ./.maintain/gitlab/check_polkadot.sh
135+
interruptible: true
136+
allow_failure: true
137+
138+
130139
cargo-audit:
131140
stage: test
132141
<<: *docker-env
@@ -136,6 +145,20 @@ cargo-audit:
136145
- cargo audit
137146
allow_failure: true
138147

148+
cargo-deny:
149+
stage: test
150+
<<: *docker-env
151+
script:
152+
- cargo deny check --hide-inclusion-graph -c .maintain/deny.toml
153+
after_script:
154+
- echo "___The complete log is in the artifacts___"
155+
- cargo deny check -c .maintain/deny.toml 2> deny.log
156+
artifacts:
157+
name: $CI_COMMIT_SHORT_SHA
158+
expire_in: 3 days
159+
when: always
160+
paths:
161+
- deny.log
139162

140163
cargo-check-benches:
141164
stage: test
@@ -167,7 +190,7 @@ test-linux-stable: &test-linux
167190
variables:
168191
- $DEPLOY_TAG
169192
script:
170-
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |
193+
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |&
171194
tee output.log
172195
- sccache -s
173196
after_script:
@@ -248,6 +271,22 @@ test-wasmtime:
248271
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime
249272
- sccache -s
250273

274+
test-runtime-benchmarks:
275+
stage: test
276+
<<: *docker-env
277+
variables:
278+
# Enable debug assertions since we are running optimized builds for testing
279+
# but still want to have debug assertions.
280+
RUSTFLAGS: -Cdebug-assertions=y
281+
RUST_BACKTRACE: 1
282+
except:
283+
variables:
284+
- $DEPLOY_TAG
285+
script:
286+
- cd bin/node/cli
287+
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --verbose --features runtime-benchmarks
288+
- sccache -s
289+
251290
test-linux-stable-int:
252291
<<: *test-linux
253292
except:
@@ -394,30 +433,6 @@ check_warnings:
394433
echo "___No warnings___";
395434
fi
396435

397-
# Nightly check whether Polkadot 'master' branch builds.
398-
check_polkadot:
399-
stage: build
400-
<<: *docker-env
401-
allow_failure: true
402-
only:
403-
- master
404-
- schedules
405-
script:
406-
- SUBSTRATE_PATH=$(pwd)
407-
# Clone the current Polkadot master branch into ./polkadot.
408-
- git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git
409-
- cd polkadot
410-
# Make sure we override the crates in native and wasm build
411-
- mkdir .cargo
412-
- echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config
413-
- mkdir -p target/debug/wbuild/.cargo
414-
- echo "paths = [ \"$SUBSTRATE_PATH\" ]" > target/debug/wbuild/.cargo/config
415-
# package, others are updated along the way.
416-
- cargo update
417-
# Check whether Polkadot 'master' branch builds with this Substrate commit.
418-
- time cargo check
419-
- cd -
420-
- sccache -s
421436

422437
trigger-contracts-ci:
423438
stage: publish

.maintain/deny.toml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# This template contains all of the possible sections and their default values
2+
3+
# Note that all fields that take a lint level have these possible values:
4+
# * deny - An error will be produced and the check will fail
5+
# * warn - A warning will be produced, but the check will not fail
6+
# * allow - No warning or error will be produced, though in some cases a note
7+
# will be
8+
9+
# The values provided in this template are the default values that will be used
10+
# when any section or field is not specified in your own configuration
11+
12+
# If 1 or more target triples (and optionally, target_features) are specified,
13+
# only the specified targets will be checked when running `cargo deny check`.
14+
# This means, if a particular package is only ever used as a target specific
15+
# dependency, such as, for example, the `nix` crate only being used via the
16+
# `target_family = "unix"` configuration, that only having windows targets in
17+
# this list would mean the nix crate, as well as any of its exclusive
18+
# dependencies not shared by any other crates, would be ignored, as the target
19+
# list here is effectively saying which targets you are building for.
20+
targets = [
21+
# The triple can be any string, but only the target triples built in to
22+
# rustc (as of 1.40) can be checked against actual config expressions
23+
#{ triple = "x86_64-unknown-linux-musl" },
24+
# You can also specify which target_features you promise are enabled for a
25+
# particular target. target_features are currently not validated against
26+
# the actual valid features supported by the target architecture.
27+
#{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
28+
]
29+
30+
# This section is considered when running `cargo deny check advisories`
31+
# More documentation for the advisories section can be found here:
32+
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
33+
[advisories]
34+
# The path where the advisory database is cloned/fetched into
35+
db-path = "~/.cargo/advisory-db"
36+
# The url of the advisory database to use
37+
db-url = "https://github.com/rustsec/advisory-db"
38+
# The lint level for security vulnerabilities
39+
vulnerability = "deny"
40+
# The lint level for unmaintained crates
41+
unmaintained = "warn"
42+
# The lint level for crates that have been yanked from their source registry
43+
yanked = "warn"
44+
# The lint level for crates with security notices. Note that as of
45+
# 2019-12-17 there are no security notice advisories in
46+
# https://github.com/rustsec/advisory-db
47+
notice = "warn"
48+
# A list of advisory IDs to ignore. Note that ignored advisories will still
49+
# output a note when they are encountered.
50+
ignore = [
51+
#"RUSTSEC-0000-0000",
52+
]
53+
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
54+
# lower than the range specified will be ignored. Note that ignored advisories
55+
# will still output a note when they are encountered.
56+
# * None - CVSS Score 0.0
57+
# * Low - CVSS Score 0.1 - 3.9
58+
# * Medium - CVSS Score 4.0 - 6.9
59+
# * High - CVSS Score 7.0 - 8.9
60+
# * Critical - CVSS Score 9.0 - 10.0
61+
#severity-threshold =
62+
63+
# This section is considered when running `cargo deny check licenses`
64+
# More documentation for the licenses section can be found here:
65+
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
66+
[licenses]
67+
# The lint level for crates which do not have a detectable license
68+
unlicensed = "deny"
69+
# List of explictly allowed licenses
70+
# See https://spdx.org/licenses/ for list of possible licenses
71+
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
72+
allow = [
73+
#"MIT",
74+
#"Apache-2.0",
75+
#"Apache-2.0 WITH LLVM-exception",
76+
]
77+
# List of explictly disallowed licenses
78+
# See https://spdx.org/licenses/ for list of possible licenses
79+
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
80+
deny = [
81+
#"Nokia",
82+
]
83+
# Lint level for licenses considered copyleft
84+
copyleft = "allow"
85+
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
86+
# * both - The license will be approved if it is both OSI-approved *AND* FSF
87+
# * either - The license will be approved if it is either OSI-approved *OR* FSF
88+
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
89+
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
90+
# * neither - This predicate is ignored and the default lint level is used
91+
allow-osi-fsf-free = "either"
92+
# Lint level used when no other predicates are matched
93+
# 1. License isn't in the allow or deny lists
94+
# 2. License isn't copyleft
95+
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
96+
default = "deny"
97+
# The confidence threshold for detecting a license from license text.
98+
# The higher the value, the more closely the license text must be to the
99+
# canonical license text of a valid SPDX license file.
100+
# [possible values: any between 0.0 and 1.0].
101+
confidence-threshold = 0.9
102+
# Allow 1 or more licenses on a per-crate basis, so that particular licenses
103+
# aren't accepted for every possible crate as with the normal allow list
104+
exceptions = [
105+
# Each entry is the crate and version constraint, and its specific allow
106+
# list
107+
#{ allow = ["Zlib"], name = "adler32", version = "*" },
108+
]
109+
110+
# Some crates don't have (easily) machine readable licensing information,
111+
# adding a clarification entry for it allows you to manually specify the
112+
# licensing information
113+
[[licenses.clarify]]
114+
# The name of the crate the clarification applies to
115+
name = "ring"
116+
# THe optional version constraint for the crate
117+
#version = "*"
118+
# The SPDX expression for the license requirements of the crate
119+
expression = "OpenSSL"
120+
# One or more files in the crate's source used as the "source of truth" for
121+
# the license expression. If the contents match, the clarification will be used
122+
# when running the license check, otherwise the clarification will be ignored
123+
# and the crate will be checked normally, which may produce warnings or errors
124+
# depending on the rest of your configuration
125+
license-files = [
126+
# Each entry is a crate relative path, and the (opaque) hash of its contents
127+
{ path = "LICENSE", hash = 0xbd0eed23 }
128+
]
129+
[[licenses.clarify]]
130+
name = "webpki"
131+
expression = "ISC"
132+
license-files = [{ path = "LICENSE", hash = 0x001c7e6c }]
133+
134+
[licenses.private]
135+
# If true, ignores workspace crates that aren't published, or are only
136+
# published to private registries
137+
ignore = false
138+
# One or more private registries that you might publish crates to, if a crate
139+
# is only published to private registries, and ignore is true, the crate will
140+
# not have its license(s) checked
141+
registries = [
142+
#"https://sekretz.com/registry
143+
]
144+
145+
# This section is considered when running `cargo deny check bans`.
146+
# More documentation about the 'bans' section can be found here:
147+
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
148+
[bans]
149+
# Lint level for when multiple versions of the same crate are detected
150+
multiple-versions = "warn"
151+
# The graph highlighting used when creating dotgraphs for crates
152+
# with multiple versions
153+
# * lowest-version - The path to the lowest versioned duplicate is highlighted
154+
# * simplest-path - The path to the version with the fewest edges is highlighted
155+
# * all - Both lowest-version and simplest-path are used
156+
highlight = "lowest-version"
157+
# List of crates that are allowed. Use with care!
158+
allow = [
159+
#{ name = "ansi_term", version = "=0.11.0" },
160+
]
161+
# List of crates to deny
162+
deny = [
163+
{ name = "parity-util-mem", version = "<0.6" }
164+
# Each entry the name of a crate and a version range. If version is
165+
# not specified, all versions will be matched.
166+
]
167+
# Certain crates/versions that will be skipped when doing duplicate detection.
168+
skip = [
169+
#{ name = "ansi_term", version = "=0.11.0" },
170+
]
171+
# Similarly to `skip` allows you to skip certain crates during duplicate
172+
# detection. Unlike skip, it also includes the entire tree of transitive
173+
# dependencies starting at the specified crate, up to a certain depth, which is
174+
# by default infinite
175+
skip-tree = [
176+
#{ name = "ansi_term", version = "=0.11.0", depth = 20 },
177+
]
178+
179+
# This section is considered when running `cargo deny check sources`.
180+
# More documentation about the 'sources' section can be found here:
181+
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
182+
[sources]
183+
# Lint level for what to happen when a crate from a crate registry that is not
184+
# in the allow list is encountered
185+
unknown-registry = "deny"
186+
# Lint level for what to happen when a crate from a git repository that is not
187+
# in the allow list is encountered
188+
unknown-git = "warn"
189+
# List of URLs for allowed crate registries. Defaults to the crates.io index
190+
# if not specified. If it is specified but empty, no registries are allowed.
191+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
192+
# List of URLs for allowed Git repositories
193+
allow-git = []

.maintain/gitlab/check_polkadot.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/sh
2+
#
3+
# check if a pr is compatible with polkadot companion pr or master if not
4+
# available
5+
#
6+
# mark companion pr in the body of the polkadot pr like
7+
#
8+
# polkadot companion: paritytech/polkadot#567
9+
10+
11+
github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
12+
# use github api v3 in order to access the data without authentication
13+
github_header="Accept: application/vnd.github.v3+json"
14+
15+
boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; }
16+
boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
17+
18+
19+
20+
boldcat <<-EOT
21+
22+
23+
check_polkadot
24+
==============
25+
26+
this job checks if there is a string in the description of the pr like
27+
28+
polkadot companion: paritytech/polkadot#567
29+
30+
31+
it will then run cargo check from this polkadot's branch with substrate code
32+
from this pull request.
33+
34+
35+
EOT
36+
37+
38+
39+
SUBSTRATE_PATH=$(pwd)
40+
41+
# Clone the current Polkadot master branch into ./polkadot.
42+
git clone --depth 1 https://github.com/paritytech/polkadot.git
43+
44+
cd polkadot
45+
46+
# either it's a pull request then check for a companion otherwise use
47+
# polkadot:master
48+
if expr match "${CI_COMMIT_REF_NAME}" '^[0-9]\+$' >/dev/null
49+
then
50+
boldprint "this is pull request no ${CI_COMMIT_REF_NAME}"
51+
# get the last reference to a pr in polkadot
52+
comppr="$(curl -H "${github_header}" -s ${github_api_substrate_pull_url}/${CI_COMMIT_REF_NAME} \
53+
| sed -n -r 's;^[[:space:]]+"body":[[:space:]]+".*polkadot companion: paritytech/polkadot#([0-9]+).*"[^"]+$;\1;p;$!d')"
54+
if [ "${comppr}" ]
55+
then
56+
boldprint "companion pr specified: #${comppr}"
57+
git fetch --depth 1 origin refs/pull/${comppr}/head:pr/${comppr}
58+
git checkout pr/${comppr}
59+
else
60+
boldprint "no companion pr declared - building polkadot:master"
61+
fi
62+
else
63+
boldprint "this is not a pull request - building polkadot:master"
64+
fi
65+
66+
# Make sure we override the crates in native and wasm build
67+
# patching the git path as described in the link below did not test correctly
68+
# https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html
69+
mkdir .cargo
70+
echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config
71+
72+
mkdir -p target/debug/wbuild/.cargo
73+
cp .cargo/config target/debug/wbuild/.cargo/config
74+
75+
# package, others are updated along the way.
76+
cargo update
77+
78+
# Test Polkadot pr or master branch with this Substrate commit.
79+
time cargo test --all --release --verbose
80+

0 commit comments

Comments
 (0)