Skip to content

Conversation

@penDerGraft
Copy link
Contributor

This PR creates the following validation functions:

Attestations

Note: these functions are basically inverses of each other, but the semantics are easier to understand when having both as opposed to having to include negation in an expression

  • Attestation. is_valid_at - for checking if an attestation is valid at a given time
  • Attestation. is_expired - for checking if an attestation has expired (used for determining when a UUID is safe to clean up)

Global Validations

  • verify_upgrade_authority - checks the validity of an upgrade authority
  • validate_policy_id - validates that a policy ID is correctly formatted (0 < len < 64)

Architectural changes

This PR includes the entire attestation as part of the UsedUuidAccount. This will increase rent costs but I think it's more semantically correct, and as such makes the validators above safer and more intuitive. Without this change, we would need to create one validator on the UUID account and one on the Statement and/or attestation. This way a single object is the source of truth for expiration timestamps.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants