Skip to content

Support async key implementations #94

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

Merged
merged 11 commits into from
May 6, 2025

Conversation

immortalizzy
Copy link
Contributor

This pull request abstracts the Keypair used to sign transactions. This allows the integration of cryptographic backends that require async calls (such as HSMs in cloud environments).

The bittensor_wallet.Keypair type is replaced by a protocol that defines its properties and methods. In create_signed_extrinsic it is checked if the result of sign() is awaitable, and if so the result is
properly awaited.

@thewhaleking thewhaleking changed the base branch from main to staging April 15, 2025 16:34
@thewhaleking
Copy link
Collaborator

Will look at this today.

Copy link
Collaborator

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm happy with this, but just fix the type hints because we support Python 3.9 on this (pipe types were added in 3.10), and update the branch.

immortalizzy and others added 4 commits April 27, 2025 01:54
Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
@immortalizzy
Copy link
Contributor Author

Thanks for your review and suggested changes, I've merged them into the branch. Also, I updated the protocol with a Union annotation for the sign() return value, so the async key implementations do no produce type hint errors.

@thewhaleking thewhaleking added run-bittensor-sdk-tests Runs Bittensor SDK tests. run-bittensor-cli-tests Runs BTCLI tests. labels Apr 29, 2025
@thewhaleking
Copy link
Collaborator

I'm happy with this, but it keeps failing a test. I need to dig in more.

@thewhaleking thewhaleking mentioned this pull request May 6, 2025
@thewhaleking thewhaleking merged commit 7cf1164 into opentensor:staging May 6, 2025
58 of 62 checks passed
@ibraheem-abe ibraheem-abe mentioned this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants