Skip to content

Commit 8b00c38

Browse files
authored
feat: MMD-1309 / Update from Substrate 3 to latest commit 852bab073407b65b5e3e461baaa0541c4e0bc3d6 dated 31st Aug (#223)
* update to Substrate commit 5e1aab8192cd84b653e023db5ee83abda856438c * update to Substrate commit 670ca51e954182746fa3bf76214f2b1b560c1f90 * update to Substrate commit b7a1a2cda5c860f18a7802051e881c5062828042 * update to Substrate commit 852bab073407b65b5e3e461baaa0541c4e0bc3d6 * fix indentation * rebuild Cargo.lock * update rustc version * remove old wasm * generate chain spec, definitions, and wasm * add uncles * remove useless extension for light clients since it only supports Babe but we are using Aura now
1 parent 484b12e commit 8b00c38

File tree

85 files changed

+2312
-3466
lines changed

Some content is hidden

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

85 files changed

+2312
-3466
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818
- name: Add wasm toolchain
1919
uses: actions-rs/toolchain@v1
2020
with:
21-
toolchain: nightly-2021-07-30
21+
toolchain: nightly-2021-08-31
2222
target: wasm32-unknown-unknown
2323
override: true
2424

2525
- name: Initialize environment and build
2626
run: |
2727
rustup update stable
28-
rustup toolchain install nightly-2021-07-30
29-
rustup default nightly-2021-07-30
30-
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-07-30
28+
rustup toolchain install nightly-2021-08-31
29+
rustup default nightly-2021-08-31
30+
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
3131
cargo build --release
3232
3333
- name: Upload artifact

.github/workflows/test.yml

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
- name: Initialize WASM build environment
2727
run: |
2828
rustup update stable
29-
rustup toolchain install nightly-2021-07-30
30-
rustup default nightly-2021-07-30
31-
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-07-30
29+
rustup toolchain install nightly-2021-08-31
30+
rustup default nightly-2021-08-31
31+
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
3232
3333
- name: Run cargo check
34-
run: cargo +nightly-2021-07-30 check
34+
run: cargo +nightly-2021-08-31 check
3535

3636
test:
3737
name: Test Suite
@@ -56,46 +56,46 @@ jobs:
5656
- name: Initialize WASM build environment
5757
run: |
5858
rustup update stable
59-
rustup toolchain install nightly-2021-07-30
60-
rustup default nightly-2021-07-30
61-
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-07-30
59+
rustup toolchain install nightly-2021-08-31
60+
rustup default nightly-2021-08-31
61+
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
6262
6363
# Runs integration tests in the runtime/tests folder
6464
- name: Run Integration Tests across all runtime modules
6565
run: |
66-
cargo +nightly-2021-07-30 test -p datahighway-runtime
66+
cargo +nightly-2021-08-31 test -p datahighway-runtime
6767
6868
# Runs unit tests in each runtime module of the pallet folder
6969
- name: Run Unit Tests in each runtime module
7070
run: |
71-
cargo +nightly-2021-07-30 test -p roaming-operators &&
72-
cargo +nightly-2021-07-30 test -p roaming-networks &&
73-
cargo +nightly-2021-07-30 test -p roaming-organizations &&
74-
cargo +nightly-2021-07-30 test -p roaming-network-servers &&
75-
cargo +nightly-2021-07-30 test -p roaming-devices &&
76-
cargo +nightly-2021-07-30 test -p roaming-routing-profiles &&
77-
cargo +nightly-2021-07-30 test -p roaming-service-profiles &&
78-
cargo +nightly-2021-07-30 test -p roaming-accounting-policies &&
79-
cargo +nightly-2021-07-30 test -p roaming-agreement-policies &&
80-
cargo +nightly-2021-07-30 test -p roaming-network-profiles &&
81-
cargo +nightly-2021-07-30 test -p roaming-device-profiles &&
82-
cargo +nightly-2021-07-30 test -p roaming-sessions &&
83-
cargo +nightly-2021-07-30 test -p roaming-billing-policies &&
84-
cargo +nightly-2021-07-30 test -p roaming-charging-policies &&
85-
cargo +nightly-2021-07-30 test -p roaming-packet-bundles &&
86-
cargo +nightly-2021-07-30 test -p mining-setting-token &&
87-
cargo +nightly-2021-07-30 test -p mining-setting-hardware &&
88-
cargo +nightly-2021-07-30 test -p mining-rates-token &&
89-
cargo +nightly-2021-07-30 test -p mining-rates-hardware &&
90-
cargo +nightly-2021-07-30 test -p mining-sampling-token &&
91-
cargo +nightly-2021-07-30 test -p mining-sampling-hardware &&
92-
cargo +nightly-2021-07-30 test -p mining-eligibility-token &&
93-
cargo +nightly-2021-07-30 test -p mining-eligibility-hardware &&
94-
cargo +nightly-2021-07-30 test -p mining-eligibility-proxy &&
95-
cargo +nightly-2021-07-30 test -p mining-claims-token &&
96-
cargo +nightly-2021-07-30 test -p mining-claims-hardware &&
97-
cargo +nightly-2021-07-30 test -p mining-execution-token &&
98-
cargo +nightly-2021-07-30 test -p exchange-rate
71+
cargo +nightly-2021-08-31 test -p roaming-operators &&
72+
cargo +nightly-2021-08-31 test -p roaming-networks &&
73+
cargo +nightly-2021-08-31 test -p roaming-organizations &&
74+
cargo +nightly-2021-08-31 test -p roaming-network-servers &&
75+
cargo +nightly-2021-08-31 test -p roaming-devices &&
76+
cargo +nightly-2021-08-31 test -p roaming-routing-profiles &&
77+
cargo +nightly-2021-08-31 test -p roaming-service-profiles &&
78+
cargo +nightly-2021-08-31 test -p roaming-accounting-policies &&
79+
cargo +nightly-2021-08-31 test -p roaming-agreement-policies &&
80+
cargo +nightly-2021-08-31 test -p roaming-network-profiles &&
81+
cargo +nightly-2021-08-31 test -p roaming-device-profiles &&
82+
cargo +nightly-2021-08-31 test -p roaming-sessions &&
83+
cargo +nightly-2021-08-31 test -p roaming-billing-policies &&
84+
cargo +nightly-2021-08-31 test -p roaming-charging-policies &&
85+
cargo +nightly-2021-08-31 test -p roaming-packet-bundles &&
86+
cargo +nightly-2021-08-31 test -p mining-setting-token &&
87+
cargo +nightly-2021-08-31 test -p mining-setting-hardware &&
88+
cargo +nightly-2021-08-31 test -p mining-rates-token &&
89+
cargo +nightly-2021-08-31 test -p mining-rates-hardware &&
90+
cargo +nightly-2021-08-31 test -p mining-sampling-token &&
91+
cargo +nightly-2021-08-31 test -p mining-sampling-hardware &&
92+
cargo +nightly-2021-08-31 test -p mining-eligibility-token &&
93+
cargo +nightly-2021-08-31 test -p mining-eligibility-hardware &&
94+
cargo +nightly-2021-08-31 test -p mining-eligibility-proxy &&
95+
cargo +nightly-2021-08-31 test -p mining-claims-token &&
96+
cargo +nightly-2021-08-31 test -p mining-claims-hardware &&
97+
cargo +nightly-2021-08-31 test -p mining-execution-token &&
98+
cargo +nightly-2021-08-31 test -p exchange-rate
9999
100100
lints:
101101
name: Lints
@@ -120,19 +120,19 @@ jobs:
120120
override: true
121121
components: rustfmt, clippy
122122

123-
# nightly-2021-07-30-x86_64-unknown-linux-gnu
123+
# nightly-2021-08-31-x86_64-unknown-linux-gnu
124124
- name: Initialize WASM build environment
125125
run: |
126126
rustup update stable
127-
rustup toolchain install nightly-2021-07-30
128-
rustup default nightly-2021-07-30
129-
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-07-30
127+
rustup toolchain install nightly-2021-08-31
128+
rustup default nightly-2021-08-31
129+
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
130130
131131
# Ignore use of Rust Linting since rearranging makes it challenging to update to latest Substrate
132132
# - name: Run cargo fmt
133133
# run: |
134-
# rustup component add rustfmt --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
135-
# cargo +nightly-2021-07-30 fmt --all -- --check
134+
# rustup component add rustfmt --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
135+
# cargo +nightly-2021-08-31 fmt --all -- --check
136136

137137
# Ignore use of Clippy until a clippy.toml file may be used. See README.md
138138
# - name: Run cargo clippy
@@ -142,6 +142,6 @@ jobs:
142142
# # args: --release -- -D warnings
143143
# # FIXME - temporary fix below. See https://github.com/rust-lang/rust-clippy/issues/5094#issuecomment-579116431
144144
# run: |
145-
# rustup component add clippy --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
146-
# rustup component add clippy-preview --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
147-
# cargo +nightly-2021-07-30 clippy-preview -Zunstable-options
145+
# rustup component add clippy --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
146+
# rustup component add clippy-preview --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
147+
# cargo +nightly-2021-08-31 clippy-preview -Zunstable-options

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To skip running the CI unnecessarily for simple changes such as updating the doc
2222

2323
### Linting
2424

25-
Check with Rust Format. Note: If you need a specific version of it replace `+nightly` with say `+nightly-2021-07-30`
25+
Check with Rust Format. Note: If you need a specific version of it replace `+nightly` with say `+nightly-2021-08-31`
2626
```
2727
cargo +nightly fmt --all -- --check
2828
```
@@ -148,9 +148,9 @@ cargo clippy --release -- -D warnings
148148
The following is a temporary fix. See https://github.com/rust-lang/rust-clippy/issues/5094#issuecomment-579116431
149149

150150
```
151-
rustup component add clippy --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
152-
rustup component add clippy-preview --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
153-
cargo +nightly-2021-07-30 clippy-preview -Zunstable-options
151+
rustup component add clippy --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
152+
rustup component add clippy-preview --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
153+
cargo +nightly-2021-08-31 clippy-preview -Zunstable-options
154154
```
155155

156156
#### Clippy and Continuous Integration (CI)
@@ -176,7 +176,7 @@ The styles are defined in the rustfmt.toml configuration file, which was generat
176176
#### Install RustFmt
177177

178178
```bash
179-
rustup component add rustfmt --toolchain nightly-2021-07-30-x86_64-unknown-linux-gnu
179+
rustup component add rustfmt --toolchain nightly-2021-08-31-x86_64-unknown-linux-gnu
180180
```
181181

182182
#### Check Formating Changes that RustFmt before applying them
@@ -221,7 +221,7 @@ substrate-module-new <module-name> <author>
221221
so we must manually change this to the latest Rust Nightly version only
222222
when it is known to work.
223223
```bash
224-
rustup toolchain install nightly-2021-07-30
224+
rustup toolchain install nightly-2021-08-31
225225
rustup update stable
226226
rustup target add wasm32-unknown-unknown --toolchain nightly
227227
```
@@ -231,7 +231,7 @@ substrate-module-new <module-name> <author>
231231
and because developers may forget to update to the latest version of Rust
232232
Nightly locally. So the solution is to install a specific version of
233233
Rust Nightly in .github/workflows/rust.yml (i.e.
234-
`rustup toolchain install nightly-2021-07-30`), since for example
234+
`rustup toolchain install nightly-2021-08-31`), since for example
235235
the latest Rust Nightly version nightly-2020-02-20 may cause our CI tests
236236
to fail (i.e. https://github.com/DataHighway-DHX/node/issues/32)
237237

@@ -330,7 +330,7 @@ pub trait Config: frame_system::Config {
330330
* Question: When using Docker you get error: `FileNotFoundError: [Errno 2] No such file or directory: '/Users/ls/code/src/DataHighway-com/node/target/rls/debug/deps/save-analysis/libsc_executor_common-f236f3ddcd6862b3.json'`
331331
* Answer: Try run `rm -rf ./target/rls/debug` a few times until it no longer says `Directory not empty`
332332

333-
* Quesion: If I am using an Apple ARM (M1) processor instead of an Apple Intel processor, it gives warnings like `warning: toolchain 'nightly-2021-07-30-x86_64-unknown-linux-gnu' may not be able to run on this system.` and you are unable to install it with `x86_64-unknown-linux-gnu`, what may I need to do?
333+
* Quesion: If I am using an Apple ARM (M1) processor instead of an Apple Intel processor, it gives warnings like `warning: toolchain 'nightly-2021-08-31-x86_64-unknown-linux-gnu' may not be able to run on this system.` and you are unable to install it with `x86_64-unknown-linux-gnu`, what may I need to do?
334334
* Answer: Try using `aarch64-apple-darwin` instead, e.g.
335335
```
336336
softwareupdate --install-rosetta
@@ -340,16 +340,16 @@ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/ls2/.profile
340340
eval "$(/opt/homebrew/bin/brew shellenv)"
341341
brew update
342342
343-
rustup toolchain install nightly-2021-07-30-aarch64-apple-darwin
344-
rustup component add rustfmt --toolchain nightly-2021-07-30-aarch64-apple-darwin
345-
cargo +nightly-2021-07-30-aarch64-apple-darwin fmt --all -- --check
343+
rustup toolchain install nightly-2021-08-31-aarch64-apple-darwin
344+
rustup component add rustfmt --toolchain nightly-2021-08-31-aarch64-apple-darwin
345+
cargo +nightly-2021-08-31-aarch64-apple-darwin fmt --all -- --check
346346
```
347347

348348
* Question: Why do I get an error `1002: Verification Error: Execution: Could not convert parameter 'tx' between node and runtime: Error decoding field Call:: MiningEligibilityProxy.0 RuntimeApi` when in polkadot.js.apps when I try to 'Add Item' with data to a Vec?
349349
* Ans: Because there is a type mismatch, perhaps the first variable requires a `Balance` instead of `u32` in custom_types.json or similar.
350350

351351
* Question: How to debug when running tests?
352-
* Ans: Run tests with this `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug` in front, i.e. `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug cargo +nightly-2021-07-30 test -p datahighway-runtime`, and use `println!` where you want to log the output (i.e. `println!("claim duration {:#?}", claim_duration);`), as `debug::info!` not work in tests. Try using `info!` (have not tried yet)
352+
* Ans: Run tests with this `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug` in front, i.e. `SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug cargo +nightly-2021-08-31 test -p datahighway-runtime`, and use `println!` where you want to log the output (i.e. `println!("claim duration {:#?}", claim_duration);`), as `debug::info!` not work in tests. Try using `info!` (have not tried yet)
353353

354354
* Question: Why can't I connect my node to telemetry?
355355
* Ans: Try use these flags when running your node `--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe`

0 commit comments

Comments
 (0)