You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+81-28Lines changed: 81 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,36 +24,36 @@
24
24
9. ✅ ~~`subtensor.get_transfer_fee` calls extrinsic inside the subtensor module. Actually the method could be updated by using `bittensor.core.extrinsics.utils.get_extrinsic_fee`.~~`get_transfer_fee` isn't `get_extrinsic_fee`
25
25
26
26
## Subtensor
27
-
1. In the synchronous Subtensor class, the `get_owned_hotkeys` method includes a `reuse_block` parameter that is inconsistent with other methods. Either remove this parameter from `get_owned_hotkeys`, or add it to all other methods that directly call self.substrate.* to maintain a consistent interface.
28
-
2. In all methods where we `get_stake_operations_fee` is called, remove unused arguments. Consider combining all methods using `get_stake_operations_fee` into one common one.
29
-
3. Delete deprecated `get_current_weight_commit_info` and `get_current_weight_commit_info_v2`. Rename `get_timelocked_weight_commits` to get_current_weight_commit_info.
30
-
4. Remove references like `get_stake_info_for_coldkey = get_stake_for_coldkey`.
31
-
5. Reconsider some methods naming across the entire subtensor module.
32
-
6. Add `hotkey_ss58` parameter to `get_liquidity_list` method. One wallet can have many HKs. Currently, the mentioned method uses default HK only.
27
+
1.✅ In the synchronous Subtensor class, the `get_owned_hotkeys` method includes a `reuse_block` parameter that is inconsistent with other methods. Either remove this parameter from `get_owned_hotkeys`, or add it to all other methods that directly call self.substrate.* to maintain a consistent interface.
28
+
2.✅ In all methods where we `get_stake_operations_fee` is called, remove unused arguments. Consider combining all methods using `get_stake_operations_fee` into one common one.
29
+
3.✅ Delete deprecated `get_current_weight_commit_info` and `get_current_weight_commit_info_v2`. ~~Rename `get_timelocked_weight_commits` to `get_current_weight_commit_info`.~~
30
+
4.✅ Remove references like `get_stake_info_for_coldkey = get_stake_for_coldkey`.
31
+
5.✅ Reconsider some methods naming across the entire subtensor module.
32
+
6.~~Add `hotkey_ss58` parameter to `get_liquidity_list` method. One wallet can have many HKs. Currently, the mentioned method uses default HK only.~~ wrong idea
33
33
34
34
## Metagraph
35
-
1. Remove verbose archival node warnings for blocks older than 300. Some users complained about many messages for them.
36
-
2. Reconsider entire metagraph module logic.
35
+
1.✅ Remove verbose archival node warnings for blocks older than 300. Some users complained about many messages for them.
36
+
2.✅ Reconsider entire metagraph module logic.
37
37
38
38
## Balance
39
-
1. In `bittensor.utils.balance._check_currencies` raise the error instead of `warnings.warn`.
40
-
2. In `bittensor.utils.balance.check_and_convert_to_balance` raise the error instead of `warnings.warn`.
39
+
1.✅ In `bittensor.utils.balance._check_currencies` raise the error instead of `warnings.warn`.
40
+
2.✅ In `bittensor.utils.balance.check_and_convert_to_balance` raise the error instead of `warnings.warn`.
41
41
This may seem like a harsh decision at first, but ultimately we will push the community to use Balance and there will be fewer errors in their calculations. Confusion with TAO and Alpha in calculations and display/printing/logging will be eliminated.
42
42
43
43
## Common things
44
-
1. Reduce the amount of logging.info or transfer part of logging.info to logging.debug`(in progress)`
44
+
1.✅ Reduce the amount of logging.info or transfer part of logging.info to logging.debug
45
45
46
-
2. To be consistent across all SDK regarding local environment variables name:
46
+
2.✅ To be consistent across all SDK regarding local environment variables name:
47
47
remove `BT_CHAIN_ENDPOINT` (settings.py :line 124) and use `BT_SUBTENSOR_CHAIN_ENDPOINT` instead of that.
48
48
rename this variable in documentation.
49
49
50
-
3. Move `bittensor.utils.get_transfer_fn_params` to `bittensor.core.extrinsics.utils`.
50
+
3.✅ ~~Move `bittensor.utils.get_transfer_fn_params` to `bittensor.core.extrinsics.utils`.~~ it's on the right place.
51
51
52
52
4. ✅ Common refactoring (improve type annotations, etc)
53
53
54
-
5. Rename `non-/fast-blocks` to `non-/fast-runtime` in related places to be consistent with subtensor repo. Related with testing, subtensor scripts, documentation.
54
+
5.✅ ~~Rename `non-/fast-blocks` to `non-/fast-runtime` in related places to be consistent with subtensor repo. Related with testing, subtensor scripts, documentation.~~ done across many PRs.
55
55
56
-
6. To be consistent throughout the SDK`(in progress)`:
56
+
6.✅ To be consistent throughout the SDK:
57
57
`hotkey`, `coldkey`, `hotkeypub`, and `coldkeypub` are keypairs
58
58
`hotkey_ss58`, `coldkey_ss58`, `hotkeypub_ss58`, and `coldkeypub_ss58` are SS58 addresses of keypair.
59
59
@@ -65,19 +65,19 @@ rename this variable in documentation.
65
65
-[x] CRv3 extrinsics
66
66
-[x] CRv3 logic related subtensor's calls
67
67
68
-
10. Revise `bittensor/utils/easy_imports.py` module to remove deprecated backwards compatibility objects. Use this module as a functionality for exporting existing objects to the package root to keep __init__.py minimal and simple.
68
+
10.✅ Revise `bittensor/utils/easy_imports.py` module to remove deprecated backwards compatibility objects. Use this module as a functionality for exporting existing objects to the package root to keep __init__.py minimal and simple.
12. Find and process all `TODOs` across the entire code base. If in doubt, discuss each one with the team separately. SDK has 29 TODOs.
73
73
13. ✅ The SDK is dropping support for `Python 3.9` starting with this release.
74
74
14. ✅ Remove `Default is` and `Default to` in docstrings bc parameters enough.
75
75
15. camfairchild: TODO, but we should have a grab_metadata if we don't already. Maybe don't decode, but can have a call that removes the Raw prefix, and another just doing grab_metadata_raw (no decoding)
76
76
77
77
## New features
78
-
1. Add `bittensor.utils.hex_to_ss58` function. SDK still doesn't have it. (Probably inner import `from scalecodec import ss58_encode, ss58_decode`)
1. ✅ When running tests via Docker, ensure no lingering processes occupy required ports before launch.
@@ -95,23 +95,21 @@ rename this variable in documentation.
95
95
96
96
97
97
## Implementation
98
-
99
98
To implement the above changes and prepare for the v10 release, the following steps must be taken:
100
99
101
100
-[x] Create a new branch named SDKv10.~~
102
101
All breaking changes and refactors should be targeted into this branch to isolate them from staging and maintain backward compatibility during development.
103
-
-[] Add a `MIGRATION.md` document at the root of the repository and use it as a check list. This file will serve as a changelog and technical reference.
102
+
-[x] Add a `MIGRATION.md` document at the root of the repository and use it as a check list. This file will serve as a changelog and technical reference.
104
103
It must include:
105
-
-[] All change categories (Extrinsics, Subtensor, Metagraph, etc.)
106
-
-[] Per-PR breakdown of what was added, removed, renamed, or refactored.
107
-
-[] Justifications and migration notes for users (if API behavior changed).
104
+
-[x] All change categories (Extrinsics, Subtensor, Metagraph, etc.)
105
+
-[x] Per-PR breakdown of what was added, removed, renamed, or refactored.
106
+
-[x] Justifications and migration notes for users (if API behavior changed).
108
107
109
108
-[ ] Based on the final `MIGRATION.md`, develop migration documentation for the community.
110
109
-[ ] Once complete, merge SDKv10 into staging and release version 10.
111
110
112
111
113
112
# Migration guide
114
-
115
113
-[x]`._do_commit_reveal_v3` logic is included in the main code `.commit_timelocked_weights_extrinsic`
116
114
-[x]`commit_reveal_version` parameter with default value `4` added to `commit_timelocked_weights_extrinsic`
117
115
-[x]`._do_commit_weights` logic is included in the main code `.commit_weights_extrinsic`
@@ -126,8 +124,8 @@ It must include:
126
124
-[x]`dest` parameter has been renamed to `destination` in `transfer_extrinsic` function and `subtensor.transfer` method.
127
125
-[x] obsolete extrinsic `set_root_weights_extrinsic` removed. Also related subtensor calls `subtensor.set_root_weights_extrinsic` removed too.
128
126
129
-
# Standardize parameter order is applied for (extrinsics and related calls):
130
127
128
+
# Standardize parameter order is applied for (extrinsics and related calls):
131
129
These parameters will now exist in all extrinsics and related calls (default values could be different depends by extrinsic):
132
130
133
131
```py
@@ -216,6 +214,7 @@ Removing deprecated extrinsics and replacing them with consistent ones:
216
214
217
215
-`decrease_take_extrinsic` and `increase_take_extrinsic` have been merged into a single set_take_extrinsic. The API now has a new `action: Literal["increase_take", "decrease_take"]` parameter (DRY rule).
218
216
217
+
219
218
### Extrinsics has extra data in response's `data` field:
220
219
-`add_stake_extrinsic`
221
220
-`add_stake_multiple_extrinsic`
@@ -225,15 +224,30 @@ Removing deprecated extrinsics and replacing them with consistent ones:
225
224
-`unstake_extrinsic`
226
225
-`unstake_multiple_extrinsic`
227
226
227
+
228
228
### Subtensor changes
229
229
- method `all_subnets` has renamed parameter from `block_number` to `block` (consistency in the codebase).
230
-
- The `hotkey` parameter, which meant ss58 key address, was renamed to `hotkey_ss58` in all methods (consistency in the codebase).
230
+
- The `hotkey` parameter, which meant ss58 key address, was renamed to `hotkey_ss58` in all methods and related extrinsics (consistency in the codebase).
231
231
- The `coldkey` parameter, which meant ss58 key address, was renamed to `coldkey_ss58` in all methods (consistency in the codebase).
232
232
- method `query_subtensor` has updated parameters order.
233
233
- method `query_module` has updated parameters order.
234
234
- method `query_map_subtensor` has updated parameters order.
235
235
- method `query_map` has updated parameters order.
236
236
- method `add_stake_multiple` has updated parameters order.
237
+
- method `get_stake_for_coldkey` removed, bc this is the same as `get_stake_info_for_coldkey`
238
+
- method `get_subnets` renamed to `get_all_subnets_netuid` (obvious name, consistent with existing names)
239
+
- method `get_owned_hotkeys` get rid `reuse_block` parameter to be consistent with other sync methods.
240
+
- method `blocks_since_last_update` improved. Currently it can be used to get historical data from archive node.
241
+
- methods (async) `get_subnet_validator_permits` and `get_subnet_owner_hotkey` got `block_hash` and `reuse_block` parameters.
242
+
- attribute `DelegateInfo/lite.total_daily_return` has been deleted (Vune confirmed that we shouldn't use it)
243
+
-`Async/Subtensor` parameter `_mock` renamed to `mock`, also moved to last one in order. Community can use mocked `Async/Subtensor` in their tests in the same way as in we use it in the codebase.
244
+
- method `get_traansfer_fee` has renamed parameter `value` to `amount`
245
+
246
+
Added sub-package `bittensor.core.addons` to host optional extensions and experimental logic enhancing the core functionality.
247
+
-`bittensor.core.subtensor_api` moved to `bittensor.core.addons.subtensor_api`
248
+
-`bittensor.core.timelock` moved to `bittensor.core.addons.timelock`
249
+
- local env variable `BT_CHAIN_ENDPOINT` replaced with `BT_SUBTENSOR_CHAIN_ENDPOINT`.
250
+
237
251
238
252
### Mechid related changes:
239
253
In the next subtensor methods got updated the parameters order:
@@ -249,5 +263,44 @@ In the next subtensor methods got updated the parameters order:
-`get_metagraph_info`: `field_indices` -> `selected_indices` (to be consistent)
269
+
270
+
271
+
### `easy_import.py` module
272
+
Added:
273
+
-`from bittenosor import extrinsics`
274
+
-`from bittenosor import mock`
275
+
-`from bittenosor import get_async_subtensor`
276
+
277
+
Next variables removed:
278
+
-`async_subtensor` not -> `AsyncSubtensor`
279
+
-`axon` not -> `Axon`
280
+
-`config` not -> `Config`
281
+
-`dendrite` not -> `Dendrite`
282
+
-`keyfile` not -> `Keyfile`
283
+
-`metagraph` not -> `Metagraph`
284
+
-`wallet` not -> `Wallet`
285
+
-`subtensor` not -> `Subtensor`
286
+
-`synapse` not -> `Synapse`
287
+
288
+
Links to subpackages removed:
289
+
-`bittensor.mock` (available in `bittensor.core.mock`)
290
+
-`bittensor.extrinsics` (available in `bittensor.core.extrinsics`)
291
+
292
+
293
+
New subpackage `bittensor.extras` created to host optional extensions and experimental logic enhancing the core functionality.
294
+
Currently it contains:
295
+
-`bittensor.extras.subtensor_api`
296
+
-`bittensor.extras.timelock`
297
+
298
+
299
+
### Balance (bittensor/utils/balance.py) and related changes
300
+
-[x] Added 2 custom errors:
301
+
-`bittensor.core.errors.BalanceUnitMismatchError`
302
+
-`bittensor.core.errors.BalanceTypeError`
303
+
-[x]`check_balance` renamed to `check_balance_amount`
304
+
-[x]`check_and_convert_to_balance` renamed to `check_balance_amount`
305
+
-[x]`check_balance_amount` raised `BalanceTypeError` error instead of deprecated warning message.
306
+
-[x] private function `bittensor.utils.balance._check_currencies` raises `BalanceUnitMismatchError` error instead of deprecated warning message. This function is used inside the Balance class to check if units match during various mathematical and logical operations.
0 commit comments