Skip to content

Conversation

@ray-roestenburg-da
Copy link
Contributor

@ray-roestenburg-da ray-roestenburg-da commented Jan 14, 2026

Fixes #3503

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).

@ray-roestenburg-da ray-roestenburg-da force-pushed the ray/remove-balance-endpoints/3503 branch from d9b8581 to 291e5fd Compare January 14, 2026 12:55
}
}

private def lookupTotalSupplyByLatestRound()(implicit ec: ExecutionContext, tc: TraceContext) =
Copy link
Contributor Author

@ray-roestenburg-da ray-roestenburg-da Jan 14, 2026

Choose a reason for hiding this comment

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

@OriolMunoz-da please check if these changes (and further below in this file) are OK, (ignoring noHoldingFeesOnTransfers) otherwise I have to keep getTotalAmuletBalance around in the store, but I would prefer to just delete more.

Copy link
Contributor

Choose a reason for hiding this comment

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

noHoldingFeesOnTransfers.supported is true for all networks now, so you shouldn't need the fallback
the issue is in tests though, because it depends on the latest ACS snapshot which might not be available (as it's computed every 3h)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

}
}

private def lookupTotalSupplyByLatestRound()(implicit ec: ExecutionContext, tc: TraceContext) =
Copy link
Contributor

Choose a reason for hiding this comment

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

noHoldingFeesOnTransfers.supported is true for all networks now, so you shouldn't need the fallback
the issue is in tests though, because it depends on the latest ACS snapshot which might not be available (as it's computed every 3h)

sv1ScanBackend
.lookupInstrument("Amulet")
.flatMap(_.totalSupply)
.valueOrFail("total balance not yet defined")
Copy link
Contributor

Choose a reason for hiding this comment

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

for example here, how do you know that a snapshot was generated?
(maybe there's a forceSnapshot somewhere that I'm not seeing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

always forcing now in getTotalAmuletBalance in ScanAppReference

Copy link
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.

Lgtm minus the comments Oriol already made, thank you!

I assume we already discussed this with product (probably while I was out), if not let's ofc do that so noone gets surprised by it.

sql"""
select greatest(
0,
sum_cumulative_change_to_initial_amount_as_of_round_zero -
Copy link
Contributor

Choose a reason for hiding this comment

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

we should also be able to cleanup the dbs and txlog parsers further, perhaps in multiple steps:

  1. make the columns here and in the scan txlog only required for the balances nullable
  2. stop writing those fields
  3. eventually nuke those columns

I'd suggest to move this to separate PRs but let's make sure we push through at least 1 and 2 as it meaningfully simplifies the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add another PR follow up for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added #3563 for leftovers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do this later though, rather first see what more can be removed and then simply do it all at once.


- Scan

- ``/v0/total-amulet-balance`` and ``/v0/wallet-balance`` endpoints have been removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest mentioning the replacement endpoints here and also mention that the existing endpoints are already deprecated. "deprecated endpoints have been removed in favor of X" just sounds much nicer than "Y has been removed"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ray-roestenburg-da
Copy link
Contributor Author

ray-roestenburg-da commented Jan 15, 2026

Also removed wallet-balance usage in scan_txlog.py and everything that was using it (removed option --scan-balance-assertions)

@ray-roestenburg-da ray-roestenburg-da force-pushed the ray/remove-balance-endpoints/3503 branch 2 times, most recently from 7e1cd6b to c483204 Compare January 15, 2026 12:31
@ray-roestenburg-da
Copy link
Contributor Author

FYI I will not merge this until I get OK from Product (we have discussed before, but to be certain)

Copy link
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.

thanks!

)
def getTotalAmuletBalance(): Option[BigDecimal] = {
val _ = forceAcsSnapshotNow()
lookupInstrument("Amulet")
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason not to make this an error instead of an optional? it seems like we really always expect amulet to be present

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah can do that, it's only used for testing now anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

)
def getTotalAmuletBalance(): Option[BigDecimal] = {
val _ = forceAcsSnapshotNow()
lookupInstrument("Amulet")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: read this from whatever config we have for this instead of hardcoding the string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok done

"../token-standard/dependencies/canton-json-api-v2/openapi-ts-client": {
"name": "@lfdecentralizedtrust/canton-json-api-v2",
"version": "3.4.0-SNAPSHOT",
"version": "3.4.8-SNAPSHOT",
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand why this changed now but it does seem correct 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also don't know, I did a npmFix and npmLint at some point..

@ray-roestenburg-da ray-roestenburg-da force-pushed the ray/remove-balance-endpoints/3503 branch 2 times, most recently from a9745e9 to b0ad3c4 Compare January 15, 2026 14:16
Copy link
Contributor

@OriolMunoz-da OriolMunoz-da left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@ray-roestenburg-da ray-roestenburg-da force-pushed the ray/remove-balance-endpoints/3503 branch 2 times, most recently from 1e57f3a to d4e02d9 Compare January 15, 2026 17:11
@ray-roestenburg-da
Copy link
Contributor Author

/cluster_test

@github-actions
Copy link

Deploy cluster test triggered for Commit 90b485e6f06c872792e27907b008f730a2e4e2ce in , please contact a Contributor to approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/47691

ray-roestenburg-da and others added 10 commits January 23, 2026 09:34
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
…e/ScanAppReference.scala

Co-authored-by: moritzkiefer-da <45630097+moritzkiefer-da@users.noreply.github.com>
Signed-off-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
Signed-off-by: Raymond Roestenburg <raymond.roestenburg@digitalasset.com>
@ray-roestenburg-da ray-roestenburg-da force-pushed the ray/remove-balance-endpoints/3503 branch from 90b485e to 0eb5150 Compare January 23, 2026 09:39
@ray-roestenburg-da ray-roestenburg-da enabled auto-merge (squash) January 23, 2026 09:41
@ray-roestenburg-da ray-roestenburg-da merged commit 3b59f60 into main Jan 23, 2026
44 checks passed
@ray-roestenburg-da ray-roestenburg-da deleted the ray/remove-balance-endpoints/3503 branch January 23, 2026 09:51
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.

Remove total-amulet-balance and wallet-balance APIs

4 participants