Skip to content

Commit a0af732

Browse files
committed
Merge branch 'devnet-ready' into utility-pallet-fees
2 parents 0eedabe + 3e5d3ed commit a0af732

File tree

146 files changed

+4512
-2535
lines changed

Some content is hidden

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

146 files changed

+4512
-2535
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
description: "Branch or tag to use for the Docker image tag and ref to checkout (optional)"
1010
required: false
1111
default: ""
12-
1312
push:
1413
branches:
1514
- devnet-ready
@@ -35,6 +34,13 @@ jobs:
3534
echo "tag=$branch_or_tag" >> $GITHUB_ENV
3635
echo "ref=$branch_or_tag" >> $GITHUB_ENV
3736
37+
# Check if this is a tagged release (not devnet-ready/devnet/testnet)
38+
if [[ "${{ github.event_name }}" == "release" && "$branch_or_tag" != "devnet-ready" && "$branch_or_tag" != "devnet" && "$branch_or_tag" != "testnet" ]]; then
39+
echo "latest_tag=true" >> $GITHUB_ENV
40+
else
41+
echo "latest_tag=false" >> $GITHUB_ENV
42+
fi
43+
3844
- name: Checkout code
3945
uses: actions/checkout@v4
4046
with:
@@ -58,5 +64,7 @@ jobs:
5864
with:
5965
context: .
6066
push: true
67+
platforms: linux/amd64,linux/arm64
6168
tags: |
6269
ghcr.io/${{ github.repository }}:${{ env.tag }}
70+
${{ env.latest_tag == 'true' && format('ghcr.io/{0}:latest', github.repository) || '' }}

Cargo.lock

Lines changed: 47 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 62 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
description = "Implementation of the bittensor blockchain"
55
authors = ["Substrate DevHub <https://github.com/substrate-developer-hub>"]
66
homepage = "https://substrate.io/"
7-
edition = "2021"
7+
edition = "2024"
88
license = "Unlicense"
99
publish = false
1010
repository = "https://github.com/opentensor/subtensor"
@@ -23,21 +23,14 @@ rayon = "1.10"
2323

2424
[workspace]
2525
members = [
26-
"node",
27-
"pallets/commitments",
28-
"pallets/subtensor",
29-
"pallets/admin-utils",
30-
"pallets/collective",
31-
"pallets/registry",
32-
"primitives/*",
33-
"runtime",
34-
"support/tools",
35-
"support/macros",
36-
"support/linting",
37-
"support/procedural-fork",
38-
"pallets/drand",
26+
"common",
27+
"node",
28+
"pallets/*",
29+
"precompiles",
30+
"primitives/*",
31+
"runtime",
32+
"support/*",
3933
]
40-
exclude = ["support/procedural-fork"]
4134
resolver = "2"
4235

4336
[workspace.lints.clippy]
@@ -46,13 +39,29 @@ arithmetic-side-effects = "deny"
4639
type_complexity = "allow"
4740
unwrap-used = "deny"
4841
manual_inspect = "allow"
42+
useless_conversion = "allow" # until polkadot is patched
4943

