Skip to content

Commit b32a423

Browse files
authored
Merge pull request #2905 from opentensor/release/9.7.0
Release/9.7.0
2 parents 025792c + 5dcf51b commit b32a423

File tree

17 files changed

+303
-30
lines changed

17 files changed

+303
-30
lines changed

.github/PULL_REQUEST_TEMPLATE/bug_fix.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ Examples:
5656
- Fixed an issue where multiple cursors did not work in a file with a single line.
5757
- Increased the performance of searching and replacing across a whole project.
5858
59-
-->
59+
-->
60+
61+
62+
### Branch Acknowledgement
63+
[ ] I am acknowledging that I am opening this branch against `staging`

.github/PULL_REQUEST_TEMPLATE/feature_change.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ Examples:
5151
- Fixed an issue where multiple cursors did not work in a file with a single line.
5252
- Increased the performance of searching and replacing across a whole project.
5353
54-
-->
54+
-->
55+
56+
57+
### Branch Acknowledgement
58+
[ ] I am acknowledging that I am opening this branch against `staging`

.github/PULL_REQUEST_TEMPLATE/performance_improvement.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,8 @@ Examples:
5252
- Fixed an issue where multiple cursors did not work in a file with a single line.
5353
- Increased the performance of searching and replacing across a whole project.
5454
55-
-->
55+
-->
56+
57+
58+
### Branch Acknowledgement
59+
[ ] I am acknowledging that I am opening this branch against `staging`

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ please switch to **Preview** for links to render properly.
55

66
Please choose the right template for your pull request:
77

8-
- 🐛 Are you fixing a bug? [Bug fix](?template=bug_fix.md)
9-
- 📈 Are you improving performance? [Performance improvement](?template=performance_improvement.md)
10-
- 💻 Are you changing functionality? [Feature change](?template=feature_change.md)
8+
- 🐛 Are you fixing a bug? [Bug fix](?expand=1&template=bug_fix.md)
9+
- 📈 Are you improving performance? [Performance improvement](?expand=1&template=performance_improvement.md)
10+
- 💻 Are you changing functionality? [Feature change](?expand=1&template=feature_change.md)

.github/workflows/e2e-subtensor-tests.yaml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,31 @@ jobs:
128128
fi
129129
done
130130
131+
# run non-fast-blocks only on Saturday and by cron schedule
132+
check-if-saturday:
133+
if: github.event_name == 'schedule'
134+
runs-on: ubuntu-latest
135+
outputs:
136+
is-saturday: ${{ steps.check.outputs.is-saturday }}
137+
steps:
138+
- id: check
139+
run: |
140+
day=$(date -u +%u)
141+
echo "Today is weekday $day"
142+
if [ "$day" -ne 6 ]; then
143+
echo "⏭️ Skipping: not Saturday"
144+
echo "is-saturday=false" >> "$GITHUB_OUTPUT"
145+
exit 0
146+
fi
147+
echo "is-saturday=true"
148+
echo "is-saturday=true" >> "$GITHUB_OUTPUT"
149+
131150
132151
cron-run-non-fast-blocks-e2e-test:
133-
if: github.event_name == 'schedule'
152+
if: github.event_name == 'schedule' && needs.check-if-saturday.outputs.is-saturday == 'true'
134153
name: "NFB: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}"
135154
needs:
155+
- check-if-saturday
136156
- find-tests
137157
- pull-docker-image
138158
runs-on: ubuntu-latest
@@ -148,14 +168,6 @@ jobs:
148168
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
149169

