From 7cb256f9a6c4cbaa498174121aa5998cd6e003d6 Mon Sep 17 00:00:00 2001 From: Saumyajit P <86034982+AgSpades@users.noreply.github.com> Date: Sun, 18 May 2025 09:44:33 +0530 Subject: [PATCH 01/16] fix: update pull request template links to properly reload appropriate template from subdirectory --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4a5da46aee..f94135f64e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,6 +5,6 @@ please switch to **Preview** for links to render properly. Please choose the right template for your pull request: -- 🐛 Are you fixing a bug? [Bug fix](?template=bug_fix.md) -- 📈 Are you improving performance? [Performance improvement](?template=performance_improvement.md) -- 💻 Are you changing functionality? [Feature change](?template=feature_change.md) +- 🐛 Are you fixing a bug? [Bug fix](?template=bug_fix) +- 📈 Are you improving performance? [Performance improvement](?template=performance_improvement) +- 💻 Are you changing functionality? [Feature change](?template=feature_change) From 73105235402b5bf87c222486106a0160bd226dda Mon Sep 17 00:00:00 2001 From: Saumyajit P <86034982+AgSpades@users.noreply.github.com> Date: Sun, 18 May 2025 10:04:25 +0530 Subject: [PATCH 02/16] fix: update PR template links to use full paths Updated pull request template links to point to the correct `.github/PULL_REQUEST_TEMPLATE/*.md` files for proper rendering and navigation. --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f94135f64e..bbe2f309a1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,6 +5,6 @@ please switch to **Preview** for links to render properly. Please choose the right template for your pull request: -- 🐛 Are you fixing a bug? [Bug fix](?template=bug_fix) -- 📈 Are you improving performance? [Performance improvement](?template=performance_improvement) -- 💻 Are you changing functionality? [Feature change](?template=feature_change) +- 🐛 Are you fixing a bug? [Bug fix](?template=.github/PULL_REQUEST_TEMPLATE/bug_fix.md) +- 📈 Are you improving performance? [Performance improvement](?template=.github/PULL_REQUEST_TEMPLATE/performance_improvement.md) +- 💻 Are you changing functionality? [Feature change](?template=.github/PULL_REQUEST_TEMPLATE/feature_change.md) From 0e463b8aeb48a011f37da522a574c71564120636 Mon Sep 17 00:00:00 2001 From: Saumyajit P <86034982+AgSpades@users.noreply.github.com> Date: Sun, 18 May 2025 20:44:20 +0530 Subject: [PATCH 03/16] fix: template rendering with required 'expand' query parameter The issue wasn't with the path itself, but with GitHub requiring the additional 'expand=1' query parameter for proper template rendering. This change ensures the correct behavior when selecting pull request templates. --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index bbe2f309a1..a58c86f015 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,6 +5,6 @@ please switch to **Preview** for links to render properly. Please choose the right template for your pull request: -- 🐛 Are you fixing a bug? [Bug fix](?template=.github/PULL_REQUEST_TEMPLATE/bug_fix.md) -- 📈 Are you improving performance? [Performance improvement](?template=.github/PULL_REQUEST_TEMPLATE/performance_improvement.md) -- 💻 Are you changing functionality? [Feature change](?template=.github/PULL_REQUEST_TEMPLATE/feature_change.md) +- 🐛 Are you fixing a bug? [Bug fix](?expand=1&template=bug_fix.md) +- 📈 Are you improving performance? [Performance improvement](?expand=1&template=performance_improvement.md) +- 💻 Are you changing functionality? [Feature change](?expand=1&template=feature_change.md) From 4b8fef8bdf9af82e221427f885e3dbf08f18c4bf Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 23 May 2025 10:09:58 -0700 Subject: [PATCH 04/16] add `get_subnet_info` to subtensors --- bittensor/core/async_subtensor.py | 36 +++++++++++++++++++++++++++++++ bittensor/core/subtensor.py | 27 +++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index aa5fa9c5f1..5525a1eb37 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -1921,6 +1921,42 @@ async def get_stake_add_fee( ) return Balance.from_rao(result) + async def get_subnet_info( + self, + netuid: int, + block: Optional[int] = None, + block_hash: Optional[str] = None, + reuse_block: bool = False, + ) -> Optional["SubnetInfo"]: + """ + Retrieves detailed information about subnet within the Bittensor network. + This function provides comprehensive data on subnet, including its characteristics and operational parameters. + + Arguments: + netuid: The unique identifier of the subnet. + block: The blockchain block number for the query. + block_hash (Optional[str]): The hash of the block to retrieve the stake from. Do not specify if using block + or reuse_block + reuse_block (bool): Whether to use the last-used block. Do not set if using block_hash or block. + + Returns: + SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet. + + Gaining insights into the subnet's details assists in understanding the network's composition, the roles of + different subnets, and their unique features. + """ + result = await self.query_runtime_api( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + block_hash=block_hash, + reuse_block=reuse_block, + ) + if not result: + return None + return SubnetInfo.from_dict(result) + async def get_unstake_fee( self, amount: Balance, diff --git a/bittensor/core/subtensor.py b/bittensor/core/subtensor.py index 015b918cd7..5c7241d4dc 100644 --- a/bittensor/core/subtensor.py +++ b/bittensor/core/subtensor.py @@ -1507,6 +1507,33 @@ def get_stake_add_fee( ) return Balance.from_rao(result) + def get_subnet_info( + self, netuid: int, block: Optional[int] = None + ) -> Optional["SubnetInfo"]: + """ + Retrieves detailed information about subnet within the Bittensor network. + This function provides comprehensive data on subnet, including its characteristics and operational parameters. + + Arguments: + netuid: The unique identifier of the subnet. + block: The blockchain block number for the query. + + Returns: + SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet. + + Gaining insights into the subnet's details assists in understanding the network's composition, the roles of + different subnets, and their unique features. + """ + result = self.query_runtime_api( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + ) + if not result: + return None + return SubnetInfo.from_dict(result) + def get_unstake_fee( self, amount: Balance, From 50fc0aa94d92a6788f8df9d4ac3b81f438807e32 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 23 May 2025 10:10:19 -0700 Subject: [PATCH 05/16] add unit tests for `get_subnet_info` to subtensors --- tests/unit_tests/test_async_subtensor.py | 57 ++++++++++++++++++++++++ tests/unit_tests/test_subtensor.py | 52 +++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/tests/unit_tests/test_async_subtensor.py b/tests/unit_tests/test_async_subtensor.py index 0449a7b8ef..b726ce41c3 100644 --- a/tests/unit_tests/test_async_subtensor.py +++ b/tests/unit_tests/test_async_subtensor.py @@ -3314,3 +3314,60 @@ async def test_get_subnet_validator_permits_is_none(subtensor, mocker): ) assert result is None + + +@pytest.mark.asyncio +async def test_get_subnet_info_success(mocker, subtensor): + """Test get_subnet_info returns correct data when subnet information is found.""" + # Prep + netuid = mocker.Mock() + block = mocker.Mock() + + mocker.patch.object(subtensor, "query_runtime_api") + mocker.patch.object( + async_subtensor.SubnetInfo, + "from_dict", + ) + + # Call + result = await subtensor.get_subnet_info(netuid=netuid, block=block) + + # Asserts + subtensor.query_runtime_api.assert_awaited_once_with( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + block_hash=None, + reuse_block=False, + ) + async_subtensor.SubnetInfo.from_dict.assert_called_once_with( + subtensor.query_runtime_api.return_value, + ) + assert result == async_subtensor.SubnetInfo.from_dict.return_value + + +@pytest.mark.asyncio +async def test_get_subnet_info_no_data(mocker, subtensor): + """Test get_subnet_info returns None.""" + # Prep + netuid = mocker.Mock() + block = mocker.Mock() + mocker.patch.object(async_subtensor.SubnetInfo, "from_dict") + mocker.patch.object(subtensor, "query_runtime_api", return_value=None) + + # Call + result = await subtensor.get_subnet_info(netuid=netuid, block=block) + + # Asserts + subtensor.query_runtime_api.assert_awaited_once_with( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + block_hash=None, + reuse_block=False, + ) + async_subtensor.SubnetInfo.from_dict.assert_not_called() + assert result is None + diff --git a/tests/unit_tests/test_subtensor.py b/tests/unit_tests/test_subtensor.py index 0db7c0cafe..e4513d9617 100644 --- a/tests/unit_tests/test_subtensor.py +++ b/tests/unit_tests/test_subtensor.py @@ -3668,3 +3668,55 @@ def test_is_subnet_active(subtensor, mocker, query_return, expected): ) assert result == expected + + +# `geg_l_subnet_info` tests +def test_get_subnet_info_success(mocker, subtensor): + """Test get_subnet_info returns correct data when subnet information is found.""" + # Prep + netuid = mocker.Mock() + block = mocker.Mock() + + mocker.patch.object(subtensor, "query_runtime_api") + mocker.patch.object( + subtensor_module.SubnetInfo, + "from_dict", + ) + + # Call + result = subtensor.get_subnet_info(netuid=netuid, block=block) + + # Asserts + subtensor.query_runtime_api.assert_called_once_with( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + ) + subtensor_module.SubnetInfo.from_dict.assert_called_once_with( + subtensor.query_runtime_api.return_value, + ) + assert result == subtensor_module.SubnetInfo.from_dict.return_value + + +def test_get_subnet_info_no_data(mocker, subtensor): + """Test get_subnet_info returns None.""" + # Prep + netuid = mocker.Mock() + block = mocker.Mock() + mocker.patch.object(subtensor_module.SubnetInfo, "from_dict") + mocker.patch.object(subtensor, "query_runtime_api", return_value=None) + + # Call + result = subtensor.get_subnet_info(netuid=netuid, block=block) + + # Asserts + subtensor.query_runtime_api.assert_called_once_with( + runtime_api="SubnetInfoRuntimeApi", + method="get_subnet_info_v2", + params=[netuid], + block=block, + ) + subtensor_module.SubnetInfo.from_dict.assert_not_called() + assert result is None + From 2ab8a712a5778441e2673273b4073265665c1afe Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 23 May 2025 10:13:32 -0700 Subject: [PATCH 06/16] update SubtensorApi --- bittensor/core/subtensor_api/subnets.py | 1 + bittensor/core/subtensor_api/utils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/bittensor/core/subtensor_api/subnets.py b/bittensor/core/subtensor_api/subnets.py index 8b8c9121e7..962f761d1e 100644 --- a/bittensor/core/subtensor_api/subnets.py +++ b/bittensor/core/subtensor_api/subnets.py @@ -24,6 +24,7 @@ def __init__(self, subtensor: Union["_Subtensor", "_AsyncSubtensor"]): self.get_next_epoch_start_block = subtensor.get_next_epoch_start_block self.get_subnet_burn_cost = subtensor.get_subnet_burn_cost self.get_subnet_hyperparameters = subtensor.get_subnet_hyperparameters + self.get_subnet_info = subtensor.get_subnet_info self.get_subnet_owner_hotkey = subtensor.get_subnet_owner_hotkey self.get_subnet_reveal_period_epochs = subtensor.get_subnet_reveal_period_epochs self.get_subnet_validator_permits = subtensor.get_subnet_validator_permits diff --git a/bittensor/core/subtensor_api/utils.py b/bittensor/core/subtensor_api/utils.py index 3f8cc7d36d..0ca9b1234a 100644 --- a/bittensor/core/subtensor_api/utils.py +++ b/bittensor/core/subtensor_api/utils.py @@ -84,6 +84,7 @@ def add_legacy_methods(subtensor: "SubtensorApi"): subtensor.get_subnet_hyperparameters = ( subtensor._subtensor.get_subnet_hyperparameters ) + subtensor.get_subnet_info = subtensor._subtensor.get_subnet_info subtensor.get_subnet_owner_hotkey = subtensor._subtensor.get_subnet_owner_hotkey subtensor.get_subnet_reveal_period_epochs = ( subtensor._subtensor.get_subnet_reveal_period_epochs From b0d159e997168da2a1752b2dfebb2c50c5616486 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 23 May 2025 10:15:22 -0700 Subject: [PATCH 07/16] ruff --- tests/unit_tests/test_async_subtensor.py | 1 - tests/unit_tests/test_subtensor.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/unit_tests/test_async_subtensor.py b/tests/unit_tests/test_async_subtensor.py index b726ce41c3..ddf8daf818 100644 --- a/tests/unit_tests/test_async_subtensor.py +++ b/tests/unit_tests/test_async_subtensor.py @@ -3370,4 +3370,3 @@ async def test_get_subnet_info_no_data(mocker, subtensor): ) async_subtensor.SubnetInfo.from_dict.assert_not_called() assert result is None - diff --git a/tests/unit_tests/test_subtensor.py b/tests/unit_tests/test_subtensor.py index e4513d9617..163a89de6c 100644 --- a/tests/unit_tests/test_subtensor.py +++ b/tests/unit_tests/test_subtensor.py @@ -3719,4 +3719,3 @@ def test_get_subnet_info_no_data(mocker, subtensor): ) subtensor_module.SubnetInfo.from_dict.assert_not_called() assert result is None - From 332fc2154a82c01007db36d99747022b3ca7909d Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 28 May 2025 12:17:48 -0700 Subject: [PATCH 08/16] improve skipping logic (no error when skip the job) --- .github/workflows/e2e-subtensor-tests.yaml | 30 +++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-subtensor-tests.yaml b/.github/workflows/e2e-subtensor-tests.yaml index 494da0b011..364b96698b 100644 --- a/.github/workflows/e2e-subtensor-tests.yaml +++ b/.github/workflows/e2e-subtensor-tests.yaml @@ -128,11 +128,31 @@ jobs: fi done + # run non-fast-blocks only on Saturday and by cron schedule + check-if-saturday: + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + outputs: + is-saturday: ${{ steps.check.outputs.is-saturday }} + steps: + - id: check + run: | + day=$(date -u +%u) + echo "Today is weekday $day" + if [ "$day" -ne 6 ]; then + echo "⏭️ Skipping: not Saturday" + echo "is-saturday=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "is-saturday=true" + echo "is-saturday=true" >> "$GITHUB_OUTPUT" + cron-run-non-fast-blocks-e2e-test: - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' && needs.check-if-saturday.outputs.is-saturday == 'true' name: "NFB: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}" needs: + - check-if-saturday - find-tests - pull-docker-image runs-on: ubuntu-latest @@ -148,14 +168,6 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - - name: Check if today is Saturday - run: | - day=$(date -u +%u) - echo "Today is weekday $day" - if [ "$day" -ne 6 ]; then - echo "⏭️ Skipping: not Saturday" - exit 78 - fi - name: Check-out repository uses: actions/checkout@v4 From d6393f97f54a97e6ccea4e72e885303332b215cb Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 28 May 2025 12:37:03 -0700 Subject: [PATCH 09/16] is `blocks_since_last_step==0` then `get_next_epoch_start_block` returns `None`: Fixed --- bittensor/core/async_subtensor.py | 2 +- bittensor/core/subtensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index 5525a1eb37..9b2c7d2f00 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -1796,7 +1796,7 @@ async def get_next_epoch_start_block( netuid=netuid, block=block, block_hash=block_hash, reuse_block=reuse_block ) - if block and blocks_since_last_step and tempo: + if block and blocks_since_last_step is not None and tempo: return block - blocks_since_last_step + tempo + 1 return None diff --git a/bittensor/core/subtensor.py b/bittensor/core/subtensor.py index 5c7241d4dc..6f292d6551 100644 --- a/bittensor/core/subtensor.py +++ b/bittensor/core/subtensor.py @@ -1385,7 +1385,7 @@ def get_next_epoch_start_block( blocks_since_last_step = self.blocks_since_last_step(netuid=netuid, block=block) tempo = self.tempo(netuid=netuid, block=block) - if block and blocks_since_last_step and tempo: + if block and blocks_since_last_step is not None and tempo: return block - blocks_since_last_step + tempo + 1 return None From 9b30583f93e5e1fadc9191fab221d4eacc52329e Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 28 May 2025 12:37:38 -0700 Subject: [PATCH 10/16] add unit test for 3 scenarios --- tests/unit_tests/test_async_subtensor.py | 35 ++++++++++++++++++++++++ tests/unit_tests/test_subtensor.py | 27 ++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/tests/unit_tests/test_async_subtensor.py b/tests/unit_tests/test_async_subtensor.py index ddf8daf818..39e54284c3 100644 --- a/tests/unit_tests/test_async_subtensor.py +++ b/tests/unit_tests/test_async_subtensor.py @@ -3370,3 +3370,38 @@ async def test_get_subnet_info_no_data(mocker, subtensor): ) async_subtensor.SubnetInfo.from_dict.assert_not_called() assert result is None + + +@pytest.mark.parametrize( + "call_return, expected", + [[10, 111], [None, None], [0, 121]], +) +@pytest.mark.asyncio +async def test_get_next_epoch_start_block(mocker, subtensor, call_return, expected): + """Check that get_next_epoch_start_block returns the correct value.""" + # Prep + netuid = mocker.Mock() + block = 20 + + fake_block_hash = mocker.Mock() + mocker.patch.object(subtensor, "get_block_hash", return_value=fake_block_hash) + + mocked_blocks_since_last_step = mocker.AsyncMock(return_value=call_return) + subtensor.blocks_since_last_step = mocked_blocks_since_last_step + + mocker.patch.object(subtensor, "tempo", return_value=100) + + # Call + result = await subtensor.get_next_epoch_start_block(netuid=netuid, block=block) + + # Asserts + mocked_blocks_since_last_step.assert_called_once_with( + netuid=netuid, + block=block, + block_hash=fake_block_hash, + reuse_block=False, + ) + subtensor.tempo.assert_awaited_once_with( + netuid=netuid, block=block, block_hash=fake_block_hash, reuse_block=False + ) + assert result == expected diff --git a/tests/unit_tests/test_subtensor.py b/tests/unit_tests/test_subtensor.py index 163a89de6c..c16fc98635 100644 --- a/tests/unit_tests/test_subtensor.py +++ b/tests/unit_tests/test_subtensor.py @@ -3719,3 +3719,30 @@ def test_get_subnet_info_no_data(mocker, subtensor): ) subtensor_module.SubnetInfo.from_dict.assert_not_called() assert result is None + + +@pytest.mark.parametrize( + "call_return, expected", + [[10, 111], [None, None], [0, 121]], +) +def test_get_next_epoch_start_block(mocker, subtensor, call_return, expected): + """Check that get_next_epoch_start_block returns the correct value.""" + # Prep + netuid = mocker.Mock() + block = 20 + + mocked_blocks_since_last_step = mocker.Mock(return_value=call_return) + subtensor.blocks_since_last_step = mocked_blocks_since_last_step + + mocker.patch.object(subtensor, "tempo", return_value=100) + + # Call + result = subtensor.get_next_epoch_start_block(netuid=netuid, block=block) + + # Asserts + mocked_blocks_since_last_step.assert_called_once_with( + netuid=netuid, + block=block, + ) + subtensor.tempo.assert_called_once_with(netuid=netuid, block=block) + assert result == expected From 9bfdae467981bcbd48e92d9e34b45ef8ede7f9a5 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 29 May 2025 11:53:22 -0700 Subject: [PATCH 11/16] replace `transfer_allow_death` with `transfer_keep_alive` --- bittensor/core/async_subtensor.py | 2 +- bittensor/core/extrinsics/asyncex/transfer.py | 2 +- bittensor/core/extrinsics/transfer.py | 2 +- bittensor/core/subtensor.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index 9b2c7d2f00..da7d75a82f 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -2322,7 +2322,7 @@ async def get_transfer_fee( call = await self.substrate.compose_call( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": dest, "value": value.rao}, ) diff --git a/bittensor/core/extrinsics/asyncex/transfer.py b/bittensor/core/extrinsics/asyncex/transfer.py index a1c781310c..e98e234307 100644 --- a/bittensor/core/extrinsics/asyncex/transfer.py +++ b/bittensor/core/extrinsics/asyncex/transfer.py @@ -45,7 +45,7 @@ async def _do_transfer( """ call = await subtensor.substrate.compose_call( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": destination, "value": amount.rao}, ) diff --git a/bittensor/core/extrinsics/transfer.py b/bittensor/core/extrinsics/transfer.py index 03624097d0..a2ac8df11d 100644 --- a/bittensor/core/extrinsics/transfer.py +++ b/bittensor/core/extrinsics/transfer.py @@ -44,7 +44,7 @@ def _do_transfer( """ call = subtensor.substrate.compose_call( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": destination, "value": amount.rao}, ) diff --git a/bittensor/core/subtensor.py b/bittensor/core/subtensor.py index 6f292d6551..406295e330 100644 --- a/bittensor/core/subtensor.py +++ b/bittensor/core/subtensor.py @@ -1831,7 +1831,7 @@ def get_transfer_fee(self, wallet: "Wallet", dest: str, value: Balance) -> Balan value = check_and_convert_to_balance(value) call = self.substrate.compose_call( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": dest, "value": value.rao}, ) From e12b20f4eeb9c15255a0c50b9b6ee9a010e261c9 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 29 May 2025 11:53:32 -0700 Subject: [PATCH 12/16] update tests --- tests/unit_tests/extrinsics/asyncex/test_transfer.py | 6 +++--- tests/unit_tests/extrinsics/test_transfer.py | 6 +++--- tests/unit_tests/test_async_subtensor.py | 2 +- tests/unit_tests/test_subtensor.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit_tests/extrinsics/asyncex/test_transfer.py b/tests/unit_tests/extrinsics/asyncex/test_transfer.py index 77fcd72f9f..95c5249b62 100644 --- a/tests/unit_tests/extrinsics/asyncex/test_transfer.py +++ b/tests/unit_tests/extrinsics/asyncex/test_transfer.py @@ -32,7 +32,7 @@ async def test_do_transfer_success(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_awaited_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_destination, "value": fake_amount.rao}, ) @@ -77,7 +77,7 @@ async def test_do_transfer_failure(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_awaited_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_destination, "value": fake_amount.rao}, ) @@ -124,7 +124,7 @@ async def test_do_transfer_no_waiting(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_awaited_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_destination, "value": fake_amount.rao}, ) diff --git a/tests/unit_tests/extrinsics/test_transfer.py b/tests/unit_tests/extrinsics/test_transfer.py index fcd532e2d0..081a56ffae 100644 --- a/tests/unit_tests/extrinsics/test_transfer.py +++ b/tests/unit_tests/extrinsics/test_transfer.py @@ -26,7 +26,7 @@ def test_do_transfer_is_success_true(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_called_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_dest, "value": fake_transfer_balance.rao}, ) subtensor.sign_and_send_extrinsic.assert_called_once_with( @@ -64,7 +64,7 @@ def test_do_transfer_is_success_false(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_called_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_dest, "value": fake_transfer_balance.rao}, ) subtensor.sign_and_send_extrinsic.assert_called_once_with( @@ -103,7 +103,7 @@ def test_do_transfer_no_waits(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_called_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_dest, "value": fake_transfer_balance.rao}, ) subtensor.sign_and_send_extrinsic.assert_called_once_with( diff --git a/tests/unit_tests/test_async_subtensor.py b/tests/unit_tests/test_async_subtensor.py index 39e54284c3..a023be1c62 100644 --- a/tests/unit_tests/test_async_subtensor.py +++ b/tests/unit_tests/test_async_subtensor.py @@ -707,7 +707,7 @@ async def test_get_transfer_fee(subtensor, fake_wallet, mocker, balance): mocked_compose_call.assert_awaited_once() mocked_compose_call.assert_called_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={ "dest": fake_dest, "value": fake_value.rao, diff --git a/tests/unit_tests/test_subtensor.py b/tests/unit_tests/test_subtensor.py index c16fc98635..2499db8248 100644 --- a/tests/unit_tests/test_subtensor.py +++ b/tests/unit_tests/test_subtensor.py @@ -1877,7 +1877,7 @@ def test_get_transfer_fee(subtensor, fake_wallet, mocker): # Asserts subtensor.substrate.compose_call.assert_called_once_with( call_module="Balances", - call_function="transfer_allow_death", + call_function="transfer_keep_alive", call_params={"dest": fake_dest, "value": value.rao}, ) From aaa3c2242220d3daa2dd2754c674c6153def7f16 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 29 May 2025 12:57:33 -0700 Subject: [PATCH 13/16] bumps version and changelog --- CHANGELOG.md | 10 ++++++++++ pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5190ea2525..025b16efac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 9.6.2 /2025-05-29 + +## What's Changed +* Add `get_subnet_info` by @basfroman in https://github.com/opentensor/bittensor/pull/2894 +* Fix bug in `get_next_epoch_start_block` by @basfroman in https://github.com/opentensor/bittensor/pull/2899 +* e2e workflow: improve skipping logic (no error when skip the job) by @basfroman in https://github.com/opentensor/bittensor/pull/2898 +* Replace `transfer_allow_death` with `transfer_keep_alive` by @basfroman in https://github.com/opentensor/bittensor/pull/2900 + +**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.6.1...v9.6.2 + ## 9.6.1 /2025-05-22 ## What's Changed diff --git a/pyproject.toml b/pyproject.toml index 244fcd3a53..b448c450d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "bittensor" -version = "9.6.1" +version = "9.6.2" description = "Bittensor" readme = "README.md" authors = [ From 35212f7d4c22639591984fd11e2ac53368ff5bf5 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 29 May 2025 22:24:58 +0200 Subject: [PATCH 14/16] Update PR templates so users acknowledge they are opening against the right branch. --- .github/PULL_REQUEST_TEMPLATE/bug_fix.md | 6 +++++- .github/PULL_REQUEST_TEMPLATE/feature_change.md | 6 +++++- .github/PULL_REQUEST_TEMPLATE/performance_improvement.md | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md index 8bf781b532..e3c29ef96d 100644 --- a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md +++ b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md @@ -56,4 +56,8 @@ Examples: - Fixed an issue where multiple cursors did not work in a file with a single line. - Increased the performance of searching and replacing across a whole project. ---> \ No newline at end of file +--> + + +### Branch Acknowledgement +[ ] I am acknowledging that I am opening this branch against `staging` diff --git a/.github/PULL_REQUEST_TEMPLATE/feature_change.md b/.github/PULL_REQUEST_TEMPLATE/feature_change.md index 0b29a822b3..15292a9d7a 100644 --- a/.github/PULL_REQUEST_TEMPLATE/feature_change.md +++ b/.github/PULL_REQUEST_TEMPLATE/feature_change.md @@ -51,4 +51,8 @@ Examples: - Fixed an issue where multiple cursors did not work in a file with a single line. - Increased the performance of searching and replacing across a whole project. ---> \ No newline at end of file +--> + + +### Branch Acknowledgement +[ ] I am acknowledging that I am opening this branch against `staging` diff --git a/.github/PULL_REQUEST_TEMPLATE/performance_improvement.md b/.github/PULL_REQUEST_TEMPLATE/performance_improvement.md index 96e18c9d29..0419f9f88d 100644 --- a/.github/PULL_REQUEST_TEMPLATE/performance_improvement.md +++ b/.github/PULL_REQUEST_TEMPLATE/performance_improvement.md @@ -52,4 +52,8 @@ Examples: - Fixed an issue where multiple cursors did not work in a file with a single line. - Increased the performance of searching and replacing across a whole project. ---> \ No newline at end of file +--> + + +### Branch Acknowledgement +[ ] I am acknowledging that I am opening this branch against `staging` From 0414d4e8b4b10fb3b07e74ef9aca7c7e1e6b1979 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 29 May 2025 13:52:19 -0700 Subject: [PATCH 15/16] bumps version & changelog --- CHANGELOG.md | 10 ++++++++-- pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 025b16efac..130228c182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,20 @@ # Changelog -## 9.6.2 /2025-05-29 +## 9.7.0 /2025-05-29 ## What's Changed * Add `get_subnet_info` by @basfroman in https://github.com/opentensor/bittensor/pull/2894 * Fix bug in `get_next_epoch_start_block` by @basfroman in https://github.com/opentensor/bittensor/pull/2899 * e2e workflow: improve skipping logic (no error when skip the job) by @basfroman in https://github.com/opentensor/bittensor/pull/2898 * Replace `transfer_allow_death` with `transfer_keep_alive` by @basfroman in https://github.com/opentensor/bittensor/pull/2900 +* 9.6.2: Bumps version and changelog by @ibraheem-abe in https://github.com/opentensor/bittensor/pull/2901 +* Fix broken pull request template links (#2867) by @AgSpades in https://github.com/opentensor/bittensor/pull/2883 +* update pr templates with branch ack by @thewhaleking in https://github.com/opentensor/bittensor/pull/2903 -**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.6.1...v9.6.2 +## New Contributors +* @AgSpades made their first contribution in https://github.com/opentensor/bittensor/pull/2883 + +**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.6.1...v9.7.0 ## 9.6.1 /2025-05-22 diff --git a/pyproject.toml b/pyproject.toml index b448c450d9..15a1062fbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "bittensor" -version = "9.6.2" +version = "9.7.0" description = "Bittensor" readme = "README.md" authors = [ From 7b2528412590610d4e807f7bcbd5382c1b07ce5f Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 29 May 2025 13:53:41 -0700 Subject: [PATCH 16/16] remove old ref --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 130228c182..80bf2ad1b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ * Fix bug in `get_next_epoch_start_block` by @basfroman in https://github.com/opentensor/bittensor/pull/2899 * e2e workflow: improve skipping logic (no error when skip the job) by @basfroman in https://github.com/opentensor/bittensor/pull/2898 * Replace `transfer_allow_death` with `transfer_keep_alive` by @basfroman in https://github.com/opentensor/bittensor/pull/2900 -* 9.6.2: Bumps version and changelog by @ibraheem-abe in https://github.com/opentensor/bittensor/pull/2901 * Fix broken pull request template links (#2867) by @AgSpades in https://github.com/opentensor/bittensor/pull/2883 * update pr templates with branch ack by @thewhaleking in https://github.com/opentensor/bittensor/pull/2903