Skip to content

Commit 52378dc

Browse files
authored
Merge pull request #2246 from opentensor/testnet
mainnet deploy 12/9/2025 (MeV Shield)
2 parents 024a304 + 8def8b5 commit 52378dc

File tree

134 files changed

+10289
-4664
lines changed

Some content is hidden

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

134 files changed

+10289
-4664
lines changed

.github/workflows/check-bittensor-e2e-tests.yml.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626

2727
jobs:
2828
check-label:
29-
runs-on: [self-hosted, type-ccx13]
29+
runs-on: ubuntu-latest
3030
outputs:
3131
skip-bittensor-e2e-tests: ${{ steps.get-labels.outputs.skip-bittensor-e2e-tests }}
3232
steps:
@@ -57,7 +57,7 @@ jobs:
5757
find-btcli-e2e-tests:
5858
needs: check-label
5959
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
60-
runs-on: [self-hosted, type-ccx13]
60+
runs-on: ubuntu-latest
6161
outputs:
6262
test-files: ${{ steps.get-btcli-tests.outputs.test-files }}
6363
steps:
@@ -84,7 +84,7 @@ jobs:
8484
find-sdk-e2e-tests:
8585
needs: check-label
8686
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
87-
runs-on: [self-hosted, type-ccx13]
87+
runs-on: ubuntu-latest
8888
outputs:
8989
test-files: ${{ steps.get-sdk-tests.outputs.test-files }}
9090
steps:
@@ -111,7 +111,7 @@ jobs:
111111
build-image-with-current-branch:
112112
needs: check-label
113113
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
114-
runs-on: [self-hosted, type-ccx33]
114+
runs-on: ubuntu-latest
115115
steps:
116116
- name: Checkout code
117117
uses: actions/checkout@v4
@@ -130,17 +130,27 @@ jobs:
130130
- name: Set up Docker Buildx
131131
uses: docker/setup-buildx-action@v3
132132

133+
- name: Move Docker data-root to /mnt/data
134+
run: |
135+
sudo systemctl stop docker
136+
sudo mkdir -p /mnt/data/docker
137+
sudo chown -R runner:runner /mnt/data
138+
sudo chmod -R 777 /mnt/data
139+
echo '{"data-root": "/mnt/data/docker"}' | sudo tee /etc/docker/daemon.json
140+
sudo systemctl start docker
141+
docker info | grep "Docker Root Dir"
142+
133143
- name: Build Docker Image
134144
run: docker build -f Dockerfile-localnet -t localnet .
135145

136146
- name: Save Docker Image as Tar
137-
run: docker save -o subtensor-localnet.tar localnet
147+
run: docker save -o /mnt/data/subtensor-localnet.tar localnet
138148

139149
- name: Upload Docker Image as Artifact
140150
uses: actions/upload-artifact@v4
141151
with:
142152
name: subtensor-localnet
143-
path: subtensor-localnet.tar
153+
path: /mnt/data/subtensor-localnet.tar
144154

145155
# main btcli job
146156
run-btcli-e2e-tests:
@@ -149,7 +159,7 @@ jobs:
149159
- find-btcli-e2e-tests
150160
- build-image-with-current-branch
151161
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
152-
runs-on: [self-hosted, type-ccx13]
162+
runs-on: ubuntu-latest
153163
strategy:
154164
fail-fast: false
155165
max-parallel: 16
@@ -181,7 +191,7 @@ jobs:
181191
- name: Install uv
182192
uses: astral-sh/setup-uv@v5
183193
with:
184-
enable-cache: 'false'
194+
enable-cache: "false"
185195

186196
- name: Create Python virtual environment
187197
working-directory: ${{ github.workspace }}
@@ -243,7 +253,7 @@ jobs:
243253
- find-sdk-e2e-tests
244254
- build-image-with-current-branch
245255
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
246-
runs-on: [self-hosted, type-ccx13]
256+
runs-on: ubuntu-latest
247257
strategy:
248258
fail-fast: false
249259
max-parallel: 16
@@ -275,7 +285,7 @@ jobs:
275285
- name: Install uv
276286
uses: astral-sh/setup-uv@v5
277287
with:
278-
enable-cache: 'false'
288+
enable-cache: "false"
279289

280290
- name: Create Python virtual environment
281291
working-directory: ${{ github.workspace }}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: EVM E2E Tests
1+
name: Contract E2E Tests
22

33
on:
44
pull_request:
@@ -24,7 +24,7 @@ permissions:
2424

