-
Notifications
You must be signed in to change notification settings - Fork 1
add neuron certificate discovery #2
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
base: staging
Are you sure you want to change the base?
Conversation
ecf52d3 to
308a886
Compare
| 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
| 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
| 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
b25a198 to
7d89d7e
Compare
97f6805 to
b3d222b
Compare
e47da50 to
dabd316
Compare
Co-authored-by: Benjamin Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: Benjamin Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: Benjamin Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: Benjamin Himes <37844818+thewhaleking@users.noreply.github.com>
a40a279 to
2c0bbfb
Compare
3bed339 to
467bcf9
Compare
467bcf9 to
9368030
Compare
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_axonfunction takes an additional optional parameter certificateif certificate is present the
serve_axon_tlsrpc 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_infoand 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_axonfunction and fetched via theget_neuron_certificatefunction