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

Drop old peers post v20 upgrade #4120

Merged

Conversation

marta-lokhova
Copy link
Contributor

No description provided.

@marta-lokhova marta-lokhova force-pushed the drop_old_peers_post_upgrade branch 3 times, most recently from 5cf2048 to 7dcdc3f Compare January 5, 2024 17:43
@@ -212,7 +213,7 @@ class Peer : public std::enable_shared_from_this<Peer>,

std::string mRemoteVersion;
uint32_t mRemoteOverlayMinVersion;
uint32_t mRemoteOverlayVersion;
std::optional<uint32_t> mRemoteOverlayVersion;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this optional instead of 0, so that we don't drop pending peers when we don't know their version yet (this can happen if we've sent HELLO, but haven't received a response)

Copy link
Contributor

@MonsieurNicolas MonsieurNicolas left a comment

Choose a reason for hiding this comment

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

looks good -- I suggested a simpler version for the way we loop over peers

{
maybeDrop<decltype(OverlayManagerImpl::PeersList::mPending)>(
mPending, predicate, version, reason);
maybeDrop<decltype(OverlayManagerImpl::PeersList::mAuthenticated)>(
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need to do all this templating stuff: you can just call getPendingPeers and getRandomAuthenticatedPeers (that also gives you a list), if you don't want to randomize for the later, you can refactor it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@MonsieurNicolas
Copy link
Contributor

r+ de714e6

@latobarita latobarita merged commit d60d3c3 into stellar:master Jan 5, 2024
15 checks passed
@marta-lokhova marta-lokhova deleted the drop_old_peers_post_upgrade branch May 15, 2024 20:35
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.

None yet

3 participants