Skip to content

Commit f717d4d

Browse files
committed
Merge branch 'devnet-ready' into feat/rate-limit-pallet
2 parents 69715be + bec8360 commit f717d4d

File tree

28 files changed

+2347
-609
lines changed

28 files changed

+2347
-609
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 }}

.github/workflows/evm-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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:

common/src/lib.rs

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

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

evm-tests/src/address-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Address } from "viem"
22
import { encodeAddress } from "@polkadot/util-crypto";
3-
import { ss58Address } from "@polkadot-labs/hdkd-helpers";
3+
import { ss58Address, ss58Decode } from "@polkadot-labs/hdkd-helpers";
44
import { hexToU8a } from "@polkadot/util";
55
import { blake2AsU8a, decodeAddress } from "@polkadot/util-crypto";
66
import { Binary } from "polkadot-api";

evm-tests/src/contracts/proxy.ts

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
export const IPROXY_ADDRESS = "0x000000000000000000000000000000000000080b";
2+
3+
export const IProxyABI = [
4+
{
5+
"inputs": [
6+
{
7+
"internalType": "uint8",
8+
"name": "proxy_type",
9+
"type": "uint8"
10+
},
11+
{
12+
"internalType": "uint32",
13+
"name": "delay",
14+
"type": "uint32"
15+
},
16+
{
17+
"internalType": "uint16",
18+
"name": "index",
19+
"type": "uint16"
20+
}
21+
],
22+
"name": "createPureProxy",
23+
"outputs": [
24+
{
25+
"internalType": "bytes32",
26+
"name": "proxy",
27+
"type": "bytes32"
28+
}
29+
],
30+
"stateMutability": "nonpayable",
31+
"type": "function"
32+
},
33+
{
34+
"inputs": [
35+
{
36+
"internalType": "bytes32",
37+
"name": "spawner",
38+
"type": "bytes32"
39+
},
40+
{
41+
"internalType": "uint8",
42+
"name": "proxy_type",
43+
"type": "uint8"
44+
},
45+
{
46+
"internalType": "uint16",
47+
"name": "index",
48+
"type": "uint16"
49+
},
50+
{
51+
"internalType": "uint32",
52+
"name": "height",
53+
"type": "uint32"
54+
},
55+
{
56+
"internalType": "uint32",
57+
"name": "ext_index",
58+
"type": "uint32"
59+
}
60+
],
61+
"name": "killPureProxy",
62+
"outputs": [],
63+
"stateMutability": "nonpayable",
64+
"type": "function"
65+
},
66+
{
67+
"inputs": [
68+
{
69+
"internalType": "bytes32",
70+
"name": "real",
71+
"type": "bytes32"
72+
},
73+
{
74+
"internalType": "uint8[]",
75+
"name": "force_proxy_type", // optional
76+
"type": "uint8[]"
77+
},
78+
{
79+
"internalType": "uint8[]",
80+
"name": "call",
81+
"type": "uint8[]"
82+
}
83+
],
84+
"name": "proxyCall",
85+
"outputs": [],
86+
"stateMutability": "nonpayable",
87+
"type": "function"
88+
},
89+
{
90+
"inputs": [],
91+
"name": "removeProxies",
92+
"outputs": [],
93+
"stateMutability": "nonpayable",
94+
"type": "function"
95+
}, {
96+
"inputs": [],
97+
"name": "pokeDeposit",
98+
"outputs": [],
99+
"stateMutability": "nonpayable",
100+
"type": "function"
101+
},
102+
{
103+
"inputs": [
104+
{
105+
"internalType": "bytes32",
106+
"name": "delegate",
107+
"type": "bytes32"
108+
},
109+
{
110+
"internalType": "uint8",
111+
"name": "proxy_type",
112+
"type": "uint8"
113+
},
114+
{
115+
"internalType": "uint32",
116+
"name": "delay",
117+
"type": "uint32"
118+
}
119+
],
120+
"name": "removeProxy",
121+
"outputs": [],
122+
"stateMutability": "nonpayable",
123+
"type": "function"
124+
},
125+
{
126+
"inputs": [
127+
{
128+
"internalType": "bytes32",
129+
"name": "delegate",
130+
"type": "bytes32"
131+
},
132+
{
133+
"internalType": "uint8",
134+
"name": "proxy_type",
135+
"type": "uint8"
136+
},
137+
{
138+
"internalType": "uint32",
139+
"name": "delay",
140+
"type": "uint32"
141+
}
142+
],
143+
"name": "addProxy",
144+
"outputs": [],
145+
"stateMutability": "nonpayable",
146+
"type": "function"
147+
}
148+
];

evm-tests/test/neuron.precompile.emission-check.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("Test the Neuron precompile with emission", () => {
4545

4646
it("Burned register and check emission", async () => {
4747
let netuid = (await api.query.SubtensorModule.TotalNetworks.getValue()) - 1
48-
48+
4949
const uid = await api.query.SubtensorModule.SubnetworkN.getValue(netuid)
5050
const contract = new ethers.Contract(INEURON_ADDRESS, INeuronABI, wallet);
5151

@@ -63,7 +63,7 @@ describe("Test the Neuron precompile with emission", () => {
6363

6464
let i = 0;
6565
while (i < 10) {
66-
const emission = await api.query.SubtensorModule.ServerEmission.getValue(netuid)
66+
const emission = await api.query.SubtensorModule.Emission.getValue(netuid)
6767

6868
console.log("emission is ", emission);
6969
await new Promise((resolve) => setTimeout(resolve, 2000));

0 commit comments

Comments
 (0)