-
Notifications
You must be signed in to change notification settings - Fork 1
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
add neuron certificate discovery #2
base: staging
Are you sure you want to change the base?
Conversation
ecf52d3
to
308a886
Compare
@@ -30,6 +30,8 @@ | |||
U16_MAX = 65535 | |||
U64_MAX = 18446744073709551615 | |||
|
|||
Certificate = str |
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.
Shouldn't it be bytes
?
bittensor/extrinsics/serving.py
Outdated
@@ -44,6 +47,8 @@ def serve_extrinsic( | |||
Endpoint host port i.e., ``192.122.31.4``. | |||
port (int): | |||
Endpoint port number i.e., ``9221``. | |||
certificate (str): | |||
Certificate. |
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.
this needs way more text
@@ -30,6 +30,8 @@ | |||
U16_MAX = 65535 | |||
U64_MAX = 18446744073709551615 | |||
|
|||
Certificate = str |
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.
We can make a new type that inherits from str but is not str, so that mypy or something will be able to tell the difference between str
and Certificate(str)
bittensor/subtensor.py
Outdated
if call_params["certificate"] is None: | ||
del call_params["certificate"] | ||
call_function = "serve_axon" | ||
else: | ||
call_function = "serve_axon_tls" | ||
|
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.
It feels like a hack. I'm not sure about this, lets ask OTF
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.
I guess it was needed for backwards compatibility. A new method was added to substrate, instead of modifying the existing one.
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.
it's sad that the placeholders they left in case of stuff like this can't be used https://github.com/backend-developers-ltd/subtensor-fork/blob/development/pallets/subtensor/src/serving.rs#L30
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.
We need to validate that the provided certificate length is correct before calling substrate.
308a886
to
8d17046
Compare
update port on localnet from 9944 to 9946
3bed339
to
467bcf9
Compare
467bcf9
to
9368030
Compare
… to be compatible with cli
…ests-for-async-registration Async unittests for `bittensor/core/extrinsics/async_registration.py`
# Conflicts: # bittensor/core/extrinsics/async_registration.py # bittensor/core/extrinsics/registration.py
…or-console BittensorConsole class
…tion Improve reconnection logic
E2E tests - Increasing Subtensor coverage (Pt 1)
…-python-3-12 Add python3.12 support
Requirements for Adding, Changing, or Removing a Feature
subtensor migrated to version that handles certificate discovery
Description of the Change
Adds the ability to send neuron certificate and receive other neuron's certificates. This change will enable setting up mutual tls between neurons
serve_axon
function takes an additional optional parameter certificateif certificate is present the
serve_axon_tls
rpc call will be called on the subtensor and the neuron's certificate will be discoverable through the subtensor. The function will behave the same other than the possible storing of certificate.get_neuron_certificate(netuid, neuron_uid)
will fetch from the subtensor a specific neuron's certificate.Alternate Designs
save the certificate as a field in the axon.
This can be implemented either:
serve_axon
,get_neuron_info
and other function. However this would break compatibility for multiple rpc calls encoding and would need patching.Possible Drawbacks
none?
Verification Process
TODO
Release Notes
serve_axon
function and fetched via theget_neuron_certificate
function