Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,72 @@ jobs:
cargo -Zgitoxide -Zgit clippy --locked --all-targets --features rocm -- -D warnings
if: runner.os == 'Windows'

cargo-runtime-build:
strategy:
matrix:
os: ${{ fromJson(github.repository_owner == 'autonomys' &&
'[
"runs-on=${{ github.run_id }}/runner=self-hosted-ubuntu-22.04-x86-64",
["self-hosted", "windows-server-2022-x86-64"],
["self-hosted", "macos-14-arm64"]
]' ||
'["ubuntu-22.04", "windows-2022", "macos-14"]') }}
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
- name: Install LLVM and Clang for macOS
uses: KyleMayes/install-llvm-action@dec985c8d7b46a2f363ea1a78f660c946a3349ea # v2.0.1
with:
env: true
version: 17
if: runner.os == 'macOS'

# Because macOS, see https://andreasfertig.blog/2021/02/clang-and-gcc-on-macos-catalina-finding-the-include-paths/
- name: Configure C compiler macOS
run: |
echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
if: runner.os == 'macOS'

- name: Install glibtoolize (macOS)
run: brew install libtool
if: runner.os == 'macOS'

- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Needed for hwloc
- name: Install automake (macOS)
run: brew install automake
if: runner.os == 'macOS'

- name: Configure cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: build subspace-runtime
run: |
cargo -Zgitoxide -Zgit build --locked --package subspace-runtime

- name: build evm-domain-runtime
run: |
cargo -Zgitoxide -Zgit build --locked --package evm-domain-runtime

- name: build auto-id-domain-runtime
run: |
cargo -Zgitoxide -Zgit build --locked --package auto-id-domain-runtime

cargo-test:
strategy:
matrix:
Expand Down Expand Up @@ -226,3 +292,50 @@ jobs:
- name: cargo nextest run --locked
run: |
cargo -Zgitoxide -Zgit nextest run --locked

# This job checks all crates individually, including no_std and other featureless builds.
# We need to check crates individually for missing features, because cargo does feature
# unification, which hides missing features when crates are built together.
cargo-check-individually:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically not required if we can just clippy consensus runtime and domain runtimes with no-std

Copy link
Contributor Author

@teor2345 teor2345 Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would only discover some issues. The runtimes all build with commit 94bff8b, but there are fixes to 10+ other crates that are only covered by this check (see the fix commits after that commit).

It only takes 2.5 minutes (edit: still working out how long it takes) to run these checks, so it seems worth doing them.

strategy:
matrix:
# We only want to run these slower checks on the fastest runner
os: ${{ fromJson(github.repository_owner == 'autonomys' &&
'[
"runs-on=${{ github.run_id }}/runner=self-hosted-ubuntu-22.04-x86-64",
]' ||
'["ubuntu-22.04"]') }}
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: check all crates individually
run: |
for crate in $(grep 'path =' Cargo.toml | sed 's/.*path *= *"\([^"]*\).*/\1/' | sort); do
echo "$crate";
pushd "$crate";
if ! cargo -Zgitoxide -Zgit check --locked --all-targets; then
pwd;
popd;
exit 1;
fi;
pwd;
popd;
done
2 changes: 1 addition & 1 deletion crates/pallet-rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sp-runtime.workspace = true
subspace-runtime-primitives.workspace = true

[dev-dependencies]
pallet-balances.workspace = true
pallet-balances = { workspace = true, features = ["std"] }
sp-io.workspace = true

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/pallet-subspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ subspace-verification.workspace = true
[dev-dependencies]
env_logger.workspace = true
futures.workspace = true
pallet-balances.workspace = true
pallet-balances = { workspace = true, features = ["std"] }
rand = { workspace = true, features = ["min_const_gen"] }
sp-io.workspace = true
subspace-archiving.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/sc-consensus-subspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ sc-transaction-pool-api.workspace = true
sc-utils.workspace = true
sp-api.workspace = true
sp-blockchain.workspace = true
sp-block-builder.workspace = true
sp-block-builder = { workspace = true, features = ["std"] }
sp-consensus.workspace = true
sp-consensus-subspace.workspace = true
sp-consensus-subspace = { workspace = true, features = ["std"] }
sp-consensus-slots.workspace = true
sp-core.workspace = true
sp-inherents.workspace = true
sp-objects.workspace = true
sp-objects = { workspace = true, features = ["std"] }
sp-runtime.workspace = true
subspace-archiving.workspace = true
subspace-core-primitives.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions crates/sc-domains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ frame-benchmarking = { workspace = true, optional = true }
sc-client-api.workspace = true
sc-executor.workspace = true
sp-api.workspace = true
sp-auto-id.workspace = true
sp-auto-id = { workspace = true, features = ["std"] }
sp-blockchain.workspace = true
sp-core.workspace = true
sp-domains.workspace = true
sp-domains-fraud-proof.workspace = true
sp-domains = { workspace = true, features = ["std"] }
sp-domains-fraud-proof = { workspace = true, features = ["std"] }
sp-externalities.workspace = true
sp-io.workspace = true
sp-messenger-host-functions.workspace = true
sp-messenger-host-functions = { workspace = true, features = ["std"] }
sp-runtime.workspace = true
sp-subspace-mmr.workspace = true

