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

Port #2525 and #2531 to master #2548

Merged
merged 5 commits into from
Aug 28, 2020
Merged

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Aug 26, 2020

#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.

@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Aug 26, 2020
@mrBliss mrBliss requested a review from coot August 26, 2020 16:44
@mrBliss
Copy link
Contributor Author

mrBliss commented Aug 27, 2020

Ah, #2525 makes the ThreadNet tests loop/hang. I did not realise that before, because the branch in which I merged #2525 didn't compile cleanly on CI (so CI never ran these tests) and I never ran them myself 😳.

@mrBliss
Copy link
Contributor Author

mrBliss commented Aug 28, 2020

Ah, #2525 makes the ThreadNet tests loop/hang. I did not realise that before, because the branch in which I merged #2525 didn't compile cleanly on CI (so CI never ran these tests) and I never ran them myself flushed.

I solved the issue with help from @nfrisby, see #2553.

@mrBliss
Copy link
Contributor Author

mrBliss commented Aug 28, 2020

@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 coot/connection-manager branch still contains that bug, so best to merge this PR soon and rebase your branch on top of master.

mrBliss and others added 5 commits August 28, 2020 16:45
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.
@mrBliss mrBliss force-pushed the mrBliss/port-2525-2531-to-master branch from bf98f28 to 8be435e Compare August 28, 2020 14:46
Copy link
Contributor

@nfrisby nfrisby left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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 😬.

@mrBliss
Copy link
Contributor Author

mrBliss commented Aug 28, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Aug 28, 2020

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

Successfully merging this pull request may close these issues.

2 participants