FR - Query block
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- haskell
- Ambito
- blockchain, cli, databases
Direzione di ricerca
Inizia esaminando la struttura dei comandi di cardano-cli e il livello di storage di ouroboros-consensus, concentrandoti su ChainDB, ImmutableDB e VolatileDB. Determina quali indici esistenti supportano le ricerche per slot, hash e numero di blocco prima di definire la forma del comando. Il lavoro è completato quando un comando offline recupera il blocco di uno dei due database come CBORHex non elaborato su stdout e segnala i blocchi mancanti e la loro posizione nello storage.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
As cardano-node operators, we currently have no straightforward way to access the raw content of a block stored in our local ChainDB. When debugging network incidents — particularly forks and network partitions — the ability to inspect individual blocks is critical.
Proposed Solution
Add a CLI command (either as part of cardano-cli or as a standalone tool) that can retrieve a block directly from the ChainDB on disk and output its CBORHex to stdout.
Retrieve by slot number
cardano-cli debug get-block --db /path/to/db --slot 83413505
Retrieve by block hash
cardano-cli debug get-block --db /path/to/db --hash e60aa1eb682ac5...
Retrieve by block number
cardano-cli debug get-block --db /path/to/db --block-number 4043212
Why
During a recent network partition, we needed to compare block contents across nodes to understand the fork. The process was painful because:
- Debugging is time-sensitive — During incidents, you need to inspect blocks quickly. Having to restart nodes or set up special queries adds delay at the worst possible time.
Implementation Considerations
The ChainDB is split into two components:
- ImmutableDB — Stores finalized blocks (older than k slots from the tip). Blocks are stored in chunk files and indexed by slot number. This is where most historical lookups would go.
- VolatileDB — Stores recent blocks that have not yet been finalized. These are the blocks most relevant during fork investigations, since competing chains live here until one wins.
A viable approach would be to read the ChainDB directly on disk, bypassing the node process entirely. Does ouroboros-consensus library provides the storage layer types and indexing logic? The key question is which block identifiers are supported by the existing index structures: Slot number, Block hash, Block number?
The command should:
- Work offline (no running node required)
- Output raw CBORHex to stdout (composable with other tools via pipes)
- Support both ImmutableDB and VolatileDB lookups.
- Report when a block is not found, or when it exists, id it's in the Immutable or in the Volatile Db.
- Lingua principale
- Haskell
- Stelle
- 72
- Fork
- 26
- Merge medio
- 3g 4h
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di IntersectMBO/cardano-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
IntersectMBO/cardano-cli#1306 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Show genesis hash mismatches in plain wordsForse già presa @palas l’ha presa oggi. Aperta
IntersectMBO/cardano-cli#1481 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
IntersectMBO/cardano-cli#1479 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
IntersectMBO/cardano-cli#1472 ·
I maintainer di solito rispondono entro 1 giorno
-
Clarify the origin and intended use of Plutus V2/V4 test fixturesForse già presa @Jimbo4350 l’ha presa 9 giorni fa. Aperta
IntersectMBO/cardano-cli#1464 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di IntersectMBO/cardano-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/phino#2059 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NixOS/nixpkgs-update#586 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
koalaman/shellcheck#3593 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Make node sockets moduleApertaconfiguration
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
tweag/cardano-kosmos#47 ·
I maintainer di solito rispondono entro 1 giorno