question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sandbox classic and Sandbox next handle empty transactions differently

See original GitHub issue

Consider the following DAML Model:

template T
  with
    p : Party
  where
    signatory p
    nonconsuming choice C : ()
      controller p
      do pure ()

together with this REPL session (it doesn’t matter if you use the REPL or anything else)

daml> p <- allocatePartyWithHint "p" (PartyIdHint "p")
daml> cid <- submit p (createCmd (T p))
daml> submit p (exerciseCmd cid C)

If you now look at the transaction stream, you will see two transactions for Sandbox classic:

{
  "transactions": [
    {
      "transactionId": "3",
      "commandId": "2890353f-9788-4b4b-984e-5ace58e30ff2",
      "effectiveAt": "2020-08-03T19:38:37.989539Z",
      "events": [
        {
          "created": {
            "eventId": "#3:0",
            "contractId": "#3:0",
            "templateId": {
              "packageId": "ed52b012e14eba3719e0edd43e0db33e5140ce4fa6c084de844b90001c2d387c",
              "moduleName": "Main",
              "entityName": "T"
            },
            "createArguments": {
              "fields": [
                {
                  "value": {
                    "party": "p"
                  }
                }
              ]
            },
            "witnessParties": [
              "p"
            ],
            "agreementText": "",
            "signatories": [
              "p"
            ]
          }
        }
      ],
      "offset": "0000000000000003"
    }
  ]
}
{
  "transactions": [
    {
      "transactionId": "4",
      "commandId": "b94d4442-09c3-4116-9e91-e8b3c18556c3",
      "effectiveAt": "2020-08-03T19:38:52.187258Z",
      "offset": "0000000000000004"
    }
  ]
}

But for sandbox next, you get only one

{
  "transactions": [
    {
      "transactionId": "0A2432366565653138662D396637352D336663312D393334612D323766336539346637396164",
      "commandId": "8bf38d6e-ce70-4354-826b-8bee12e84162",
      "effectiveAt": "2020-08-03T19:35:28.286117Z",
      "events": [
        {
          "created": {
            "eventId": "#0A2432366565653138662D396637352D336663312D393334612D323766336539346637396164:0",
            "contractId": "00aa688090465067ffe871ed9e439befd56ad303e7059b10cc2f59f733d783d722",
            "templateId": {
              "packageId": "ed52b012e14eba3719e0edd43e0db33e5140ce4fa6c084de844b90001c2d387c",
              "moduleName": "Main",
              "entityName": "T"
            },
            "createArguments": {
              "fields": [
                {
                  "value": {
                    "party": "p"
                  }
                }
              ]
            },
            "witnessParties": [
              "p"
            ],
            "agreementText": "",
            "signatories": [
              "p"
            ]
          }
        }
      ],
      "offset": "00000000000000040000000000000000"
    }
  ]
}

The completion stream contains both commands in both cases and it also contains a transactionId in both cases.

I would expect to get the empty transaction like I do in Sandbox classic.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:28 (27 by maintainers)

github_iconTop GitHub Comments

2reactions
nmarton-dacommented, Jun 8, 2022

Current implementation for flat transactions:

  • if TX killed by filter, then not returning anything (no empty TX neither).
  • if TX only having transient pairs, and the union of all parties in TransactionFilter has intersection with the TX’s submitters then returning an empty transaction.

Suggestion by @mziolekda @cocreature @nmarton-da

  • keeping the current behavior for persistence queries
  • fixing IMFO so it behaves the same as persistence
  • NOT changing Ledger API, so this feature is not explicit
  • Fixing the original issue with Triggers: this will wait for the unified stream project to have a proper implementation
1reaction
cocreaturecommented, Jun 1, 2022

If you’re confident that the performance will be reasonable, I think this can work. It feels a bit odd to have to resort to only the completion stream + pointwise queries instead of subscribing to the completion & transaction stream but I don’t feel super strongly about this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Staking Troubleshooting - The Sandbox - GitBook
Clear your browser's cache. · Try a different browser. · Check that your wallet is unlocked (you unlock a wallet by logging into...
Read more >
Sandboxes: Staging Environments for Customizing and Testing
Want to customize your organization in a staging environment where you can test changes without affecting your production organization.
Read more >
Ethereum Merge: What You Need to Know - CoinDesk
Proof-of-stake (PoS) and proof-of-work (PoW) differ in how they decide who has the right to record the next “block” of transactions on the ......
Read more >
Troubleshoot plug-ins - Power Apps - Microsoft Learn
This topic contains information about errors that can occur due to plug-in execution and how to fix them.
Read more >
Sandbox Helmets - Snow, Skate and Watersports protection ...
Based on Canada's west coast Sandbox designs snow, skate, bike and watersports helmets with unique graphics and prints.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found