Skip to content

Derisking: two-party lock substitution. - #13

Draft
jonored wants to merge 5 commits into
dpak/cip-105-topup-allocationsfrom
jg/derisk/lock-substitution
Draft

Derisking: two-party lock substitution.#13
jonored wants to merge 5 commits into
dpak/cip-105-topup-allocationsfrom
jg/derisk/lock-substitution

Conversation

@jonored

@jonored jonored commented Aug 17, 2026

Copy link
Copy Markdown

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If an upgrade test is required, comment /upgrade_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a logical synchronizer upgrade test is required (from canton-3.5), comment /lsu_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

@meiersi-da meiersi-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.

Comment thread daml/splice-amulet/daml/Splice/GovernanceSubstitutionProposal.daml Outdated
-- Using amount becuase the settlement legs below will all have this amount. nextIterationFunding maps will vary.
let Some [(_, amount)] = TM.toList substituteWithAllocation.allocation.nextIterationFunding

require "lock subjects must match between substituted allocations" $

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd suggest we do not require this. If the substitution controllers on the target are OK with, then we should just allow it.

I'd also suggest that we don't encode the vesting state in the proposal. Instead just copy it over from substituted allocation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Should be copying the vesting state from the substituted allocation, yes, but this implementation allows each side to decide which allocation of theirs to use when they approve, which means we do need to at least bound the vesting parameters to protect the party that made the offer. It ought to be a less-than and a copy in the vesting case.

For governance it seems surprising to allow lock suppliers to freely reassign locks between subjects gated only by the substitution controllers. I did consider putting that check at offer creation time, though, to let a non-subject-altering and subject-altering path share the offer type.

Comment on lines +39 to +40
substituteWithCid : ContractId AmuletAllocationV2
topUpAllocationCid : Optional (ContractId AmuletAllocationV2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we have both of these options?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Both are present to allow a party to provide a substitution for a subject they already supply by increasing their allocation instead of producing a new one. This isn't for general top-up, which shouldn't get any form of propose-accept.

…daml

Co-authored-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Jonathan D.K. Gibbons <jonored@gmail.com>
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.

2 participants