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

Replace networking stack with etcd-based approach #1720

Open
7 of 14 tasks
noonio opened this issue Oct 25, 2024 · 7 comments · Fixed by #1852 · May be fixed by #1854
Open
7 of 14 tasks

Replace networking stack with etcd-based approach #1720

noonio opened this issue Oct 25, 2024 · 7 comments · Fixed by #1852 · May be fixed by #1854
Assignees
Labels
green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap

Comments

@noonio
Copy link
Contributor

noonio commented Oct 25, 2024

Why

We saw in the recent spike #1591 that Raft (via etcd) provides benefits over our present approach: it allows for more instability in the client connections, and more transparency in what is happening.

We would like a resiliant and reliable networking layer, and this seems like a viable approach.

What

How

@noonio noonio added the 💭 idea An idea or feature request label Oct 25, 2024
@github-project-automation github-project-automation bot moved this to In Progress 🕐 in ☕ Hydra Team Work Oct 25, 2024
@noonio noonio added the amber ⚠️ Medium complexity or partly unclear feature label Oct 25, 2024
@noonio noonio moved this from In Progress 🕐 to Later in ☕ Hydra Team Work Oct 25, 2024
@noonio noonio added the 💬 feature A feature on our roadmap label Oct 25, 2024
@noonio noonio moved this from Later to Todo 📋 in ☕ Hydra Team Work Jan 31, 2025
@noonio noonio removed the amber ⚠️ Medium complexity or partly unclear feature label Feb 4, 2025
@ch1bo ch1bo added green 💚 Low complexity or well understood feature and removed 💭 idea An idea or feature request labels Feb 4, 2025
@locallycompact
Copy link
Contributor

What is the difference between our use and cardano-node's use of ouroboros that causes us to seek out this alternate solution? Why can we not improve things there?

@noonio
Copy link
Contributor Author

noonio commented Feb 10, 2025

I think, indeed, we could use cardano-style networking, but that would again be wildly upping the difficulty of the task.

What we have right now was, I suppose, basically just the bare minimum to get it working. This task improves on that somewhat with some more deliverability features; and we know if fixes a problem we care about ; i.e. #1786.

I think in some sense our whole approach to Hydra, and it's networking, could be different and could've focused on direct re-use of the actual cardano-node binary; but given where we are this is a fine incremental improvement, in my view.

@locallycompact
Copy link
Contributor

locallycompact commented Feb 10, 2025

I have created this task, assuming we want to address the use of the CLI with a recommended approach #1843

@ch1bo ch1bo moved this from Todo 📋 to In progress 🕐 in ☕ Hydra Team Work Feb 12, 2025
@ch1bo
Copy link
Member

ch1bo commented Feb 12, 2025

What is the difference between our use and cardano-node's use of ouroboros that causes us to seek out this alternate solution? Why can we not improve things there?

@locallycompact We only (mis-)use the same framework to actually send out CBOR-encoded messages over TCP in a fully connected topology. Over this, we tried (and failed?) to implement reliable broadcast primitives. The cardano network works differently as it consists of pull-based, stateful protocols that can deal with network failures by design, i.e. clients need to ask and pull data from (uniform) upstream peers anyways. See the spike #1591 and this monthly report for more details why using etcd with its Raft-consensus is an alternative to reliable broadcast as we tried to achieve.

@ch1bo ch1bo linked a pull request Feb 12, 2025 that will close this issue
@locallycompact
Copy link
Contributor

I have sketched out both calls to put and to watch using grapesy in the grapesy-etcd repo:

https://github.com/cardano-scaling/grapesy-etcd/blob/bc3517caea2a87f1715e186b9a96d2c6c5779c3a/grapesy-etcd/app/Client.hs#L22-L35

And integrated the put command in hydra that replaces the call to etcdctl in a branch.

63d5260

Replacing the call to etcdctl watch is a little more involved but it suggests removing the json response logic and replacing it with the optics provided by proto-lens.

@github-project-automation github-project-automation bot moved this from In progress 🕐 to Done ✔ in ☕ Hydra Team Work Feb 14, 2025
@ch1bo
Copy link
Member

ch1bo commented Feb 17, 2025

Re-open as not done yet

@ch1bo ch1bo reopened this Feb 17, 2025
@github-project-automation github-project-automation bot moved this from Done ✔ to Triage 🏥 in ☕ Hydra Team Work Feb 17, 2025
@ch1bo ch1bo linked a pull request Feb 17, 2025 that will close this issue
4 tasks
github-merge-queue bot pushed a commit that referenced this issue Feb 17, 2025
This is a change I encountered when rebasing `raft-network` for #1720
and was useful back in the spike, but would have also been valuable in
the `hydra-doom` use case.

Anyways, this is adding a `--offline-head-seed` argument to offline mode
and fixes the "simulation" opened head to be deterministic across
multiple instances, resulting that the nodes can and do talk to each
other and consequently sign snapshots.

---

* [x] CHANGELOG updated
* [x] Documentation updated
* [x] Haddocks updated
* [x] No new TODOs introduced
@noonio noonio moved this from Triage 🏥 to Todo 📋 in ☕ Hydra Team Work Feb 18, 2025
@ch1bo ch1bo moved this from Todo 📋 to In progress 🕐 in ☕ Hydra Team Work Feb 18, 2025
@locallycompact
Copy link
Contributor

I will provide a "simple" interface to grapesy-etcd cardano-scaling/grapesy-etcd#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap
Projects
Status: In progress 🕐
Status: No status
3 participants