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

Group all peer logic into a single struct #563

Open
wants to merge 2 commits into
base: lighthouse-gossipsub
Choose a base branch
from

Conversation

AgeManning
Copy link
Member

Description

I have grouped all the peer connection mappings into a single struct with strict mutability rules. This makes it significantly easier to reason about how these mappings change relative to each other. It should be very clear if any of these mappings go out of sync now.

This also simplified a bit of the code in the behaviour, however there was a cost of doing this change, which involved adding a few clones of some peer lists as we can no longer hold multiple mutable references of the mappings as they are grouped into this new struct. I think the trade-off is worth it to simplify the logical complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant