-
Notifications
You must be signed in to change notification settings - Fork 156
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
* Update to the latest version of ouroboros-network #78
Conversation
MarcFontaine
commented
Apr 22, 2020
- Update to the latest version of ouroboros-network
- Use ready-made codecs
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 cabal.project
file and the stack.yaml
file must be in sync (and that's why CI failed).
The easiest way to do this is using a recent version of cardano-repo-tool
.
a391713
to
66c10ac
Compare
I ran |
I will still want to build and run this to make sure it works as expected. |
8935782
to
a391713
Compare
(NodeToClientProtocols { | ||
localChainSyncProtocol = localChainSyncProtocol | ||
,localTxSubmissionProtocol = localTxSubmissionProtocol | ||
,localStateQueryProtocol = Prelude.error "localTxSubmissionProtocol" -- todo! |
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.
TODO: use the ready-made null protocol
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 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 is used now
OK |
This looks fine. Let me build and run it and make sure it all works! |
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 just built and ran this and got:
[db-sync-node.Handshake:Info:36] [2020-04-24 00:12:09.66 UTC]
{"event":"Send MsgProposeVersions (fromList [(NodeToClientV_1,TInt 1097911063)])"
,"kind":"LocalHandshakeTrace"
,"bearer":"ConnectionId {localAddress = LocalAddress {getFilePath = \"\"}
, remoteAddress = LocalAddress {getFilePath = \"state-node-testnet/node.socket\"}}"
}
I really did expect NodeToClientV_2
there?
@erikd just to double check, the node is after #809 was merged, right? (i.e. after this commit IntersectMBO/cardano-node@0172a96) |
@@ -206,7 +204,7 @@ runDbSyncNodeNodeClient iomgr trce plugin nodeConfig (SocketPath socketPath) = d | |||
logInfo trce $ "localInitiatorNetworkApplication: connecting to node via " <> textShow socketPath | |||
networkState <- newNetworkMutableState | |||
txv <- newEmptyTMVarM @_ @(GenTx blk) | |||
ncSubscriptionWorker_V1 | |||
ncSubscriptionWorker_V2 |
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.
@MarcFontaine could we use this pattern: https://github.com/input-output-hk/cardano-node/blob/master/cardano-cli/src/Cardano/CLI/Ops.hs#L436 and nsSubscriptionWorker
; I'd like to deprecate ncSubscriptionWorker_V1
and ncSubscriptionWorker_V2
and remove them.
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.
Let me know when you fix that.
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 had looked it at when you suggested it on Slack, but had not been sure
if it is just a syntactic changes or if it breaks anything.
But I changed it now.
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.
It does not breaking anything, and it's good to use the same pattern across whole ecosystem.
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.
foldMapVersions
is like foldMap
but for Semigroup
rather than for Monoid
(and specialised for Versions
rather than for any Semigroup
, just to make the api clearer). It folds the results with (<>)
(one possible implementation is foldMapVersions = \f -> foldr1 (<>) . fmap f
. ncSubscriptionWorker_V2
combines two versions explicitly with (<>)
- so there's no difference.
You're right, it is not even proposing |
Nevermind, I just updated my node to current HEAD (commit
so it supports both versions and then
suggesting it is running V2. |
e2cf2ec
to
dab715f
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.
LGTM!
(NodeToClientVersionData { networkMagic = nodeNetworkMagic (Proxy @blk) topLevelConfig }) | ||
(dbSyncProtocols v trce plugin topLevelConfig txv) | ||
) | ||
(supportedNodeToClientVersions (Proxy @blk)) |
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.
@erikd is cardano-db-sync
using the same config file as cardano-node
?
If it is, once IntersectMBO/cardano-node#830 is merged we can use the specified versions rather than supportedNodeToClientVersions
.
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.
no, the configs are different.
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.
it looks good now, thanks @MarcFontaine
57b594a
to
2e8901b
Compare
bors r+ |
9b7f9c2
to
71397d4
Compare
71397d4
to
cf48776
Compare
…ros-network * Use ready-made codecs * Replace ncSubsciptionWorker_V1 with foldMapVersions pattern * Replace hard-coded protocol version with correct parameter
cf48776
to
f37fbea
Compare
bors r+ |
Build succeeded |