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.
- Alphabetic
- By Inheritance
- state
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- 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
- sealed trait CommitSetUpdate extends SequencedUpdate
- 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
- sealed trait FloatingUpdate extends SynchronizerIndexUpdate
- trait InternalStateService extends AnyRef
- trait InternalStateServiceProvider extends AnyRef
- trait InternalStateServiceProviderImpl extends InternalStateServiceProvider
- trait LapiCommitSet extends AnyRef
- 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
- trait PackageSyncService extends AnyRef
An interface for uploading and validating packages via a participant.
- 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.
- sealed trait ParticipantUpdate extends Update
- trait PartySyncService extends AnyRef
An interface for on-boarding parties via a participant.
- sealed trait PruningResult extends Product with Serializable
- sealed trait Reassignment extends AnyRef
- sealed trait ReassignmentCommand extends AnyRef
- sealed trait ReassignmentCommandsBatch extends AnyRef
- 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.
- final case class RepairIndex(timestamp: CantonTimestamp, counter: RepairCounter) extends Product with Serializable
- sealed trait RepairUpdate extends SynchronizerIndexUpdate
- trait RoutingSynchronizerState extends AnyRef
Provides state information about a synchronizer.
- sealed trait SequencedUpdate extends SynchronizerIndexUpdate
- final case class SequencerIndex(sequencerTimestamp: CantonTimestamp) extends Product with Serializable
- sealed abstract class SubmissionResult extends Product with Serializable
- trait SubmissionSyncService extends AnyRef
- 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.
- 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:
- submitting a transaction using SyncService!.submitTransaction
- allocating a new party using PartySyncService!.allocateParty
- pruning a participant ledger using ParticipantPruningSyncService!.prune
- final case class SynchronizerIndex(repairIndex: Option[RepairIndex], sequencerIndex: Option[SequencerIndex], recordTime: CantonTimestamp) extends Product with Serializable
- sealed trait SynchronizerIndexUpdate extends SynchronizerUpdate
Update which defines a SynchronizerIndex, and therefore contribute to SynchronizerIndex moving ahead.
- final case class SynchronizerRank(reassignments: Map[LfContractId, (LfPartyId, SynchronizerId)], priority: Int, synchronizerId: SynchronizerId) extends Product with Serializable
- sealed trait SynchronizerUpdate extends Update
- 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.
- 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
. Ifoff2
's CompletionInfo.optDeduplicationPeriod is a com.digitalasset.canton.data.DeduplicationPeriod.DeduplicationOffset, letoff1
be the first offset after the deduplication offset. If the deduplication period is a com.digitalasset.canton.data.DeduplicationPeriod.DeduplicationDuration, letoff1
be the first offset whose record time is at most the duration beforeoff2
's record time (inclusive). Then there is no other Update.TransactionAccepted with CompletionInfo for the same CompletionInfo.changeId between the offsetsoff1
andoff2
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.
Value Members
- object CompletionInfo extends Serializable
- object PackageDescription extends Serializable
- object PruningResult extends Serializable
- object Reassignment
- object ReassignmentCommand
- object ReassignmentCommandsBatch
- object RepairIndex extends Serializable
- object SubmissionResult extends Serializable
- object SubmitterInfo extends Serializable
- object SyncService
- object SynchronizerIndex extends Serializable
- object SynchronizerRank extends Serializable
- object Update extends Serializable