Skip to content

feat: serve the registration for explicit disclosure - #29

Merged
salindne merged 7 commits into
mainfrom
feat/scan-serve-registration
Sep 8, 2026
Merged

feat: serve the registration for explicit disclosure#29
salindne merged 7 commits into
mainfrom
feat/scan-serve-registration

Conversation

@salindne

@salindne salindne commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Closes ChainSafe/canton-extending-mainnet#42

Summary: Scan serves the RegisteredSynchronizer at GET /v0/synchronizers/{synchronizer_id}/registration as a ContractWithState, so a buying validator can disclose it on AmuletRules_BuyMemberTraffic; the ACS store is the only source of the created event blob, since update history drops it by design.

Review fixes: the query now filters on a new indexed scan_acs_store.registered_synchronizer_id instead of a jsonb extraction. Split the way V072 did, so the column is in the migration and the concurrent index is in SqlIndexInitializationTrigger. Operator change is not supported, so newest-wins is gone; order by contract_id remains because duplicates are still representable and every Scan must return the same row for bftCall.

Adds GET /v0/domains/{domain_id}/registration, returning the
RegisteredSynchronizer as a ContractWithState so a buying validator can disclose
it on AmuletRules_BuyMemberTraffic. The buyer is neither signatory nor observer,
and update history drops the created event blob by design, so the ACS store is
the only source.

Orders by created_at desc, contract_id: duplicates are representable during an
operator change, a stale pick would credit the superseded operator, and the
tiebreak keeps every Scan in agreement under bftCall.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
Reshuffles the wall-clock-time sharding, which is recomputed per run. The
previous grouping put SplitwellIntegrationTest under enough co-tenancy to
starve its base traffic on the splitwell synchronizer.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
@salindne
salindne requested a review from sadiq1971 September 3, 2026 21:12
Say what is surprising about the code rather than why the change is right.
The reasoning is in the commit messages and the PR.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
@salindne salindne self-assigned this Sep 4, 2026

@moritzkiefer-da moritzkiefer-da left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

thx, queries need more work

Comment thread apps/scan/src/main/openapi/scan.yaml Outdated
"404":
$ref: "../../../../common/src/main/openapi/common-external.yaml#/components/responses/404"

/v0/domains/{domain_id}/registration:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
/v0/domains/{domain_id}/registration:
/v0/synchronizers/{synchronizer_id}/registration:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread apps/scan/src/main/openapi/scan.yaml Outdated
Comment on lines +1134 to +1135
synchronizer. Served from the ACS store, so the response carries the created event blob
a buyer needs in order to disclose it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
synchronizer. Served from the ACS store, so the response carries the created event blob
a buyer needs in order to disclose it.
synchronizer.

that's not useful info for a user of that API

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Applied your suggestion verbatim

domainMigrationId,
RegisteredSynchronizer.COMPANION,
additionalWhere = sql"""
and acs.create_arguments->>'synchronizerId' = ${lengthLimited(synchronizerId)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

that's gonna do a linear scan, that's no good. we need to add a new column to the acs store and an index for that to make this a better query.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. V075 adds scan_acs_store.registered_synchronizer_id, populated at ingestion, and the query filters on it. Followed V072's split.

}
}

// Both registrations are live during an operator change; the superseded one would

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I thought we said we don't support operator change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right, oops! Newest-wins and its test are gone.

The query extracted synchronizerId from create_arguments on every candidate row.
V075 adds scan_acs_store.registered_synchronizer_id, populated at ingestion, and
the query filters on it. The column goes in the migration and the concurrent
index in SqlIndexInitializationTrigger, the way V072 split the same operation.

Operator change is not supported, so the newest-wins ordering and its test are
gone. order by contract_id stays: the template has no key and
DsoRules_RegisterSynchronizer creates unconditionally, so duplicates are still
representable, and every Scan has to return the same row for bftCall.

Renames the path to /v0/synchronizers/{synchronizer_id}/registration, which needs
a new rate-limit prefix and the regenerated cluster configs that follow from it.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>

@moritzkiefer-da moritzkiefer-da left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice thanks

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>

# Conflicts:
#	apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SyncOperatorTrafficIntegrationTest.scala
@salindne
salindne merged commit cd317bd into main Sep 8, 2026
63 checks passed
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.

[P2-E7.2] Serve the registration for disclosure

2 participants