5044
[workspace.dependencies]
45+
pallet-admin-utils = { default-features = false, path = "pallets/admin-utils" }
46+
pallet-collective = { default-features = false, path = "pallets/collective" }
47+
pallet-commitments = { default-features = false, path = "pallets/commitments" }
48+
pallet-registry = { default-features = false, path = "pallets/registry" }
49+
pallet-subtensor = { default-features = false, path = "pallets/subtensor" }
50+
subtensor-custom-rpc = { default-features = false, path = "pallets/subtensor/rpc" }
51+
subtensor-custom-rpc-runtime-api = { default-features = false, path = "pallets/subtensor/runtime-api" }
52+
subtensor-precompiles = { default-features = false, path = "precompiles" }
53+
subtensor-runtime-common = { default-features = false, path = "common" }
54+
node-subtensor-runtime = { default-features = false, path = "runtime" }
55+
5156
async-trait = "0.1"
5257
cargo-husky = { version = "1", default-features = false }
5358
clap = "4.5.4"
54-
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
55-
ed25519-dalek = { version = "2.1.0", default-features = false, features = ["alloc"] }
59+
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
60+
"derive",
61+
] }
62+
ed25519-dalek = { version = "2.1.0", default-features = false, features = [
63+
"alloc",
64+
] }
5665
enumflags2 = "0.7.9"
5766
futures = "0.3.30"
5867
hex = { version = "0.4", default-features = false }
@@ -63,7 +72,9 @@ memmap2 = "0.9.4"
6372
ndarray = { version = "0.15.6", default-features = false }
6473
parity-util-mem = "0.12.0"
6574
rand = "0.8.5"
66-
scale-codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive"] }
75+
scale-codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [
76+
"derive",
77+
] }
6778
scale-info = { version = "2.11.2", default-features = false }
6879
serde = { version = "1.0.214", default-features = false }
6980
serde-tuple-vec-map = { version = "1.0.1", default-features = false }
@@ -73,11 +84,11 @@ serde_with = { version = "=2.0.0", default-features = false }
7384
smallvec = "1.13.2"
7485
litep2p = { git = "https://github.com/paritytech/litep2p", tag = "v0.7.0" }
7586
syn = { version = "2.0.87", features = [
76-
"full",
77-
"visit-mut",
78-
"visit",
79-
"extra-traits",
80-
"parsing",
87+
"full",
88+
"visit-mut",
89+
"visit",
90+
"extra-traits",
91+
"parsing",
8192
] }
8293
quote = "1"
8394
proc-macro2 = { version = "1", features = ["span-locations"] }
@@ -181,7 +192,9 @@ fc-consensus = { git = "https://github.com/opentensor/frontier", rev = "635bdac8
181192
fp-consensus = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
182193
fp-dynamic-fee = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
183194
fc-api = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
184-
fc-rpc = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false, features = ["rpc-binary-search-estimate"]}
195+
fc-rpc = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false, features = [
196+
"rpc-binary-search-estimate",
197+
] }
185198
fc-rpc-core = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
186199
fc-mapping-sync = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
187200
precompile-utils = { git = "https://github.com/opentensor/frontier", rev = "635bdac882", default-features = false }
@@ -199,21 +212,34 @@ pallet-hotfix-sufficients = { git = "https://github.com/opentensor/frontier", re
199212

200213
#DRAND
201214
pallet-drand = { path = "pallets/drand", default-features = false }
202-
sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", features = ["bls12-381"] }
203-
getrandom = { version = "0.2.15", features = ["custom"], default-features = false }
204-
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
215+
sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", features = [
216+
"bls12-381",
217+
] }
218+
getrandom = { version = "0.2.15", features = [
219+
"custom",
220+
], default-features = false }
221+
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
205222
w3f-bls = { version = "=0.1.3", default-features = false }
206-
ark-crypto-primitives = { version = "0.4.0", default-features = false, features = [ "r1cs", "snark" ] }
207-
ark-scale = { version = "0.0.11", default-features = false, features = ["hazmat"] }
223+
ark-crypto-primitives = { version = "0.4.0", default-features = false, features = [
224+
"r1cs",
225+
"snark",
226+
] }
227+
ark-scale = { version = "0.0.11", default-features = false, features = [
228+
"hazmat",
229+
] }
208230
sp-ark-bls12-381 = { git = "https://github.com/paritytech/substrate-curves", default-features = false }
209-
ark-bls12-381 = { version = "0.4.0", features = ["curve"], default-features = false }
210-
ark-serialize = { version = "0.4.0", features = [ "derive" ], default-features = false }
231+
ark-bls12-381 = { version = "0.4.0", features = [
232+
"curve",
233+
], default-features = false }
234+
ark-serialize = { version = "0.4.0", features = [
235+
"derive",
236+
], default-features = false }
211237
ark-ff = { version = "0.4.0", default-features = false }
212238
ark-ec = { version = "0.4.0", default-features = false }
213239
ark-std = { version = "0.4.0", default-features = false }
214240
anyhow = "1.0.81"
215241
sha2 = { version = "0.10.8", default-features = false }
216-
rand_chacha = { version = "0.3.1", default-features = false }
242+
rand_chacha = { version = "0.3.1", default-features = false }
217243
tle = { git = "https://github.com/ideal-lab5/timelock", rev = "5416406cfd32799e31e1795393d4916894de4468", default-features = false }
218244

219245
frame-metadata = "16"
@@ -232,11 +258,11 @@ codegen-units = 1
232258
[features]
233259
default = []
234260
try-runtime = [
235-
"node-subtensor/try-runtime",
236-
"node-subtensor-runtime/try-runtime",
261+
"node-subtensor/try-runtime",
262+
"node-subtensor-runtime/try-runtime",
237263
]
238264
runtime-benchmarks = [
239-
"node-subtensor/runtime-benchmarks",
240-
"node-subtensor-runtime/runtime-benchmarks",
265+
"node-subtensor/runtime-benchmarks",
266+
"node-subtensor-runtime/runtime-benchmarks",
241267
]
242268
metadata-hash = ["node-subtensor-runtime/metadata-hash"]

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=ubuntu:24.04
1+
ARG BASE_IMAGE=ubuntu:latest
22

33
FROM $BASE_IMAGE AS builder
44
SHELL ["/bin/bash", "-c"]
@@ -18,18 +18,22 @@ RUN apt-get update && \
1818
apt-get install -y curl build-essential protobuf-compiler clang git pkg-config libssl-dev && \
1919
rm -rf /var/lib/apt/lists/*
2020

21-
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
22-
ENV PATH="/root/.cargo/bin:${PATH}"
23-
RUN rustup update stable
24-
RUN rustup target add wasm32-unknown-unknown --toolchain stable
25-
2621
# Copy entire repository
2722
COPY . /build
2823
WORKDIR /build
2924

25+
# Install Rust
26+
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
27+
ENV PATH="/root/.cargo/bin:${PATH}"
28+
RUN rustup toolchain install
29+
RUN rustup target add wasm32-unknown-unknown
30+
3031
# Build the project
3132
RUN cargo build -p node-subtensor --profile production --features="metadata-hash" --locked
3233

34+
# Slim down image
35+
RUN rm -rf /root/.cargo
36+
3337
# Verify the binary was produced
3438
RUN test -e /build/target/production/node-subtensor
3539

build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn main() {
3131

3232
// Parse each rust file with syn and run the linting suite on it in parallel
3333
rust_files.par_iter().for_each_with(tx.clone(), |tx, file| {
34+
let is_test = file.display().to_string().contains("test");
3435
let Ok(content) = fs::read_to_string(file) else {
3536
return;
3637
};
@@ -63,6 +64,10 @@ fn main() {
6364
track_lint(ForbidKeysRemoveCall::lint(&parsed_file));
6465
track_lint(RequireFreezeStruct::lint(&parsed_file));
6566
track_lint(RequireExplicitPalletIndex::lint(&parsed_file));
67+
68+
if is_test {
69+
track_lint(ForbidSaturatingMath::lint(&parsed_file));
70+
}
6671
});
6772

6873
// Collect and print all errors after the parallel processing is done

0 commit comments

Comments
 (0)