Skip to content

feat: per-synchronizer validator top-up configuration - #28

Merged
salindne merged 7 commits into
mainfrom
feat/per-sync-topup-config
Sep 7, 2026
Merged

feat: per-synchronizer validator top-up configuration#28
salindne merged 7 commits into
mainfrom
feat/per-sync-topup-config

Conversation

@salindne

@salindne salindne commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Closes ChainSafe/canton-extending-mainnet#110

Summary: domains.extra gains per-synchronizer top-up settings and a derived topupTargets, so the trigger fan-out has an input, and the top-up interval check now runs over every synchronizer instead of reading domains.global alone.

Adds buy-extra-traffic settings to domains.extra entries via a new two-field
ExtraSynchronizerTopupConfig, and a topupTargets accessor returning the
non-zero targets with global first. That accessor is the handoff to the
trigger fan-out.

A narrower type than BuyExtraTrafficConfig, whose grpcDeadline is read once
app-wide and has no per-synchronizer plumbing. Existing {alias, url} entries
are unchanged; targetThroughput defaults to 0.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
The check read domains.global.buy-extra-traffic only, so a per-synchronizer
min-topup-interval set below the polling interval escaped it. It now iterates
topupTargets, which already drops zero-throughput entries, so the global case
stays covered by the general check rather than by a separate one.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
@salindne
salindne marked this pull request as ready for review September 3, 2026 18:45
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.

thanks!


/** Extra traffic purchase settings for a single synchronizer.
*
* Narrower than [[BuyExtraTrafficConfig]], which also carries `grpcDeadline`. That one is

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what's the argument for not wanting a grpc deadline here?

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.

No good argument, this was wrong. Dropped the narrow type and reused BuyExtraTrafficConfig, which also removed its two pureconfig instances and most of topupTargets

canton.validator-apps.validator_backend.domains.extra.{{ $ii }} = {
alias = {{ $domain.alias | quote }}
url = {{ $domain.url | quote }}
{{- if $domain.topup }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

with usually works quite nice for this stuff and is a bit easier to read imho

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, thanks!

topup {
target-throughput = {{ $domain.topup.targetThroughput }}
{{- if $domain.topup.minTopupInterval }}
min-topup-interval = {{ $domain.topup.minTopupInterval }}

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 is a mandatory parameter for the global synchronizer, why should it not be mandatory here?

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.

changed it to align

"url": {
"type": "string"
},
"topup": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

factor this out into a def and reuse it between the global synchronizer schema and this

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

The narrower ExtraSynchronizerTopupConfig left out grpcDeadline on the grounds
that it had no per-synchronizer plumbing. It does: ValidatorApp passes it to
ValidatorAutomationService, which passes it to TopupMemberTrafficTrigger, and
that trigger is what the fan-out instantiates per synchronizer. Reusing the
global type drops a case class, its two pureconfig instances and most of
topupTargets.

The chart follows: one $defs.topup shared by the global block and the extra
synchronizers, so min-topup-interval is required in both and the template can
drop its inner guard.

Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
Signed-off-by: Sebastian Lindner <33971232+salindne@users.noreply.github.com>
@salindne
salindne merged commit dbd7d88 into main Sep 7, 2026
116 of 118 checks passed
@salindne
salindne deleted the feat/per-sync-topup-config branch September 11, 2026 10:26
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-E5.6] Per-synchronizer validator top-up configuration

2 participants