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

Đang mở
#3,587 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
blockchain, cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Rust
Star
155
Fork
52
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
37

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IntersectMBO/mithril

Tất cả issue của IntersectMBO/mithril

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.