Skip to content

Commit

Permalink
merge master & fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Jul 5, 2024
2 parents a459e1b + cf4d517 commit d5c7de7
Show file tree
Hide file tree
Showing 102 changed files with 6,598 additions and 3,479 deletions.
46 changes: 46 additions & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Configuration for the Zepter CLI to ensure correct feature configuration in the Rust workspace.
# <https://crates.io/crates/zepter>

version:
# File format for parsing it:
format: 1
# Minimum version of the binary that is expected to work. This is just for printing a nice error
# message when someone tries to use an older version.
binary: 1.5.0

# The examples in this file assume crate `A` to have a dependency on crate `B`.
workflows:
# Check that everything is good without modifying anything:
check:
- [
'lint',
# Check that `A` activates the features of `B`.
'propagate-feature',
# These are the features to check:
'--features=try-runtime,runtime-benchmarks,evm-tracing,std',
# Ignore the features of dependencies that are exclusively used as dev or build.
'--dep-kinds=normal:check,dev:ignore,build:ignore',
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
'--left-side-feature-missing=ignore',
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
'--left-side-outside-workspace=ignore',
# Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used.
'--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking',
# Show the paths of failed crates to have them clickable in the terminal: 
'--show-path',
# Aux
'--offline',
'--locked',
'--quiet',
]
# Same as `check`, but actually fix the issues instead of just reporting them:
default:
- [ $check.0, '--fix' ]

# Will be displayed when any workflow fails:
help:
text: |
Astar uses the Zepter CLI to detect abnormalities in the feature configuration.
It looks like at least one check failed; please see the console output. You can try to automatically address them by running `zepter`.
links:
- "https://github.com/ggwpez/zepter"
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Rust",
"image": "mcr.microsoft.com/devcontainers/rust:latest",
"runArgs": ["--platform=linux/amd64"]
}
4 changes: 4 additions & 0 deletions .github/try-runtime-storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
System:
$removePrefix: ["Account"]
EVM:
$removePrefix: ["AccountCodes", "AccountStorages"]
2 changes: 1 addition & 1 deletion .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
npx @acala-network/chopsticks@beta try-runtime -c ${{ matrix.runtime }} --checks All --runtime $RUNTIME_BLOB_PATH ${{ env.EXTRA_ARGS }}
npx @acala-network/chopsticks try-runtime -c ${{ matrix.runtime }} --import-storage .github/try-runtime-storage.yml --checks All --runtime $RUNTIME_BLOB_PATH ${{ env.EXTRA_ARGS }}
76 changes: 54 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
id: artifact-name
run: echo "::set-output name=name::astar-ubuntu-latest-${TARGET%%-*}"

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-name.outputs.name }}
path: target/${{ matrix.target }}/release/astar-collator
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
- name: Build optimized binary with evm tracing
run: CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C codegen-units=1" cargo build --release --target x86_64-unknown-linux-gnu --features evm-tracing --verbose --locked

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: astar-evm-tracing-ubuntu-latest-x86_64-unknown-linux-gnu
path: target/x86_64-unknown-linux-gnu/release/astar-collator
Expand All @@ -142,17 +142,17 @@ jobs:
mv target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_runtime.compact.compressed.wasm target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_evm_tracing_runtime.compact.compressed.wasm
mv target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_runtime.compact.compressed.wasm target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_evm_tracing_runtime.compact.compressed.wasm
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: astar-evm-tracing-runtime
path: target/x86_64-unknown-linux-gnu/release/wbuild/astar-runtime/astar_evm_tracing_runtime.compact.compressed.wasm

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: shiden-evm-tracing-runtime
path: target/x86_64-unknown-linux-gnu/release/wbuild/shiden-runtime/shiden_evm_tracing_runtime.compact.compressed.wasm

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: shibuya-evm-tracing-runtime
path: target/x86_64-unknown-linux-gnu/release/wbuild/shibuya-runtime/shibuya_evm_tracing_runtime.compact.compressed.wasm
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Show sccache stats
run: sccache --show-stats

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: astar-macOS-latest-x86_64
path: target/release/astar-collator
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
tag-sha: true # add git short SHA as Docker tag

- name: Download pre-built linux collator binary
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-ubuntu-latest-x86_64

Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
# it takes a while to build the runtime, so let's save the artifact as soon as we have it
- name: Archive Artifacts for ${{ matrix.chain }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.chain }}-runtime
path: |
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
tee ${{ matrix.chain }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.chain }}-runtime
path: |
Expand All @@ -332,19 +332,19 @@ jobs:
fetch-depth: 0

