-
Notifications
You must be signed in to change notification settings - Fork 281
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
Async for bittensor/extrinsics/registration.py
#1996
Conversation
bittensor/chain_data.py
Outdated
@@ -659,7 +659,7 @@ class PrometheusInfo: | |||
|
|||
block: int | |||
version: int | |||
ip: str | |||
ip: str # string representation of converted ip to int using tool like https://tools.iplocation.net/ip-to-integer-converter |
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 would replace the link to this one
https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPAddress.value
We actually use netaddr to do this in the networking.py file. This is their API documentation.
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.
Done
bittensor/extrinsics/prometheus.py
Outdated
success (bool): | ||
Flag is ``true`` if extrinsic was finalized or uncluded in the block. | ||
If we did not wait for finalization / inclusion, the response is ``true``. | ||
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``. |
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.
nit: 'included' - spelling
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.
done
bittensor/extrinsics/prometheus.py
Outdated
wallet.hotkey.ss58_address, netuid=netuid | ||
) | ||
neuron_up_to_date = not neuron.is_null and call_params == { | ||
"version": neuron.prometheus_info.version, | ||
"ip": net.ip_to_int(neuron.prometheus_info.ip), | ||
"ip": neuron.prometheus_info.ip, |
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.
does neuron.prometheus_info.ip
still return an 'int'?
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 forgot to replace this back. done
@@ -469,7 +469,7 @@ class RegistrationStatistics: | |||
hash_rate: float | |||
difficulty: int | |||
block_number: int | |||
block_hash: bytes | |||
block_hash: 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.
with going from bytes
to str
, lets make sure the E2E tests run and pass.
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.
Left the TODO
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.
Nits - otherwise lgtm
@@ -73,7 +73,7 @@ def _get_real_torch(): | |||
|
|||
|
|||
def log_no_torch_error(): | |||
bittensor.btlogging.error( | |||
bittensor.btlogging.logging.error( |
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.
Nice
bittensor/extrinsics/registration.py
Outdated
Returns: | ||
success (bool): | ||
Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``. | ||
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``. |
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.
nit: I think the spelling uncluded
needs to update in all doc strings
bittensor/extrinsics/prometheus.py
Outdated
@@ -96,7 +95,7 @@ def prometheus_extrinsic( | |||
bittensor.__console__.print( | |||
f":white_heavy_check_mark: [green]Prometheus already Served[/green]\n" | |||
f"[green not bold]- Status: [/green not bold] |" | |||
f"[green not bold] ip: [/green not bold][white not bold]{net.int_to_ip(neuron.prometheus_info.ip)}[/white not bold] |" | |||
f"[green not bold] ip: [/green not bold][white not bold]{net.ip_to_int(neuron.prometheus_info.ip)}[/white not bold] |" |
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.
Why change this from int_to_ip
to ip_to_int
?
The console logs will be much easier to read if we dont have to convert it back. Otherwise we will just see a long number that doesnt mean anything unless you run it through a conversion.
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 is the result of a long refactoring) Thank you! I went for coffee
6d4e808
to
01b82bd
Compare
01b82bd
to
6ac935b
Compare
Part 3 of #1990
includes:
bittensor/extrinsics/prometheus.py
bittensor/extrinsics/registration.py