Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash of Daml script on duplicate disclosed contract #20213

Open
meiersi-da opened this issue Oct 31, 2024 · 1 comment
Open

Crash of Daml script on duplicate disclosed contract #20213

meiersi-da opened this issue Oct 31, 2024 · 1 comment

Comments

@meiersi-da
Copy link
Contributor

Affected Daml version

sdk-version: 3.0.0-snapshot.20240318.12913.0.v1c415c97

Bug description

The crash below is unexpected.

module Splice.Scripts.ReproDuplicateDisclosureCrash where

import Daml.Script

template Foo with p : Party
  where
    signatory p

    nonconsuming choice Foo_Dummy : ()
      controller p
      do pure ()

testDuplicateDisclosure : Script ()
testDuplicateDisclosure = do
  alice <- allocateParty "Alice"
  fooCid <- submit alice $ createCmd Foo with p = alice


  Some fooDisc <- queryDisclosure @Foo alice fooCid

  submitWithDisclosures alice [fooDisc] $ exerciseCmd fooCid Foo_Dummy

  -- Fails with
  --
  -- Script execution failed:
  --   CRASH: Script.FailedCmd unexpected cause: null
  --
  submitWithDisclosures alice [fooDisc, fooDisc] $ exerciseCmd fooCid Foo_Dummy

To reproduce

See script above.

Expected behavior

Allow disclosing the same contract multiple times. This can easily happen when fetching disclosure from multiple disparate contexts.

Additional context

@meiersi-da
Copy link
Contributor Author

Closing as this is due to currently expected behavior in Canton: https://github.com/DACH-NY/canton/blob/073343d4f145886f953fa49f3a8f4edc344616c9/enterprise/ledger-test-tool/suites/lf-v2.1/src/main/scala/com/daml/ledger/api/testtool/suites/v2_1/ExplicitDisclosureIT.scala#L317-L355

This should likely change, but I'll create a separate ticket for that.

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

No branches or pull requests

1 participant