-
Notifications
You must be signed in to change notification settings - Fork 87
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
Port #2525 and #2531 to master #2548
Conversation
9b4ea28
to
bf98f28
Compare
@coot @dcoutts @nfrisby Can somebody approve/review this PR? It ports two already reviewed PRs to master. However, because the branch in which they were merged had build errors in CI, we never detected a bug in the original PR, which @nfrisby and I fixed. @coot This means your |
Fixes #2499 for the ChainSyncClient.
Now a directed edge in the topology (ie a bundle of mini-protocol instances) restarts for two reasons. 1) The ChainSync client and/or server terminated *without* an exception. It restarts at the next slot onset. 2) The node was scheduled to restart at this slot onset. It restarts immediately.
This allows us to later easily add arguments to an `App`, e.g., `NodeToClientVersion` or `ControlMessageSTM m`.
The control message isn't used yet.
bf98f28
to
8be435e
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.
Rubber-stamping, as requested, since these commits have been reviewed elsewhere. See Thomas' explanation above.
I also did a quick skim and I unsurpsingly see nothing heinous -- no missiles being launched here :P
-- | Applications for the node-to-node protocols | ||
-- | ||
-- See 'Network.Mux.Types.MuxApplication' | ||
data Apps m peer bCS bBF bTX bKA a = Apps { | ||
-- | Start a chain sync client that communicates with the given upstream | ||
-- node. | ||
aChainSyncClient :: NodeToNodeVersion -> peer -> Channel m bCS -> m (a, Maybe bCS) | ||
aChainSyncClient :: App m peer bCS a |
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 means we'll not see the actual return value of the client, even though all the upstream code changes now make it available. (The a
is shared by the other protocols, and none of those return anything. So it's ()
/Void
/void
/etc or at the very least a bit misleading.) The CS return value is recorded in a tracer invoked within the client, so it'll at least be logged, which seems like the primary use-case, though.
Just an observation.
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.
Yeah, that's indeed not so nice. That Apps
business is actually written by the network team. Unfortunately it lives in the consensus layer 😬.
bors merge |
#2525 and #2531 were merged in the https://github.com/input-output-hk/ouroboros-network/tree/coot/connection-manager. However, that branch won't be merged for another few weeks. In the meantime, the merge conflicts with the changes made in those two PRs will accumulate. For example, I know that #2546 will cause a merge conflict.
Now that @coot has kindly merged #2541 (which those PRs depended on) in master, we can port #2525 and #2531 to master so we can avoid the upcoming merge conflicts. After this PR is merged, the
coot/connection-manager
branch should be rebased onto master.