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

[DO NOT MERGE] AsyncSubstrateInterface Overhaul (with Sync AsyncSubstrate) #2526

Open
wants to merge 222 commits into
base: staging
Choose a base branch
from

Conversation

thewhaleking
Copy link
Contributor

@thewhaleking thewhaleking commented Dec 6, 2024

Before merging, this needs to be thoroughly manually tested.

Changes Subtensor (not AsyncSubtensor) to use AsyncSubstrateInterface through a wrapper. Adjusts the rest of Subtensor to handle this (including tests). Also improves the handling of reconnection in AsyncSubstrateInterface, which directly improves the sync version of it.

Removes all our ensure_connected wrappers, because we are now able to do the reconnection logic directly in the (Async)SubstrateInterface

TODO:

  • Port all methods of py-substrate-interface to async substrate interface
  • Port all methods of subtensor to async_subtensor
  • Improve connection logic
  • Make SubstrateInterface use AsyncSubstrateInterface
  • Remove all non-AsyncSubstrateInterface-level reconnection handling/logic
  • Speed

Important to know for users of release:

  • All py-substrate-interface exceptions (especially SubstrateRequestException) will need to be caught from bittensor.core.errors rather than substrateinterface.exceptions.
  • The base websocket object inside SubstrateInterface has changed.

@thewhaleking thewhaleking marked this pull request as ready for review December 10, 2024 12:53
@thewhaleking thewhaleking changed the title [WIP] sync AsyncSubstrateInterface Sync AsyncSubstrateInterface Dec 10, 2024
@thewhaleking thewhaleking requested a review from a team December 10, 2024 13:59
@thewhaleking thewhaleking force-pushed the feat/thewhaleking/new-sync-substrate branch 2 times, most recently from d81be92 to a35276a Compare December 10, 2024 18:32
@thewhaleking thewhaleking changed the title Sync AsyncSubstrateInterface AsyncSubstrateInterface Overhaul (with Sync AsyncSubstrate) Dec 12, 2024
@thewhaleking thewhaleking force-pushed the feat/thewhaleking/new-sync-substrate branch 3 times, most recently from e5c8451 to 8383fce Compare December 16, 2024 17:49
@thewhaleking thewhaleking marked this pull request as draft December 16, 2024 20:04
@thewhaleking thewhaleking force-pushed the feat/thewhaleking/new-sync-substrate branch 2 times, most recently from 914b86a to 59778da Compare December 16, 2024 23:01
thewhaleking and others added 2 commits January 8, 2025 22:55
…-wrapper

[SDK] Get rid of py-substrate-interface (DO NOT MERGE)
@thewhaleking thewhaleking marked this pull request as ready for review January 8, 2025 20:56
@thewhaleking thewhaleking changed the title AsyncSubstrateInterface Overhaul (with Sync AsyncSubstrate) [DO NOT MERGE] AsyncSubstrateInterface Overhaul (with Sync AsyncSubstrate) Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants