Packages

package state

Interfaces to read from and write to an (abstract) participant state.

A Daml ledger participant is code that allows to actively participate in the evolution of a shared Daml ledger. Each such participant maintains a particular view onto the state of the Daml ledger. We call this view the participant state.

Actual implementations of a Daml ledger participant will likely maintain more state than what is exposed through the interfaces in this package, which is why we talk about an abstract participant state. It abstracts over the different implementations of Daml ledger participants.

The interfaces are optimized for easy implementation. The SyncService interface contains the methods for changing the participant state (and potentially the state of the Daml ledger), which all ledger participants must support. These methods are for example exposed via the Daml Ledger API. Actual ledger participant implementations likely support more implementation-specific methods. They are however not exposed via the Daml Ledger API.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. state
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package index
  2. package metrics

Type Members

  1. final case class ChangeId(userId: daml.lf.data.Ref.UserId, commandId: daml.lf.data.Ref.CommandId, actAs: Set[Party]) extends Product with Serializable

    Identifier for ledger changes used by command deduplication.

    Identifier for ledger changes used by command deduplication. Equality is defined in terms of the cryptographic hash.

    See also

    ReadService.stateUpdates for the command deduplication guarantee

  2. sealed trait CommitSetUpdate extends SequencedUpdate
  3. final case class CompletionInfo(actAs: List[Party], userId: daml.lf.data.Ref.UserId, commandId: daml.lf.data.Ref.CommandId, optDeduplicationPeriod: Option[DeduplicationPeriod], submissionId: Option[SubmissionId]) extends PrettyPrinting with Product with Serializable

    Information about a completion for a submission.

    Information about a completion for a submission.

    actAs

    the non-empty set of parties that submitted the change.

    userId

    an identifier for the user that submitted the command.

    commandId

    a submitter-provided identifier to identify an intended ledger change within all the submissions by the same parties and application.

    optDeduplicationPeriod

    The deduplication period that the SyncService actually uses for the command submission. It may differ from the suggested deduplication period given to SyncService.submitTransaction. For example, the suggested deduplication period may have been converted into a different kind or extended. The particular choice depends on the particular implementation. This allows auditing the deduplication guarantee described in the Update. Optional as some implementations may not be able to provide this deduplication information. If an implementation does not provide this deduplication information, it MUST adhere to the deduplication guarantee under a sensible interpretation of the corresponding CompletionInfo.optDeduplicationPeriod.

    submissionId

    An identifier for the submission that allows an application to correlate completions to its submissions. Optional as entries created by the participant.state.v1 API do not have this filled. Only set for participant.state.v2 created entries

  4. sealed trait FloatingUpdate extends SynchronizerIndexUpdate
  5. trait InternalStateService extends AnyRef
  6. trait InternalStateServiceProvider extends AnyRef
  7. trait InternalStateServiceProviderImpl extends InternalStateServiceProvider
  8. trait LapiCommitSet extends AnyRef
  9. final case class PackageDescription(packageId: LfPackageId, name: String255, version: String255, uploadedAt: CantonTimestamp, packageSize: Int) extends Product with Serializable

    packageId

    the unique identifier for the package

    name

    name of the package (from package metadata])

    version

    version of package (from package metadata)

    uploadedAt

    The package upload timestamp

    packageSize

    The LF archive protobuf-serialized size in bytes

  10. trait PackageSyncService extends AnyRef

    An interface for uploading and validating packages via a participant.

  11. trait ParticipantPruningSyncService extends AnyRef

    An interface to prune participant ledger updates to manage participant ledger space and enable GDPR-style right-to-be-forgotten support.

  12. sealed trait ParticipantUpdate extends Update
  13. trait PartySyncService extends AnyRef

    An interface for on-boarding parties via a participant.

  14. sealed trait PruningResult extends Product with Serializable
  15. sealed trait Reassignment extends AnyRef
  16. sealed trait ReassignmentCommand extends AnyRef
  17. sealed trait ReassignmentCommandsBatch extends AnyRef
  18. final case class ReassignmentInfo(sourceSynchronizer: Source[SynchronizerId], targetSynchronizer: Target[SynchronizerId], submitter: Option[Party], reassignmentCounter: Long, unassignId: CantonTimestamp, isReassigningParticipant: Boolean) extends Product with Serializable

    The common information for all reassigments.

    The common information for all reassigments. Except from the hosted and reassigning stakeholders, all fields are the same for reassign and assign updates, which belong to the same reassignment.

    sourceSynchronizer

    The synchronizer ID from which the contract is unassigned.

    targetSynchronizer

    The synchronizer ID to which the contract is assigned.

    submitter

    Submitter of the command, unless the operation is performed offline.

    reassignmentCounter

    This counter is strictly increasing with each reassignment for one contract.

    unassignId

    The ID of the unassign event. This should be used for the assign command.

  19. final case class RepairIndex(timestamp: CantonTimestamp, counter: RepairCounter) extends Product with Serializable
  20. sealed trait RepairUpdate extends SynchronizerIndexUpdate
  21. trait RoutingSynchronizerState extends AnyRef

    Provides state information about a synchronizer.

  22. sealed trait SequencedUpdate extends SynchronizerIndexUpdate
  23. final case class SequencerIndex(sequencerTimestamp: CantonTimestamp) extends Product with Serializable
  24. sealed abstract class SubmissionResult extends Product with Serializable
  25. trait SubmissionSyncService extends AnyRef
  26. final case class SubmitterInfo(actAs: List[Party], readAs: List[Party], userId: daml.lf.data.Ref.UserId, commandId: daml.lf.data.Ref.CommandId, deduplicationPeriod: DeduplicationPeriod, submissionId: Option[SubmissionId], externallySignedSubmission: Option[ExternallySignedSubmission]) extends Product with Serializable

    Collects context information for a submission.

    Collects context information for a submission.

    Note that this is used for party-originating changes only. They are usually issued via the Ledger API.

    actAs

    the non-empty set of parties that submitted the change.

    readAs

    the parties on whose behalf (in addition to all parties listed in actAs) contracts can be retrieved.

    userId

    an identifier for the user that submitted the command. This is used for monitoring, command deduplication, and to allow Daml applications subscribe to their own submissions only.

    commandId

    a submitter-provided identifier to identify an intended ledger change within all the submissions by the same parties and application.

    deduplicationPeriod

    The deduplication period for the command submission. Used for the deduplication guarantee described in the Update.

    submissionId

    An identifier for the submission that allows an application to correlate completions to its submissions.

    externallySignedSubmission

    If this is provided then the authorization for all acting parties will be provided by the enclosed signatures.

  27. trait SyncService extends SubmissionSyncService with PackageSyncService with PartySyncService with ParticipantPruningSyncService with ReportsHealth with InternalStateServiceProvider

    An interface to change a ledger via a participant.

    An interface to change a ledger via a participant. Please note that this interface is unstable and may significantly change.

    The methods in this interface are all methods that are supported *uniformly* across all ledger participant implementations. Methods for uploading packages, on-boarding parties, and changing ledger-wide configuration are specific to a ledger and therefore to a participant implementation. Moreover, these methods usually require admin-level privileges, whose granting is also specific to a ledger.

    If a ledger is run for testing only, there is the option for quite freely allowing the on-boarding of parties and uploading of packages. There are plans to make this functionality uniformly available: see the roadmap for progress information https://github.com/digital-asset/daml/issues/121.

    The following methods are currently available for changing the state of a Daml ledger:

  28. final case class SynchronizerIndex(repairIndex: Option[RepairIndex], sequencerIndex: Option[SequencerIndex], recordTime: CantonTimestamp) extends Product with Serializable
  29. sealed trait SynchronizerIndexUpdate extends SynchronizerUpdate

    Update which defines a SynchronizerIndex, and therefore contribute to SynchronizerIndex moving ahead.

  30. final case class SynchronizerRank(reassignments: Map[LfContractId, (LfPartyId, SynchronizerId)], priority: Int, synchronizerId: SynchronizerId) extends Product with Serializable
  31. sealed trait SynchronizerUpdate extends Update
  32. final case class TransactionMeta(ledgerEffectiveTime: Timestamp, workflowId: Option[daml.lf.data.Ref.WorkflowId], preparationTime: Timestamp, submissionSeed: Hash, timeBoundaries: LedgerTimeBoundaries, optUsedPackages: Option[Set[PackageId]], optNodeSeeds: Option[ImmArray[(NodeId, Hash)]], optByKeyNodes: Option[ImmArray[NodeId]]) extends PrettyPrinting with Product with Serializable

    Meta-data of a transaction visible to all parties that can see a part of the transaction.

  33. sealed trait Update extends Product with Serializable with PrettyPrinting with HasTraceContext

    An update to the (abstract) participant state.

    An update to the (abstract) participant state.

    Update's are used in to communicate changes to abstract participant state to consumers.

    We describe the possible updates in the comments of each of the case classes implementing Update.

    Deduplication guarantee: Let there be a Update.TransactionAccepted with CompletionInfo or a Update.CommandRejected with CompletionInfo at offset off2. If off2's CompletionInfo.optDeduplicationPeriod is a com.digitalasset.canton.data.DeduplicationPeriod.DeduplicationOffset, let off1 be the first offset after the deduplication offset. If the deduplication period is a com.digitalasset.canton.data.DeduplicationPeriod.DeduplicationDuration, let off1 be the first offset whose record time is at most the duration before off2's record time (inclusive). Then there is no other Update.TransactionAccepted with CompletionInfo for the same CompletionInfo.changeId between the offsets off1 and off2 inclusive.

    So if a command submission has resulted in a Update.TransactionAccepted, other command submissions with the same SubmitterInfo.changeId must be deduplicated if the earlier's Update.TransactionAccepted falls within the latter's CompletionInfo.optDeduplicationPeriod.

    Implementations MAY extend the deduplication period from SubmitterInfo arbitrarily and reject a command submission as a duplicate even if its deduplication period does not include the earlier's Update.TransactionAccepted. A Update.CommandRejected completion does not trigger deduplication and implementations SHOULD process such resubmissions normally.

Inherited from AnyRef

Inherited from Any

Ungrouped