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

Hydra explorer supporting multiple hydra versions #1282

Closed
2 of 4 tasks
ch1bo opened this issue Feb 5, 2024 · 12 comments · Fixed by #1815, cardano-scaling/hydra-explorer#18, cardano-scaling/hydra-explorer#20, #1828 or #1831
Closed
2 of 4 tasks
Assignees
Labels
green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap

Comments

@ch1bo
Copy link
Member

ch1bo commented Feb 5, 2024

Why

The Hydra explorer should be able to report Hydra heads from multiple different protocol versions on all public networks. The explorer can be used to give usage information about each version.

What

  • The hydra-explorer lists heads from all networks and supported versions according to networks.json

  • The hydra-explorer does not need to be updated on every script change (e.g. when we switch plutus-tx/GHC versions)

  • The hydra-explorer reports a protocol version per head.

  • Can run multiple "(chain) observers", one for each network and hydra protocol version, feeding information into one hydra-explorer instance.

    • The hydra-explorer is decoupled from a specific hydra version
    • The interface between observers and explorer is specified and tests will ensure we don't break it accidentally
  • The hydra-explorer should be deployed from https://github.com/cardano-scaling/hydra-explorer using multiple versions of the main hydra repository

    • We need to do this because, say, the script hashes are not enough to distinguish the version; i.e. we can't make hydra-node/src/Hydra/Chain/Direct/Tx.hs generic across versions; the easiest way is just to depend on the entire codebase 🥲
  • We should delete the hydra-explorer folder from the main hydra repo

How

  • The endpoint is a POST to /v1/observations/<network>/<version> with request body of some JSON object enumerating the observations

  • Add an observer-side API definition to hydra-explorer OpenAPI schema

  • The interface should be JSON-based simpler HTTP requests; so that it's easy reason about backwards compatibility and debug, and test

  • hydra-chain-observers are HTTP clients sending requests to hydra-explorer observer-side API whenever a head transition is observed

  • Observer-side API is exposed on separate port so we can host and port configurable on the command-line of hydra-explorer

  • Both hydra-chain-observer and hydra-explorer are tested agains the observer-side API schema

TBD

  • Is specifying an interface + testing against enough to keep this maintainable?
  • Make the explorer understand any "old versions" of observer data?
    • Eventually drop too old observer versions
    • For how long should be support older versions? Will we have some separate notion of LTS versions for Hydra?
    • Might be older versions that we don't support but keep an eye on
  • Can this support protocol changes like
    • additional transitions (incremental commit)
    • not having a commit phase anymore
  • Protocol version is basically:
    • scripts, their hashes and addresses
    • datums and redeemers as contained in transactions (their format)
    • structure of protocol transactions
@ch1bo ch1bo converted this from a draft issue Feb 5, 2024
@ch1bo ch1bo added the 💭 idea An idea or feature request label Feb 5, 2024
@ch1bo ch1bo mentioned this issue Feb 5, 2024
4 tasks
@ch1bo ch1bo moved this from Later to Next in Hydra Head Roadmap Apr 10, 2024
@github-project-automation github-project-automation bot moved this to In Progress 🕐 in ☕ Hydra Team Work Jul 22, 2024
@ch1bo ch1bo moved this from In Progress 🕐 to Later in ☕ Hydra Team Work Jul 22, 2024
@ch1bo ch1bo moved this from Next to Later in 🚢 Hydra Head Roadmap Jul 23, 2024
@noonio noonio added green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap and removed 💭 idea An idea or feature request labels Aug 13, 2024
@noonio noonio added this to the 1.0.0 milestone Aug 13, 2024
@noonio
Copy link
Contributor

noonio commented Nov 7, 2024

Having looked into this a bit as part of cardano-scaling/hydra-explorer#5 I think it's worth making some notes:

  1. I don't think it's best to invoke hydra-explorer multiple times; let's just make an option for the chain-observer to look for multiple "versions"
  2. A version is defined by the Tx Id in networks.json and the script outputs from there; from this a ScriptInfo datatype can be reconstructed
  3. This can be used by the chain-observer to send ticks

