Skip to content

Commit 958be6e

Browse files
authored
Merge branch 'devnet-ready' into consensus-modes-devnet
2 parents 7d4b3cd + bbcd169 commit 958be6e

39 files changed

+2970
-759
lines changed

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

Lines changed: 6 additions & 6 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
@@ -149,7 +149,7 @@ jobs:
149149
- find-btcli-e2e-tests
150150
- build-image-with-current-branch
151151
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
152-
runs-on: [self-hosted, type-ccx13]
152+
runs-on: ubuntu-latest
153153
strategy:
154154
fail-fast: false
155155
max-parallel: 16
@@ -243,7 +243,7 @@ jobs:
243243
- find-sdk-e2e-tests
244244
- build-image-with-current-branch
245245
if: needs.check-label.outputs.skip-bittensor-e2e-tests == 'false'
246-
runs-on: [self-hosted, type-ccx13]
246+
runs-on: ubuntu-latest
247247
strategy:
248248
fail-fast: false
249249
max-parallel: 16

.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
@@ -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 {

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.PendingEmission.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)