Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncSubstrateInterface Overhaul (with Sync AsyncSubstrate) #2526

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
cd760a8
[WIP] wrapper around AsyncSubstrateInterface to be able to be used in…
thewhaleking Dec 6, 2024
8cbcf20
[WIP] working on updating tests and reconnection logic.
thewhaleking Dec 6, 2024
529410b
Removed the `.value`s everywhere as we no longer get SCALE objects fr…
thewhaleking Dec 6, 2024
41820dd
Further test improvements.
thewhaleking Dec 6, 2024
e6d298e
Added garbage collection method for closing the websocket connection.
thewhaleking Dec 6, 2024
38b1f26
Neuron certificate fix
thewhaleking Dec 6, 2024
998f7d1
Commit weights fix (no longer SCALE objects).
thewhaleking Dec 6, 2024
158f300
Catch SSL errors during WS send/receive
thewhaleking Dec 8, 2024
3426b92
Caching block hash retrieval
thewhaleking Dec 9, 2024
4de5166
Improved asynchronous websocket item retrieval. Added comments/docs.
thewhaleking Dec 9, 2024
dcbaa00
Remove all ensure_connected references.
thewhaleking Dec 9, 2024
49bd785
Handle disconnect/reconnects
thewhaleking Dec 9, 2024
f820829
Some tests fixed
thewhaleking Dec 9, 2024
541f2b8
rest of tests fixed
thewhaleking Dec 10, 2024
57e01da
Add metagraph save dir location specifying
thewhaleking Dec 10, 2024
0d373ad
Removed everything about the submit_extrinsic timeouts, as timeouts/r…
thewhaleking Dec 10, 2024
13db162
lint
thewhaleking Dec 10, 2024
ded1eb5
Optional args should have default values
thewhaleking Dec 10, 2024
1faf12d
Mypy, docstrings, cleanup comments.
thewhaleking Dec 10, 2024
8acf7b8
Integration test progress
thewhaleking Dec 10, 2024
a8d5d17
Integration tests fixed.
thewhaleking Dec 10, 2024
0c99fa7
Unit tests fixed.
thewhaleking Dec 10, 2024
79dfd3f
Clean up
thewhaleking Dec 10, 2024
a354fad
Mypy
thewhaleking Dec 10, 2024
36084ce
Removed unused tests.
thewhaleking Dec 10, 2024
d541947
Adding more methods.
thewhaleking Dec 11, 2024
bd8b724
async property handling in querymapresult
thewhaleking Dec 11, 2024
5726d53
Adjust sleep time
thewhaleking Dec 12, 2024
c558ccd
[WIP]
thewhaleking Dec 12, 2024
2870c78
WIP
thewhaleking Dec 12, 2024
2bf3871
WIP
thewhaleking Dec 12, 2024
374bdae
WIP
thewhaleking Dec 12, 2024
6fcf414
Merge staging
thewhaleking Dec 13, 2024
34495cd
Merge staging
thewhaleking Dec 13, 2024
41359c5
More porting.
thewhaleking Dec 13, 2024
34acf1d
More porting.
thewhaleking Dec 13, 2024
526b60a
More porting.
thewhaleking Dec 13, 2024
83748f0
More porting.
thewhaleking Dec 13, 2024
67086ac
Removed async-property
thewhaleking Dec 13, 2024
cb43133
Use cache for get_block_hash, port a few methods, start adding block …
thewhaleking Dec 13, 2024
caa190e
WIP
thewhaleking Dec 13, 2024
dbc6121
Added `block` arg to all asyncsubtensor commands that accept `block_h…
thewhaleking Dec 13, 2024
e7f7fa7
Line length docstring fixes
thewhaleking Dec 13, 2024
c98f77c
More porting.
thewhaleking Dec 13, 2024
ed5b664
More porting.
thewhaleking Dec 16, 2024
076ed3a
Use our own errors
thewhaleking Dec 16, 2024
e4a6170
Remove process_events() calls if they precede `is_success` (which pro…
thewhaleking Dec 16, 2024
14e08b0
More porting.
thewhaleking Dec 16, 2024
012fff5
Porting.
thewhaleking Dec 16, 2024
ab7e6a1
Porting.
thewhaleking Dec 16, 2024
c9d66da
Porting
thewhaleking Dec 16, 2024
c1d58aa
Renaming.
thewhaleking Dec 16, 2024
075f52a
Porting.
thewhaleking Dec 17, 2024
4061aa8
Experimental
thewhaleking Dec 17, 2024
b0c38f2
Deprecate async from sync and add new methods for dendrite.
thewhaleking Dec 17, 2024
6a4a453
Substrate
thewhaleking Dec 17, 2024
93ce167
WIP
thewhaleking Dec 17, 2024
fd0f2a8
tests
thewhaleking Dec 17, 2024
da4420a
Catch all exceptions from ast.literal_eval
thewhaleking Dec 18, 2024
a9aff16
Subclass
thewhaleking Dec 18, 2024
9d91aed
Deprecation date.
thewhaleking Dec 18, 2024
7c38f63
add utils.execute_coroutine
roman-opentensor Dec 27, 2024
83a7c3b
rename subtensor.py to classic_subtensor.py
roman-opentensor Dec 27, 2024
339586a
wrapp `self.initialize()` with `execute_coroutine`
roman-opentensor Dec 27, 2024
6848b42
add `publish_metadata_async` to serving.py
roman-opentensor Dec 27, 2024
5955d7a
remove async_subtensor from __init__.py
roman-opentensor Dec 27, 2024
09cc4dd
add `get_metadata_async` to serving.py
roman-opentensor Dec 27, 2024
5d8a6b8
fic `supports_rpc_method`
roman-opentensor Dec 28, 2024
048d3d4
fix type for `weights` field in neuron_info.py
roman-opentensor Dec 28, 2024
3f1dfe2
add TODO
roman-opentensor Dec 28, 2024
184831e
fix test
roman-opentensor Dec 28, 2024
3d754d9
add TODO
roman-opentensor Dec 28, 2024
b066771
ruff
roman-opentensor Dec 28, 2024
f39633b
add async staking extrinsic call, forward sync staking to async ones
roman-opentensor Dec 28, 2024
e7fa857
add async transfer extrinsic call, forward sync transfer to async one…
roman-opentensor Dec 30, 2024
0984e4f
fix transfer
roman-opentensor Dec 30, 2024
b9a4519
fix registration and burn registration
roman-opentensor Dec 30, 2024
dcd5f29
add async serving_axon_extrinsic, publish_metadata, get_metadata, do_…
roman-opentensor Dec 31, 2024
227d383
add async root extrinsic things
roman-opentensor Dec 31, 2024
8da5308
fix registration
roman-opentensor Dec 31, 2024
c26dafe
rename to be consistency
roman-opentensor Dec 31, 2024
05b456d
add sync call for async `set_weights_extrinsic`
roman-opentensor Dec 31, 2024
c5f83e5
add async_unstaking.py
roman-opentensor Jan 2, 2025
a24f4d0
rename async_weights.py
roman-opentensor Jan 2, 2025
d40b6f2
fix annotation in serving.py
roman-opentensor Jan 2, 2025
110eae1
fix test
roman-opentensor Jan 2, 2025
ae1727f
update `bittensor.core.extrinsics.async_serving.get_metadata`
roman-opentensor Jan 2, 2025
a452058
add async `bittensor.core.extrinsics.async_weights.reveal_weights_ext…
roman-opentensor Jan 2, 2025
c9a4e5d
update `bittensor.utils.execute_coroutine`
roman-opentensor Jan 2, 2025
a556cb6
add period argument
roman-opentensor Jan 2, 2025
559d20b
fix tests
roman-opentensor Jan 2, 2025
2e14c6f
fix sync setting, commiting, reveal weights extrinsics + async relate…
roman-opentensor Jan 2, 2025
59fb63f
add `bittensor/core/extrinsics/asyncex` sub-package
roman-opentensor Jan 2, 2025
32423f7
ruff for `execute_coroutine`
roman-opentensor Jan 2, 2025
a0b1334
add nonce to commit_reveal v3
roman-opentensor Jan 2, 2025
3c1df1d
update unstaking extrinsics
roman-opentensor Jan 3, 2025
39107d3
remove substrate from call args
roman-opentensor Jan 3, 2025
cb7b657
fix await, remove next_nonce from commit reveal v3
roman-opentensor Jan 3, 2025
8edbdce
update registration extrinsics
roman-opentensor Jan 3, 2025
574709d
update root extrinsics
roman-opentensor Jan 3, 2025
dbf3c99
update set_weights extrinsics
roman-opentensor Jan 3, 2025
5d0e450
update transfer extrinsics
roman-opentensor Jan 3, 2025
75e9a48
update staking extrinsics
roman-opentensor Jan 3, 2025
c58a08d
update staking extrinsics
roman-opentensor Jan 3, 2025
53f25f2
update serving extrinsics
roman-opentensor Jan 3, 2025
7262891
add event loop to async subtensor and async substrate interface
roman-opentensor Jan 3, 2025
085089c
add WeightCommitInfo chain data class
roman-opentensor Jan 3, 2025
16eb574
add new Subtensor class
roman-opentensor Jan 3, 2025
bd418ee
update AsyncSubtensor class
roman-opentensor Jan 3, 2025
81879ba
fix transfer
roman-opentensor Jan 3, 2025
8274400
fix `subtensor.substrate.submit_extrinsic` call args
roman-opentensor Jan 3, 2025
4139f37
update tests
roman-opentensor Jan 3, 2025
a380adb
ruff
roman-opentensor Jan 3, 2025
84ae79c
add sync Metagraph
roman-opentensor Jan 3, 2025
e55673e
metagraph related changes in subtensors
roman-opentensor Jan 3, 2025
7ee9c65
update metagraph.Metagraph
roman-opentensor Jan 3, 2025
1ea40e1
update `AsyncSubstrateInterface`
roman-opentensor Jan 4, 2025
5b0e9db
move async extrinsics tests to proper directory
roman-opentensor Jan 4, 2025
86a46d1
update `commit_reveal` unit test
roman-opentensor Jan 4, 2025
f940e22
update `commit_weights.py` unit test
roman-opentensor Jan 4, 2025
7ab4112
update `registration.py` unit test
roman-opentensor Jan 4, 2025
50e383e
ruff
roman-opentensor Jan 4, 2025
09751b1
typo
roman-opentensor Jan 4, 2025
785f508
update `bittensor/core/extrinsics/root.py` unit tests
roman-opentensor Jan 4, 2025
87e53c1
update `bittensor/core/extrinsics/serving.py` unit tests
roman-opentensor Jan 4, 2025
41cfd99
update `bittensor/core/extrinsics/set_weights.py` unit tests
roman-opentensor Jan 4, 2025
efc47f4
update `bittensor/core/extrinsics/staking.py` unit tests
roman-opentensor Jan 4, 2025
d10b688
update `bittensor/core/extrinsics/transfer.py` unit tests
roman-opentensor Jan 4, 2025
035148c
update `bittensor/core/extrinsics/unstaking.py` unit tests
roman-opentensor Jan 4, 2025
e25f242
improve `bittensor/core/extrinsics/utils.py`
roman-opentensor Jan 4, 2025
aa8ede9
add TODO, add close method with sync call via wrapper
roman-opentensor Jan 4, 2025
041c83d
Update subtensor.py unit tests
roman-opentensor Jan 4, 2025
600955e
Update async_subtensor.py unit tests
roman-opentensor Jan 4, 2025
48388e9
update TODOs
roman-opentensor Jan 4, 2025
943dd98
update metagraph
roman-opentensor Jan 4, 2025
7bfea83
update `close` method for Subtensor class
roman-opentensor Jan 4, 2025
0051521
update `test_subtensor.py`
roman-opentensor Jan 4, 2025
60bb8aa
Update metagraph determining logic for AI and IDE. Finally, the same …
roman-opentensor Jan 4, 2025
870d0b5
Update sync `Metagraph.__getattr__`
roman-opentensor Jan 4, 2025
ebb61d1
fix metagraph tests
roman-opentensor Jan 4, 2025
36b4cbb
update test for async_substrate_interface
roman-opentensor Jan 4, 2025
eaeff47
add `reuse_block` where is should be in async_subtensor.py
roman-opentensor Jan 4, 2025
b3e256d
fix test for async_subtensor.py
roman-opentensor Jan 4, 2025
131d49a
ruff
roman-opentensor Jan 4, 2025
f0acec3
Merge remote-tracking branch 'origin/staging' into feat/thewhaleking/…
thewhaleking Jan 6, 2025
1b17877
Revert all changes to metagraph.py and subtensor.py, as Roman will be…
thewhaleking Jan 6, 2025
3eaae9f
Ruff
thewhaleking Jan 6, 2025
d7bc745
Ruff
thewhaleking Jan 6, 2025
ecbd321
Pre-merge merge (async extrinsics)
thewhaleking Jan 6, 2025
bc45f70
Allow for passing event_loop to SubstrateInterface at init
thewhaleking Jan 6, 2025
c217967
update for `get_current_weight_commit_info`
roman-opentensor Jan 6, 2025
23b6f62
Wrapper for SCALE object like backwards compatibility.
thewhaleking Jan 6, 2025
1caf777
Merge branch 'feat/thewhaleking/new-sync-substrate' into feat/roman/a…
roman-opentensor Jan 6, 2025
25b9485
merge fixes + ruff
roman-opentensor Jan 6, 2025
02e63b0
small fixes for `async_subtensor.py`
roman-opentensor Jan 7, 2025
8fcde8a
Merge branch 'feat/thewhaleking/new-sync-substrate' into feat/roman/a…
roman-opentensor Jan 7, 2025
fe89cfc
metagraph fix
roman-opentensor Jan 7, 2025
9c4ca15
add `ensure_connected` temporarily
roman-opentensor Jan 7, 2025
71ad7fa
add argument in test
roman-opentensor Jan 7, 2025
a587611
ruff
roman-opentensor Jan 7, 2025
8f9435e
remove `EXTRINSIC_SUBMISSION_TIMEOUT` from test
roman-opentensor Jan 7, 2025
38ed94f
remove unused import
roman-opentensor Jan 7, 2025
ffb32db
make async subtensor query_* returns compatible with sync ones
roman-opentensor Jan 7, 2025
d695b09
convert `subtensor.substrate` to sync version with wrapper
roman-opentensor Jan 7, 2025
d718ddf
improve `ScaleObj` class and `SubstrateInterface` class-wrapper
roman-opentensor Jan 7, 2025
408daa9
fix `test_async_subtensor.py`
roman-opentensor Jan 7, 2025
c38e969
fix `test_commit_reveal_v3.py`
roman-opentensor Jan 7, 2025
ddfd323
remove unused import
roman-opentensor Jan 7, 2025
cf5dd72
Restore backwards-compatibility for the `is_hotkey_registered` method.
thewhaleking Jan 7, 2025
85c294a
Introduce block_hash and reuse_block args for is_hotkey_registered.
thewhaleking Jan 7, 2025
4835cc9
Merge remote-tracking branch 'origin/feat/thewhaleking/new-sync-subst…
thewhaleking Jan 7, 2025
9009282
Merge
thewhaleking Jan 7, 2025
3e0b1bd
Optimisations.
thewhaleking Jan 7, 2025
6b1604a
Improved the `execute_coroutine` function. Moved `event_loop_is_runni…
thewhaleking Jan 7, 2025
44e7f58
Created an `execute_coroutine` method to cut down on redundant code. …
thewhaleking Jan 7, 2025
4872a79
Better-handle mocked substrate and getting event loop.
thewhaleking Jan 7, 2025
bd2f3c7
Better mock handling.
thewhaleking Jan 7, 2025
a3fc4f6
`is_hotkey_registered` fixed in Subtensor
thewhaleking Jan 7, 2025
c4cb262
Unit tests fixed.
thewhaleking Jan 7, 2025
f839796
E2E test optimisation.
thewhaleking Jan 7, 2025
1732297
E2E fix
thewhaleking Jan 7, 2025
8fdfadd
Optimisations.
thewhaleking Jan 7, 2025
a9bead2
Fixed sync metagraph + added back in save dir and load dir functional…
thewhaleking Jan 7, 2025
abbddea
Trigger no-op
thewhaleking Jan 7, 2025
b03a76d
Two more unit tests passing.
thewhaleking Jan 8, 2025
c4d6d3c
All unit tests passing.
thewhaleking Jan 8, 2025
c699ba2
Most Metagraph integration tests working.
thewhaleking Jan 8, 2025
5fbe1dc
Final metagraph integration tests working.
thewhaleking Jan 8, 2025
b329bab
Lint
thewhaleking Jan 8, 2025
fbc6a83
Merge pull request #2569 from opentensor/feat/thewhaleking/improve-su…
thewhaleking Jan 8, 2025
2ddb224
Added skeleton methods for all used Substrate methods for ease of use…
thewhaleking Jan 8, 2025
522479a
Trigger no-op
thewhaleking Jan 8, 2025
7f302e2
Backwards compatibility, docsstring cleanup.
thewhaleking Jan 8, 2025
f6df25d
Removed `ensure_connected` fn and `classic_subtensor.py`
thewhaleking Jan 8, 2025
0f5def9
Imports cleanup.
thewhaleking Jan 8, 2025
1603ef5
Type fix
thewhaleking Jan 8, 2025
59739f2
Reverted change.
thewhaleking Jan 8, 2025
af6396d
Merge pull request #2565 from opentensor/feat/roman/async-to-sync-via…
thewhaleking Jan 8, 2025
ba1a132
Trigger no-op
thewhaleking Jan 8, 2025
2ce909f
fix tests
roman-opentensor Jan 9, 2025
1ff431e
Removed substrate-interface from requirements
thewhaleking Jan 9, 2025
19ac760
More stripping of py-substrate-interface
thewhaleking Jan 9, 2025
dc60e03
Completely removed py-substrate-interface.
thewhaleking Jan 9, 2025
d897b70
Docstrings update
thewhaleking Jan 9, 2025
4609355
Fix tests
thewhaleking Jan 9, 2025
9a669a4
Merge branch 'staging' into feat/thewhaleking/new-sync-substrate
thewhaleking Jan 10, 2025
46a1468
Name shadowing.
thewhaleking Jan 10, 2025
5913108
Import/type fixes.
thewhaleking Jan 10, 2025
9ec7acf
Return self from __aenter__
thewhaleking Jan 10, 2025
b31764f
Ensure correct loop is used always
thewhaleking Jan 10, 2025
6106c18
Use async_substrate_interface rather than the local version.
thewhaleking Jan 10, 2025
66c64a8
Update utils
thewhaleking Jan 10, 2025
9dcfcae
replace imports + cleanup + ruff
roman-opentensor Jan 10, 2025
0bda527
temporally use repo instead of pypi package
roman-opentensor Jan 10, 2025
344a412
ruff
roman-opentensor Jan 10, 2025
1f85164
Merge pull request #2572 from opentensor/feat/thewhaleking/use-library
roman-opentensor Jan 10, 2025
2aec7f6
update deps
roman-opentensor Jan 10, 2025
c99aaee
update deps
roman-opentensor Jan 10, 2025
528817c
Merge remote-tracking branch 'origin/feat/thewhaleking/new-sync-subst…
roman-opentensor Jan 10, 2025
ee6f834
update deps
roman-opentensor Jan 10, 2025
c31520e
update deps
roman-opentensor Jan 10, 2025
6b8776e
add nonce to root set weights
roman-opentensor Jan 10, 2025
3eead3a
fix unit test
roman-opentensor Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,10 @@
import warnings

from .core.settings import __version__, version_split, DEFAULTS, DEFAULT_NETWORK
from .core.async_subtensor import AsyncSubtensor
from .utils.btlogging import logging
from .utils.deprecated import *


async def async_subtensor(network: str = DEFAULT_NETWORK) -> AsyncSubtensor:
"""
Creates an initialised AsyncSubtensor object.
"""
async with AsyncSubtensor(network=network) as subtensor_:
return subtensor_


def __getattr__(name):
if name == "version_split":
warnings.warn(
Expand Down
Loading
Loading