Skip to content

DO NOT MERGE: Daml code for implementing traffic-based app rewards#3964

Open
meiersi-da wants to merge 5 commits into
meiersi/backup/app-rewards-base-branchfrom
meiersi/daml/app-rewards-minting-core
Open

DO NOT MERGE: Daml code for implementing traffic-based app rewards#3964
meiersi-da wants to merge 5 commits into
meiersi/backup/app-rewards-base-branchfrom
meiersi/daml/app-rewards-minting-core

Conversation

@meiersi-da
Copy link
Copy Markdown
Contributor

@meiersi-da meiersi-da commented Feb 16, 2026

@moritzkiefer-da : the code is now fully finished. If you find some time next week to do a final review, then that would be great.

Added "DO NOT MERGE" to title, as we want to merge this into the right feature branch once the implementation has progressed far enough.

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

@meiersi-da meiersi-da changed the base branch from cocreature/transfer-24h to meiersi/backup/app-rewards-base-branch February 16, 2026 12:04
Copy link
Copy Markdown
Contributor Author

@meiersi-da meiersi-da left a comment

Choose a reason for hiding this comment

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

@moritzkiefer-da : I have a sketch of what I believe are all the choices and templates to make the switch to traffic-based app rewards possible at the Daml level. Some simple work is delayed via FIXMEs in the code.

Could I ask you for a review to check alignment, in particular:

  • highlight implementation choices that you disagree with / consider fishy
  • highlight aspects / workflows that are missing or that you are not sure how they'll work

You don't have to work too hard on the latter part. I expect that we also find them as part of writing up and reviewing the full design.

Comment thread daml/splice-amulet/daml/Splice/Amulet/RewardAccountingV2.daml Outdated
Copy link
Copy Markdown
Contributor

@moritzkiefer-da moritzkiefer-da left a comment

Choose a reason for hiding this comment

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

Nice thanks!

Comment thread daml/splice-amulet/daml/Splice/Amulet/CryptoHash.daml
Comment thread daml/splice-amulet/daml/Splice/Amulet/RewardAccountingV2.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/AmuletConfig.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/ExternalPartyAmuletRules.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
Comment thread daml/splice-amulet/daml/Splice/Amulet.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/ExternalPartyAmuletRules.daml Outdated
@meiersi-da meiersi-da changed the title DRAFT: PoC for Daml fo traffic-based app rewards DRAFT: PoC for Daml of traffic-based app rewards Feb 17, 2026
@meiersi-da meiersi-da force-pushed the meiersi/daml/app-rewards-minting-core branch from f2474d0 to 057486f Compare February 20, 2026 17:19
@meiersi-da meiersi-da force-pushed the meiersi/backup/app-rewards-base-branch branch from f3677b9 to f126f7b Compare February 27, 2026 07:22
@meiersi-da meiersi-da force-pushed the meiersi/daml/app-rewards-minting-core branch 3 times, most recently from 9566611 to edc394a Compare February 27, 2026 15:37
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
@meiersi-da meiersi-da changed the title DRAFT: PoC for Daml of traffic-based app rewards Daml code for implementing traffic-based app rewards Feb 27, 2026
@meiersi-da meiersi-da changed the title Daml code for implementing traffic-based app rewards DO NOT MERGE: Daml code for implementing traffic-based app rewards Feb 27, 2026
@meiersi-da meiersi-da marked this pull request as ready for review February 27, 2026 15:46
@moritzkiefer-da
Copy link
Copy Markdown
Contributor

@moritzkiefer-da : the code is now fully finished. If you find some time next week to do a final review, then that would be great.

will get to it on Monday

Copy link
Copy Markdown
Contributor

@moritzkiefer-da moritzkiefer-da left a comment

Choose a reason for hiding this comment

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

Great work thanks!

Comment thread daml/splice-amulet/daml/Splice/Amulet.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/Amulet.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/Amulet.daml
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
@meiersi-da meiersi-da force-pushed the meiersi/daml/app-rewards-minting-core branch from e43454f to afe0825 Compare March 3, 2026 06:38
extraArgs : ExtraArgs
-- ^ Extra arguments for extensibility. Set to empty, unless needed for specific implementations.
observer map (.beneficiary) newBeneficiaries
controller (view this).beneficiary
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This makes RewardCoupons transferrable. It looks like a classic bearer instrument redeemable with the dso. I worry that this could be an issue for some stakeholders.

Comment thread daml/splice-amulet/daml/Splice/Amulet/RewardAccountingV2.daml Outdated
It will be added in a separate PR

Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
Comment thread daml/splice-amulet/daml/Splice/AmuletRules.daml
round : Round
amuletPrice : Decimal
issuanceConfig : IssuanceConfig
tickDuration : RelTime
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@meiersi-da I believe we want to pass the trafficPrice and rewardConfig to SummarizingMiningRound? I guess that was the intention of adding it to OpenMiningRound; to have this data available in SummarizingMiningRoundTrigger?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What would you expect that trigger to do with this information? Right now the code is organized such that the Calculate/ProcessRewardsV2 workflow runs to the side of the SummarizingRound workflow.

Copy link
Copy Markdown
Contributor

@dfordivam dfordivam Apr 10, 2026

Choose a reason for hiding this comment

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

In SummarizingMiningRoundTrigger I need to determine the rewardConfig.mintingVersion for the round, and the CC totals for featuredAppRewardCoupons based on total traffic for round. I guess I can query the corresponding OpenMiningRound to fetch both of this info. But since the OpenMiningRound has been archived, it wont be in ACS, so fetch from update_history will be required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah I see. I now realize my mistake. I was thinking of the IssuingMiningRound. Your request makes sense. Please add the fields to copy the info from the OpenMiningRound.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another related concern is that the test code is still based on AppRewardCoupon count. Specifically

runNextIssuance
token-standard/splice-token-standard-test/daml/Splice/Testing/Registries/AmuletRegistry.daml

runNextIssuanceD
daml/splice-dso-governance-test/daml/Splice/Scripts/DsoTestUtils.daml

And we even use these APIs as it is in Splice.Scripts.TestRewardAccountingV2.
Do you think we should do any modifications to these?

The scala is simply injecting the totalFeaturedAppRewardCoupons via offline calcs, so the flow is more or less identical to the existing daml testing even in the case of RewardVersion_TrafficBasedAppRewards. And as long as the totalFeaturedAppRewardCoupons is being set properly it would work fine.

Copy link
Copy Markdown
Contributor

@dfordivam dfordivam Apr 13, 2026

Choose a reason for hiding this comment

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

We could pass in Optional Decimal to runNextIssuance and use that alongwith an assert on rewardConfig, to keep the logic in sync with the scala.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did implement this, see PR #4724

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. yes, good call.

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