Avoid client errors when a new variant of `MultiFilesUri` is added

Aperta
#3,587 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
blockchain, cli

Direzione di ricerca

Start at the MultiFilesUri definition and compare its serialization behavior with the signed entity types’ custom serde approach. Trace how locations are handled in the client library and client CLI, then run or add unit tests for known and unknown variants and the golden test for a message containing an unknown variant. Done means unsupported locations are skipped without deserialization errors while known variants continue to work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

optimization :hammer_and_wrench: to-groom :thinking:

Why

MultiFilesUri only has the Template variant and is deserialized with the derived serde implementation, so adding a new variant on the aggregator side would make already released clients fail to deserialize the Cardano database messages.

What

Make the deserialization of MultiFilesUri tolerant to unknown variants, so that a client ignores the locations it does not support instead of failing.

How

  • Add a catch-all variant to MultiFilesUri for the unknown variants
  • Implement a custom serde deserialization that maps any unknown variant to the catch-all (same approach as SignedEntityTypeMessage, as #[serde(other)] only supports unit variants)
  • Make expand_to_file_uri and expand_for_immutable_file_number of MultiFilesUri return an error for the catch-all variant
  • Skip the locations with an unknown URI variant in ImmutablesMessagePart::sanitized_locations, so that the client library and the client CLI ignore them
  • Add a golden test with a message that holds an unknown varian
Lingua principale
Rust
Stelle
155
Fork
52
Merge medio
2g 17h
PR unite (30g)
37

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/mithril

Tutte le issue di IntersectMBO/mithril

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.