-
Notifications
You must be signed in to change notification settings - Fork 632
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
fix: increment and refactor number of hops for routed messages #12188
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12188 +/- ##
==========================================
+ Coverage 71.69% 71.83% +0.13%
==========================================
Files 825 827 +2
Lines 165834 166622 +788
Branches 165834 166622 +788
==========================================
+ Hits 118902 119692 +790
+ Misses 41751 41713 -38
- Partials 5181 5217 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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!
Could be worth adding a couple of basic unit tests covering the 0-hop and 1-hop cases.
@saketh-are I cleaned it up a bit more and added an assert in an integration test to confirm it gets incremented. Let me know if you are happy with the changes |
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.
Still LGTM, left a couple of small comments
bytes borsh = 1; | ||
// Timestamp of creating the Routed message by its original author. | ||
google.protobuf.Timestamp created_at = 2; | ||
// Number of peers this routed message travelled through. Doesn't include the peer that created the message. | ||
optional int32 num_hops = 3; | ||
uint32 num_hops = 4; |
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.
Just want to confirm, are you completely sure that deprecating this field and reusing the field name is OK?
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 should be ok:
- reusing the field name is fine as the protobuf encoding is based on the tag numbers
- there could be some data loss with deprecating the old field (for example if a node that uses the old version sends it to one that uses the new one) but the field was not used before anyway
There also is a protobuf backwards compatibility test which passed, but I do not know how it works
No description provided.