Expand Down
14 changes: 7 additions & 7 deletions crates/sc-proof-of-time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ sc-client-api.workspace = true
sc-consensus-slots.workspace = true
sc-network.workspace = true
sc-network-gossip.workspace = true
sp-api.workspace = true
sp-api = { workspace = true, features = ["std"] }
sp-blockchain.workspace = true
sp-consensus.workspace = true
sp-consensus-slots.workspace = true
sp-consensus-subspace.workspace = true
sp-inherents.workspace = true
sp-runtime.workspace = true
subspace-core-primitives.workspace = true
sp-consensus-slots = { workspace = true, features = ["std"] }
sp-consensus-subspace = { workspace = true, features = ["std"] }
sp-inherents = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
subspace-core-primitives = { workspace = true, features = ["std"] }
subspace-proof-of-time.workspace = true
thread-priority.workspace = true
tokio = { workspace = true, features = ["sync"] }
tracing.workspace = true
tracing = { workspace = true, features = ["std"] }
10 changes: 5 additions & 5 deletions crates/sc-subspace-block-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ sc-client-api.workspace = true
sc-network.workspace = true
sc-network-common.workspace = true
sc-network-sync.workspace = true
sp-api.workspace = true
sp-consensus-subspace.workspace = true
sp-api = { workspace = true, features = ["std"] }
sp-consensus-subspace = { workspace = true, features = ["std"] }
sc-transaction-pool-api.workspace = true
sp-runtime.workspace = true
sp-runtime = { workspace = true, features = ["std"] }
strum_macros.workspace = true
subspace-core-primitives.workspace = true
subspace-core-primitives = { workspace = true, features = ["std"] }
substrate-prometheus-endpoint.workspace = true
thiserror.workspace = true
tracing.workspace = true
tracing = { workspace = true, features = ["std"] }
2 changes: 0 additions & 2 deletions crates/sp-domains-fraud-proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ std = [
"hash-db/std",
"log/std",
"scale-info/std",
"domain-block-preprocessor",
"sc-client-api",
"sc-executor",
"sc-executor/std",
"sp-api/std",
"sp-blockchain",
Expand Down
15 changes: 15 additions & 0 deletions crates/sp-domains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ rlp = { workspace = true, optional = true }
num-traits.workspace = true
rand = { workspace = true, features = ["min_const_gen"] }

# test-ethereum dependencies
ethereum.workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this to be duplicated in test deps and actual deps ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is required by the tests, but optional for production code.

fp-self-contained = { workspace = true, features = ["default"] }
frame-system.workspace = true
libsecp256k1 = { workspace = true, features = ["static-context", "hmac"] }
pallet-evm.workspace = true
rlp.workspace = true

[features]
default = ["std"]
std = [
Expand All @@ -76,6 +84,13 @@ std = [
"subspace-core-primitives/std",
"subspace-runtime-primitives/std",
"trie-db/std",
# test-ethereum dependencies
"ethereum?/std",
"fp-self-contained?/std",
"frame-system?/std",
"libsecp256k1?/std",
"pallet-evm?/std",
"rlp?/std",
]
runtime-benchmarks = []
test-ethereum = [
Expand Down
7 changes: 6 additions & 1 deletion crates/subspace-archiving/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ subspace-erasure-coding.workspace = true
subspace-kzg.workspace = true
thiserror.workspace = true

# This is required to for benchmark dependency features to work correctly
rand = { workspace = true, optional = true }

[dev-dependencies]
criterion.workspace = true
rand = { workspace = true, features = ["min_const_gen"] }
subspace-core-primitives.workspace = true
subspace-verification.workspace = true
subspace-verification = { workspace = true, features = ["kzg"] }

[features]
default = ["std"]
Expand All @@ -44,6 +47,8 @@ serde = [
std = [
"parity-scale-codec/std",
"parallel",
"rand?/std",
"rand?/std_rng",
"serde",
"subspace-core-primitives/std",
"subspace-erasure-coding/std",
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-core-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static_assertions.workspace = true
uint.workspace = true

[dev-dependencies]
rand = { workspace = true, features = ["min_const_gen"] }
rand = { workspace = true, features = ["min_const_gen", "std", "std_rng"] }

[features]
default = [
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ hex.workspace = true
memmap2.workspace = true
multihash = { workspace = true, features = ["scale-codec"] }
nohash-hasher.workspace = true
parity-scale-codec.workspace = true
parity-scale-codec = { workspace = true, features = ["std"] }
parking_lot.workspace = true
pin-project.workspace = true
prometheus-client.workspace = true
Expand All @@ -47,7 +47,7 @@ tokio-stream.workspace = true
tracing.workspace = true
unsigned-varint = { workspace = true, features = ["futures", "asynchronous_codec"] }
void.workspace = true
libp2p= { workspace = true, features = ["autonat", "dns", "gossipsub", "identify", "kad", "macros", "metrics", "noise", "ping", "plaintext", "request-response", "serde", "tcp", "tokio", "yamux"] }
libp2p = { workspace = true, features = ["autonat", "dns", "gossipsub", "identify", "kad", "macros", "metrics", "noise", "ping", "plaintext", "request-response", "serde", "tcp", "tokio", "yamux"] }

[dev-dependencies]
rand.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions crates/subspace-proof-of-time/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ aes.workspace = true
subspace-core-primitives.workspace = true
thiserror.workspace = true

# This is required to for benchmark dependency features to work correctly
rand = { workspace = true, optional = true }

[dev-dependencies]
core_affinity.workspace = true
criterion.workspace = true
Expand All @@ -37,4 +40,6 @@ default = ["std"]
std = [
"subspace-core-primitives/std",
"thiserror/std",
"rand?/std",
"rand?/std_rng",
]
2 changes: 1 addition & 1 deletion domains/client/block-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hash-db.workspace = true
sc-client-api.workspace = true
sp-api.workspace = true
sp-blockchain.workspace = true
sp-block-builder.workspace = true
sp-block-builder = { workspace = true, features = ["std"] }
sp-core.workspace = true
sp-externalities.workspace = true
sp-inherents.workspace = true
Expand Down
14 changes: 7 additions & 7 deletions domains/client/block-preprocessor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ sc-executor.workspace = true
sc-executor-common.workspace = true
sp-api.workspace = true
sp-blockchain.workspace = true
sp-block-fees.workspace = true
sp-block-fees = { workspace = true, features = ["std"] }
sp-core.workspace = true
sp-domains.workspace = true
sp-domain-sudo.workspace = true
sp-evm-tracker.workspace = true
sp-executive.workspace = true
sp-domain-sudo = { workspace = true, features = ["std"] }
sp-evm-tracker = { workspace = true, features = ["std"] }
sp-executive = { workspace = true, features = ["std"] }
sp-externalities.workspace = true
sp-inherents.workspace = true
sp-messenger.workspace = true
sp-messenger = { workspace = true, features = ["std"] }
sp-mmr-primitives.workspace = true
sp-runtime.workspace = true
sp-state-machine.workspace = true
sp-subspace-mmr.workspace = true
sp-timestamp.workspace = true
sp-subspace-mmr = { workspace = true, features = ["std"] }
sp-timestamp = { workspace = true, features = ["std"] }
sp-weights.workspace = true
sp-version.workspace = true
subspace-core-primitives.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion domains/client/domain-operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ sp-state-machine.workspace = true
subspace-core-primitives.workspace = true
subspace-test-runtime.workspace = true
subspace-test-service.workspace = true
subspace-test-primitives.workspace = true
subspace-test-primitives = { workspace = true, features = ["std"] }
tempfile.workspace = true
2 changes: 1 addition & 1 deletion domains/pallets/executive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sp-std.workspace = true
sp-tracing.workspace = true

[dev-dependencies]
pallet-balances.workspace = true
pallet-balances = { workspace = true, features = ["std"] }
sp-core.workspace = true
sp-externalities.workspace = true
sp-version.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions domains/pallets/messenger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ sp-subspace-mmr.workspace = true

[dev-dependencies]
domain-runtime-primitives.workspace = true
pallet-balances.workspace = true
pallet-transporter.workspace = true
pallet-balances = { workspace = true, features = ["std"] }
pallet-transporter = { workspace = true, features = ["std"] }
sp-state-machine.workspace = true

[features]
Expand Down
Loading
Loading