2525
jobs:
2626
run:
27-
runs-on: [self-hosted, type-ccx33]
27+
runs-on: ubuntu-latest
2828
env:
2929
RUST_BACKTRACE: full
3030
steps:
@@ -52,10 +52,10 @@ jobs:
5252
- name: Run tests
5353
uses: nick-fields/retry@v3
5454
with:
55-
timeout_minutes: 60
55+
timeout_minutes: 90
5656
max_attempts: 3
5757
retry_wait_seconds: 60
5858
command: |
5959
cd ${{ github.workspace }}
6060
npm install --global yarn
61-
./evm-tests/run-ci.sh
61+
./contract-tests/run-ci.sh

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "p
274274
w3f-bls = { git = "https://github.com/opentensor/bls", branch = "fix-no-std", default-features = false }
275275
ark-crypto-primitives = { version = "0.4.0", default-features = false }
276276
ark-scale = { version = "0.0.11", default-features = false }
277-
sp-ark-bls12-381 = { git = "https://github.com/paritytech/arkworks-substrate", package = "sp-ark-bls12-381", default-features = false }
278277
ark-bls12-381 = { version = "0.4.0", default-features = false }
279278
ark-serialize = { version = "0.4.0", default-features = false }
280279
ark-ff = { version = "0.4.0", default-features = false }
@@ -285,6 +284,9 @@ sha2 = { version = "0.10.8", default-features = false }
285284
rand_chacha = { version = "0.3.1", default-features = false }
286285
tle = { git = "https://github.com/ideal-lab5/timelock", rev = "5416406cfd32799e31e1795393d4916894de4468", default-features = false }
287286

287+
pallet-shield = { path = "pallets/shield", default-features = false }
288+
ml-kem = { version = "0.2.0", default-features = true }
289+
288290
# Primitives
289291

290292
[profile.release]

common/src/lib.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,33 @@ pub enum ProxyType {
162162
RootClaim,
163163
}
164164

165+
impl TryFrom<u8> for ProxyType {
166+
type Error = ();
167+
168+
fn try_from(value: u8) -> Result<Self, Self::Error> {
169+
match value {
170+
0 => Ok(Self::Any),
171+
1 => Ok(Self::Owner),
172+
2 => Ok(Self::NonCritical),
173+
3 => Ok(Self::NonTransfer),
174+
4 => Ok(Self::Senate),
175+
5 => Ok(Self::NonFungible),
176+
6 => Ok(Self::Triumvirate),
177+
7 => Ok(Self::Governance),
178+
8 => Ok(Self::Staking),
179+
9 => Ok(Self::Registration),
180+
10 => Ok(Self::Transfer),
181+
11 => Ok(Self::SmallTransfer),
182+
12 => Ok(Self::RootWeights),
183+
13 => Ok(Self::ChildKeys),
184+
14 => Ok(Self::SudoUncheckedSetCode),
185+
15 => Ok(Self::SwapHotkey),
186+
16 => Ok(Self::SubnetLeaseBeneficiary),
187+
_ => Err(()),
188+
}
189+
}
190+
}
191+
165192
impl Default for ProxyType {
166193
// allow all Calls; required to be most permissive
167194
fn default() -> Self {
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# type-test
22

3-
The evm-tests folder includes all typescript code to test the basic EVM function
3+
The contract-tests folder includes all typescript code to test the basic EVM function
44
like token transfer, and all precompile contracts in Subtensor. It is
55
implemented in typescript, use both ethers and viem lib to interact with
66
contracts. The polkadot API is used to call extrinsic, get storage in Subtensor
77
. The developers can use it to verify the code change in precompile contracts.
88

9-
It is also included in the CI process, all test cases are executed for new
9+
The Ink contract tests also are included in the contract-tests folder.
10+
There is an Ink project in the bittensor folder, which include all functions defined
11+
in the runtime extension. The test file for it is wasm.contract.test.ts.
12+
13+
The whole test process is also included in the CI, all test cases are executed for new
1014
commit. CI flow can get catch any failed test cases. The polkadot API get the
1115
latest metadata from the runtime, the case also can find out any incompatibility
1216
between runtime and precompile contracts.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore build artifacts from the local tests sub-crate.
2+
/target/
3+
4+
# Ignore backup files creates by cargo fmt.
5+
**/*.rs.bk
6+
7+
# Remove Cargo.lock when creating an executable, leave it for libraries
8+
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
9+
Cargo.lock

0 commit comments

Comments
 (0)