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

LM parallel rewards support #41

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

LM parallel rewards support #41

wants to merge 5 commits into from

Conversation

AOranov
Copy link
Contributor

@AOranov AOranov commented Sep 18, 2023

List of main changes:

  • Parallel rewards (2 tokens)
  • Program budget can be increased during the program
  • Rewards are accumulated in the bundle

val poolLQ0 = SELF.tokens(2)
val poolVLQ0 = SELF.tokens(3)
val poolTMP0 = SELF.tokens(4)
val poolOptReward0 = SELF.tokens(5)
Copy link
Member

Choose a reason for hiding this comment

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

If the asset at this index is supposed to be optional, then I guess it can be absent. This code fails in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, at least 1 optional reward token must be added during the initialisation with it's redeemer in the R5.

val budgetsNotDepleted = poolMainReward1._2 != 0 && poolOptReward0._2 != 0

if (
(deltaMainReward > 0 || deltaOptReward > 0) && !budgetsNotUpdated && budgetsNotDepleted
Copy link
Member

Choose a reason for hiding this comment

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

Budget can be increased only in the case opt token is initialized and not depleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same, depleted means 0 tokens, which is impossible during normal program operation

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.

3 participants