Skip to content

Conversation

@OriolMunoz-da
Copy link
Contributor

@OriolMunoz-da OriolMunoz-da commented Aug 20, 2025

Fixes #829

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

@OriolMunoz-da
Copy link
Contributor Author

/cluster_test

@github-actions
Copy link

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

@OriolMunoz-da OriolMunoz-da changed the title Oriol/packagename stores interface fallback Switch to relying on package names instead of module names Aug 25, 2025
}
}

"prevent against ingestion of same (moduleName, entityName) with different package name - via interface fallback" in {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test is the best summary for the reason of being of this PR

Comment on lines 1 to 10
-- strictly not necessary, but lets us define the constraint as mandatory afterwards,
-- and also makes index creation faster since there's no data to index
truncate table acs_store_template cascade;
truncate table user_wallet_acs_store cascade;
truncate table external_party_wallet_acs_store cascade;
truncate table validator_acs_store cascade;
truncate table sv_acs_store cascade;
truncate table dso_acs_store cascade;
truncate table scan_acs_store cascade;
truncate table splitwell_acs_store cascade;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

double-check me that this is not a bad idea

Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that all descriptors are bumped

* another list; that is why the contract ID by itself cannot be used by
* itself as the source of the sort key.
*/
def listAssignedContractsNotOnDomainN(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused except in a test (also deleted)

storeId: AcsStoreId,
migrationId: Long,
where: SQLActionBuilder,
companion: C,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should've been the case all along, instead of having where ti_q_n = ? on every query

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed, thanks for pulling through that simplification!

MultiDomainAcsStoreTest.generatedCoids.value.size should (be >= 900 and be <= 1000)
}

"read assignment-mismatched contracts in a stable order" in {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tested listAssignedContractsNotOnDomainN, deleted

@OriolMunoz-da
Copy link
Contributor Author

/cluster_test

@OriolMunoz-da OriolMunoz-da marked this pull request as ready for review August 25, 2025 15:31
@github-actions
Copy link

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

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.

Very nice, thanks a lot!

Please run a performance test before merging so we can avoid surprises for long downtimes due to ACS backfilling.

storeId: AcsStoreId,
migrationId: Long,
where: SQLActionBuilder,
companion: C,
Copy link
Contributor

Choose a reason for hiding this comment

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

agreed, thanks for pulling through that simplification!

@@ -0,0 +1,362 @@
-- strictly not necessary, but lets us define the constraint as mandatory afterwards,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know what performance we get for a full ACS backfill? I'm a bit nervous about this given that the ACS queries are known to not perform well without pruning and there is no pruning atm on SV participants.

How about on CILR you take one SV (maybe best to use the SV runbook given that it resets daily anyway so if it goes wrong we can just reset again) manually force a reingestion by dropping the data from the table and last ingested offset?

If it does take too long, the easy short term option we have is to merge this into the 3.4 branch only. Afaict, there isn't an immediate need to have this be on 3.3.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about on CILR you take one SV (maybe best to use the SV runbook given that it resets daily anyway so if it goes wrong we can just reset again) manually force a reingestion by dropping the data from the table and last ingested offset?

What is an "ACS backfill"? After truncating the ACS tables and bumping the store descriptor, the new ACS store will be initialized from the ACS endpoint of the ledger API, is that what you meant? Apart from the participant being slow to deliver the ACS, we are not batching SQL inserts when consuming the ACS

override def ingestAcs() = {
    ...
    // TODO (#989): batch inserts
}

and we load the whole ACS into one in-memory structure:

private def ingestAcsAndInFlight(offset: Long) = {
    ...
    // TODO(#863): stream contracts instead of ingesting them as a single Seq

so I agree that one test on CILR is a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

is that what you meant?

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

@OriolMunoz-da So given the very rapid increase in ACS size on mainnet I'm rather nervous about merging this atm. Can we hold off on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or merge it into 3.4? There we will ingest the acs anyway so it's not making anything worse

Signed-off-by: Oriol Muñoz <[email protected]>
@OriolMunoz-da
Copy link
Contributor Author

timings for ACS reingestion:

a bit more than 2m for scan, logs:
image

and SV app doesn't reingest, see #2041

@OriolMunoz-da OriolMunoz-da removed the request for review from pawelperek-da October 1, 2025 17:12
Copy link
Contributor

@rautenrieth-da rautenrieth-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!

@OriolMunoz-da OriolMunoz-da changed the base branch from main to canton-3.4 October 9, 2025 11:29
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.

Nice work thank you!

@OriolMunoz-da OriolMunoz-da merged commit 6447ce5 into canton-3.4 Oct 10, 2025
56 checks passed
@OriolMunoz-da OriolMunoz-da deleted the oriol/packagename-stores-interface-fallback branch October 10, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to relying on package names instead of module names

4 participants