[DRAFT] SV weight management fully on-ledger#5567
Conversation
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Co-authored-by: Itai Segall <itai.segall@digitalasset.com> Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
|
@isegall-da |
|
Thanks @jose-velasco-ieu great work! |
…hts.daml Co-authored-by: Itai Segall <itai.segall@digitalasset.com> Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
| -- ^ The full beneficiary distribution to set. The total beneficiary | ||
| -- weight must be less than or equal to the SV weight in 'DsoRules'. | ||
| -- Any unassigned SV weight is created for the SV itself. | ||
| | ClearBeneficiaries with |
There was a problem hiding this comment.
what's the difference between this and just setting SetBeneficiaries (Some cid) []?
There was a problem hiding this comment.
None, but ClearBeneficiaries is probably more semantic
There was a problem hiding this comment.
I think I'd lean towards having one less choice to maintain and test instead
There was a problem hiding this comment.
somewhat related to my discussion below on whether we should ensure this always exists though so let's maybe resolve that first
| let isSvOperator = flip Map.member svs | ||
| require "svOperator is an SV operator" $ isSvOperator svOperator | ||
|
|
||
| unless (hostedSvHasBeenOnboardedBefore newSvName this) $ |
There was a problem hiding this comment.
do I read it correctly that this is intended for the migration path so you call it for all existing SVs? if so probably worth documenting this here
There was a problem hiding this comment.
Not really. This relates to the case where a hosted SV has been offboarded and then onboarded again.
As I mention above, I mirrored the current SV onboard/offboard flow. In that flow, when an SV (SV operator) is offboarded, the corresponding SvRewardState is not archived. So if we onboard it back, we need reuse the old SvRewardState contract.
In the proposed migration path, I archive the SvRewardState contract of the SV operator. Then, here, I create SvRewardState contracts for the hosted SVs.
There was a problem hiding this comment.
I think this is solved, right @moritzkiefer-da ?
| data SvMigrationData = SvMigrationData with | ||
| svParty : Party -- ^ The SV party. | ||
| svName : Text -- ^ Human-readable name; must be unique. | ||
| svParticipantId : Text -- ^ Participant ID of the SV. |
There was a problem hiding this comment.
I don't understand why you need participant ids for random non-node operator svs.
There was a problem hiding this comment.
I can remove it (again, I mirrored the SV node flows).
@isegall-da
There was a problem hiding this comment.
I’ll proceed with removing svParticipantId unless there are objections.
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
…vRewardBeneficiaries with empty beneficiaries to the onboard flow of a hosted SV Signed-off-by: Jose Velasco <jose.velasco@intellecteu.com>
Summary
This PR adds a Daml draft for the new on-ledger SV weight model. The goal is to represent SV weights fully on-ledger, including SV beneficiary weights.
Main changes:
HostedSvInfoand thehostedSvs/offboardedHostedSvsfields to theDsoRulestemplate to represent SV reward weights separately from legacy SV node/operator state.SvInfofor SV node/operator information, but marksjoinedAsOfRoundandsvRewardWeightas deprecated in favor ofHostedSvInfo.DsoRules_AddHostedSvto add hosted SVs,DsoRules_UpdateHostedSvRewardWeightto update hosted SV weights, andDsoRules_OffboardHostedSvto offboard hosted SVs.DsoRules_AddSvNode, which replacesDsoRules_AddSvfor adding SV nodes. UnlikeDsoRules_AddSv, it does not takenewSvRewardWeightorjoinedAsOfRound, since SV nodes no longer have reward weight attached in the new model.SvRewardBeneficiariestemplate to optionally configure on-ledger beneficiary splits for an SV’s rewards.DsoRules_SetSvRewardBeneficiariesto create, update, or clear beneficiary distributions.DsoRules_MigrateHostedSvs, to migrate an SV operator’s legacy reward weight into hosted SV entries.DsoRules_ReceiveSvRewardCoupon_V2, which creates reward coupons for all SVs operated by an SV operator using hosted SV weights and optional beneficiary splits.DsoRules_UpdateSvRewardWeightandDsoRules_ReceiveSvRewardCoupon, once all SVs have migrated tohostedSvs.Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines