-
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
Refine cardano-node executable dependencies #178
Conversation
We had it like this in the past. Not sure though why we moved away from it 🤔 |
I did not dug into the commits but IIRC the main reason why we moved away from pulling the cardano-node and cardano-cli executables in nix was that this would introduce a potential discrepancy between the version of the API we are using inside Hydra node and the version of Cardano node (which includes API, ledger, plutus) we are using for our tests. |
I guess the relevant question to ask is what is the relationship between Hydra and a Cardano node? If we don't test against "standard" builds of the node then wouldn't it risk forcing Hydra operators to build a Cardano node from the source with the dependencies that Hydra specifies for stability? On the other hand, pushing for standard node support means Hydra users can just integrate it with whatever (standard) node setup they are using. The current setup already tracks Cardano node dependencies so it does aim for the same effects, just with more overheads.
Exactly! We've been discussing this with the Plutus team to promote it for a while now. It's non-trivial though as it would add more operation overheads to upstream maintainers, and require a coordinated effort across the board. If you're interested, I would love to invite the Hydra team to our developer experience presentations too! |
We are testing against standard node: The dependencies we have is tied to some cardano-node version (1.31.0). At some point, we should make it clearer what are the ties with Cardano. |
@abailly-iohk The current I might be wrong but doesn't Hydra only want the same ledger (for transaction validation) with layer one as a common ground for consensus, with everything else like node, consensus, etc. unrelated? If so, while Realistically, a Cardano node should only be an external agent for Hydra to interact with, not an internal dependency. We should not manage it inside this codebase. Even the standard binaries in Other dApps also need to interact with a Cardano node to sync data and submit transactions, etc. Listing and building a node inside every smart contract codebase to test such integration sounds strange. |
@kk-hainq I am sorry but I don't really understand your arguments. What I know is that I spent a couple days battling with inconsistencies between shell.nix and cabal.project back in October: Here is a link to our Logbook with some explanations why this change was done: https://github.com/input-output-hk/hydra-poc/wiki/Logbook-2021-H2#2021-10-15 I personally don't want to impose the use of nix to our users, so the more we do outside of nix the better IMO. |
The log and corresponding PR were too vague to tell what was the problem. However, if we could not make Hydra integrate with the
As I've mentioned, the Another example: If your web servers need |
I totally agree that having to build the cardano-node from source is a problem. And that having dependencies on specific commits is also a problem. And that mixing dependencies which are needed for the Head's ledger and the End-to-end test is another problem. I am just saying I am reluctant with changing the statu quo because I know for a fact that each time we have needed to update dependencies has been a major PITA, but it will need to change for 1.0.0. |
Also, one depends on the cardano-node binary for running the end-to-end tests, not for running the hydra-node, so users of Hydra will never need that. And we will distribute binaries anyway. And we'll have to provide some kind of compatibility matrix because we are somewhat dependent on the version of the node we are talking to, at least the version of the protocols. |
What's the standard way of installing a node? According to https://docs.cardano.org/getting-started/installing-the-cardano-node one can download binaries from https://hydra.iohk.io/build/12243146/download/1/cardano-node-1.33.0-linux.tar.gz. |
I genuinely believe that building the node from our source contributes greatly to the problem. If we remove it for good then we naturally get rid of
Exactly why we should remove it from our dependency tree, to perform integration testing with standard nodes from Nix caches, Docker, etc. If such an integration test fails, building the node from our source is a dodge, not a fix. We should instead slap Hydra until it starts talking to the standard nodes properly.
Very nice!
I would say downloading pre-built binaries/Docker images/Nix caches from IOG, or building from the source of
I agree. I guess a compatibility matrix and a few options to auto-fetch stable compatible binaries would be best.
I totally agree.
Yeah, the lack of Hackage support doesn't help either. Let's push for it!
The Nix thing was really just a convenient example, and to also keep CI sane. We can, and as you said, really should add more options. For what it's worth, I've gone to great lengths to criticize Nix for bad developer experience on Cardano, like in IntersectMBO/plutus-apps#180.
All sound wonderful to me! For the last one I think we can have Anyhow, we have been actively working on improving dependency management across the ecosystem and are happy to serve Hydra in at least 2022 too :). |
We had a quick discussion also internally and would like to merge this, but only if
Rationale for the pinning: If someone from the community does run our (integration) tests, but would use a non-standard environment for that - for example WDYT? (@abailly-iohk I just realize that using the |
08e9bea
to
a62ffbd
Compare
a62ffbd
to
437b129
Compare
Previously we were building
cardano-node
&cardano-cli
executables from source withcabal
. This is not very nice because:cabal.project
, forcing the codebase to followcardano-node
'scabal.project
as tightly as possible, which is error-prone and inflexible. For instance, bumping the commit ofplutus
in ourcabal.project
to get smaller script sizes (new compiler optimizations or something) risks building an untested version of the node with a newplutus-ledger-api
leading to failed tests and unexpected behaviors.cardano-node
's Nix cache and adds extra overheads to our own Cabal caches.ekg-forward
. In fact, if we removecardano-node
(only keepcardano-api
) fromcabal.project
for good then we'll be able to get rid ofoptparse-applicative
,hedgehog-extras
, andcardano-config
. The trade-off is to (re)define a few orphan instances (only for tracing) inHydra.Network.Ouroboros
, which I guess is acceptable?As a solution, this PR avoids building the
cardano-node
executables from source with our owncabal.project
, and populates more standard ones to the defaultnix-shell
for convenience. Outside of it, we should advise people to get a stable binary directly, build from source, etc.Reference: IntersectMBO/plutus-apps#213.