150170
steps:
151-
- name: Check if today is Saturday
152-
run: |
153-
day=$(date -u +%u)
154-
echo "Today is weekday $day"
155-
if [ "$day" -ne 6 ]; then
156-
echo "⏭️ Skipping: not Saturday"
157-
exit 78
158-
fi
159171
- name: Check-out repository
160172
uses: actions/checkout@v4
161173

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 9.7.0 /2025-05-29
4+
5+
## What's Changed
6+
* Add `get_subnet_info` by @basfroman in https://github.com/opentensor/bittensor/pull/2894
7+
* Fix bug in `get_next_epoch_start_block` by @basfroman in https://github.com/opentensor/bittensor/pull/2899
8+
* e2e workflow: improve skipping logic (no error when skip the job) by @basfroman in https://github.com/opentensor/bittensor/pull/2898
9+
* Replace `transfer_allow_death` with `transfer_keep_alive` by @basfroman in https://github.com/opentensor/bittensor/pull/2900
10+
* Fix broken pull request template links (#2867) by @AgSpades in https://github.com/opentensor/bittensor/pull/2883
11+
* update pr templates with branch ack by @thewhaleking in https://github.com/opentensor/bittensor/pull/2903
12+
13+
## New Contributors
14+
* @AgSpades made their first contribution in https://github.com/opentensor/bittensor/pull/2883
15+
16+
**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.6.1...v9.7.0
17+
318
## 9.6.1 /2025-05-22
419

520
## What's Changed

bittensor/core/async_subtensor.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ async def get_next_epoch_start_block(
17961796
netuid=netuid, block=block, block_hash=block_hash, reuse_block=reuse_block
17971797
)
17981798

1799-
if block and blocks_since_last_step and tempo:
1799+
if block and blocks_since_last_step is not None and tempo:
18001800
return block - blocks_since_last_step + tempo + 1
18011801
return None
18021802

@@ -1921,6 +1921,42 @@ async def get_stake_add_fee(
19211921
)
19221922
return Balance.from_rao(result)
19231923

1924+
async def get_subnet_info(
1925+
self,
1926+
netuid: int,
1927+
block: Optional[int] = None,
1928+
block_hash: Optional[str] = None,
1929+
reuse_block: bool = False,
1930+
) -> Optional["SubnetInfo"]:
1931+
"""
1932+
Retrieves detailed information about subnet within the Bittensor network.
1933+
This function provides comprehensive data on subnet, including its characteristics and operational parameters.
1934+
1935+
Arguments:
1936+
netuid: The unique identifier of the subnet.
1937+
block: The blockchain block number for the query.
1938+
block_hash (Optional[str]): The hash of the block to retrieve the stake from. Do not specify if using block
1939+
or reuse_block
1940+
reuse_block (bool): Whether to use the last-used block. Do not set if using block_hash or block.
1941+
1942+
Returns:
1943+
SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet.
1944+
1945+
Gaining insights into the subnet's details assists in understanding the network's composition, the roles of
1946+
different subnets, and their unique features.
1947+
"""
1948+
result = await self.query_runtime_api(
1949+
runtime_api="SubnetInfoRuntimeApi",
1950+
method="get_subnet_info_v2",
1951+
params=[netuid],
1952+
block=block,
1953+
block_hash=block_hash,
1954+
reuse_block=reuse_block,
1955+
)
1956+
if not result:
1957+
return None
1958+
return SubnetInfo.from_dict(result)
1959+
19241960
async def get_unstake_fee(
19251961
self,
19261962
amount: Balance,
@@ -2286,7 +2322,7 @@ async def get_transfer_fee(
22862322

22872323
call = await self.substrate.compose_call(
22882324
call_module="Balances",
2289-
call_function="transfer_allow_death",
2325+
call_function="transfer_keep_alive",
22902326
call_params={"dest": dest, "value": value.rao},
22912327
)
22922328

bittensor/core/extrinsics/asyncex/transfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def _do_transfer(
4545
"""
4646
call = await subtensor.substrate.compose_call(
4747
call_module="Balances",
48-
call_function="transfer_allow_death",
48+
call_function="transfer_keep_alive",
4949
call_params={"dest": destination, "value": amount.rao},
5050
)
5151

bittensor/core/extrinsics/transfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _do_transfer(
4444
"""
4545
call = subtensor.substrate.compose_call(
4646
call_module="Balances",
47-
call_function="transfer_allow_death",
47+
call_function="transfer_keep_alive",
4848
call_params={"dest": destination, "value": amount.rao},
4949
)
5050

bittensor/core/subtensor.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ def get_next_epoch_start_block(
13851385
blocks_since_last_step = self.blocks_since_last_step(netuid=netuid, block=block)
13861386
tempo = self.tempo(netuid=netuid, block=block)
13871387

1388-
if block and blocks_since_last_step and tempo:
1388+
if block and blocks_since_last_step is not None and tempo:
13891389
return block - blocks_since_last_step + tempo + 1
13901390
return None
13911391

@@ -1507,6 +1507,33 @@ def get_stake_add_fee(
15071507
)
15081508
return Balance.from_rao(result)
15091509

1510+
def get_subnet_info(
1511+
self, netuid: int, block: Optional[int] = None
1512+
) -> Optional["SubnetInfo"]:
1513+
"""
1514+
Retrieves detailed information about subnet within the Bittensor network.
1515+
This function provides comprehensive data on subnet, including its characteristics and operational parameters.
1516+
1517+
Arguments:
1518+
netuid: The unique identifier of the subnet.
1519+
block: The blockchain block number for the query.
1520+
1521+
Returns:
1522+
SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet.
1523+
1524+
Gaining insights into the subnet's details assists in understanding the network's composition, the roles of
1525+
different subnets, and their unique features.
1526+
"""
1527+
result = self.query_runtime_api(
1528+
runtime_api="SubnetInfoRuntimeApi",
1529+
method="get_subnet_info_v2",
1530+
params=[netuid],
1531+
block=block,
1532+
)
1533+
if not result:
1534+
return None
1535+
return SubnetInfo.from_dict(result)
1536+
15101537
def get_unstake_fee(
15111538
self,
15121539
amount: Balance,
@@ -1804,7 +1831,7 @@ def get_transfer_fee(self, wallet: "Wallet", dest: str, value: Balance) -> Balan
18041831
value = check_and_convert_to_balance(value)
18051832
call = self.substrate.compose_call(
18061833
call_module="Balances",
1807-
call_function="transfer_allow_death",
1834+
call_function="transfer_keep_alive",
18081835
call_params={"dest": dest, "value": value.rao},
18091836
)
18101837

0 commit comments

Comments
 (0)