Skip to content

Allow admin to expire V2.Allocations using Allocation_Cancel#5746

Merged
meiersi-da merged 1 commit into
token-standard-v2-upcomingfrom
meiersi/ts2/expire-allocation-v2
Jun 1, 2026
Merged

Allow admin to expire V2.Allocations using Allocation_Cancel#5746
meiersi-da merged 1 commit into
token-standard-v2-upcomingfrom
meiersi/ts2/expire-allocation-v2

Conversation

@meiersi-da
Copy link
Copy Markdown
Contributor

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 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).

Comment thread daml/splice-amulet/daml/Splice/AmuletAllocationV2.daml Outdated
Comment thread daml/splice-amulet/daml/Splice/ExternalPartyAmuletRules.daml Outdated
case (view alloc).expiresAt of
None -> fail "Cannot expire allocation without an expiry time"
Some expiresAt -> do
assertDeadlineExceeded "allocation.expiresAt" expiresAt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand why you need this check. You say you need this to avoid expiry with DSO party as executor. But then the allocation cancel implementation also checks expiry if executors = dso.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So what I'm worried about is that an SV calls the DsoRules_ExpireAmuletAllocationsV2 with an allocation that has executors = [dso] before the allocation expires. Without this check that would go through; and would for example be a problem for staking: any SV could cancel a stake of any other SV.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh because the if is the wrong way around and this only checks if dso is not the executor, I see

@meiersi-da meiersi-da changed the title DRAFT: allow admin to expire V2.Allocation using Allocation_Cancel Allow admin to expire V2.Allocations using Allocation_Cancel Jun 1, 2026
@meiersi-da meiersi-da force-pushed the meiersi/ts2/expire-allocation-v2 branch from 7757ea3 to 015c821 Compare June 1, 2026 07:04
import Daml.Script
import DA.Time

import Splice.Round()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorted and grouped imports for easier understanding.

exerciseCmd dsoRulesCid DsoRules_Amulet_ExpireTransferInstructions with
amuletRulesCid = amuletRulesCid
transferInsts = expireBatchChoice
sv = sv1
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like your VS code is not automatically trimming trailing whitespace. Consider turning on https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig

so that your setup follows: https://github.com/canton-network/splice/blob/main/.editorconfig

@meiersi-da meiersi-da marked this pull request as ready for review June 1, 2026 07:05
Copy link
Copy Markdown
Contributor

@moritzkiefer-da moritzkiefer-da left a comment

Choose a reason for hiding this comment

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

thanks

Fixes #5558 [static]

Signed-off-by: Simon Meier <simon@digitalasset.com>
@meiersi-da meiersi-da force-pushed the meiersi/ts2/expire-allocation-v2 branch from 015c821 to 0595404 Compare June 1, 2026 07:47
@meiersi-da meiersi-da merged commit f5cf646 into token-standard-v2-upcoming Jun 1, 2026
44 checks passed
@meiersi-da meiersi-da deleted the meiersi/ts2/expire-allocation-v2 branch June 1, 2026 08:02
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.

3 participants