Skip to content

Commit 251438f

Browse files
liamaharonggwpez
andauthored
Inherents and empty block production overhaul (#86)
A pre-requisite to producing empty blocks for MBMs is fixing inherents for relay and parachains, and moving block production logic from being tied to `fast_forward` to common logic. It will also be very beneficial to allow producing blocks based on a snapshot, without any live node (`--block-ws-uri`). Based on the changes in this PR, I'll add MBM support to the `on-runtime-upgrade` subcommand. - Fixes inherent providers for relay and parachains - Introduces a SMART inherent provider designed to work across different chains, removing the requirement for a cli arg to specify which inherents to use - Moves inherent and block production to a common utils dir - Removes requirement for a remote node to produce empty blocks - Closes #32 (no longer compiles kitchensink runtime) --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
1 parent c8ab2fd commit 251438f

Some content is hidden

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

41 files changed

+3921
-1983
lines changed

.github/workflows/rust-checks.yaml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ concurrency:
1313
env:
1414
RUST_BACKTRACE: 1
1515
# pin nightly to avoid constantly throwing out cache
16-
TOOLCHAIN_LINT: nightly-2023-11-13
16+
TOOLCHAIN_FMT: nightly-2024-04-09
1717

1818
jobs:
1919
doc:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Install Rust ${{ env.TOOLCHAIN_LINT }}
23+
- name: Install Rust stable
2424
uses: dtolnay/rust-toolchain@stable
2525
with:
2626
targets: wasm32-unknown-unknown
@@ -34,21 +34,35 @@ jobs:
3434
- name: cargo doc
3535
run: RUSTFLAGS="-D warnings" cargo doc --locked
3636

37-
lint:
37+
fmt:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- uses: actions/checkout@v4
41-
- name: Install Rust ${{ env.TOOLCHAIN_LINT }}
41+
- name: Install Rust ${{ env.TOOLCHAIN_FMT }}
4242
uses: dtolnay/rust-toolchain@stable
4343
with:
44-
toolchain: ${{ env.TOOLCHAIN_LINT }}
44+
toolchain: ${{ env.TOOLCHAIN_FMT }}
4545
targets: wasm32-unknown-unknown
4646
components: rustfmt, clippy, rust-src
4747
- uses: Swatinem/rust-cache@v2
4848
with:
49-
key: lint-v0
49+
key: fmt-v0
5050
- name: cargo fmt
51-
run: cargo +${{ env.TOOLCHAIN_LINT }} fmt --all -- --check
51+
run: cargo +${{ env.TOOLCHAIN_FMT }} fmt --all -- --check
52+
53+
clippy:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Install Rust stable
58+
uses: dtolnay/rust-toolchain@stable
59+
with:
60+
toolchain: stable
61+
targets: wasm32-unknown-unknown
62+
components: rustfmt, clippy, rust-src
63+
- uses: Swatinem/rust-cache@v2
64+
with:
65+
key: clippy-v0
5266
- name: Install deps for musl build
5367
run: |
5468
sudo apt-get update
@@ -57,7 +71,7 @@ jobs:
5771
- name: cargo clippy
5872
uses: actions-rs-plus/clippy-check@v2
5973
with:
60-
toolchain: ${{ env.TOOLCHAIN_LINT }}
74+
toolchain: stable
6175
args: --all-targets --all-features --locked --no-deps -- --deny warnings
6276

6377
test:
@@ -78,6 +92,32 @@ jobs:
7892
uses: arduino/setup-protoc@v1
7993
with:
8094
version: "3.6.1"
95+
- name: Free disk space
96+
run: |
97+
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
98+
sudo rm -rf \
99+
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
100+
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
101+
/usr/lib/jvm || true
102+
sudo apt install aptitude -y >/dev/null 2>&1
103+
sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
104+
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
105+
google-cloud-sdk imagemagick \
106+
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
107+
mercurial apt-transport-https mono-complete libmysqlclient \
108+
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
109+
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
110+
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
111+
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
112+
-y -f >/dev/null 2>&1
113+
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
114+
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
115+
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
116+
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
117+
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
118+
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
119+
sudo apt-get autoremove -y >/dev/null 2>&1
120+
sudo apt-get autoclean -y >/dev/null 2>&1
81121
- name: build try-runtime-cli
82122
# this is required for testing
83123
# build --release or the execution time of the test is too long

0 commit comments

Comments
 (0)