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

Add automatic mana allotment #1961

Merged
merged 74 commits into from
Feb 15, 2024
Merged

Add automatic mana allotment #1961

merged 74 commits into from
Feb 15, 2024

Conversation

DaughterOfMars
Copy link

Description of change

Adds automatic mana allotment to ISA. These changes move the context input addition to a new requirement, as well as adds the mana allotment requirement. In order to facilitate these changes, the slot index was upgraded to a slot commitment ID and input selection now requires an issuer ID. This also means that an issuer ID is now required to prepare a transaction. The reason for this is that we must be able to put the new allotments on the proper mana allotment, or else create one with the issuer ID. If we did not, we could not be certain that the resulting work score would be correct.

The reference work score must also be passed into ISA now in order to calculate the correct mana balance between the inputs and outputs.

In the process of making the changes, I found that it seems to be a simpler change to loop over the last two requirements for Mana and Allotment until no more inputs are needed.

Links to any relevant issues

Closes #1816

@DaughterOfMars DaughterOfMars linked an issue Feb 6, 2024 that may be closed by this pull request
@DaughterOfMars
Copy link
Author

DaughterOfMars commented Feb 6, 2024

Tests are failing because they do not account for mana needed to allot the block. This could be fixed in two ways:

  1. Fix the protocol params we use in the tests (see Should ProtocolParameters impl Default? #1876) so that generated mana can cover the amount
  2. Add stored mana to all of the inputs.

Either way, I'd appreciate it if this was reviewed now, so I'm leaving it undrafted.

Thoralf-M
Thoralf-M previously approved these changes Feb 15, 2024
Copy link
Member

@Thoralf-M Thoralf-M left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More changes in new PR(s)

@Thoralf-M Thoralf-M merged commit 7671804 into 2.0 Feb 15, 2024
37 checks passed
@Thoralf-M Thoralf-M deleted the feat/automatic-mana-allotment branch February 15, 2024 20:43
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.

Automatic Mana Allotment
4 participants