From 680c5108b061fdedf615c631b7f9269528e96be5 Mon Sep 17 00:00:00 2001 From: open-junius Date: Mon, 14 Jul 2025 19:34:02 +0800 Subject: [PATCH 1/5] three new get method in alpha --- evm-tests/src/contracts/alpha.ts | 121 +++++++++++++++++------- evm-tests/test/alpha.precompile.test.ts | 26 +++++ precompiles/src/alpha.rs | 24 +++++ precompiles/src/solidity/alpha.abi | 121 +++++++++++++++++------- precompiles/src/solidity/alpha.sol | 29 +++++- 5 files changed, 254 insertions(+), 67 deletions(-) diff --git a/evm-tests/src/contracts/alpha.ts b/evm-tests/src/contracts/alpha.ts index 35baf83129..55ea773147 100644 --- a/evm-tests/src/contracts/alpha.ts +++ b/evm-tests/src/contracts/alpha.ts @@ -9,7 +9,7 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getAlphaPrice", + "name": "getAlphaInEmission", "outputs": [ { "internalType": "uint256", @@ -28,12 +28,12 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getMovingAlphaPrice", + "name": "getAlphaInPool", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -47,7 +47,7 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getTaoInPool", + "name": "getAlphaIssuance", "outputs": [ { "internalType": "uint64", @@ -66,12 +66,12 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getAlphaInPool", + "name": "getAlphaOutEmission", "outputs": [ { - "internalType": "uint64", + "internalType": "uint256", "name": "", - "type": "uint64" + "type": "uint256" } ], "stateMutability": "view", @@ -104,7 +104,26 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getAlphaIssuance", + "name": "getAlphaPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getEMAPriceHalvingBlocks", "outputs": [ { "internalType": "uint64", @@ -116,8 +135,14 @@ export const IAlphaABI = [ "type": "function" }, { - "inputs": [], - "name": "getTaoWeight", + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getMovingAlphaPrice", "outputs": [ { "internalType": "uint256", @@ -128,20 +153,47 @@ export const IAlphaABI = [ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getRootNetuid", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint16", "name": "netuid", "type": "uint16" - }, + } + ], + "name": "getSubnetMechanism", + "outputs": [ { - "internalType": "uint64", - "name": "tao", - "type": "uint64" + "internalType": "uint16", + "name": "", + "type": "uint16" } ], - "name": "simSwapTaoForAlpha", + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getSubnetVolume", "outputs": [ { "internalType": "uint256", @@ -158,14 +210,9 @@ export const IAlphaABI = [ "internalType": "uint16", "name": "netuid", "type": "uint16" - }, - { - "internalType": "uint64", - "name": "alpha", - "type": "uint64" } ], - "name": "simSwapAlphaForTao", + "name": "getTaoInEmission", "outputs": [ { "internalType": "uint256", @@ -184,12 +231,12 @@ export const IAlphaABI = [ "type": "uint16" } ], - "name": "getSubnetMechanism", + "name": "getTaoInPool", "outputs": [ { - "internalType": "uint16", + "internalType": "uint64", "name": "", - "type": "uint16" + "type": "uint64" } ], "stateMutability": "view", @@ -197,12 +244,12 @@ export const IAlphaABI = [ }, { "inputs": [], - "name": "getRootNetuid", + "name": "getTaoWeight", "outputs": [ { - "internalType": "uint16", + "internalType": "uint256", "name": "", - "type": "uint16" + "type": "uint256" } ], "stateMutability": "view", @@ -214,14 +261,19 @@ export const IAlphaABI = [ "internalType": "uint16", "name": "netuid", "type": "uint16" + }, + { + "internalType": "uint64", + "name": "alpha", + "type": "uint64" } ], - "name": "getEMAPriceHalvingBlocks", + "name": "simSwapAlphaForTao", "outputs": [ { - "internalType": "uint64", + "internalType": "uint256", "name": "", - "type": "uint64" + "type": "uint256" } ], "stateMutability": "view", @@ -233,9 +285,14 @@ export const IAlphaABI = [ "internalType": "uint16", "name": "netuid", "type": "uint16" + }, + { + "internalType": "uint64", + "name": "tao", + "type": "uint64" } ], - "name": "getSubnetVolume", + "name": "simSwapTaoForAlpha", "outputs": [ { "internalType": "uint256", diff --git a/evm-tests/test/alpha.precompile.test.ts b/evm-tests/test/alpha.precompile.test.ts index 85161aae92..a7007bc967 100644 --- a/evm-tests/test/alpha.precompile.test.ts +++ b/evm-tests/test/alpha.precompile.test.ts @@ -118,6 +118,32 @@ describe("Test Alpha Precompile", () => { // Both should be defined and valid assert.ok(alphaPrice !== undefined && movingAlphaPrice !== undefined); }); + + it("Tao in / Alpha in / Alpha out are consistent for same subnet", async () => { + const taoInEmission = await publicClient.readContract({ + abi: IAlphaABI, + address: toViemAddress(IALPHA_ADDRESS), + functionName: "getTaoInEmission", + args: [subnetId] + }) + + const alphaInEmission = await publicClient.readContract({ + abi: IAlphaABI, + address: toViemAddress(IALPHA_ADDRESS), + functionName: "getAlphaInEmission", + args: [subnetId] + }) + + const alphaOutEmission = await publicClient.readContract({ + abi: IAlphaABI, + address: toViemAddress(IALPHA_ADDRESS), + functionName: "getAlphaOutEmission", + args: [subnetId] + }) + + // all should be defined and valid + assert.ok(taoInEmission !== undefined && alphaInEmission !== undefined && alphaOutEmission !== undefined); + }); }); describe("Pool Data Functions", () => { diff --git a/precompiles/src/alpha.rs b/precompiles/src/alpha.rs index feacc582f7..c3c28dc5b0 100644 --- a/precompiles/src/alpha.rs +++ b/precompiles/src/alpha.rs @@ -151,4 +151,28 @@ where NetUid::from(netuid), ))) } + + #[precompile::public("getTaoInEmission(uint16)")] + #[precompile::view] + fn get_tao_in_emission(_handle: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { + Ok(U256::from(pallet_subtensor::SubnetTaoInEmission::::get( + NetUid::from(netuid), + ))) + } + + #[precompile::public("getAlphaInEmission(uint16)")] + #[precompile::view] + fn get_alpha_in_emission(_handle: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { + Ok(U256::from( + pallet_subtensor::SubnetAlphaInEmission::::get(NetUid::from(netuid)), + )) + } + + #[precompile::public("getAlphaOutEmission(uint16)")] + #[precompile::view] + fn get_alpha_out_emission(_handle: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { + Ok(U256::from( + pallet_subtensor::SubnetAlphaOutEmission::::get(NetUid::from(netuid)), + )) + } } diff --git a/precompiles/src/solidity/alpha.abi b/precompiles/src/solidity/alpha.abi index feb2b518af..7b52cca53d 100644 --- a/precompiles/src/solidity/alpha.abi +++ b/precompiles/src/solidity/alpha.abi @@ -7,7 +7,7 @@ "type": "uint16" } ], - "name": "getAlphaPrice", + "name": "getAlphaInEmission", "outputs": [ { "internalType": "uint256", @@ -26,12 +26,12 @@ "type": "uint16" } ], - "name": "getMovingAlphaPrice", + "name": "getAlphaInPool", "outputs": [ { - "internalType": "uint256", + "internalType": "uint64", "name": "", - "type": "uint256" + "type": "uint64" } ], "stateMutability": "view", @@ -45,7 +45,7 @@ "type": "uint16" } ], - "name": "getTaoInPool", + "name": "getAlphaIssuance", "outputs": [ { "internalType": "uint64", @@ -64,12 +64,12 @@ "type": "uint16" } ], - "name": "getAlphaInPool", + "name": "getAlphaOutEmission", "outputs": [ { - "internalType": "uint64", + "internalType": "uint256", "name": "", - "type": "uint64" + "type": "uint256" } ], "stateMutability": "view", @@ -102,7 +102,26 @@ "type": "uint16" } ], - "name": "getAlphaIssuance", + "name": "getAlphaPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getEMAPriceHalvingBlocks", "outputs": [ { "internalType": "uint64", @@ -114,8 +133,14 @@ "type": "function" }, { - "inputs": [], - "name": "getTaoWeight", + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getMovingAlphaPrice", "outputs": [ { "internalType": "uint256", @@ -126,20 +151,47 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getRootNetuid", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint16", "name": "netuid", "type": "uint16" - }, + } + ], + "name": "getSubnetMechanism", + "outputs": [ { - "internalType": "uint64", - "name": "tao", - "type": "uint64" + "internalType": "uint16", + "name": "", + "type": "uint16" } ], - "name": "simSwapTaoForAlpha", + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getSubnetVolume", "outputs": [ { "internalType": "uint256", @@ -156,14 +208,9 @@ "internalType": "uint16", "name": "netuid", "type": "uint16" - }, - { - "internalType": "uint64", - "name": "alpha", - "type": "uint64" } ], - "name": "simSwapAlphaForTao", + "name": "getTaoInEmission", "outputs": [ { "internalType": "uint256", @@ -182,12 +229,12 @@ "type": "uint16" } ], - "name": "getSubnetMechanism", + "name": "getTaoInPool", "outputs": [ { - "internalType": "uint16", + "internalType": "uint64", "name": "", - "type": "uint16" + "type": "uint64" } ], "stateMutability": "view", @@ -195,12 +242,12 @@ }, { "inputs": [], - "name": "getRootNetuid", + "name": "getTaoWeight", "outputs": [ { - "internalType": "uint16", + "internalType": "uint256", "name": "", - "type": "uint16" + "type": "uint256" } ], "stateMutability": "view", @@ -212,14 +259,19 @@ "internalType": "uint16", "name": "netuid", "type": "uint16" + }, + { + "internalType": "uint64", + "name": "alpha", + "type": "uint64" } ], - "name": "getEMAPriceHalvingBlocks", + "name": "simSwapAlphaForTao", "outputs": [ { - "internalType": "uint64", + "internalType": "uint256", "name": "", - "type": "uint64" + "type": "uint256" } ], "stateMutability": "view", @@ -231,9 +283,14 @@ "internalType": "uint16", "name": "netuid", "type": "uint16" + }, + { + "internalType": "uint64", + "name": "tao", + "type": "uint64" } ], - "name": "getSubnetVolume", + "name": "simSwapTaoForAlpha", "outputs": [ { "internalType": "uint256", diff --git a/precompiles/src/solidity/alpha.sol b/precompiles/src/solidity/alpha.sol index 7bb529f684..2077e9119a 100644 --- a/precompiles/src/solidity/alpha.sol +++ b/precompiles/src/solidity/alpha.sol @@ -41,13 +41,19 @@ interface IAlpha { /// @param netuid The subnet identifier. /// @param tao The amount of TAO to swap. /// @return The amount of alpha that would be received. - function simSwapTaoForAlpha(uint16 netuid, uint64 tao) external view returns (uint256); + function simSwapTaoForAlpha( + uint16 netuid, + uint64 tao + ) external view returns (uint256); /// @dev Simulates swapping alpha for TAO. /// @param netuid The subnet identifier. /// @param alpha The amount of alpha to swap. /// @return The amount of TAO that would be received. - function simSwapAlphaForTao(uint16 netuid, uint64 alpha) external view returns (uint256); + function simSwapAlphaForTao( + uint16 netuid, + uint64 alpha + ) external view returns (uint256); /// @dev Returns the mechanism type for a subnet (0 for Stable, 1 for Dynamic). /// @param netuid The subnet identifier. @@ -61,10 +67,27 @@ interface IAlpha { /// @dev Returns the EMA price halving blocks parameter for a subnet. /// @param netuid The subnet identifier. /// @return The number of blocks for EMA price halving. - function getEMAPriceHalvingBlocks(uint16 netuid) external view returns (uint64); + function getEMAPriceHalvingBlocks( + uint16 netuid + ) external view returns (uint64); /// @dev Returns the transaction volume for a subnet. /// @param netuid The subnet identifier. /// @return The subnet volume. function getSubnetVolume(uint16 netuid) external view returns (uint256); + + /// @dev Returns the amount of tao emission into the pool per block for a subnet. + /// @param netuid The subnet identifier. + /// @return The tao-in emission per block. + function getTaoInEmission(uint16 netuid) external view returns (uint256); + + /// @dev Returns the amount of alpha emission into the pool per block for a subnet. + /// @param netuid The subnet identifier. + /// @return The alpha-in emission per block. + function getAlphaInEmission(uint16 netuid) external view returns (uint256); + + /// @dev Returns the amount of alpha emission outside the pool per block for a subnet. + /// @param netuid The subnet identifier. + /// @return The alpha-out emission per block. + function getAlphaOutEmission(uint16 netuid) external view returns (uint256); } From 7a6018bba4bb25815c34986e908036396b661fe4 Mon Sep 17 00:00:00 2001 From: open-junius Date: Mon, 14 Jul 2025 20:33:29 +0800 Subject: [PATCH 2/5] bump version --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 19b44a6e0b..c7450ebc78 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -218,7 +218,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 293, + spec_version: 294, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 391d04572041eb5952041b54b1a95c7606242030 Mon Sep 17 00:00:00 2001 From: open-junius Date: Tue, 15 Jul 2025 19:59:56 +0800 Subject: [PATCH 3/5] add sum alpha interface --- evm-tests/src/contracts/alpha.ts | 13 ++++++ evm-tests/test/alpha.precompile.test.ts | 11 +++++ precompiles/src/alpha.rs | 55 +++++++++++++++++++++---- precompiles/src/solidity/alpha.abi | 13 ++++++ precompiles/src/solidity/alpha.sol | 4 ++ 5 files changed, 89 insertions(+), 7 deletions(-) diff --git a/evm-tests/src/contracts/alpha.ts b/evm-tests/src/contracts/alpha.ts index 55ea773147..a87702eb80 100644 --- a/evm-tests/src/contracts/alpha.ts +++ b/evm-tests/src/contracts/alpha.ts @@ -302,5 +302,18 @@ export const IAlphaABI = [ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [], + "name": "getSumAlphaPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/evm-tests/test/alpha.precompile.test.ts b/evm-tests/test/alpha.precompile.test.ts index a7007bc967..31b31da135 100644 --- a/evm-tests/test/alpha.precompile.test.ts +++ b/evm-tests/test/alpha.precompile.test.ts @@ -144,6 +144,17 @@ describe("Test Alpha Precompile", () => { // all should be defined and valid assert.ok(taoInEmission !== undefined && alphaInEmission !== undefined && alphaOutEmission !== undefined); }); + + it("getSumAlphaPrice returns valid sum of alpha prices", async () => { + const sumAlphaPrice = await publicClient.readContract({ + abi: IAlphaABI, + address: toViemAddress(IALPHA_ADDRESS), + functionName: "getSumAlphaPrice", + args: [] + }) + + assert.ok(sumAlphaPrice !== undefined, "Sum alpha price should be defined"); + }) }); describe("Pool Data Functions", () => { diff --git a/precompiles/src/alpha.rs b/precompiles/src/alpha.rs index c3c28dc5b0..62271b8198 100644 --- a/precompiles/src/alpha.rs +++ b/precompiles/src/alpha.rs @@ -1,7 +1,7 @@ use core::marker::PhantomData; use fp_evm::{ExitError, PrecompileFailure}; -use pallet_evm::PrecompileHandle; +use pallet_evm::{BalanceConverter, PrecompileHandle, SubstrateBalance}; use precompile_utils::EvmResult; use sp_core::U256; use substrate_fixed::types::U96F32; @@ -14,7 +14,10 @@ pub struct AlphaPrecompile(PhantomData); impl PrecompileExt for AlphaPrecompile where - R: frame_system::Config + pallet_subtensor::Config + pallet_subtensor_swap::Config, + R: frame_system::Config + + pallet_subtensor::Config + + pallet_subtensor_swap::Config + + pallet_evm::Config, R::AccountId: From<[u8; 32]>, { const INDEX: u64 = 2056; @@ -23,7 +26,10 @@ where #[precompile_utils::precompile] impl AlphaPrecompile where - R: frame_system::Config + pallet_subtensor::Config + pallet_subtensor_swap::Config, + R: frame_system::Config + + pallet_subtensor::Config + + pallet_subtensor_swap::Config + + pallet_evm::Config, { #[precompile::public("getAlphaPrice(uint16)")] #[precompile::view] @@ -32,16 +38,24 @@ where as SwapHandler>::current_alpha_price( netuid.into(), ); - let price_scaled = price.saturating_mul(U96F32::saturating_from_num(1_000_000_000)); - Ok(U256::from(price_scaled.saturating_to_num::())) + let price: SubstrateBalance = price.saturating_to_num::().into(); + let price_eth = ::BalanceConverter::into_evm_balance(price) + .map(|amount| amount.into_u256()) + .ok_or(ExitError::InvalidRange)?; + + Ok(price_eth) } #[precompile::public("getMovingAlphaPrice(uint16)")] #[precompile::view] fn get_moving_alpha_price(_handle: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { let price: U96F32 = pallet_subtensor::Pallet::::get_moving_alpha_price(netuid.into()); - let price_scaled = price.saturating_mul(U96F32::saturating_from_num(1_000_000_000)); - Ok(U256::from(price_scaled.saturating_to_num::())) + let price: SubstrateBalance = price.saturating_to_num::().into(); + let price_eth = ::BalanceConverter::into_evm_balance(price) + .map(|amount| amount.into_u256()) + .ok_or(ExitError::InvalidRange)?; + + Ok(price_eth) } #[precompile::public("getTaoInPool(uint16)")] @@ -175,4 +189,31 @@ where pallet_subtensor::SubnetAlphaOutEmission::::get(NetUid::from(netuid)), )) } + + #[precompile::public("getSumAlphaPrice(uint16)")] + #[precompile::view] + fn get_sum_alpha_price(_handle: &mut impl PrecompileHandle) -> EvmResult { + let netuids = pallet_subtensor::NetworksAdded::::iter() + .filter(|(netuid, _)| *netuid != NetUid::ROOT) + .collect::>(); + + let mut sum_alpha_price: U96F32 = U96F32::from_num(0); + for (netuid, _) in netuids { + let price = + as SwapHandler>::current_alpha_price( + netuid.into(), + ); + + if price < U96F32::from_num(1) { + sum_alpha_price = sum_alpha_price.saturating_add(price); + } + } + + let price: SubstrateBalance = sum_alpha_price.saturating_to_num::().into(); + let price_eth = ::BalanceConverter::into_evm_balance(price) + .map(|amount| amount.into_u256()) + .ok_or(ExitError::InvalidRange)?; + + Ok(price_eth) + } } diff --git a/precompiles/src/solidity/alpha.abi b/precompiles/src/solidity/alpha.abi index 7b52cca53d..06975d5e61 100644 --- a/precompiles/src/solidity/alpha.abi +++ b/precompiles/src/solidity/alpha.abi @@ -300,5 +300,18 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [], + "name": "getSumAlphaPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/precompiles/src/solidity/alpha.sol b/precompiles/src/solidity/alpha.sol index 2077e9119a..e66dcf00d9 100644 --- a/precompiles/src/solidity/alpha.sol +++ b/precompiles/src/solidity/alpha.sol @@ -90,4 +90,8 @@ interface IAlpha { /// @param netuid The subnet identifier. /// @return The alpha-out emission per block. function getAlphaOutEmission(uint16 netuid) external view returns (uint256); + + /// @dev Returns the sum of alpha prices for all subnets. + /// @return The sum of alpha prices. + function getSumAlphaPrice() external view returns (uint256); } From a5dc2e019f0371ba3d4b5c0095239472ff5d3f1d Mon Sep 17 00:00:00 2001 From: open-junius Date: Tue, 15 Jul 2025 20:02:35 +0800 Subject: [PATCH 4/5] commit Cargo.lock --- precompiles/src/alpha.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/precompiles/src/alpha.rs b/precompiles/src/alpha.rs index 62271b8198..defe20e2f9 100644 --- a/precompiles/src/alpha.rs +++ b/precompiles/src/alpha.rs @@ -4,6 +4,7 @@ use fp_evm::{ExitError, PrecompileFailure}; use pallet_evm::{BalanceConverter, PrecompileHandle, SubstrateBalance}; use precompile_utils::EvmResult; use sp_core::U256; +use sp_std::vec::Vec; use substrate_fixed::types::U96F32; use subtensor_runtime_common::NetUid; use subtensor_swap_interface::{OrderType, SwapHandler}; From 48564d2322a180cfd38dc274bf4b8131fe20066c Mon Sep 17 00:00:00 2001 From: open-junius Date: Tue, 15 Jul 2025 20:29:33 +0800 Subject: [PATCH 5/5] fix wrong func definition --- precompiles/src/alpha.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precompiles/src/alpha.rs b/precompiles/src/alpha.rs index defe20e2f9..a797aa3593 100644 --- a/precompiles/src/alpha.rs +++ b/precompiles/src/alpha.rs @@ -191,7 +191,7 @@ where )) } - #[precompile::public("getSumAlphaPrice(uint16)")] + #[precompile::public("getSumAlphaPrice()")] #[precompile::view] fn get_sum_alpha_price(_handle: &mut impl PrecompileHandle) -> EvmResult { let netuids = pallet_subtensor::NetworksAdded::::iter()