-
Notifications
You must be signed in to change notification settings - Fork 425
[v10] Adds block backwards compatibility for fetching metagraph. #3139
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
[v10] Adds block backwards compatibility for fetching metagraph. #3139
Conversation
basfroman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on adding backwards compatibility for metagraph!
Current approach:
If we're only targeting get_metagraph_info, the current solution is fine. However, if we plan to apply this pattern to other methods, we should consider a more scalable approach.
I consider these options:
RuntimeAPIVersionAdapter(or something like this) in SDK (short-term)
- create a centralized adapter with method mapping and fallback logic.
- avoids duplicating logic in each method.
- can be implemented quickly without changing dependencies.
- Move logic to
ASI(preferred long-term)
- SDK (or any other clients) shouldn't need to worry about which method to use.
- the low-level library should handle version detection and return the right data for a given block.
- better separation of concerns: SDK focuses on business logic, version handling belongs in the substrate layer.
- reusable for other clients.
The logic cannot live in ASI. ASI is a general-purpose Substrate library, and thus does have any concept of which methods retrieve which data. |
dc6ef7c to
652ec0c
Compare
|
The failing tests are failing upstream. Seems a new devnet-ready release broke them. |
basfroman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Please resolve the conflicts and let's merge it.
Yes, tomorrow in the next PR these tests will be fixed. |
…tibility # Conflicts: # bittensor/core/async_subtensor.py # bittensor/core/subtensor.py
Resolves the metagraph portion of #3138
Demonstrated with:
What this does not cover:
Legacy (think 2023) Runtime API methods were defined through dicts. This is still an issue that needs resolved upstream in async-substrate-interface. However, once that is resolved, no additional work will need done here, but until then the legacy runtime call will not work.