I.e. the real limitation is with the chain-observer; so we just need to make that parameterisable by a specific ScriptInfo parameter; then maybe we just run multiple chain-observers, or (probably better) run a single one that attempts to find all the ScriptInfo things that it is provided.

-- Edit:

As discussed with @ffakenz and @ch1bo , it is not possible to "de-version" the relevant parts of the chain-observer code (i.e. to parameterise it by the version), because all the version information is essentially hard-coded in the code itself; so it's easier just to depend on different revisions of the code and adapt them to write to a generic (?JSON) format consumable by the hydra-explorer.

@ch1bo
Copy link
Member Author

ch1bo commented Jan 9, 2025

We discussed again the intended architecture of this and drew this picture today. It shows multiple versions of the chain observing code (in hydra-chain-observer) and also running on multiple networks / against different cardano-nodes, all aggregating data into a single hydra-explorer instance.

hydra-explorer multiple versions - Frame 1

@noonio noonio moved this from In Progress 🕐 to Todo 📋 in ☕ Hydra Team Work Jan 13, 2025
@noonio noonio assigned ch1bo and unassigned locallycompact and ffakenz Jan 20, 2025
@noonio noonio modified the milestones: 1.0.0, 0.20.0 Jan 20, 2025
@ffakenz ffakenz moved this from In progress 🕐 to In review 👀 in ☕ Hydra Team Work Feb 6, 2025
@ch1bo ch1bo linked a pull request Feb 10, 2025 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from In review 👀 to Done ✔ in ☕ Hydra Team Work Feb 10, 2025
@ch1bo
Copy link
Member Author

ch1bo commented Feb 10, 2025

Last piece of work in cardano-scaling/hydra-explorer#20

@ch1bo ch1bo reopened this Feb 10, 2025
@github-project-automation github-project-automation bot moved this from Done ✔ to Triage 🏥 in ☕ Hydra Team Work Feb 10, 2025
@ch1bo ch1bo moved this from Triage 🏥 to In review 👀 in ☕ Hydra Team Work Feb 10, 2025
@github-project-automation github-project-automation bot moved this from In review 👀 to Done ✔ in ☕ Hydra Team Work Feb 11, 2025
@ch1bo ch1bo moved this from Done ✔ to In progress 🕐 in ☕ Hydra Team Work Feb 11, 2025
@ch1bo
Copy link
Member Author

ch1bo commented Feb 11, 2025

Realized that the 0.19 observers don't find any heads and also mainnet is missing still.

@ch1bo ch1bo reopened this Feb 11, 2025
@github-project-automation github-project-automation bot moved this from In progress 🕐 to Triage 🏥 in ☕ Hydra Team Work Feb 11, 2025
@ch1bo ch1bo moved this from Triage 🏥 to In progress 🕐 in ☕ Hydra Team Work Feb 11, 2025
@ch1bo ch1bo linked a pull request Feb 12, 2025 that will close this issue
4 tasks
@ch1bo ch1bo moved this from In progress 🕐 to In review 👀 in ☕ Hydra Team Work Feb 12, 2025
@noonio noonio moved this from In review 👀 to In progress 🕐 in ☕ Hydra Team Work Feb 13, 2025
@noonio
Copy link
Contributor

noonio commented Feb 13, 2025

Presently investigating why we don't see any 0.19 heads in the explorer.

@noonio noonio assigned noonio and unassigned ch1bo and ffakenz Feb 13, 2025
@noonio noonio moved this from In progress 🕐 to Done ✔ in ☕ Hydra Team Work Feb 19, 2025
@noonio noonio closed this as completed by moving to Done ✔ in ☕ Hydra Team Work Feb 19, 2025
@noonio noonio moved this from Done ✔ to In review 👀 in ☕ Hydra Team Work Feb 19, 2025
@ch1bo ch1bo moved this from In review 👀 to Done ✔ in ☕ Hydra Team Work Feb 19, 2025
@ch1bo ch1bo self-assigned this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment