Skip to content
CCPEDIAby Unity Nodes
App Development

Getting more info out of `LOCAL_VERDICT` errors

7 posts319 views1 likesLast activity Jun 2023

  1. Artur_PoorOP

    Canton 2.6.0-rc2 (2.6.0-snapshot.20230222.11471.0.d1a33784) logs LOCAL_VERDICT_LOCKED_KEYS errors. The problem is, error message doesn’t reveal the key being locked:

    2023-03-09 21:04:59.365 [input-mapping-pool-11] INFO  c.d.p.i.p.ParallelIndexerSubscription - Storing Reject command 97ad7210-5d1d-4a50-a07f-046c56f3f1b2(): LOCAL_VERDICT_LOCKED_KEYS(2,3fc8dd8b): Rejected transaction is referring to locked keys  , context: {participant: "myparticipant", offset: "0000000000000053ca", update: {rejectionReason: {code: 10, message: "LOCAL_VERDICT_LOCKED_KEYS(2,3fc8dd8b): Rejected transaction is referring to locked keys ", definiteAnswer: false}, deduplicationPeriod: {offset: "000000000000000001"}, recordTime: "2023-03-09T21:04:57.955461Z", applicationId: "example", submitter: ["Alice::(somelongpartyhash)"], commandId: "97ad7210-5d1d-4a50-a07f-046c56f3f1b2"}} 
    

    Is revealing the locked key a matter of some Canton logback configuration I’m not aware of?

  2. Carl_Pulley 1

    How to manage this is described here:

    Specifically, the information at:

    will help locate the command ID (using this you can then identify the template and choice) and the contract ID (in the ResourceInfo block that is also logged).

  3. Artur_Poor

    Thank you, Carl. Indeed, increasing log level to debug helped to find the locked contract key. It’s just a bit inconvenient to follow cross references. It seems as if LockedKeys.Reject already has knowledge about the locked contract key:

    github.com

    digital-asset/canton/blob/3d64f68770e5f3fbb9ccf8c198cd07f7a4c18bf0/community/common/src/main/scala/com/digitalasset/canton/protocol/messages/LocalVerdict.scala#L337-L354

    
          
    1. @Explanation(
    2. """The transaction is referring to locked keys which are in the process of being
    3. modified by another transaction."""
    4. )
    5. @Resolution("Retry the transaction")
    6. object LockedKeys
    7. extends LocalRejectErrorCode(
    8. id = "LOCAL_VERDICT_LOCKED_KEYS",
    9. ErrorCategory.ContentionOnSharedResources,
    10. v0.LocalReject.Code.LockedKeys,
    11. ) {
    12. case class Reject(override val _resources: Seq[String])(
    13. override val representativeProtocolVersion: RepresentativeProtocolVersion[LocalVerdict]
    14. ) extends LocalRejectImpl(
    15. _causePrefix = "Rejected transaction is referring to locked keys ",
    16. _resourcesType = Some(CantonErrorResource.ContractKey),
    17. )
    18. }

    Makes me think if the log line in my original question is just incomplete and result of some small issue in canton logging code.

  4. Rafael_Guglielmetti

    Hey!
    We could probably include the global key: https://github.com/digital-asset/daml/blob/b5441712aa0b91b7f63b23dc51b40b9cd08914a2/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/GlobalKey.scala#L13-L26
    Would that help?
    Raf

  5. Artur_Poor

    Hey Rafael,
    GlobalKey would be perfect.
    Thank you!

  6. Rafael_Guglielmetti

    I created the issue. Should be shipped as part of 2.7

  7. raphson93

    Hi sir, is this consider a bug fix ?