-
Notifications
You must be signed in to change notification settings - Fork 86
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
Implement Light Peer Sharing #4277
Conversation
Closes #3596 |
12f34dc
to
33807f6
Compare
e241bce
to
56e24bf
Compare
33807f6
to
8cbf166
Compare
56e24bf
to
5e74ffc
Compare
8cbf166
to
f813bd3
Compare
1e7fba5
to
f1ce6d3
Compare
f813bd3
to
36dd348
Compare
04d2abd
to
d59e0e8
Compare
36dd348
to
06cddc1
Compare
d59e0e8
to
720af59
Compare
06cddc1
to
e8fa78d
Compare
720af59
to
43dd74a
Compare
e8fa78d
to
951bd6e
Compare
43dd74a
to
76e47dd
Compare
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
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 - just the question, for me, about the consequences of self-connection. Is this something we just want to avoid in tests (as kernel would disallow) or is it something that we need to avoid in operation (given that for NAT and multi-homed hosts it could happen)
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/KnownPeers.hs
Outdated
Show resolved
Hide resolved
951bd6e
to
eda5af2
Compare
2837d08
to
ad3fa0e
Compare
8da3492
to
9ecb003
Compare
a9116fb
to
54dc5f5
Compare
03e09cb
to
9d833ba
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.
A few minor remarks.
ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Core.hs
Outdated
Show resolved
Hide resolved
ouroboros-network-framework/src/Ouroboros/Network/Protocol/Handshake/Unversioned.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/Monitor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/Types.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/Monitor.hs
Outdated
Show resolved
Hide resolved
a516d53
to
1b64f8e
Compare
1b64f8e
to
fd4e201
Compare
8d6cec5
to
f17f251
Compare
ouroboros-network-framework/src/Ouroboros/Network/ConnectionManager/Core.hs
Outdated
Show resolved
Hide resolved
ouroboros-network-framework/src/Ouroboros/Network/InboundGovernor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network-framework/src/Ouroboros/Network/InboundGovernor/ControlChannel.hs
Outdated
Show resolved
Hide resolved
ouroboros-network-framework/src/Ouroboros/Network/InboundGovernor/ControlChannel.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor/Monitor.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/test/Test/Ouroboros/Network/PeerSelection/MockEnvironment.hs
Outdated
Show resolved
Hide resolved
-- of a node's listening socket. This is something that in the real world | ||
-- wouldn't happen since the kernel would disallow it. |
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.
I don't think that's true, have you tried?
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.
Right, what I meant here is that our net sim would misbehave in the case of self connects, but you fixed it recently, is that right?
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.
Bump
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.
Yes, it's fixed, it was a bug in connection-manager
not sim-net
though.
So that we can use it for sharing information between InboundGovernor and Outbound Governor.
705cfad
to
1dfdc4d
Compare
ouroboros-network/src/Ouroboros/Network/PeerSelection/Governor.hs
Outdated
Show resolved
Hide resolved
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
Added a Control Channel between the Inbound Governor and the OutboundGovernor. Reading from this channel is abstracted as a PeerSelectionAction. When the InboundGovernor receives an Inbound NewConnection it will write the address and PeerSharing Willingness information to the Channel.
1dfdc4d
to
1d2b488
Compare
Added to merge queue. |
…t-peer-sharing Implement Light Peer Sharing
This PR introduces Light Peer Sharing on top of the already existing Peer Sharing feature. They're actually somewhat independent, but one should be careful with this feature since it will be prone to Eclipse attacks without the Eclipse Evasion implementation.
The main objective here is to use the information that the Inbound Governor has about incoming connections and feed that information directly to the Peer Selection Governor (aka Outbound Governor). Right now the Outbound Governor only has peers information (Known / Established / Active Peers Set etc..) from local configuration and/or ledger peers. With Light Peer Sharing, when a node connects to us we will make an effort to add it to our Known Peer Set, being yet another source of peers for fulfilling this target and possibly share across the network
Checklist
interface-CHANGELOG.md
interface-CHANGELOG.md