Skip to content

PoC: tx history using events #4638

Draft
meiersi-da wants to merge 56 commits intotoken-standard-v2-upcomingfrom
meiersi/ts2/poc-event-history
Draft

PoC: tx history using events #4638
meiersi-da wants to merge 56 commits intotoken-standard-v2-upcomingfrom
meiersi/ts2/poc-event-history

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

CMD: gsr -f  -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' 'token-standard-test(?!-v)///token-standard-test-v1'
…1/ -> token-standard/splice-api-token-transfer-instruction-v2/

CMD: rsync -a token-standard/splice-api-token-transfer-instruction-v1/ token-standard/splice-api-token-transfer-instruction-v2/
…-standard/splice-token-standard-test-v2/

CMD: rsync -a token-standard/splice-token-standard-test-v1/ token-standard/splice-token-standard-test-v2/
… -> token-standard/splice-api-token-allocation-request-v2/

CMD: rsync -a token-standard/splice-api-token-allocation-request-v1/ token-standard/splice-api-token-allocation-request-v2/
…-v1/ -> token-standard/splice-api-token-allocation-instruction-v2/

CMD: rsync -a token-standard/splice-api-token-allocation-instruction-v1/ token-standard/splice-api-token-allocation-instruction-v2/
…n-standard/splice-api-token-allocation-v2/

CMD: rsync -a token-standard/splice-api-token-allocation-v1/ token-standard/splice-api-token-allocation-v2/
…tandard/splice-api-token-holding-v2/

CMD: rsync -a token-standard/splice-api-token-holding-v1/ token-standard/splice-api-token-holding-v2/
…daml/Splice/Testing/Apps/TradingApp.daml -> token-standard/splice-token-standard-test-v2/daml/Splice/Testing/Apps/TradingAppV2.daml

CMD: rsync -a token-standard/examples/splice-token-test-trading-app/daml/Splice/Testing/Apps/TradingApp.daml token-standard/splice-token-standard-test-v2/daml/Splice/Testing/Apps/TradingAppV2.daml
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<![Mm]etadata-)(?<![Mm]etadata/)(?<![Mm]etadata)(?<! )v1///v2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<![Mm]etadata-)(?<![Mm]etadata/)(?<![Mm]etadata)(?<! )V1///V2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<=[./])AmuletRegistry(?!V2)///AmuletRegistryV2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<=[./])RegistryApi(?!V2)///RegistryApiV2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<=[./])WalletClient(?!V2)///WalletClientV2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<!TokenApi)(?<=[./])Utils(?!V2)///UtilsV2'
CMD: gsr -f -i 'token-standard/*-v2/*' -e 'scripts/rename.sh' -e '**/release_notes.rst' -e '**/auth0.ts' -e 'token-standard/README.md' -e 'token-standard/CHANGELOG.md' -e '*.lock' -e 'nix/**' -e '*lock.json' -e '**/expected*.json' -e 'canton/**' '(?<=[./])TradingApp(?!V2)///TradingAppV2'
Make PoC compile after rebase

tests pass! *yay*

Reuse Lock and InstrumentId from V1

Add type-class based conversion

Communicate action graph in transfer instr

partial work towards v1 transfer

Base Amulet implementation changes on V1

Add conversion of instrumentId and lock

make tests pass and polish conversion utilities

Use V1 views as the base impl. for Amulet

Switch to multiple actors on transfer instructions

Split AmuletAllocation and AmuletAllocationV2

Remove accidentally committed file

external amulet rules with inline two-step tfer

Revert "external amulet rules with inline two-step tfer"

This reverts commit 0af6c68.

Switch to a list of parties for the executors

switch allocationfactory to actors

partial work towards V1/V2 alloc compatibility

partial implemenation of V2 on AmuletAllocation

Move settlement implementation into generic utils

write generic mixed version settlement algorithm

Allow V2 settlemnt of V1 allocations

partial testing of mixed settlement

Wrangle mixed version settlement into submissions

... but its not pretty :/

script allocation request acceptance

Introdue settlementVersion and settlementV1Authorizers

Move authorizer into allocation specification

Switch back to single executor; remove tryDowncast_allocation

Ensure V2 settlement of V1 allocation always calls V1 choices

Implement AmuletAllocationV1's V2 withdraw

Draft impl. of V1-based V2-alloc-cancel impl

Polish comments and types on allocation interface

PARTIAL work towards allocation factory polish

Move and polish SettlementFactory_SettleBatch

Remove HoldingMap, group settle result holdings by account

Split UtilsV2 into better scoped modules

Share public fetch implementations

Better structure and comments for defaultBatchSettleImpl

Use controllersOverride pattern for settleBatch

Add more actor checks and self-archivals

Better names for default allocation implementations

self-review

More self-review; polish AmuletAllocationV2 impl.

More allocation impl polish

Polish TradingAppV2 - step 1

Polish TradingApp: reuse AllocationRequestView

Polish test code

Generalize and simplify V1 compatibility code

Remove canWithdraw and default choice controllers infra

Adjust allocation commentary to polish

Self-review

Add missing tx metadata for history parsing

Remove expectedAdmin as it is redundant

Switch to multiple actors for publicFetch

Add CHANGELOG for preview branch

Reintroduce senderHoldingCids where more clear

Multiple executors -- pure rename

Switch to multiple executors

Rename 'Splice.Api.Token.UtilsV2' to 'Splice.TokenStandard.Utils'

Rename 'splice-api-token-utils-v2' to 'splice-token-standard-utils'

cleanup allocation request API -- missing impl.

Default implementations for AllocationRequest + TradingAppV2 cleanup

Undo changes to TradingAppV1

Improve authorization flow for TradingAppV2

Improve trade settlement test script

Make cancellation work with on-demand authorization

Save partial state

Build proper settlement testing infrastructure

add support for v1 allocation request acceptance

Make tests pass and update some comments

More tests and explicit authorizers for allocation requests

Improve auto receipt authorizer support in TradingAppV2

Share code for allocation validation

Cleanup organization of TokenStandard.Utils

and add extra validation for AllocationV2: no account meta

Mark internal modules of Utils as internal

Cleanup allocations util

Comments on internal utils modules

Cleanup requirement checking infra

Cleanup actors patter infra

before fixing all require occurrences

Re-export 'TokenStandard.Utils.require' in Splice.Utils

Drop superfluous old DvP v2 test

Replace FIXMEs by appropriate TODOs

Resolve all FIXMEs to resolve before preview

Adjust Changelog

Self-review of Changelog
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
[ci]

Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
This reverts commit 9dc96ea.

Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
Signed-off-by: Simon Meier <simon@digitalasset.com>
let reason = "Settle net negative allocation for settlement " <> show allocation.settlement.settlementRef
pure V2.Allocation_SettleResult with
authorizerHoldingCids = mempty
meta = simpleHoldingTxMeta TxKind_Burn (Some reason) None
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 are you removing these? Wouldn't they keep some V1 compatibility?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Oh, I see, because it's now in the Events.

@meiersi-da meiersi-da force-pushed the meiersi/ts2/preview branch 4 times, most recently from 3e54fb6 to 8a416a0 Compare March 27, 2026 12:26
Base automatically changed from meiersi/ts2/preview to token-standard-v2-upcoming March 27, 2026 15:12
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