-
Notifications
You must be signed in to change notification settings - Fork 34
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
refactor(gossip) Add methods, data structures, and edits to improve memory safety in gossip #189
Conversation
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 a few notes, otherwise LGTM.
Th failing CI is due to #157. |
b7d92fa
to
24b8ac4
Compare
…ctures outside of table lock boundaries
…unnecessary at it is currently only used safely within lock boundaries
… minimise time with write lock
…o convert to millis everywhere, would rather extend Timer to use comptime types or provide additional access methods like read_ms() etc
…sages without table lock
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 - should be good to merge after you add the docs
01211f8
to
77c641d
Compare
77c641d
to
945ab44
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.
lgtm - should get @dnut approval too since he has a lot of context around this problem
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.
Looks good, I just have a few minor concerns.
I like the approach of just returning a lean contact info with the bare minimum data, instead of requiring more allocations. It actually moves us back away from the new ContactInfo, closer towards something resembling LegacyContactInfo. If we go all-in on this approach, at some point we could probably get rid of the contact info mapping that I added to facilitate the migration to ContactInfo.
Line 90 in b311478
converted_contact_infos: AutoArrayHashMap(Pubkey, ContactInfo), |
I can imagine some approaches where a caller could specify exactly the minimum amount of data they need about a contact. Something that feels like graphql.
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.
Need to go over some details concerning bincode.
Memory Leaks
ThreadSafeContactInfo
Clone
Other