Skip to content

Use DTO format for storing attestations #1179

Closed

Description

@netrome

Background

Currently our contract has conversion methods in both directions for the attestations vs attestation DTOs. This is because the contract state holds the upstream attestation type as opposed to the DTO type. Because we want a high degree of control over the types we store in the contract, it's better to hold the DTO types here and only convert to the upstream type when we want to validate attestations.

This way, the contract only needs to convert from DTOs to the native type but never the other direction.

User Story

As a developer I don't want upstream changes to break our contract serialization format.

Acceptance Criteria

  • We store the DTO variant of the attestation instead of the upstream variant in the contract state.
  • The contract never converts from a native type to a DTO, only the other direction.

Resources & Additional Notes

Note: We may want to rename dtos_contract to just contract_types.

Activity

  1. added
    refactorImprovements to code structure, readability, or performance that don't add new features or fix bugs.
    on Sep 24, 2025
  2. gilcu3 commented on Mar 2, 2026

    @gilcu3
    Contributor

    This was partially solved as part of #1663. Although we did not use the dto types, the types that we ended up storing in the contract are now our own types defined in the mpc-attestation crate. Therefore, the original aim of the issue was achieved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorImprovements to code structure, readability, or performance that don't add new features or fix bugs.tech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions