-
Notifications
You must be signed in to change notification settings - Fork 90
Peers behind a firewall #5241
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
base: main
Are you sure you want to change the base?
Peers behind a firewall #5241
Conversation
6fb89b7 to
fd67e72
Compare
fd67e72 to
c2e3eec
Compare
ouroboros-network/lib/Ouroboros/Network/PeerSelection/Governor/EstablishedPeers.hs
Outdated
Show resolved
Hide resolved
ouroboros-network/lib/Ouroboros/Network/PeerSelection/Governor/EstablishedPeers.hs
Outdated
Show resolved
Hide resolved
| -- ^ True if peer is not behind a firewall | ||
| <$> readLocalRootPeers | ||
|
|
||
| peerconn <- establishPeerConnection isBigLedgerPeer diffusionMode peeraddr connectionMode |
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.
rename connectionMode to provenance.
| -> DiffusionMode | ||
| -> peeraddr -> m peerconn, | ||
| -> peeraddr | ||
| -> ConnectionMode |
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.
Use Provenance here instead.
| when (inboundRequired connectionMode) $ | ||
| throwIO (withCallStack $ InboundConnectionNotFound peerAddr) | ||
|
|
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.
The damage is done by the time you do this check. A few lines above in the Nothing case we have updated the stateVar by inserting this outbound connection into the CM's connection table.
| localRootsToRelayAccessPoint | ||
| :: LocalRoots | ||
| -> [(RelayAccessPoint, PeerAdvertise, Bool)] | ||
| localRootsToRelayAccessPoint LocalRoots {rootConfig, behindFirewall} = | ||
| (\(accessPoint, advertise) -> (accessPoint, advertise, behindFirewall)) | ||
| <$> rootConfigToRelayAccessPoint rootConfig |
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 it's needed.
| extraLocalRootFlags :: !extraFlags | ||
| peerAdvertise :: !PeerAdvertise, | ||
| diffusionMode :: !DiffusionMode, | ||
| localRootBehindFirewall :: !Bool, |
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.
Change this type to Provenance?
| IsTrustable -> not | ||
| . null | ||
| . rootAccessPoints | ||
| . rootConfig |
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 it's needed - see my other comments.
|
|
||
| type AcquireOutboundConnection peerAddr handle handleError m | ||
| = DiffusionMode -> peerAddr -> m (Connected peerAddr handle handleError) | ||
| = DiffusionMode -> peerAddr -> ConnectionMode -> m (Connected peerAddr handle handleError) |
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.
s/ConnectionMode/Provenance/
| -- | ||
| | InboundConnectionNotFound !peerAddr !CallStack |
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.
This can be a typical case where an inbound is not found for behind firewall peers. Maybe instead create the opposite trace where we inform that we are establishing a connection back to a peer of 'inbound' provenance?
|
@crocodile-dentist I’m not sure the |
|
What I had in mind was a little overloading of the meaning of provenance. So |
Description
Closes #4381
Checklist
Quality
Maintenance
ouroboros-networkproject.