diff --git a/.gitignore b/.gitignore index b53212a0d..60fc7dd56 100644 --- a/.gitignore +++ b/.gitignore @@ -153,3 +153,6 @@ vite.config.ts.timestamp-* .internal/* .venv .venv/* + +*.pyc +__pycache__/ \ No newline at end of file diff --git a/docs-main/global-synchronizer/splice-fundamentals/reward-sharing.mdx b/docs-main/global-synchronizer/splice-fundamentals/reward-sharing.mdx index 7600ecaf9..3d1718952 100644 --- a/docs-main/global-synchronizer/splice-fundamentals/reward-sharing.mdx +++ b/docs-main/global-synchronizer/splice-fundamentals/reward-sharing.mdx @@ -12,6 +12,10 @@ sharing allows the provider to distribute (part of) the minting allowance of the parties (beneficiaries) before minting, using the `assignBeneficiaries` API provided by the `splice-api-reward-assignment-v1` interface package. +Reward Sharing has a type discriminator that distinguishes between two modes: +- `built-in`: the validator performs beneficiary assignment and minting itself. This is the default type when the `type` key is omitted. +- `external`: beneficiary assignment is handled by automation outside the validator and the node leaves unassigned coupons untouched. + API reference docs for `splice-api-reward-assignment-v1` are [forthcoming](https://github.com/canton-network/cf-docs/issues/838). @@ -33,6 +37,7 @@ canton.validator-apps.validator_backend { reward-sharing-config-by-party = { # 30% -> charlie, 20% -> dave, remaining 50% stays with alice "alice::1220abc...def" = { + # if `type` is omitted, it defaults to "built-in" # Minimum remaining coupon TTL before sharing is triggered (default: 30h). # With the default 36h coupon TTL, 25h means sharing fires ~11h after creation. min-ttl-after-sharing = 25h @@ -45,6 +50,8 @@ canton.validator-apps.validator_backend { # External party bob sends 100% of rewards to a treasury party "bob::1220bbb...ccc" = { + # an example of `type` being explicitly declared as `built-in` + type = "built-in" min-ttl-after-sharing = 25h # Max coupons to share per trigger run (default: 100) batch-size = 50 @@ -56,6 +63,28 @@ canton.validator-apps.validator_backend { } ``` +## External Sharing + +Use the `external` type when beneficiary assignment is managed by automation outside the validator node. + +In this mode the validator node does not do the minting of the unassigned `Splice.Amulet.RewardCouponV2` coupons, to allow an external automation to do the assignment. To do the reward sharing build an external automation that lists unassigned `RewardCouponV2` contracts and assigns them to beneficiaries using the `assignBeneficiaries` API. + +Once the coupons are assigned, the validator app automation will mint the coupons assigned to the beneficiaries automatically if they are a local party. +If a beneficiary is an external party then set up a [minting delegation](/global-synchronizer/splice-fundamentals/rewards-minting) to mint the assigned coupons. The `batch-size` parameter limits the number of coupons minted per trigger run. + +Only keys `type` and `batch-size` are permitted for external configurations so any other keys in the config will cause an error. + +```hocon +canton.validator-apps.validator_backend { + reward-sharing-config-by-party = { + "charlie::1220ccc...ddd" = { + type = "external" + batch-size = 50 + } + } +} +``` + ## Batched Sharing The automation batches sharing to reduce traffic costs. Rather than sharing