You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the independent review of #255 (finding #1). SetupCouponReassignmentDelegation.executeImpl re-validates the split at execute time (non-empty, ≤20, each percentage in (0,1], sum == 1.0) as defense-in-depth for a direct ledger submit that bypasses DecMan's HTTP API. It is missing the uniqueness check that the other guards mirror and that the on-ledger RewardCoupon_AssignBeneficiaries enforces (require "Beneficaries are unique", splice-amuletAmulet.daml).
The Rust-side guard was added in #255 (validate_reward_beneficiaries now rejects duplicates at propose time), so the realistic path is covered. This issue tracks completing the DAML executeImpl mirror.
Adding the assert changes the compiled governance-rewards-v1 DAR. The current 0.1.3 (package-id 1ff1b18c89d71a4176c9cf4d5eff215127b2a3297136a0e17be5125f27611a4f) is already vetted on devnet (confirmed via __packages) and is the committed releases/v1/governance-rewards-v1-0.1.3.dar the localnet IT distributes. Re-hashing 0.1.3 in place would collide with the vetted package (same name+version, different hash). The clean path is a version bump, not an in-place regen.
Add to SetupCouponReassignmentDelegation.executeImpl (after the percentage check):
assertMsg "beneficiaries must be unique" (unique (map (.beneficiary) beneficiaries))
(add import DA.List (unique)).
Repoint all governance-rewards-v1-0.1.3.dar pins → 0.1.4: the data-dependencies in the sibling daml.yaml files, crates/decman/tests/common/phases/distribute_dars.rs (DAR_FILES), and add releases/v1/governance-rewards-v1-0.1.4.dar. (#governance-rewards-v1 alias resolves by name, so default_package_config is unaffected.)
Re-add the DAML regression test (was staged in CIP-104 Mode A coupon-reassignment automation #255, removed with the assert): test_setup_duplicate_beneficiary_rejected — setupExecuteMustFail f [m1] [rb m2 0.5, rb m2 0.5].
dpm build --all; dpm test in governance-rewards-assign-test; deploy + vet 0.1.4 on devnet (additive alongside 0.1.3 — no un-vetting needed).
Priority
Low. Defense-in-depth only: the Rust guard (propose time) and the runtime require "unique" (assign time) already bracket this — the worst case without it is a bricked-but-harmless delegation created via a deliberate API bypass, never a misassignment. Bundle with the next governance-rewards version bump so the DAR churn/re-vet cost is shared.
Context
From the independent review of #255 (finding #1).
SetupCouponReassignmentDelegation.executeImplre-validates the split at execute time (non-empty, ≤20, each percentage in (0,1], sum == 1.0) as defense-in-depth for a direct ledger submit that bypasses DecMan's HTTP API. It is missing the uniqueness check that the other guards mirror and that the on-ledgerRewardCoupon_AssignBeneficiariesenforces (require "Beneficaries are unique",splice-amuletAmulet.daml).The Rust-side guard was added in #255 (
validate_reward_beneficiariesnow rejects duplicates at propose time), so the realistic path is covered. This issue tracks completing the DAMLexecuteImplmirror.Why it was deferred (not done in #255)
Adding the assert changes the compiled
governance-rewards-v1DAR. The current0.1.3(package-id1ff1b18c89d71a4176c9cf4d5eff215127b2a3297136a0e17be5125f27611a4f) is already vetted on devnet (confirmed via__packages) and is the committedreleases/v1/governance-rewards-v1-0.1.3.darthe localnet IT distributes. Re-hashing0.1.3in place would collide with the vetted package (same name+version, different hash). The clean path is a version bump, not an in-place regen.What to do
governance-rewards0.1.3→0.1.4(daml/governance-rewards/daml.yaml).SetupCouponReassignmentDelegation.executeImpl(after the percentage check):import DA.List (unique)).governance-rewards-v1-0.1.3.darpins →0.1.4: thedata-dependenciesin the siblingdaml.yamlfiles,crates/decman/tests/common/phases/distribute_dars.rs(DAR_FILES), and addreleases/v1/governance-rewards-v1-0.1.4.dar. (#governance-rewards-v1alias resolves by name, sodefault_package_configis unaffected.)test_setup_duplicate_beneficiary_rejected—setupExecuteMustFail f [m1] [rb m2 0.5, rb m2 0.5].dpm build --all;dpm testingovernance-rewards-assign-test; deploy + vet 0.1.4 on devnet (additive alongside 0.1.3 — no un-vetting needed).Priority
Low. Defense-in-depth only: the Rust guard (propose time) and the runtime
require "unique"(assign time) already bracket this — the worst case without it is a bricked-but-harmless delegation created via a deliberate API bypass, never a misassignment. Bundle with the nextgovernance-rewardsversion bump so the DAR churn/re-vet cost is shared.