-
Notifications
You must be signed in to change notification settings - Fork 283
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
Child Hotkeys #2071
base: staging
Are you sure you want to change the base?
Child Hotkeys #2071
Conversation
35a205b
to
d2bc588
Compare
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.
There are no questions about implementation. I left a few comments regarding the style and tests.
""" | ||
|
||
|
||
def test_get_children_info(local_chain, capsys): |
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.
Pls add at least single line docstring to the test case.
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.
There is a docstring above this test that explains what its function is. Do you want me to move it down?
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.
Yeah, that would be great. Otherwise it looks like a description for a module. Thank you
""" | ||
|
||
|
||
def test_set_revoke_child(local_chain, capsys): |
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.
Pls add at least single line docstring to the test case.
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.
There is a docstring above this test that explains what its function is. Do you want me to move it down?
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.
Yeah, that would be great. Otherwise it looks like a description for a module. Thank you
""" | ||
|
||
|
||
def test_set_revoke_children(local_chain, capsys): |
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.
Pls add at least single line docstring to the test case.
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.
There is a docstring above this test that explains what its function is. Do you want me to move it down?
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.
Yeah, that would be great. Otherwise it looks like a description for a module. Thank you
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.
As a suggestion for the tests
I would prefer to see test cases where an assertion is set after each change in the state of the subnet or objects under test, as in the example below, it is useful to know that each step is successful. If one of the step is broken, it will be easier to understand which one of them exactly.
...
# Register Alice neuron to the subnet
alice_exec_command(...)
assert foo_1 == bar_1 # example
# Alice to Stake to become to top neuron after the first epoch
alice_exec_command(...)
assert foo_2 == bar_2 # example
# Register Bob neuron to the subnet
bob_exec_command(...)
assert foo_3 == bar_3 # example
...
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.
There is a certain scope for each test.
For example, when we test emissions, to get started on that test you will need an axon and dendrite, you will need to set weights, and make sure that incentive is put in correctly.
But we already have a test_axon, a test_dendrite, a test_incentive and a test for weights. These tests assert that the functionality they are testing work correctly.
For set_revoke_child, I am not going to assert the alice_exec register command or the alice_stake command, because this is already covered in other test cases. The purpose of this test is to set and revoke child hotkeys. If there is an error in stake or registering the other tests will catch that.
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 understand what you described. As I mentioned above, this is a recommendation of what tests should look like in an ideal case. What I recommend helps track the flaky behavior of tests.
We can take this into account for future implementations. You can apply the recommendation or resolve it.
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.
LGTM
We need to integrate new extrinsics related to child key management into our Python codebase and add corresponding CLI commands. These extrinsics allow users to set and revoke child keys for hotkeys on specific subnets. This feature enhances the flexibility of our stake delegation system.