class DomainSyncCryptoClient extends SyncCryptoClient[DomainSnapshotSyncCryptoApi] with HasFutureSupervision with NamedLogging with FlagCloseable
Crypto operations on a particular domain
- Alphabetic
- By Inheritance
- DomainSyncCryptoClient
- FlagCloseable
- PerformUnlessClosing
- OnShutdownRunner
- AutoCloseable
- NamedLogging
- HasFutureSupervision
- SyncCryptoClient
- TopologyClientApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new DomainSyncCryptoClient(owner: KeyOwner, domainId: DomainId, ips: DomainTopologyClient, crypto: Crypto, cacheConfigs: CachingConfigs, staticDomainParameters: StaticDomainParameters, timeouts: ProcessingTimeout, futureSupervisor: FutureSupervisor, loggerFactory: NamedLoggerFactory)(implicit executionContext: ExecutionContext)
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
- def approximateTimestamp: CantonTimestamp
The approximate timestamp
The approximate timestamp
This is either the last observed sequencer timestamp OR the effective timestamp after we observed the time difference of (effective - sequencer = epsilon) to elapse
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def awaitIpsSnapshot(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[TopologySnapshot]
Returns a snapshot of the current member topology for the given domain
Returns a snapshot of the current member topology for the given domain
The future will wait for the data if the data is not there yet.
The snapshot returned by this method should be used for validating transaction and transfer requests (Phase 2 - 7). Use the request timestamp as parameter for this method. Do not use a response or result timestamp, because all validation steps must use the same topology snapshot.
- Definition Classes
- DomainSyncCryptoClient → SyncCryptoClient
- def awaitIpsSnapshotUS(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[TopologySnapshot]
- Definition Classes
- DomainSyncCryptoClient → SyncCryptoClient
- def awaitIpsSnapshotUSSupervised(description: => String, warnAfter: Duration = 10.seconds)(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[TopologySnapshot]
- Definition Classes
- SyncCryptoClient
- def awaitSnapshot(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[DomainSnapshotSyncCryptoApi]
Waits until a snapshot is available
Waits until a snapshot is available
The snapshot returned by this method should be used for validating transaction and transfer requests (Phase 2 - 7). Use the request timestamp as parameter for this method. Do not use a response or result timestamp, because all validation steps must use the same topology snapshot.
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def awaitSnapshotSupervised(description: => String, warnAfter: Duration = 30.seconds)(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[DomainSnapshotSyncCryptoApi]
Supervised version of awaitSnapshot
Supervised version of awaitSnapshot
- Definition Classes
- TopologyClientApi
- def awaitSnapshotUS(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[DomainSnapshotSyncCryptoApi]
Shutdown safe version of await snapshot
Shutdown safe version of await snapshot
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def awaitSnapshotUSSupervised(description: => String, warnAfter: Duration = 30.seconds)(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[DomainSnapshotSyncCryptoApi]
Supervised version of awaitSnapshotUS
Supervised version of awaitSnapshotUS
- Definition Classes
- TopologyClientApi
- def awaitTimestamp(timestamp: CantonTimestamp, waitForEffectiveTime: Boolean)(implicit traceContext: TraceContext): Option[Future[Unit]]
Returns an optional future which will complete when the timestamp has been observed
Returns an optional future which will complete when the timestamp has been observed
If the timestamp is already observed, we return None.
Note that this function allows to wait for effective time (true) and sequenced time (false). If we wait for effective time, we wait until the topology snapshot for that given point in time is known. As we future date topology transactions (to avoid bottlenecks), this might be before we actually observed a sequencing timestamp.
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def awaitTimestampUS(timestamp: CantonTimestamp, waitForEffectiveTime: Boolean)(implicit traceContext: TraceContext): Option[FutureUnlessShutdown[Unit]]
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def cancelShutdownTask(token: Long): Unit
Removes a shutdown task from the list using a token returned by runOnShutdown
Removes a shutdown task from the list using a token returned by runOnShutdown
- Definition Classes
- OnShutdownRunner
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- 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
- def closingTimeout: FiniteDuration
- Attributes
- protected
- Definition Classes
- FlagCloseable → PerformUnlessClosing
- def containsShutdownTask(token: Long): Boolean
- Definition Classes
- OnShutdownRunner
- val crypto: Crypto
- def currentSnapshotApproximation(implicit traceContext: TraceContext): DomainSnapshotSyncCryptoApi
Our current snapshot approximation
Our current snapshot approximation
As topology transactions are future dated (to prevent sequential bottlenecks), we do have to "guess" the current state, as time is defined by the sequencer after we've sent the transaction. Therefore, this function will return the best snapshot approximation known.
The snapshot returned by this method should be used when preparing a transaction or transfer request (Phase 1). It must not be used when validating a request (Phase 2 - 7); instead, use one of the
snapshot
methods with the request timestamp.- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- val domainId: DomainId
The domain this client applies to
The domain this client applies to
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- 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
- implicit val executionContext: ExecutionContext
- Attributes
- protected
- Definition Classes
- DomainSyncCryptoClient → HasFutureSupervision
- val futureSupervisor: FutureSupervisor
- Attributes
- protected
- Definition Classes
- DomainSyncCryptoClient → HasFutureSupervision
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def headSnapshot(implicit traceContext: TraceContext): DomainSnapshotSyncCryptoApi
Possibly future dated head snapshot
Possibly future dated head snapshot
As we future date topology transactions, the head snapshot is our latest knowledge of the topology state, but as it can be still future dated, we need to be careful when actually using it: the state might not yet be active, as the topology transactions are future dated. Therefore, do not act towards the sequencer using this snapshot, but use the currentSnapshotApproximation instead.
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def internalPerformUnlessClosingF[A](name: String)(f: => Future[A])(implicit ec: ExecutionContext, traceContext: TraceContext): UnlessShutdown[Future[A]]
- Attributes
- protected
- Definition Classes
- PerformUnlessClosing
- val ips: DomainTopologyClient
- def ipsSnapshot(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[TopologySnapshot]
Returns a snapshot of the current member topology for the given domain.
Returns a snapshot of the current member topology for the given domain. The future will log a warning and await the snapshot if the data is not there yet.
The snapshot returned by this method should be used for validating transaction and transfer requests (Phase 2 - 7). Use the request timestamp as parameter for this method. Do not use a response or result timestamp, because all validation steps must use the same topology snapshot.
- Definition Classes
- DomainSyncCryptoClient → SyncCryptoClient
- 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
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keepTrackOfOpenFutures: Boolean
track running futures on shutdown
track running futures on shutdown
set to true to get detailed information about all futures that did not complete during shutdown. if set to false, we don't do anything.
- Attributes
- protected
- Definition Classes
- PerformUnlessClosing
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Definition Classes
- DomainSyncCryptoClient → NamedLogging
- 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
- 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
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def onCloseFailure(e: Throwable): Unit
- Attributes
- protected
- Definition Classes
- PerformUnlessClosing
- def onClosed(): Unit
- Definition Classes
- DomainSyncCryptoClient → 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()
- val owner: KeyOwner
- 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.- 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 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.- etf
The task to perform
- Definition Classes
- PerformUnlessClosing
- def performUnlessClosingEitherTF[E, R](name: String, onClosing: => E)(etf: => EitherT[Future, E, Future[R]])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[Future, E, Future[R]]
- 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 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.- 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 performUnlessClosingUSF[A](name: String)(f: => FutureUnlessShutdown[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
- Definition Classes
- PerformUnlessClosing
- def pureCrypto: CryptoPureApi
- Definition Classes
- DomainSyncCryptoClient → SyncCryptoClient
- def runOnShutdown[T](task: RunOnShutdown)(implicit traceContext: TraceContext): Long
Same as runOnShutdown_ but returns a token that allows you to remove the task explicitly from being run using cancelShutdownTask
Same as runOnShutdown_ but returns a token that allows you to remove the task explicitly from being run using cancelShutdownTask
- Definition Classes
- OnShutdownRunner
- def runOnShutdown_[T](task: RunOnShutdown)(implicit traceContext: TraceContext): Unit
Register a task to run when shutdown is initiated.
Register a task to run when shutdown is initiated.
You can use this for example to register tasks that cancel long-running computations, whose termination you can then wait for in "closeAsync".
- Definition Classes
- OnShutdownRunner
- def runStateChanged(waitingState: Boolean = false): Unit
- Attributes
- protected
- Definition Classes
- OnShutdownRunner
- Annotations
- @VisibleForTesting()
- def snapshot(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[DomainSnapshotSyncCryptoApi]
Returns the topology information at a certain point in time
Returns the topology information at a certain point in time
Use this method if you are sure to be synchronized with the topology state updates. The method will block & wait for an update, but emit a warning if it is not available
The snapshot returned by this method should be used for validating transaction and transfer requests (Phase 2 - 7). Use the request timestamp as parameter for this method. Do not use a response or result timestamp, because all validation steps must use the same topology snapshot.
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def snapshotAvailable(timestamp: CantonTimestamp): Boolean
Returns true if the topology information at the passed timestamp is already known
Returns true if the topology information at the passed timestamp is already known
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def snapshotUS(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[DomainSnapshotSyncCryptoApi]
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- val staticDomainParameters: StaticDomainParameters
- def supervised[T](description: => String, warnAfter: Duration = 10.seconds)(fut: Future[T])(implicit traceContext: TraceContext): Future[T]
- Attributes
- protected
- Definition Classes
- HasFutureSupervision
- def supervisedUS[T](description: => String, warnAfter: Duration = 10.seconds)(fut: FutureUnlessShutdown[T])(implicit traceContext: TraceContext): FutureUnlessShutdown[T]
- Definition Classes
- HasFutureSupervision
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val timeouts: ProcessingTimeout
- Definition Classes
- DomainSyncCryptoClient → FlagCloseable
- def toString(): String
- Definition Classes
- AnyRef → Any
- def topologyKnownUntilTimestamp: CantonTimestamp
The most recently observed effective timestamp
The most recently observed effective timestamp
The effective timestamp is sequencer_time + epsilon(sequencer_time), where epsilon is given by the topology change delay time, defined using the domain parameters.
This is the highest timestamp for which we can serve snapshots
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- def trySnapshot(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): DomainSnapshotSyncCryptoApi
Returns the topology information at a certain point in time
Returns the topology information at a certain point in time
Fails with an exception if the state is not yet known.
The snapshot returned by this method should be used for validating transaction and transfer requests (Phase 2 - 7). Use the request timestamp as parameter for this method. Do not use a response or result timestamp, because all validation steps must use the same topology snapshot.
- Definition Classes
- DomainSyncCryptoClient → TopologyClientApi
- 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])