From 42d5af1fffd5ff018e4e3220e92794aabe825d88 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 22 Aug 2025 17:41:11 +0800 Subject: [PATCH 1/6] fix e2e test stability --- evm-tests/src/subtensor.ts | 2 +- runtime/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evm-tests/src/subtensor.ts b/evm-tests/src/subtensor.ts index a2e5d49083..b1ff818038 100644 --- a/evm-tests/src/subtensor.ts +++ b/evm-tests/src/subtensor.ts @@ -32,7 +32,7 @@ export async function addNewSubnetwork(api: TypedApi, hotkey: Key // force set balance for a ss58 address export async function forceSetBalanceToSs58Address(api: TypedApi, ss58Address: string) { const alice = getAliceSigner() - const balance = tao(1e8) + const balance = tao(1e10) const internalCall = api.tx.Balances.force_set_balance({ who: MultiAddress.Id(ss58Address), new_free: balance }) const tx = api.tx.Sudo.sudo({ call: internalCall.decodedCall }) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 120987a00a..375b7d3185 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,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: 303, + spec_version: 304, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1144,7 +1144,7 @@ parameter_types! { pub const SubtensorInitialSenateRequiredStakePercentage: u64 = 1; // 1 percent of total stake pub const SubtensorInitialNetworkImmunity: u64 = 7 * 7200; pub const SubtensorInitialMinAllowedUids: u16 = 128; - pub const SubtensorInitialMinLockCost: u64 = 1_000_000_000_000; // 1000 TAO + pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 1_000_000_000); // 1000 TAO pub const SubtensorInitialSubnetOwnerCut: u16 = 11_796; // 18 percent // pub const SubtensorInitialSubnetLimit: u16 = 12; // (DEPRECATED) pub const SubtensorInitialNetworkLockReductionInterval: u64 = 14 * 7200; From 74a06df03f3c6ceb1b05fe5ac51384632aba281a Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 22 Aug 2025 17:43:34 +0800 Subject: [PATCH 2/6] fix e2e test stability --- 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 375b7d3185..3e2fa1c3de 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1144,7 +1144,7 @@ parameter_types! { pub const SubtensorInitialSenateRequiredStakePercentage: u64 = 1; // 1 percent of total stake pub const SubtensorInitialNetworkImmunity: u64 = 7 * 7200; pub const SubtensorInitialMinAllowedUids: u16 = 128; - pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 1_000_000_000); // 1000 TAO + pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 10_000_000_000); // 1000 TAO pub const SubtensorInitialSubnetOwnerCut: u16 = 11_796; // 18 percent // pub const SubtensorInitialSubnetLimit: u16 = 12; // (DEPRECATED) pub const SubtensorInitialNetworkLockReductionInterval: u64 = 14 * 7200; From 480423c334c26be40caf2f8e6f31e2f1316fac19 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 22 Aug 2025 18:23:45 +0800 Subject: [PATCH 3/6] update lease amount --- evm-tests/test/leasing.precompile.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evm-tests/test/leasing.precompile.test.ts b/evm-tests/test/leasing.precompile.test.ts index 7ea45c0509..0021ef1f49 100644 --- a/evm-tests/test/leasing.precompile.test.ts +++ b/evm-tests/test/leasing.precompile.test.ts @@ -44,7 +44,7 @@ describe("Test Leasing precompile", () => { it("gets an existing lease created on substrate side, its subnet id and its contributor shares", async () => { const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO + const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; const leaseEmissionsShare = 15; @@ -98,7 +98,7 @@ describe("Test Leasing precompile", () => { it("registers a new leased network through a crowdloan and retrieves the lease", async () => { const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO + const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO const crowdloanMinContribution = BigInt(1_000_000_000); // 1 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; @@ -159,7 +159,7 @@ describe("Test Leasing precompile", () => { await tx.wait(); const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO + const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO const crowdloanMinContribution = BigInt(1_000_000_000); // 1 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; From 963cb3a7cb1b573d80765bacdc7207fa910a5444 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 22 Aug 2025 20:10:05 +0800 Subject: [PATCH 4/6] increase lock amount for leasing network test --- 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 3e2fa1c3de..4a830dff24 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1144,7 +1144,7 @@ parameter_types! { pub const SubtensorInitialSenateRequiredStakePercentage: u64 = 1; // 1 percent of total stake pub const SubtensorInitialNetworkImmunity: u64 = 7 * 7200; pub const SubtensorInitialMinAllowedUids: u16 = 128; - pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 10_000_000_000); // 1000 TAO + pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 100_000_000_000); // 1000 TAO pub const SubtensorInitialSubnetOwnerCut: u16 = 11_796; // 18 percent // pub const SubtensorInitialSubnetLimit: u16 = 12; // (DEPRECATED) pub const SubtensorInitialNetworkLockReductionInterval: u64 = 14 * 7200; From 2474c872b361ecd367e4361ff530e16eca64c17f Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 22 Aug 2025 20:11:36 +0800 Subject: [PATCH 5/6] revert loan value --- evm-tests/test/leasing.precompile.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evm-tests/test/leasing.precompile.test.ts b/evm-tests/test/leasing.precompile.test.ts index 0021ef1f49..7ea45c0509 100644 --- a/evm-tests/test/leasing.precompile.test.ts +++ b/evm-tests/test/leasing.precompile.test.ts @@ -44,7 +44,7 @@ describe("Test Leasing precompile", () => { it("gets an existing lease created on substrate side, its subnet id and its contributor shares", async () => { const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO + const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; const leaseEmissionsShare = 15; @@ -98,7 +98,7 @@ describe("Test Leasing precompile", () => { it("registers a new leased network through a crowdloan and retrieves the lease", async () => { const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO + const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO const crowdloanMinContribution = BigInt(1_000_000_000); // 1 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; @@ -159,7 +159,7 @@ describe("Test Leasing precompile", () => { await tx.wait(); const nextCrowdloanId = await api.query.Crowdloan.NextCrowdloanId.getValue(); - const crowdloanDeposit = BigInt(5_000_000_000); // 5 TAO + const crowdloanDeposit = BigInt(100_000_000_000); // 100 TAO const crowdloanMinContribution = BigInt(1_000_000_000); // 1 TAO const crowdloanCap = await api.query.SubtensorModule.NetworkLastLockCost.getValue() * BigInt(2); const crowdloanEnd = await api.query.System.Number.getValue() + 100; From e4d743e9bebb2f4be55944423256a7c82032b878 Mon Sep 17 00:00:00 2001 From: gztensor <166415444+gztensor@users.noreply.github.com> Date: Fri, 22 Aug 2025 08:17:19 -0700 Subject: [PATCH 6/6] Update lib.rs --- 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 4a830dff24..d7097b605c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1144,7 +1144,7 @@ parameter_types! { pub const SubtensorInitialSenateRequiredStakePercentage: u64 = 1; // 1 percent of total stake pub const SubtensorInitialNetworkImmunity: u64 = 7 * 7200; pub const SubtensorInitialMinAllowedUids: u16 = 128; - pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 100_000_000_000); // 1000 TAO + pub const SubtensorInitialMinLockCost: u64 = prod_or_fast!(1_000_000_000_000, 100_000_000_000); // 1000 TAO for prod, 100 TAO for fast pub const SubtensorInitialSubnetOwnerCut: u16 = 11_796; // 18 percent // pub const SubtensorInitialSubnetLimit: u16 = 12; // (DEPRECATED) pub const SubtensorInitialNetworkLockReductionInterval: u64 = 14 * 7200;