- name: Download astar runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-runtime
path: runtime-artifacts

- name: Download shiden runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: shiden-runtime
path: runtime-artifacts

- name: Download shibuya runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: shibuya-runtime
path: runtime-artifacts
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
mkdir -p ubuntu-tracing-bin
- name: Download pre-built collator binary
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-${{ matrix.os }}-latest-${{ matrix.arch }}
path: ${{ matrix.os }}-${{ matrix.arch }}-bin
Expand Down Expand Up @@ -427,7 +427,7 @@ jobs:
chain: ["astar", "shiden", "shibuya"]
steps:
- name: Download runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: ${{ matrix.chain }}-runtime

Expand Down Expand Up @@ -491,25 +491,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download pre-built collator binary for evm tracing
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-evm-tracing-ubuntu-latest-x86_64-unknown-linux-gnu
path: evm-tracing-artifacts

- name: Download evm tracing runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-evm-tracing-runtime
path: evm-tracing-artifacts

- name: Download evm tracing runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: shiden-evm-tracing-runtime
path: evm-tracing-artifacts

- name: Download evm tracing runtime
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: shibuya-evm-tracing-runtime
path: evm-tracing-artifacts
Expand All @@ -536,7 +536,7 @@ jobs:
asset_name: evm-tracing-artifacts-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip

chain-sync:
chain-sync-smoke:
needs: native-linux
runs-on: ubuntu-latest
strategy:
Expand All @@ -548,12 +548,44 @@ jobs:
uses: actions/checkout@v4

- name: Download pre-built collator binary
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: astar-ubuntu-latest-x86_64
path: target/release

- name: Sync chain ${{ matrix.chain }}
run: |
chmod +x target/release/astar-collator
./scripts/sync.sh ${{ matrix.chain }}
./scripts/sync-smoke.sh ${{ matrix.chain }}
zombienet-smoke:
needs: native-linux
runs-on: ubuntu-latest
strategy:
matrix:
chain: [ "astar-dev", "shiden-dev", "shibuya-dev" ]

steps:
- name: Checkout the source code
uses: actions/checkout@v4

- name: Download pre-built collator binary
uses: actions/download-artifact@v3
with:
name: astar-ubuntu-latest-x86_64
path: target/release

- name: Setup
run: |
chmod +x target/release/astar-collator
mv target/release/astar-collator third-party/zombienet
- name: Setup zombienet
working-directory: third-party/zombienet
run: ./setup.sh

- name: ${{ matrix.chain }} build blocks
working-directory: third-party/zombienet
env:
CHAIN: ${{ matrix.chain }}
run: zombienet -p native test smoke.zndsl
48 changes: 23 additions & 25 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Static Analysis
on: [push, workflow_dispatch]
on: [ push, workflow_dispatch ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
fmt:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install deps
run: sudo apt -y install protobuf-compiler
Expand All @@ -35,39 +35,37 @@ jobs:
clippy:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Checkout the source code
uses: actions/checkout@v4

- name: Install deps
run: sudo apt -y install protobuf-compiler
- name: Install deps
run: sudo apt -y install protobuf-compiler

- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: Install & display rust toolchain
run: rustup show
- name: Install & display rust toolchain
run: rustup show

- name: Check targets are installed correctly
run: rustup target list --installed
- name: Check targets are installed correctly
run: rustup target list --installed

- uses: actions-rs/clippy-check@v1
env:
SKIP_WASM_BUILD: 1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features try-runtime,runtime-benchmarks -- -D warnings
- name: Clippy
env:
SKIP_WASM_BUILD: 1
run: cargo clippy --features evm-tracing,try-runtime,runtime-benchmarks -- -D warnings

check-license:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, Linux, X64]
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check license
uses: viperproject/check-license-header@v2
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/zepter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Zepter

on:
pull_request:
branches:
- master
paths-ignore:
- '**/README.md'
push:
branches:
- master
paths-ignore:
- '**/README.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4

- name: Install deps
run: sudo apt -y install protobuf-compiler

- name: Install & display rust toolchain
run: rustup show

- name: Install Zepter
run: cargo install zepter -f --locked && zepter --version

- name: Check Rust features
run: zepter run check
Loading

0 comments on commit d5c7de7

Please sign in to comment.