class CantonSyncService extends SyncService with ParticipantPruningSyncService with FlagCloseable with Spanning with NamedLogging with HasCloseContext with InternalStateServiceProviderImpl
The Canton-based synchronization service.
A single Canton sync service can connect to multiple synchronizers.
- Alphabetic
- By Inheritance
- CantonSyncService
- InternalStateServiceProviderImpl
- HasCloseContext
- PromiseUnlessShutdownFactory
- NamedLogging
- Spanning
- FlagCloseable
- PerformUnlessClosing
- HasSynchronizeWithReaders
- OnShutdownRunner
- HasRunOnClosing
- HasUnlessClosing
- AutoCloseable
- SyncService
- InternalStateServiceProvider
- ReportsHealth
- ParticipantPruningSyncService
- PartySyncService
- PackageSyncService
- SubmissionSyncService
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new CantonSyncService(participantId: ParticipantId, synchronizerRegistry: SynchronizerRegistry, synchronizerConnectionConfigStore: SynchronizerConnectionConfigStore, aliasManager: SynchronizerAliasManager, participantNodePersistentState: Eval[ParticipantNodePersistentState], participantNodeEphemeralState: ParticipantNodeEphemeralState, syncPersistentStateManager: SyncPersistentStateManager, packageService: Eval[PackageService], partyOps: PartyOps, identityPusher: ParticipantTopologyDispatcher, partyNotifier: LedgerServerPartyNotifier, syncCrypto: SyncCryptoApiParticipantProvider, pruningProcessor: PruningProcessor, engine: Engine, commandProgressTracker: CommandProgressTracker, syncEphemeralStateFactory: SyncEphemeralStateFactory, clock: Clock, resourceManagementService: ResourceManagementService, parameters: ParticipantNodeParameters, connectedSynchronizerFactory: Factory[ConnectedSynchronizer], storage: Storage, metrics: ParticipantMetrics, sequencerInfoLoader: SequencerInfoLoader, isActive: () => Boolean, declarativeChangeTrigger: () => Unit, futureSupervisor: FutureSupervisor, loggerFactory: NamedLoggerFactory, testingConfig: TestingConfigInternal, ledgerApiIndexer: LifeCycleContainer[LedgerApiIndexer], connectedSynchronizersLookupContainer: ConnectedSynchronizersLookupContainer)(implicit ec: ExecutionContextExecutor, mat: Materializer, tracer: Tracer)
- participantId
The participant node id hosting this sync service.
- synchronizerRegistry
registry for connecting to synchronizers.
- synchronizerConnectionConfigStore
Storage for synchronizer connection configs
- packageService
Underlying package management service.
- syncCrypto
Synchronisation crypto utility combining IPS and Crypto operations.
- isActive
Returns true of the node is the active replica
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val acsCommitmentProcessorHealth: MutableHealthComponent
- def addReader(reader: String)(implicit traceContext: TraceContext): UnlessShutdown[ReaderHandle]
TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more
TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more
- Attributes
- protected[this]
- Definition Classes
- HasSynchronizeWithReaders
- def addSynchronizer(config: SynchronizerConnectionConfig, sequencerConnectionValidation: SequencerConnectionValidation)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
Adds a new synchronizer to the sync service's configuration.
Adds a new synchronizer to the sync service's configuration.
NOTE: Does not automatically connect the sync service to the new synchronizer.
- config
The synchronizer configuration.
- returns
Error or unit.
- def allocateParty(hint: LfPartyId, rawSubmissionId: LedgerSubmissionId, externalPartyOnboardingDetails: Option[ExternalPartyOnboardingDetails])(implicit traceContext: TraceContext): FutureUnlessShutdown[SubmissionResult]
Adds a new party to the set managed by the ledger.
Adds a new party to the set managed by the ledger.
Caller specifies a party identifier suggestion, the actual identifier allocated might be different and is implementation specific.
In particular, a ledger may:
- Disregard the given hint and choose a completely new party identifier
- Construct a new unique identifier from the given hint, e.g., by appending a UUID
- Use the given hint as is, and reject the call if such a party already exists
Successful party allocations will result in a com.digitalasset.canton.ledger.participant.state.Update.PartyAddedToParticipant message. See the comments on com.digitalasset.canton.ledger.participant.state.Update for further details.
- hint
A party identifier suggestion
- externalPartyOnboardingDetails
Onboarding information when allocating an external party
- returns
an async result of a SubmissionResult
- Definition Classes
- CantonSyncService → PartySyncService
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def checkOverloaded(traceContext: TraceContext): Option[SubmissionResult]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def close(): Unit
Blocks until all earlier tasks have completed and then prevents further tasks from being run.
Blocks until all earlier tasks have completed and then prevents further tasks from being run.
- Definition Classes
- FlagCloseable → OnShutdownRunner → AutoCloseable
- implicit val closeContext: CloseContext
- Definition Classes
- HasCloseContext
- def closingTimeout: FiniteDuration
- Attributes
- protected
- Definition Classes
- FlagCloseable → PerformUnlessClosing
- val commitmentsService: CommitmentsService
- def computeHighestRankedSynchronizerFromAdmissible(submitterInfo: SubmitterInfo, transaction: LfSubmittedTransaction, transactionMeta: TransactionMeta, admissibleSynchronizers: NonEmpty[Set[SynchronizerId]], disclosedContractIds: List[LfContractId], routingSynchronizerState: RoutingSynchronizerState)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, TransactionRoutingError, SynchronizerId]
Computes the highest ranked synchronizer from the given admissible synchronizers without performing topology checks.
Computes the highest ranked synchronizer from the given admissible synchronizers without performing topology checks.
This method is used internally in command processing to pre-select a synchronizer for determining the package preference set used in command interpretation.
For the definitive synchronizer selection to be used for routing of a submitted transaction, use selectRoutingSynchronizer.
- submitterInfo
The submitter info
- transaction
The submitted transaction
- transactionMeta
The transaction metadata
- admissibleSynchronizers
The list of synchronizers from which the best one should be selected
- disclosedContractIds
The list of disclosed contracts used in command interpretation
- routingSynchronizerState
The routing synchronizer state the computation should be based on
- returns
The ID of the best ranked synchronizer
- Definition Classes
- CantonSyncService → SyncService
- def computeTotalLoad: Int
- def connectSynchronizer(synchronizerAlias: SynchronizerAlias, keepRetrying: Boolean, connectSynchronizer: ConnectSynchronizer)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Boolean]
Connect the sync service to the given synchronizer.
Connect the sync service to the given synchronizer. This method makes sure there can only be one connection in progress at a time.
- val connectedSynchronizerHealth: MutableHealthComponent
- def currentHealth(): HealthStatus
Reports the current health of the object.
Reports the current health of the object. This should always return immediately.
- Definition Classes
- CantonSyncService → ReportsHealth
- def currentWriteHealth(): HealthStatus
- def disconnectSynchronizer(synchronizerAlias: SynchronizerAlias)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
Disconnect the given synchronizer from the sync service.
- def disconnectSynchronizers()(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
Disconnect from all connected synchronizers.
- val dynamicSynchronizerParameterGetter: CantonDynamicSynchronizerParameterGetter
- val ephemeralHealth: MutableHealthComponent
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getConnectedSynchronizers(request: ConnectedSynchronizerRequest)(implicit traceContext: TraceContext): FutureUnlessShutdown[ConnectedSynchronizerResponse]
- Definition Classes
- CantonSyncService → SyncService
- def getLfArchive(packageId: PackageId)(implicit traceContext: TraceContext): Future[Option[Archive]]
- Definition Classes
- CantonSyncService → PackageSyncService
- def getPackageMetadataSnapshot(implicit errorLoggingContext: ErrorLoggingContext): PackageMetadata
- Definition Classes
- CantonSyncService → PackageSyncService
- def getProtocolVersionForSynchronizer(synchronizerId: Traced[SynchronizerId]): Option[ProtocolVersion]
- Definition Classes
- CantonSyncService → SyncService
- def getRoutingSynchronizerState(implicit traceContext: TraceContext): RoutingSynchronizerState
Constructs and fetches the current synchronizer state, to be used throughout command execution
Constructs and fetches the current synchronizer state, to be used throughout command execution
- Definition Classes
- CantonSyncService → SyncService
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def incompleteReassignmentOffsets(validAt: Offset, stakeholders: Set[LfPartyId])(implicit traceContext: TraceContext): FutureUnlessShutdown[Vector[Offset]]
Get the offsets of the incomplete assigned/unassigned events for a set of stakeholders.
Get the offsets of the incomplete assigned/unassigned events for a set of stakeholders.
- validAt
The offset of validity in participant offset terms.
- stakeholders
Only offsets are returned which have at least one stakeholder from this set.
- returns
All the offset of assigned/unassigned events which do not have their counterparts visible at the validAt offset, and only for the reassignments for which this participant is reassigning.
- Definition Classes
- CantonSyncService → SyncService
- def initializeState()(implicit traceContext: TraceContext): Unit
- def internalStateService: Option[InternalStateService]
- Definition Classes
- InternalStateServiceProviderImpl → InternalStateServiceProvider
- val isActive: () => Boolean
- def isClosing: Boolean
Check whether we're closing.
Check whether we're closing. Susceptible to race conditions; unless you're using this as a flag to the retry lib or you really know what you're doing, prefer
performUnlessClosing
and friends.- Definition Classes
- OnShutdownRunner → HasUnlessClosing
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keepTrackOfReaderCallStack: Boolean
Set this to true to get detailed information about all futures that did not complete during shutdown.
Set this to true to get detailed information about all futures that did not complete during shutdown.
- Attributes
- protected[this]
- Definition Classes
- PerformUnlessClosing → HasSynchronizeWithReaders
- val ledgerApiIndexer: LifeCycleContainer[LedgerApiIndexer]
- def listLfPackages()(implicit traceContext: TraceContext): Future[Seq[PackageDescription]]
- Definition Classes
- CantonSyncService → PackageSyncService
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Attributes
- protected
- Definition Classes
- CantonSyncService → NamedLogging
- def logout(synchronizerAlias: SynchronizerAlias)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, Status, Unit]
- def lookupSynchronizerTimeTracker(synchronizerId: SynchronizerId): Option[SynchronizerTimeTracker]
Lookup a time tracker for the given
synchronizerId
.Lookup a time tracker for the given
synchronizerId
. A time tracker will only be returned if the synchronizer is registered and connected. - def lookupTopologyClient(synchronizerId: SynchronizerId): Option[SynchronizerTopologyClientWithInit]
- val maxDeduplicationDuration: NonNegativeFiniteDuration
- def maxSleepMillis: Long
How often to poll to check that all tasks have completed.
How often to poll to check that all tasks have completed.
- Attributes
- protected
- Definition Classes
- PerformUnlessClosing
- def migrateSynchronizer(source: Source[SynchronizerAlias], target: Target[SynchronizerConnectionConfig], force: Boolean)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
Migrates contracts from a source synchronizer to target synchronizer by re-associating them in the participant's persistent store.
Migrates contracts from a source synchronizer to target synchronizer by re-associating them in the participant's persistent store. Prune some of the synchronizer stores after the migration.
The migration only starts when certain preconditions are fulfilled:
- the participant is disconnected from the source and target synchronizer
- there are neither in-flight submissions nor dirty requests
You can force the migration in case of in-flight transactions but it may lead to a ledger fork. Consider:
- Transaction involving participants P1 and P2 that create a contract c
- P1 migrates (D1 -> D2) when processing is done, P2 when it is in-flight
- Final state:
- P1 has the contract on D2 (it was created and migrated)
- P2 does have the contract because it will not process the mediator verdict
Instead of forcing a migration when there are in-flight transactions reconnect all participants to the source synchronizer, halt activity and let the in-flight transactions complete or time out.
Using the force flag should be a last resort, that is for disaster recovery when the source synchronizer is unrecoverable.
- def mkPromise[A](description: String, futureSupervisor: FutureSupervisor, logAfter: Duration = 10.seconds, logLevel: Level = Level.DEBUG)(implicit elc: ErrorLoggingContext): PromiseUnlessShutdown[A]
Use this method to create a PromiseUnlessShutdown that will automatically be cancelled when the close context is closed.
Use this method to create a PromiseUnlessShutdown that will automatically be cancelled when the close context is closed. This allows proper clean up of stray promises when the node is transitioning to a passive state.
Note: you should *not* invoke
success
on the returned promise but rather usetrySuccess
. The reason is that the call tosuccess
may fail in case of shutdown.- Definition Classes
- PromiseUnlessShutdownFactory
- def modifySynchronizer(config: SynchronizerConnectionConfig, sequencerConnectionValidation: SequencerConnectionValidation)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
Modifies the settings of the synchronizer connection
Modifies the settings of the synchronizer connection
NOTE: This does not automatically reconnect to the synchronizer.
- def nameInternal: String
- Attributes
- protected[this]
- Definition Classes
- PerformUnlessClosing → HasSynchronizeWithReaders
- implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noTracingLogger: Logger
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def onCloseFailure(e: Throwable): Unit
- Attributes
- protected
- Definition Classes
- PerformUnlessClosing
- def onClosed(): Unit
- Definition Classes
- CantonSyncService → PerformUnlessClosing
- final def onFirstClose(): Unit
Blocks until all earlier tasks have completed and then prevents further tasks from being run.
Blocks until all earlier tasks have completed and then prevents further tasks from being run.
- Definition Classes
- PerformUnlessClosing → OnShutdownRunner
- Annotations
- @SuppressWarnings()
- def packageMapFor(submitters: Set[LfPartyId], informees: Set[LfPartyId], vettingValidityTimestamp: CantonTimestamp, prescribedSynchronizer: Option[SynchronizerId], routingSynchronizerState: RoutingSynchronizerState)(implicit traceContext: TraceContext): FutureUnlessShutdown[Map[SynchronizerId, Map[LfPartyId, Set[LfPackageId]]]]
Computes a SynchronizerId -> PartyId -> PackageId relation that describes:
Computes a SynchronizerId -> PartyId -> PackageId relation that describes:
- for each synchronizer that hosts all the provided
submitters
that can submit. The providedsubmitters
can be empty (for externally signed transactions), in which case synchronizers are not restricted by parties with submission rights on the local participant - which package-ids can be accepted (i.e. they are vetting-valid) in a transaction by each of the informees provided
- if the prescribed synchronizer is provided, only that one is considered
- Definition Classes
- CantonSyncService → SyncService
- for each synchronizer that hosts all the provided
- val participantId: ParticipantId
- def performUnlessClosing[A](name: String)(f: => A)(implicit traceContext: TraceContext): UnlessShutdown[A]
Performs the task given by
f
unless a shutdown has been initiated.Performs the task given by
f
unless a shutdown has been initiated. The shutdown will only begin afterf
completes, but other tasks may execute concurrently withf
, if started using this function, or one of the other variants (performUnlessClosingF and performUnlessClosingEitherT). The tasks are assumed to take less than closingTimeout to complete.DO NOT CALL
this.close
as part off
, because it will result in a deadlock. DO NOT PUT retries, especially indefinite ones, insidef
.- f
The task to perform
- returns
scala.None$ if a shutdown has been initiated. Otherwise the result of the task.
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingCheckedT[A, N, R](name: String, onClosing: => Checked[A, N, R])(etf: => CheckedT[Future, A, N, R])(implicit ec: ExecutionContext, traceContext: TraceContext): CheckedT[Future, A, N, R]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingCheckedUST[A, N, R](name: String, onClosing: => Checked[A, N, R])(etf: => CheckedT[FutureUnlessShutdown, A, N, R])(implicit ec: ExecutionContext, traceContext: TraceContext): CheckedT[FutureUnlessShutdown, A, N, R]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingEitherT[E, R](name: String, onClosing: => E)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[Future, E, R]
Performs the EitherT[Future] given by
etf
unless a shutdown has been initiated, in which case the provided error is returned instead.Performs the EitherT[Future] given by
etf
unless a shutdown has been initiated, in which case the provided error is returned instead. Bothetf
and the error are lazy;etf
is only evaluated if there is no shutdown, the error only if we're shutting down. The shutdown will only begin afteretf
completes, but other tasks may execute concurrently withetf
, if started using this function, or one of the other variants (performUnlessClosing and performUnlessClosingF). The tasks are assumed to take less than closingTimeout to complete.DO NOT CALL
this.close
as part ofetf
, because it will result in a deadlock. DO NOT PUT retries, especially indefinite ones, insidef
.- etf
The task to perform
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingEitherU[E, R](name: String)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingEitherUSF[E, R](name: String)(etf: => EitherT[FutureUnlessShutdown, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingEitherUSFAsync[E, R](name: String)(etf: => EitherT[FutureUnlessShutdown, E, R])(asyncResultToWaitForF: (R) => FutureUnlessShutdown[_])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.
Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.
- etf
closing of this object will wait for all such spawned Futures to finish
- asyncResultToWaitForF
closing of this object will wait also wait for all such asynchronous Futures to finish too
- returns
the future spawned by etf
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingF[A](name: String)(f: => Future[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
Performs the Future given by
f
unless a shutdown has been initiated.Performs the Future given by
f
unless a shutdown has been initiated. The future is lazy and not evaluated during shutdown. The shutdown will only begin afterf
completes, but other tasks may execute concurrently withf
, if started using this function, or one of the other variants (performUnlessClosing and performUnlessClosingEitherT). The tasks are assumed to take less than closingTimeout to complete.DO NOT CALL
this.close
as part off
, because it will result in a deadlock. DO NOT PUT retries, especially indefinite ones, insidef
.- f
The task to perform
- returns
The future completes with com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if a shutdown has been initiated. Otherwise the result of the task wrapped in com.digitalasset.canton.lifecycle.UnlessShutdown.Outcome.
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingOptionUSF[R](name: String)(otf: => OptionT[FutureUnlessShutdown, R])(implicit ec: ExecutionContext, traceContext: TraceContext): OptionT[FutureUnlessShutdown, R]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingUSF[A](name: String)(f: => FutureUnlessShutdown[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingUSFAsync[A](name: String)(f: => FutureUnlessShutdown[A])(asyncResultToWaitForF: (A) => FutureUnlessShutdown[_])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.
Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.
- f
closing of this object will wait for all such spawned Futures to finish
- asyncResultToWaitForF
closing of this object will wait also wait for all such asynchronous Futures to finish too
- returns
the future spawned by f
- Definition Classes
- PerformUnlessClosing
- def protocolVersionForSynchronizerId(synchronizerId: SynchronizerId): Option[ProtocolVersion]
Return the protocol version for a synchronizer ID if the node is connected to it.
Return the protocol version for a synchronizer ID if the node is connected to it.
- Definition Classes
- CantonSyncService → PartySyncService
- val protocolVersionGetter: (Traced[SynchronizerId]) => Option[ProtocolVersion]
- def prune(pruneUpToInclusive: Offset, submissionId: LedgerSubmissionId, _pruneAllDivulgedContracts: Boolean): CompletionStage[PruningResult]
Prune the participant ledger specifying the offset up to which participant ledger events can be removed.
Prune the participant ledger specifying the offset up to which participant ledger events can be removed.
As this interface applies only to the local participant unlike other administrator services, returns a (completion stage of a) PruningResult rather than a SubmissionResult.
Ledgers that do not elect to support participant pruning, return NotPruned(Status.UNIMPLEMENTED). Returning an error also keeps the ledger api server from pruning its index.
Ledgers whose participants hold no participant-local state, but want the ledger api server to prune, return ParticipantPruned.
For pruning implementations to be fault tolerant, the following aspects are important:
- Consider failing a prune request before embarking on destructive operations for example if certain safety conditions are not met (such as being low on resources). This helps minimize the chances of partially performed prune operations. If the system cannot prune up to the specified offset, the call should not alter the system and return NotPruned rather than prune partially.
- Implement pruning either atomically (performing all operations or none), or break down pruning steps into idempotent pieces that pick up after retries or system recovery in case of a mid-pruning crash.
- To the last point, be aware that pruning of the ledger api server index happens in such an idempotent follow-up step upon successful completion of each prune call. To reach eventual consistency upon failures, be sure to return ParticipantPruned even if the specified offset has already been pruned to allow ledger api server index pruning to proceed in case of an earlier failure.
- pruneUpToInclusive
The offset up to which contracts should be pruned.
- submissionId
The submission id.
- returns
The pruning result.
- Definition Classes
- CantonSyncService → ParticipantPruningSyncService
- def pruneInternally(pruneUpToInclusive: Offset)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, RpcError, Unit]
- val pruningProcessor: PruningProcessor
- def pureCryptoApi: CryptoPureApi
Returns the pure crypto operations used for the sync protocol
- def purgeDeactivatedSynchronizer(synchronizerAlias: SynchronizerAlias)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Unit]
- def readySynchronizers: Map[SynchronizerAlias, (SynchronizerId, SubmissionReady)]
Returns the ready synchronizers this sync service is connected to.
- def reconnectSynchronizers(ignoreFailures: Boolean, isTriggeredManually: Boolean, mustBeActive: Boolean)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, SyncServiceError, Seq[SynchronizerAlias]]
Reconnect configured synchronizers
Reconnect configured synchronizers
- ignoreFailures
If true, a failure will not interrupt reconnects
- isTriggeredManually
True if the call of this method is triggered by an explicit call to the connectivity service, false if the call of this method is triggered by a node restart or transition to active
- mustBeActive
If true, only executes if the instance is active
- returns
The list of connected synchronizers
- def refreshCaches()(implicit traceContext: TraceContext): FutureUnlessShutdown[Unit]
- def registerInternalStateService(internalStateService: InternalStateService): Unit
- Definition Classes
- InternalStateServiceProviderImpl → InternalStateServiceProvider
- def registeredSynchronizers: Seq[StoredSynchronizerConnectionConfig]
Returns the synchronizers this sync service is configured with.
- def remainingReaders(): Seq[String]
- Attributes
- protected[this]
- Definition Classes
- HasSynchronizeWithReaders
- def removeReader(handle: ReaderHandle): Unit
TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more
TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more
- Attributes
- protected[this]
- Definition Classes
- HasSynchronizeWithReaders
- val repairService: RepairService
- def runOnClose(task: RunOnClosing): UnlessShutdown[LifeCycleRegistrationHandle]
Schedules the given task to be run upon closing.
Schedules the given task to be run upon closing.
- returns
An com.digitalasset.canton.lifecycle.UnlessShutdown.Outcome indicates that the task will have been run when the
LifeCycleManager
'scloseAsync
method completes or whenAutoCloseable
'sclose
method returns, unless the returnedLifeCycleRegistrationHandle
was used to cancel the task or the task has been done beforehand. com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if the task is not run due to closing. This always happens if isClosing returns true.
- Definition Classes
- OnShutdownRunner → HasRunOnClosing
- def runOnOrAfterClose(task: RunOnClosing)(implicit traceContext: TraceContext): LifeCycleRegistrationHandle
Register a task to run when closing is initiated, or run it immediately if closing is already ongoing.
Register a task to run when closing is initiated, or run it immediately if closing is already ongoing. Unlike runOnClose, this method does not guarantee that this task will have run by the time the
LifeCycleManager
'scloseAsync
method completes orAutoCloseable
'sclose
returns. This is because the task is run immediately if the component has already been closed.- Definition Classes
- HasRunOnClosing
- final def runOnOrAfterClose_(task: RunOnClosing)(implicit traceContext: TraceContext): Unit
Variant of runOnOrAfterClose that does not return a com.digitalasset.canton.lifecycle.LifeCycleRegistrationHandle.
Variant of runOnOrAfterClose that does not return a com.digitalasset.canton.lifecycle.LifeCycleRegistrationHandle.
- Definition Classes
- HasRunOnClosing
- def runTaskUnlessDone(task: RunOnClosing)(implicit traceContext: TraceContext): Unit
- Attributes
- protected[this]
- Definition Classes
- OnShutdownRunner → HasRunOnClosing
- def selectRoutingSynchronizer(submitterInfo: SubmitterInfo, transaction: LfSubmittedTransaction, transactionMeta: TransactionMeta, disclosedContractIds: List[LfContractId], optSynchronizerId: Option[SynchronizerId], transactionUsedForExternalSigning: Boolean, synchronizerState: RoutingSynchronizerState)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, TransactionError, SynchronizerRank]
Computes the best synchronizer for a submitted transaction by checking the submitted transaction against the topology of the connected synchronizers and ranking the admissible ones using the synchronizer ranking (by priority, minimum number of reassignments and synchronizer-id).
Computes the best synchronizer for a submitted transaction by checking the submitted transaction against the topology of the connected synchronizers and ranking the admissible ones using the synchronizer ranking (by priority, minimum number of reassignments and synchronizer-id).
- submitterInfo
The submitter info
- transaction
The submitted transaction
- transactionMeta
The transaction metadata
- disclosedContractIds
The list of disclosed contracts used in command interpretation
- optSynchronizerId
If provided, only this synchronizer id is considered as a candidate for routing
- transactionUsedForExternalSigning
If true, the topology checks do not required that the submitters of the transaction have submission rights on the local participant since they are supposed to externally sign the transaction.
- returns
The rank of the routing synchronizer
- Definition Classes
- CantonSyncService → SyncService
- val sequencerClientHealth: MutableHealthComponent
- lazy val stateInspection: SyncStateInspection
- def submitReassignment(submitter: Party, userId: daml.lf.data.Ref.UserId, commandId: daml.lf.data.Ref.CommandId, submissionId: Option[SubmissionId], workflowId: Option[daml.lf.data.Ref.WorkflowId], reassignmentCommands: Seq[ReassignmentCommand])(implicit traceContext: TraceContext): CompletionStage[SubmissionResult]
Submit a reassignment command for acceptance to the ledger.
Submit a reassignment command for acceptance to the ledger.
To complete a reassignment, first a submission of an unassign command followed by an assign command is required. The com.digitalasset.canton.ledger.participant.state.ReassignmentCommand.Assign command must include the unassign ID which can be observed in the accepted event marking the corresponding successful unassign command.
- submitter
The submitter of the reassignment.
- 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.
- submissionId
An identifier for the submission that allows an application to correlate completions to its submissions.
- workflowId
A submitter-provided identifier used for monitoring and to traffic-shape the work handled by Daml applications communicating over the ledger.
- reassignmentCommands
The commands specifying this reassignment further.
- Definition Classes
- CantonSyncService → SubmissionSyncService
- def submitTransaction(transaction: LfSubmittedTransaction, synchronizerRank: SynchronizerRank, routingSynchronizerState: RoutingSynchronizerState, submitterInfo: SubmitterInfo, transactionMeta: TransactionMeta, _estimatedInterpretationCost: Long, keyResolver: LfKeyResolver, processedDisclosedContracts: ImmArray[FatContractInstance])(implicit traceContext: TraceContext): CompletionStage[SubmissionResult]
Submit a transaction for acceptance to the ledger.
Submit a transaction for acceptance to the ledger.
This method must be thread-safe.
The result of the transaction submission is communicated asynchronously via a sequence of com.digitalasset.canton.ledger.participant.state.Update implementation backed by the same participant state as this com.digitalasset.canton.ledger.participant.state.SyncService. Successful transaction acceptance is communicated using a com.digitalasset.canton.ledger.participant.state.Update.TransactionAccepted message. Failed transaction acceptance is communicated when possible via a com.digitalasset.canton.ledger.participant.state.Update.CommandRejected message referencing the same
submitterInfo
as provided in the submission. There can be failure modes where a transaction submission is lost in transit, and no com.digitalasset.canton.ledger.participant.state.Update.CommandRejected is generated. See the comments on com.digitalasset.canton.ledger.participant.state.Update for further details.A note on ledger time and record time: transactions are submitted together with a
ledgerTime
provided as part of thetransactionMeta
information. The ledger time is used by the Daml Engine to resolve calls to thegetTime :: Update Time
function. Letting the submitter freely choose the ledger time is though a problem for the other stakeholders in the contracts affected by the submitted transaction. The submitter can in principle choose to submit transactions that are effective far in the past or future relative to the wall-clock time of the other participants. This gives the submitter an unfair advantage and make the semantics ofgetTime
quite surprising. We've chosen the following solution to provide useful guarantees for contracts relying ongetTime
.The ledger is charged with (1) associating record-time stamps to accepted transactions and (2) to provide a guarantee on the maximal skew between the ledger effective time and the record time stamp associated to an accepted transaction. The ledger is also expected to provide guarantees on the distribution of the maximal skew between record time stamps on accepted transactions and the wall-clock time at delivery of accepted transactions to a ledger participant. Thereby providing ledger participants with a guarantee on the maximal skew between the ledger effective time of an accepted transaction and the wall-clock time at delivery to these participants.
Concretely, we typically expect the allowed skew between record time and ledger time to be in the minute range. Thereby leaving ample time for submitting and validating large transactions before they are timestamped with their record time.
The com.digitalasset.canton.ledger.participant.state.SyncService is responsible for deduplicating commands with the same com.digitalasset.canton.ledger.participant.state.SubmitterInfo.changeId within the com.digitalasset.canton.ledger.participant.state.SubmitterInfo.deduplicationPeriod.
- transaction
the submitted transaction. This transaction can contain local contract-ids that need suffixing. The participant state may have to suffix those contract-ids in order to guaranteed their global uniqueness. See the Contract Id specification for more detail daml-lf/spec/contract-id.rst.
- synchronizerRank
The synchronizer rank based on which:
- the participant performs the required reassignments of the transaction's input contracts
- the participant routes the transaction to the synchronizer
- routingSynchronizerState
The synchronizer state used for synchronizer selection. This is subsequently used for synchronizer routing.
- submitterInfo
the information provided by the submitter for correlating this submission with its acceptance or rejection on the associated com.digitalasset.canton.ledger.participant.state.Update.
- transactionMeta
the meta-data accessible to all consumers of the transaction. See com.digitalasset.canton.ledger.participant.state.TransactionMeta for more information.
- _estimatedInterpretationCost
Estimated cost of interpretation that may be used for handling submitted transactions differently.
- keyResolver
Input key mapping inferred by interpretation. The map should contain all contract keys that were used during interpretation. A value of None means no contract was found with this contract key.
- processedDisclosedContracts
Explicitly disclosed contracts used during interpretation.
- Definition Classes
- CantonSyncService → SubmissionSyncService
- def subscribeToConnections(subscriber: ConnectionListener): Unit
- val syncCrypto: SyncCryptoApiParticipantProvider
- val synchronizeVettingOnConnectedSynchronizers: PackageVettingSynchronization
Validates that the provided packages are vetted on the currently connected synchronizers.
- def synchronizeWithClosingPatience: FiniteDuration
- Attributes
- protected[this]
- Definition Classes
- PerformUnlessClosing → HasSynchronizeWithReaders
- def synchronizeWithReaders()(implicit traceContext: TraceContext): Boolean
- Attributes
- protected[this]
- Definition Classes
- HasSynchronizeWithReaders
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def synchronizerConnectionConfigByAlias(synchronizerAlias: SynchronizerAlias): EitherT[Future, MissingConfigForAlias, StoredSynchronizerConnectionConfig]
- def timeouts: ProcessingTimeout
- Attributes
- protected
- Definition Classes
- CantonSyncService → FlagCloseable
- def toString(): String
- Definition Classes
- CantonSyncService → AnyRef → Any
- implicit val tracer: Tracer
- final def unlessClosing[F[_], A](fa: => F[A])(implicit F: CanAbortDueToShutdown[F]): F[A]
Runs the computation
fa
unless isClosing returns true.Runs the computation
fa
unless isClosing returns true.This method does not delay the closing while
fa
is running, unlike the methods inHasSynchronizeWithClosing
. Accordingly, this method is useful for intermittent checks whether the result of the computation is still relevant.- returns
The result of
fa
or com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if isClosing is true
- Definition Classes
- HasUnlessClosing
- Annotations
- @inline()
- def unregisterInternalStateService(): Unit
- Definition Classes
- InternalStateServiceProviderImpl → InternalStateServiceProvider
- def uploadDar(dars: Seq[ByteString], submissionId: SubmissionId)(implicit traceContext: TraceContext): Future[SubmissionResult]
Upload a DAR to the ledger.
Upload a DAR to the ledger.
This method must be thread-safe, not throw, and not block on IO. It is though allowed to perform significant computation.
- submissionId
Submitter chosen submission identifier.
- returns
an async result of a com.digitalasset.canton.ledger.participant.state.SubmissionResult
- Definition Classes
- CantonSyncService → PackageSyncService
- def validateDar(dar: ByteString, darName: String)(implicit traceContext: TraceContext): Future[SubmissionResult]
- Definition Classes
- CantonSyncService → PackageSyncService
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withNewTrace[A](description: String)(f: (TraceContext) => (SpanWrapper) => A)(implicit tracer: Tracer): A
- Attributes
- protected
- Definition Classes
- Spanning
- def withReader[F[_], A](name: String)(f: => F[A])(implicit traceContext: TraceContext, F: Thereafter[F]): UnlessShutdown[F[A]]
- Attributes
- protected[this]
- Definition Classes
- HasSynchronizeWithReaders
- def withSpan[A](description: String)(f: (TraceContext) => (SpanWrapper) => A)(implicit traceContext: TraceContext, tracer: Tracer): A
- Attributes
- protected
- Definition Classes
- Spanning
- def withSpanFromGrpcContext[A](description: String)(f: (TraceContext) => (SpanWrapper) => A)(implicit tracer: Tracer): A
- Attributes
- protected
- Definition Classes
- Spanning