-
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
Enable the LocalStateQuery protocol #1522
Conversation
This includes #1507 until that is merged. This PR is only about the final commit. The This should only be merged when we're ready to break "network compatibility". |
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 - but I only looked under Ouroboros.Network.Protocol.LocalStateQuery
. Somebody needs to review the rest.
You'll have a conflict with current master. To resolve it you will need to put Examples,Tests,Direct
modules in the private library ouroboros-protocol-tests
. If you need to re-use Examples
in ouroboros-consensus
you can leave it in the public library.
import Ouroboros.Network.Protocol.LocalStateQuery.Type | ||
|
||
|
||
newtype LocalStateQueryClient block query result m a = LocalStateQueryClient { |
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.
There's no need for the new type wrapper, but let it be this way. We plan to remove all the top level newtype wrappers from all of the mini-protocols.
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.
Ok. I'll leave it there for consistency.
-- It must be prepared to handle either. | ||
-- | ||
data ClientStAcquiring block query result m a = ClientStAcquiring { | ||
recvMsgAcquired :: ClientStAcquired block query result m 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.
could you align the type
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.
Initially, I aligned all state types on their type parameters, even when some had an m (..)
around them. Now that I have added so many m
s, there's no point in alignment on this line, I'll remove it.
Thanks for giving this a look! BTW, #1507 is the PR that I want to merge now, not this one, which is #1507 + the breaking change that enables it.
That's what Edsko did in #1507 🙂
No, I rebased this morning already. I have moved |
81f52e4
to
028bb7f
Compare
'NodeToClientV_2' version of node-to-client protocol supports local-state-query mini-protocol.
`maximumMiniProtocolLimits` we are not planning to change `node-to-client` protocol limits; `node-to-client` protocol is executed in a trusted environment, so there's no need to introduce tight bounds for mux ingress queue.
028bb7f
to
9ca9de9
Compare
`Ouroboros.Network.NodeToClient.nodeToClientProtocols` takes now `NodeToClientVersion` as an argument, which provides the flexibility of running different set of mini-protocols per `NodeToClientVersion` version.
Added `ByronNetworkProtocolVersion1_1`.
9ca9de9
to
15d61d0
Compare
@karknu , this re-introduces the config parameter for the node-to-client protocols, but it is only a -- We pass the 'BlockConfig' here, even though it is currently unused. If at any
-- point we want to introduce local protocols that for example send Byron blocks
-- or headers across, we will need to have the epoch size, which comes from the
-- Byron config. Unlike the full 'TopLevelConfig', it should not be difficult
-- for a wallet to construct the 'BlockConfig'.
--
-- NOTE: Somewhat confusingly, 'pcChainSyncCodec' currently /does/ send Byron
-- blocks across, but it does not deserialize them (the user of the codec is
-- itself responsible for doing that), which is why it currently does not need
-- the config. |
Following Karl's suggestion: we set 16ths bit to distinguish `NodeToClient` and `NodeToNode` protocols. This patch includes a round trip tests for `Serialise` class of `NodeToClientVersion` and `NodeToNodeVersion`, including cross failure tests which checks that we cannot deserialise `NodeToClientVersion` as `NodeToNodeVersion` (and vice versa).
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!
, testGroup "NodeToNodeVersion" | ||
[ testCase "NodeToNodeVersion round-trip codec property" | ||
(roundTripPropAll (Proxy :: Proxy NodeToNodeVersion)) | ||
-- TODO: enable this test when `NodeToClientV_1` is removed: |
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.
👍
bors merge |
No description provided.