Skip to content

Commit

Permalink
Inherents and empty block production overhaul (#86)
Browse files Browse the repository at this point in the history
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 <oliver.tale-yazdi@parity.io>
  • Loading branch information
liamaharon and ggwpez authored May 26, 2024
1 parent c8ab2fd commit 251438f
Show file tree
Hide file tree
Showing 41 changed files with 3,921 additions and 1,983 deletions.
56 changes: 48 additions & 8 deletions .github/workflows/rust-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ concurrency:
env:
RUST_BACKTRACE: 1
# pin nightly to avoid constantly throwing out cache
TOOLCHAIN_LINT: nightly-2023-11-13
TOOLCHAIN_FMT: nightly-2024-04-09

jobs:
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN_LINT }}
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
Expand All @@ -34,21 +34,35 @@ jobs:
- name: cargo doc
run: RUSTFLAGS="-D warnings" cargo doc --locked

lint:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN_LINT }}
- name: Install Rust ${{ env.TOOLCHAIN_FMT }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.TOOLCHAIN_LINT }}
toolchain: ${{ env.TOOLCHAIN_FMT }}
targets: wasm32-unknown-unknown
components: rustfmt, clippy, rust-src
- uses: Swatinem/rust-cache@v2
with:
key: lint-v0
key: fmt-v0
- name: cargo fmt
run: cargo +${{ env.TOOLCHAIN_LINT }} fmt --all -- --check
run: cargo +${{ env.TOOLCHAIN_FMT }} fmt --all -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: rustfmt, clippy, rust-src
- uses: Swatinem/rust-cache@v2
with:
key: clippy-v0
- name: Install deps for musl build
run: |
sudo apt-get update
Expand All @@ -57,7 +71,7 @@ jobs:
- name: cargo clippy
uses: actions-rs-plus/clippy-check@v2
with:
toolchain: ${{ env.TOOLCHAIN_LINT }}
toolchain: stable
args: --all-targets --all-features --locked --no-deps -- --deny warnings

test:
Expand All @@ -78,6 +92,32 @@ jobs:
uses: arduino/setup-protoc@v1
with:
version: "3.6.1"
- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
google-cloud-sdk imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete libmysqlclient \
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
-y -f >/dev/null 2>&1
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
- name: build try-runtime-cli
# this is required for testing
# build --release or the execution time of the test is too long
Expand Down
Loading

0 comments on commit 251438f

Please sign in to comment.