cardano-rpc: honour field masks inside nested messages of ReadGenesis and ReadEraSummary
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- haskell
- Ambito
- backend-api-design, performance
Direzione di ricerca
Read readGenesisFill in cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Query.hs and boundToProto in cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/EraSummary.hs, then profile both methods with narrow masks against mainnet-sized data. If conversion is a noticeable share of request time, pass sub-masks into genesisBundleToProto and boundToProto so only selected nested fields are built; done when unselected nested fields avoid their conversion work and the responses remain correctly masked.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
ReadGenesis and ReadEraSummary now honour field_mask and skip the node queries and genesis file reads that unselected top-level fields would need (PR below). Below the top level the work is still all or nothing, because each nested message is built in one piece and proto-lens message fields are strict:
ReadGenesis: selecting any path undercardano, for examplecardano.network_magic, converts the whole genesis bundle withgenesisBundleToProto(readGenesisFillincardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Query.hs).ReadEraSummary: selectingcardano.summaries.start.slotstill computes the boundary timestamp, becauseboundToProtoincardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/EraSummary.hssetstime,slotandepochtogether.
The response is still trimmed correctly; only the server-side cost is affected. Nobody has measured yet how much this conversion costs compared with the rest of the request.
I'd suggest profiling both methods first, with a narrow mask against mainnet-sized genesis files and era history. If the conversion is a noticeable share of the request time, pass the sub-mask down into genesisBundleToProto and boundToProto with the sub-mask helpers from the PR below, so each nested field is built only when it is selected.
A client that polls a single value, such as the network magic or an era's start slot, would then pay only for that value, and the field mask would behave the same at every nesting level.
Raised in the review of:
- https://github.com/IntersectMBO/cardano-api/pull/1407
- https://github.com/IntersectMBO/cardano-api/pull/1407#discussion_r4591268763
Follow-up to:
- Lingua principale
- Haskell
- Stelle
- 41
- Fork
- 33
- Merge medio
- 5g 17h
- PR unite (30g)
- 16
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-api
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
IntersectMBO/cardano-api#1424 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 65/100
IntersectMBO/cardano-api#1425 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
IntersectMBO/cardano-api#1419 ·
I maintainer di solito rispondono entro 2 giorni
-
Add a dedicated transaction viewing type to the experimental APIForse già presa @palas l’ha presa 11 giorni fa. Apertatype: enhancement
IntersectMBO/cardano-api#1416 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Dijkstra era type: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
IntersectMBO/cardano-api#1386 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di IntersectMBO/cardano-api
Issue simili
-
Default exclude patterns drop production files whose names end in "test" or "spec" (Contest.java, Latest.swift, Aspec.hs)Forse già presa @alex09x l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
alibaba/open-code-review#2078 ·
I maintainer di solito rispondono entro 1 giorno
-
area:client bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
fmidue/term-tasks#34 · 1 reazione ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
fmidue/logic-tasks#394 ·
-
difficulty: easy open-public refactor scope
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno