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

Abierto
#3,587 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
blockchain, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Rust
Estrellas
155
Forks
52
Merge medio
2 d 17 h
PR fusionados (30 d)
37

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IntersectMBO/mithril

Todos los issues de IntersectMBO/mithril

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.