Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve SSW-101 #54

Merged
merged 4 commits into from
Mar 5, 2024
Merged

Resolve SSW-101 #54

merged 4 commits into from
Mar 5, 2024

Conversation

Quantumplation
Copy link
Member

The settings UTXO required the output to have the exact same value as
the input

But, this means we can't change the size in bytes of the datum, and the
output might be locked if the minUTXO ever increases.

To resolve this, we compare without_lovelace of the own_output.value
and own_input.value. This allows the ADA to vary arbitrarily, so the
minUTXO can be adjusted.

Two things to note about the safety of this:

  • We never expect an appreciable amount of ADA at this UTXO, essentially
    just the minUTXO, so the fact that someone can take any surplus if the
    minUTXO changes is not an issue
  • Only the settings admin and the treasury admin can spend the UTXO
    anyway

The settings UTXO required the output to have the exact same value as
the input

But, this means we can't change the size in bytes of the datum, and the
output might be locked if the minUTXO ever increases.

To resolve this, we compare `without_lovelace` of the own_output.value
and own_input.value. This allows the ADA to vary arbitrarily, so the
minUTXO can be adjusted.

Two things to note about the safety of this:
- We never expect an appreciable amount of ADA at this UTXO, essentially
  just the minUTXO, so the fact that someone can take any surplus if the
  minUTXO changes is not an issue
- Only the settings admin and the treasury admin can spend the UTXO
  anyway
@francolq
Copy link
Collaborator

Looks good, it solves SSW-101.

@cardenaso11
Copy link
Contributor

Merge conflicts should be resolved, added tests, @Quantumplation or @rrruko since I can't merge due to being last commit author

@Quantumplation
Copy link
Member Author

LGTM!

@Quantumplation Quantumplation merged commit c65928e into main Mar 5, 2024
1 check passed
@Quantumplation Quantumplation deleted the pi/SSW-101-datum-size-minUTXO branch March 5, 2024 21:49
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.

4 participants