Skip to content

SvApp: For TBA use total app activity in SummarizingMiningRoundTrigger#5903

Draft
dfordivam wants to merge 6 commits into
mainfrom
dfordivam/cip-104-summarizing-totals
Draft

SvApp: For TBA use total app activity in SummarizingMiningRoundTrigger#5903
dfordivam wants to merge 6 commits into
mainfrom
dfordivam/cip-104-summarizing-totals

Conversation

@dfordivam

Copy link
Copy Markdown
Contributor

Fixes #5849

Note: TrafficBasedRewardsTimeBasedIntegrationTest is broken currently, and require bootstrap with TBA enabled support #5624

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 an upgrade test is required, comment /upgrade_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.
  • If a logical synchronizer upgrade test is required (from canton-3.5), comment /lsu_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).

Signed-off-by: Divam <dfordivam@gmail.com>
Signed-off-by: Divam <dfordivam@gmail.com>
Signed-off-by: Divam <dfordivam@gmail.com>
Signed-off-by: Divam <dfordivam@gmail.com>
Signed-off-by: Divam <dfordivam@gmail.com>
Signed-off-by: Divam <dfordivam@gmail.com>
@dfordivam

Copy link
Copy Markdown
Contributor Author

@meiersi-da This draft PR is ready for a first look. The CI won't pass on this yet, as it require TBA bootstrap support.

@meiersi-da meiersi-da left a comment

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.

Thanks. Looks good.

Comment on lines +166 to +170
val appRewardsInCc =
(BigDecimal(totalAppActivity) * BigDecimal(trafficPrice) / BigDecimal(
payload.amuletPrice
)).setScale(10, BigDecimal.RoundingMode.HALF_EVEN)
AppRewardCouponsSum(featured = appRewardsInCc, unfeatured = BigDecimal(0))

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'm a bit nervous about repeating this computation here. I'd prefer to keep it close to Scan where it is also tested.

Scan currently doesn't deliver this number, but it could: just sum these two values:

-- Total app reward amount minting allowance across all app providers in the given round.
-- Measured in Amulet.
total_app_reward_minting_allowance decimal(38,10) not null,
-- Total amount of app rewards that were burned due to being below the threshold.
total_app_reward_thresholded decimal(38,10) not null,

The change I'd actually suggest is to expose all the numbers from the app_reward_round_totals alongside the ones from the app_activity_round_totals. I suspect these could be helpful for debugging.

val Seq(lowestOpen, middleOpen, highestOpen) =
previousOpenRounds.map(_.contract.payload.round.number)

actAndCheck(timeUntilSuccess = 90.seconds)("advancing time", advanceTime(advanceWith))(

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.

why do we need 90 seconds for this to complete?

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.

SvApp: Use total app activity in SummarizingMiningRoundTrigger

2 participants