feat: grant purchased traffic on the dedicated sequencer - #21
Conversation
Drop the speculative "yet" from the domain time comment, and call the init step what the variable already calls it. Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
MIGRATION_ID is frozen network wide and logical synchronizer upgrades carry a serial id instead, so the store's partition can never move and resolving it bought nothing. Drops resolveDomainMigrationId and its scan fallback. It also lines the store's stamp up with the payload.migrationId == 0L check in the contract filter, so there is no longer a second migration id a few lines away meaning something different. Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
…at/sync-operator-reconcile-traffic
Binds the reusable reconciliation trigger from #15 to the operator's own sequencer and store, so purchases naming its synchronizer are granted there. Enables traffic control on the splitwell synchronizer in the canton bootstrap, since a member only gets a traffic state, and so can only be granted extra traffic, on a synchronizer that has it. splitwellUpgrade is left alone. The integration test registers the synchronizer by DSO vote, buys traffic for it with the registration disclosed, and asserts the operator raises the limit on that sequencer. It calls the buy choice directly because the wallet path does not carry a registration yet. Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
Checks the member has no granted traffic before any purchase, then that a purchase lands as exactly its amount and a second one raises the limit by exactly its amount, exercising the cumulative-limit arithmetic. The buy moves into a helper so each purchase re-reads the transfer context and amulets. Also trims the trigger and test class docs. Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
…o feat/sync-operator-reconcile-traffic
| // Canton's own defaults. A member only gets a traffic state, and so can only be granted extra | ||
| // traffic, on a synchronizer that has traffic control enabled. | ||
| val defaultTrafficControlParameters = TrafficControlParameters( | ||
| maxBaseTrafficAmount = NonNegativeLong.tryCreate(10 * 20 * 1024), |
There was a problem hiding this comment.
I thought we want to run these without free traffic?
There was a problem hiding this comment.
We will actully set it to zero on this issue ChainSafe/canton-extending-mainnet#38
| extraTrafficLimit(member) shouldBe 0L | ||
| } | ||
|
|
||
| clue("a purchase is granted on the splitwell sequencer") { |
There was a problem hiding this comment.
use actAndCheck instead of clue + eventually
| ).foreach((bootstrapOtherDomain _).tupled) | ||
| // splitwell is the only non-global synchronizer a sync operator can be pointed at today, so it | ||
| // carries traffic control; see apps/app/src/test/resources/sync-operator-topology.conf. | ||
| bootstrapOtherDomain("splitwell", splitwellSequencer, splitwellMediator, enableTrafficControl = true) |
There was a problem hiding this comment.
I suspect this is not gonna work well on CI. Any test that currently uses splitwell might now run out of traffic and will fail. And going back to my earlier comment, if you disable free traffic they definitely fail.
I would suggest to make this conditional on some environment variable and then add a dedicated CI job for dedicated synchronizer tests where you set this. that way the existing tests are unaffected.
Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
Signed-off-by: sadiq1971 <sadiqurr8@gmail.com>
What this does
ReconcileDedicatedSequencerTrafficTriggerbinds the reusable base from feat: extract reusable member-traffic reconciliation trigger (Scala) #15 to the operator's own sequencer and store. The three hooks are the whole subclass: the sequencer connection the app already holds,getTotalPurchasedMemberTrafficscoped to this operator's synchronizer, and no offset.bootstrap-canton.sc. A member only gets a traffic state, and so can only be granted extra traffic, on a synchronizer that has traffic control enabled;bootstrapOtherDomainnever set it. Opt-in per synchronizer, sosplitwellUpgradeis unchanged.trafficBalanceReconciliationDelayreturns to the config. It was removed in feat: sync operator app skeleton #16 as unread, which it was until this trigger existed.The test
Registers the synchronizer by DSO vote (
DsoRules_RegisterSynchronizer), buys traffic for it, and asserts the operator raisedextraTrafficLimiton that sequencer by the purchased amount.