Skip to content
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

Ticket 33675: Adding regex to search microdescriptor files for relay ed25519 keys #62

Closed

Conversation

ANURADHAJHA99
Copy link
Contributor

@ANURADHAJHA99 ANURADHAJHA99 commented Mar 24, 2020

@teor2345 : I have added the following code, however when I run the command "make test-network-all" generally the test fails and I get warning. I have tried to fix the errors by reading the log files and solved most of the syntactical errors. Also when I ran the command, when regex code was not added and only function _setEd25519() was present in the file, then all the test were successful. I did not got any error at all. It therefore seems error is in the new code for regex. I have attached the file below which has all the logs. Kindly help to solve the following error. Also made the new branch for testing because did not wanted to pollute the already working branch with errors, but have made the same changes regardless. Thank you for your help.
single-onion-v23.log

lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Show resolved Hide resolved
lib/chutney/TorNet.py Show resolved Hide resolved
@teor2345
Copy link
Contributor

Hi, I think there's something unusual happening in the logs.
Looks like you are running two chutney instances at the same time?

How are you running "make test-network-all" ?
Are you running two at the same time?

@ANURADHAJHA99
Copy link
Contributor Author

ANURADHAJHA99 commented Mar 27, 2020

Hey @teor2345 , no I am running the command only once.

@ANURADHAJHA99
Copy link
Contributor Author

@teor2345 In the latest commit I made the changes you suggested, but I am still facing certain errors, can you suggest me further what steps to take in order to eradicate the mistakes. Thank you very much for your help. I have attached log file as well.
single-onion-v23-ipv6-md.log

@ANURADHAJHA99
Copy link
Contributor Author

Hey @ahf , Can you kindly review this PR and suggest me the changes. Thank you very much.

@teor2345 teor2345 changed the title Adding regex to search microdescriptor files for relay ed25519 keys Ticket 33675: Adding regex to search microdescriptor files for relay ed25519 keys Apr 6, 2020
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

Please get the key from _env a different way.
And handle the value of ed25519_id better.

lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Outdated Show resolved Hide resolved
lib/chutney/TorNet.py Outdated Show resolved Hide resolved
@@ -1323,11 +1358,12 @@ def getNodeDirInfoStatusPattern(self, dir_format):
elif desc:
return r'^router ' + nickname + " "
elif md:
if ed25519_key:
# Not yet implemented, see #33428
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleanup: this feature is now implemented, so we can delete this comment.

Comment on lines 1365 to 1366
return None
# Return None if ed25519_id not found
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleanup: we usually put the comments above the code.

We use comments to explain what the code does when the program runs. Or why we wrote the code.
We don't repeat what is written in the code already.

Suggested change
return None
# Return None if ed25519_id not found
# If there is no ed25519_id, then we can't search for it
return None

@@ -1300,7 +1334,8 @@ def getNodeDirInfoStatusPattern(self, dir_format):
the ed25519 key. (Or RSA block matching, which is hard.)
Copy link
Contributor

Choose a reason for hiding this comment

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

More cleanup:

  • The microdesc format is now implemented, so we can delete that comment.
  • We need to explain what returning "None" means for this function. I can make that change. I should have done it when I wrote the function.

@@ -1323,11 +1358,12 @@ def getNodeDirInfoStatusPattern(self, dir_format):
elif desc:
return r'^router ' + nickname + " "
elif md:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are only getting None for ed25519_key here. Because we are loading ed25519_id during configure(). But this code is called during wait_for_bootstrap().

Can you help me check what is happening?

If md is True, print the values of nickname and ed25519_key. Then we can check the logs.

@teor2345
Copy link
Contributor

I think this PR is obsoleted by #66.

@teor2345 teor2345 closed this Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants