-
Notifications
You must be signed in to change notification settings - Fork 115
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
change(codec): Set relay to true if the last VersionMessage byte is omitted #5835
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5835 +/- ##
==========================================
- Coverage 78.69% 78.66% -0.03%
==========================================
Files 308 308
Lines 38781 38503 -278
==========================================
- Hits 30517 30289 -228
+ Misses 8264 8214 -50 |
One possible test:
The second version message should be one byte shorter than the other one. (There's no need to check for unread bytes, because the true/false test makes sure that the relay byte was read.) |
There's a test for this part here https://github.com/ZcashFoundation/zebra/blob/main/zebra-network/src/isolated/tests/vectors.rs#L177
Ah, I was overcomplicating this part by trying to test it with a stream, I'll use |
moves codec tests to their own module
10067ef
to
0148009
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.
This looks good.
We could merge it as it is, but I'd like to improve test coverage, and document the specification we're implementing to.
adds doc comment to `read_version` renames codec/tests.rs to codec/tests/vectors.rs
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.
Thanks for the extra test and docs!
…mitted (#5835) - manually delete moved tests * sets relay = true when there's no relay byte * adds test for missing relay field moves codec tests to their own module * simplifies version_message_omitted_relay test * adds `version_message_with_relay` test adds doc comment to `read_version` renames codec/tests.rs to codec/tests/vectors.rs * updates doc comment
Motivation
We want to make the relay field on
VersionMessage
optional.Closes #5713.
Solution
relay
field onVersionMessage
to true when there's anUnexpectedEof
errorRelated changes: moves codec tests to their own module.
Review
Part of regular scheduled work.
Reviewer Checklist