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

Commit f85b890

Browse files
committed
Merge branch 'master' into td-signed-transactions
2 parents f8c9540 + d8d5da2 commit f85b890

File tree

584 files changed

+12980
-9144
lines changed

Some content is hidden

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

584 files changed

+12980
-9144
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
**/*.rs.bk
33
*.swp
44
.wasm-binaries
5-
polkadot/runtime/wasm/target/
6-
core/executor/wasm/target/
7-
core/test-runtime/wasm/target/
85
pwasm-alloc/target/
96
pwasm-libc/target/
107
pwasm-alloc/Cargo.lock
118
pwasm-libc/Cargo.lock
12-
node/runtime/wasm/target/
9+
bin/node/runtime/wasm/target/
1310
**/._*
1411
**/.criterion/
1512
.vscode

.gitlab-ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ test-linux-stable: &test-linux
148148
test-dependency-rules: &test-linux
149149
stage: test
150150
<<: *docker-env
151-
allow_failure: true
152151
except:
153152
variables:
154153
- $DEPLOY_TAG
@@ -219,14 +218,14 @@ check-web-wasm:
219218
script:
220219
# WASM support is in progress. As more and more crates support WASM, we
221220
# should add entries here. See https://github.com/paritytech/substrate/issues/2416
222-
- time cargo build --target=wasm32-unknown-unknown -p sr-io
223-
- time cargo build --target=wasm32-unknown-unknown -p sr-primitives
224-
- time cargo build --target=wasm32-unknown-unknown -p sr-std
225-
- time cargo build --target=wasm32-unknown-unknown -p substrate-client
226-
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-aura
227-
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-babe
228-
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-common
229-
- time cargo build --target=wasm32-unknown-unknown -p substrate-telemetry
221+
- time cargo build --target=wasm32-unknown-unknown -p sp-io
222+
- time cargo build --target=wasm32-unknown-unknown -p sp-runtime
223+
- time cargo build --target=wasm32-unknown-unknown -p sp-std
224+
- time cargo build --target=wasm32-unknown-unknown -p sc-client
225+
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura
226+
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe
227+
- time cargo build --target=wasm32-unknown-unknown -p sp-consensus
228+
- time cargo build --target=wasm32-unknown-unknown -p sc-telemetry
230229
# Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way.
231230
- time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown
232231
- sccache -s
@@ -370,7 +369,7 @@ check_polkadot:
370369
- git grep -l "polkadot-master" | grep toml | xargs sed -i "s/branch.*=.*\"polkadot-master\"/rev = \"$COMMIT_HASH\"/; s~https://github.com/paritytech/substrate~file://$SUBSTRATE_PATH~; s/,\s*}/ }/"
371370
# Make sure 'Cargo.lock' matches 'Cargo.toml'. It's enough to update one
372371
# package, others are updated along the way.
373-
- cargo update -p sr-io
372+
- cargo update -p sp-io
374373
# Check whether Polkadot 'master' branch builds with this Substrate commit.
375374
- time cargo check
376375
- cd -

.maintain/common.sh

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

.maintain/ensure-deps.sh

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,62 @@
33
# The script is meant to check if the rules regarding packages
44
# dependencies are satisfied.
55
# The general format is:
6-
# [top-lvl-dir]<[crate-name-prefix]
6+
# [top-lvl-dir] MESSAGE/[other-top-dir]
77

88
# For instance no crate within `./client` directory
99
# is allowed to import any crate with a directory path containing `frame`.
10-
# Such rule is just: `client<frame`.
10+
# Such rule is just: `client crates must not depend on anything in /frame`.
1111

1212
# The script should be run from the main repo directory!
1313

1414
set -u
1515

16+
# HARD FAILING
17+
MUST_NOT=(
18+
"client crates must not depend on anything in /frame"
19+
"client crates must not depend on anything in /node"
20+
"frame crates must not depend on anything in /node"
21+
"frame crates must not depend on anything in /client"
22+
"primitives crates must not depend on anything in /frame"
23+
)
24+
25+
# ONLY DISPLAYED, script still succeeds
1626
PLEASE_DONT=(
17-
"client<frame"
18-
"client<node"
19-
"frame<node"
20-
"frame<client"
21-
"primitives<frame"
22-
"primitives<client"
27+
"primitives crates should not depend on anything in /client"
2328
)
2429

2530
VIOLATIONS=()
2631
PACKAGES=()
2732

28-
for rule in "${PLEASE_DONT[@]}"
29-
do
30-
from=$(echo $rule | cut -f1 -d\<)
31-
to=$(echo $rule | cut -f2 -d\<)
33+
function check_rule() {
34+
rule=$1
35+
from=$(echo $rule | cut -f1 -d\ )
36+
to=$(echo $rule | cut -f2 -d\/)
3237

3338
cd $from
34-
echo "Checking rule $rule"
35-
packages=$(find -name Cargo.toml | xargs grep -wn "path.*$to")
39+
echo "Checking rule '$rule'"
40+
packages=$(find -name Cargo.toml | xargs grep -wn "path.*\.\.\/$to")
3641
has_references=$(echo -n $packages | wc -c)
3742
if [ "$has_references" != "0" ]; then
3843
VIOLATIONS+=("$rule")
3944
# Find packages that violate:
4045
PACKAGES+=("$packages")
4146
fi
4247
cd - > /dev/null
48+
}
49+
50+
for rule in "${MUST_NOT[@]}"
51+
do
52+
check_rule "$rule";
53+
done
54+
55+
# Only the MUST NOT will be counted towards failure
56+
HARD_VIOLATIONS=${#VIOLATIONS[@]}
57+
58+
59+
for rule in "${PLEASE_DONT[@]}"
60+
do
61+
check_rule "$rule";
4362
done
4463

4564
# Display violations and fail
@@ -58,4 +77,4 @@ EOF
5877
I=$I+1
5978
done
6079

61-
exit ${#VIOLATIONS[@]}
80+
exit $HARD_VIOLATIONS

.maintain/rename-crates-for-2.0.sh

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/bin/bash
2+
3+
function rust_rename() {
4+
sed -i "s/$1/$2/g" `grep -Rl --include="*.rs" --include="*.stderr" "$1" *` > /dev/null
5+
}
6+
7+
function cargo_rename() {
8+
find . -name "Cargo.toml" -exec sed -i "s/\(^\|[^\/]\)$1/\1$2/g" {} \;
9+
}
10+
11+
function rename_gitlabci() {
12+
sed -i "s/$1/$2/g" .gitlab-ci.yml
13+
}
14+
15+
function rename() {
16+
old=$(echo $1 | cut -f1 -d\ );
17+
new=$(echo $1 | cut -f2 -d\ );
18+
19+
echo "Renaming $old to $new"
20+
# rename in Cargo.tomls
21+
cargo_rename $old $new
22+
rename_gitlabci $old $new
23+
# and it appears, we have the same syntax in rust files
24+
rust_rename $old $new
25+
26+
# but generally we have the snail case syntax in rust files
27+
old=$(echo $old | sed s/-/_/g );
28+
new=$(echo $new | sed s/-/_/g );
29+
30+
echo " > $old to $new"
31+
rust_rename $old $new
32+
}
33+
34+
TO_RENAME=(
35+
# OLD-CRATE-NAME NEW-CRATE-NAME
36+
37+
# PRIMITIVES
38+
"substrate-application-crypto sc-application-crypto"
39+
"substrate-authority-discovery-primitives sp-authority-discovery"
40+
"substrate-block-builder-runtime-api sp-block-builder"
41+
"substrate-consensus-aura-primitives sp-consensus-aura"
42+
"substrate-consensus-babe-primitives sp-consensus-babe"
43+
"substrate-consensus-common sp-consensus"
44+
"substrate-consensus-pow-primitives sp-consensus-pow"
45+
"substrate-primitives sp-core"
46+
"substrate-debug-derive sp-debug-derive"
47+
"substrate-primitives-storage sp-storage"
48+
"substrate-externalities sp-externalities"
49+
"substrate-finality-grandpa-primitives sp-finality-granpda"
50+
"substrate-inherents sp-inherents"
51+
"substrate-keyring sp-keyring"
52+
"substrate-offchain-primitives sp-offchain"
53+
"substrate-panic-handler sp-panic-handler"
54+
"substrate-phragmen sp-phragmen"
55+
"substrate-rpc-primitives sp-rpc"
56+
"substrate-runtime-interface sp-runtime-interface"
57+
"substrate-runtime-interface-proc-macro sp-runtime-interface-proc-macro"
58+
"substrate-runtime-interface-test-wasm sp-runtime-interface-test-wasm"
59+
"substrate-serializer sp-serializer"
60+
"substrate-session sp-sesssion"
61+
"sr-api sp-api"
62+
"sr-api-proc-macro sp-api-proc-macro"
63+
"sr-api-test sp-api-test"
64+
"sr-arithmetic sp-arithmetic"
65+
"sr-arithmetic-fuzzer sp-arithmetic-fuzzer"
66+
"sr-io sp-io"
67+
"sr-primitives sp-runtime"
68+
"sr-sandbox sp-sandbox"
69+
"sr-staking-primitives sp-staking"
70+
"sr-std sp-std"
71+
"sr-version sp-version"
72+
"substrate-state-machine sp-state-machine"
73+
"substrate-transaction-pool-runtime-api sp-transaction-pool"
74+
"substrate-trie sp-trie"
75+
"substrate-wasm-interface sp-wasm-interface"
76+
77+
# # CLIENT
78+
"substrate-client sc-client"
79+
"substrate-client-api sc-api"
80+
"substrate-authority-discovery sc-authority-discovery"
81+
"substrate-basic-authorship sc-basic-authority"
82+
"substrate-block-builder sc-block-builder"
83+
"substrate-chain-spec sc-chain-spec"
84+
"substrate-chain-spec-derive sc-chain-spec-derive"
85+
"substrate-cli sc-cli"
86+
"substrate-consensus-aura sc-consensus-aura"
87+
"substrate-consensus-babe sc-consensus-babe"
88+
"substrate-consensus-pow sc-consensus-pow"
89+
"substrate-consensus-slots sc-consensus-slots"
90+
"substrate-consensus-uncles sc-consensus-uncles"
91+
"substrate-client-db sc-database"
92+
"substrate-executor sc-executor"
93+
"substrate-runtime-test sc-runtime-test"
94+
"substrate-finality-grandpa sc-finality-grandpa"
95+
"substrate-keystore sc-keystore"
96+
"substrate-network sc-network"
97+
"substrate-offchain sc-offchain"
98+
"substrate-peerset sc-peerset"
99+
"substrate-rpc-servers sc-rpc-server"
100+
"substrate-rpc sc-rpc"
101+
"substrate-service sc-service"
102+
"substrate-service-test sc-service-test"
103+
"substrate-state-db sc-state-db"
104+
"substrate-telemetry sc-telemetry"
105+
"substrate-tracing sc-tracing"
106+
107+
);
108+
109+
for rule in "${TO_RENAME[@]}"
110+
do
111+
rename "$rule";
112+
done

.maintain/update.sh

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

0 commit comments

Comments
 (0)