package mediator
- Alphabetic
- Public
- Protected
Type Members
- class CommunityMediatorRuntime extends MediatorRuntime with NamedLogging
- class ConfirmationResponseProcessor extends NamedLogging with Spanning
Scalable service to check the received Stakeholder Trees and Confirmation Responses, derive a verdict and post result messages to stakeholders.
- class EnterpriseMediatorRuntime extends MediatorRuntime with NamedLogging
- class EnterpriseMediatorRuntimeFactory extends MediatorRuntimeFactory
- class GrpcEnterpriseMediatorAdministrationService extends EnterpriseMediatorAdministrationService
- class Mediator extends NamedLogging with StartAndCloseable[Unit] with NoTracing
The Mediator that acts as transaction coordinator.
- sealed trait MediatorError extends Product with Serializable
- sealed trait MediatorEvent extends AnyRef
The MediatorEventsProcessor looks through all sequencer events provided by the sequencer client in a batch to pick out events for the Mediator with the same request-id while also scheduling timeouts and running topology transactions at appropriate times.
The MediatorEventsProcessor looks through all sequencer events provided by the sequencer client in a batch to pick out events for the Mediator with the same request-id while also scheduling timeouts and running topology transactions at appropriate times. We map all the mediator events we generate into this simplified structure so the ConfirmationResponseProcessor processes these events without having to perform the same extraction and error handling of the original SequencerEvent.
- case class MediatorEventStage(requests: NonEmpty[Map[RequestId, NonEmpty[Seq[Traced[MediatorEvent]]]]]) extends Product with Serializable
The MediatorEventsProcessor divides incoming events into a series of stages where each stage should be executed sequentially but the actions in the stage itself may execute in parallel.
The MediatorEventsProcessor divides incoming events into a series of stages where each stage should be executed sequentially but the actions in the stage itself may execute in parallel.
All mediator request related events that can be processed concurrently grouped by requestId.
- class MediatorEventsProcessor extends NamedLogging
Attempt to process a sequence of sequential events from the sequencer for the mediator in an optimal manner.
Attempt to process a sequence of sequential events from the sequencer for the mediator in an optimal manner. We could correctly process them sequentially however this is suboptimal. We can parallelize their processing by respecting the following rules:
- TODO(soren) Only the active mediator for the domain can send messages to sequencer, and this active state could change within the events we are processing. So this must be determined before processing any Mediator requests.
- Mediator requests/responses with different request ids can be processed in parallel. For events referencing the same request-id we can provide these to the confirmation request processor as a group so it can make optimizations such as deferring persistence of a response state until the final message to avoid unnecessary database writes.
- Identity transactions must be processed by the identity client before subsequent mediator request/responses as the confirmation response processor may require knowing the latest relevant topology state.
- Pending mediator requests could timeout during the execution of this batch and should be handled with the timestamp of the event from the sequencer that caused them to timeout (it is tempting to just use the last timestamp to determine timeouts however we would like to ensure we use the closest timestamp to ensure a consistent version is applied across Mediators regardless of the batches of events they process). Unlikely however technically possible is that requests that are created while processing these events could also timeout due to sequencer time passing within this event range (think a low timeout value with a sequencer that is catching up so a long period could elapse even during a short range of events).
Crashes can occur at any point during this processing (or even afterwards as it's the persistence in the sequencer client that would move us to following events). Processing should be effectively idempotent to handle this.
- sealed trait MediatorMessageId extends AnyRef
Structure serialized into a sequencer message id to convey what the sequencer event means for a mediator between a send and a receipt (witnessing the sequenced event).
- class MediatorNode extends CantonNode with NamedLogging with HasUptime
- class MediatorNodeBootstrap extends CantonNodeBootstrapBase[MediatorNode, MediatorNodeConfig, MediatorNodeParameters]
- case class MediatorNodeConfig(adminApi: EnterpriseAdminServerConfig = EnterpriseAdminServerConfig(), storage: EnterpriseStorageConfig = EnterpriseStorageConfig.Memory(), crypto: CryptoConfig = CryptoConfig(), init: InitConfig = InitConfig(autoInit = false), replication: ReplicationConfig = ReplicationConfig(), timeTracker: DomainTimeTrackerConfig = DomainTimeTrackerConfig(), sequencerClient: SequencerClientConfig = SequencerClientConfig(), caching: CachingConfigs = CachingConfigs(), parameters: MediatorNodeParameterConfig = MediatorNodeParameterConfig()) extends EnterpriseLocalNodeConfig with ConfigDefaults[MediatorNodeConfig] with Product with Serializable
Mediator Node configuration
Mediator Node configuration
- init
all nodes must provided a init config however the mediator cannot auto initialize itself so defaults
autoInit
tofalse
- timeTracker
configuration for how time is tracked on the connected domain using the sequencer
- case class MediatorNodeParameterConfig(willCorruptYourSystemDevVersionSupport: Boolean = false, dontWarnOnDeprecatedPV: Boolean = false) extends Product with Serializable
Various parameters for non-standard mediator settings
Various parameters for non-standard mediator settings
- willCorruptYourSystemDevVersionSupport
if true, then dev version will be turned on, but we will brick this mediator node if it is used for production.
- dontWarnOnDeprecatedPV
if true, then this mediator will not emit a warning when connecting to a sequencer using protocol version 2.0.0.
- case class MediatorNodeParameters(tracing: TracingConfig, delayLoggingThreshold: NonNegativeFiniteDuration, loggingConfig: LoggingConfig, logQueryCost: Option[QueryCostMonitoringConfig], enableAdditionalConsistencyChecks: Boolean, enablePreviewFeatures: Boolean, processingTimeouts: ProcessingTimeout, sequencerClient: SequencerClientConfig, cachingConfigs: CachingConfigs, nonStandardConfig: Boolean, devVersionSupport: Boolean, dontWarnOnDeprecatedPV: Boolean) extends LocalNodeParameters with Product with Serializable
- class MediatorReadyCheck extends NamedLogging
When a Mediator starts they will not be able to sign any events until their key has been assigned to the mediator identifier.
When a Mediator starts they will not be able to sign any events until their key has been assigned to the mediator identifier. For the first mediator on the domain this will happen immediately when the domain is initialized so has historically hasn't been a problem. However for additional mediators their key may not be added for many events after genesis and will be unable to send anything until this happens. MediatorReadyCheck efficiently checks that the local mediator is able to sign events on the local domain. We then cache the result of this check so it can be regularly queried without performing identity operations. Callers should ensure to call reset after every topology transaction where the state could change.
- class MediatorReplicaManager extends ReplicaManager
Manages replicas of a single Mediator instance.
Manages replicas of a single Mediator instance. Passive instances are currently entirely passive and have no components running at runtime. When becoming active a MediatorRuntime is started and connected to the admin services. When becoming passive the running MediatorRuntime is shutdown and the admin services are disconnected.
If the admin services are called while passive every method will return an unavailable response.
- class MediatorReplicaManagerException extends RuntimeException
An unexpected error occurred while transitioning between replica states
- case class MediatorRequestAlreadyFinalized(requestId: RequestId, existingVerdict: Verdict) extends ResponseAggregationError with Product with Serializable
- case class MediatorRequestNotFound(requestId: RequestId, viewHashO: Option[ViewHash] = None, rootHashO: Option[RootHash] = None) extends ResponseAggregationError with Product with Serializable
- trait MediatorRuntime extends FlagCloseable
Mediator component and its supporting services
- trait MediatorRuntimeFactory extends AnyRef
- class MediatorStateInspection extends AnyRef
- final case class RemoteMediatorConfig(adminApi: ClientConfig, crypto: CryptoConfig = CryptoConfig()) extends NodeConfig with Product with Serializable
- case class ResponseAggregation extends NamedLogging with PrettyPrinting with Product with Serializable
- sealed trait ResponseAggregationError extends MediatorError
- case class StaleVersion(requestId: RequestId, newVersion: CantonTimestamp, staleVersion: CantonTimestamp) extends MediatorError with Product with Serializable
- case class UnauthorizedMediatorResponse(requestId: RequestId, viewHash: ViewHash, sender: ParticipantId, parties: Set[LfPartyId]) extends ResponseAggregationError with Product with Serializable
- case class UnexpectedMediatorResponse(requestId: RequestId, viewHash: ViewHash, parties: Set[LfPartyId]) extends ResponseAggregationError with Product with Serializable
Value Members
- object CommunityMediatorRuntimeFactory extends MediatorRuntimeFactory
- object Mediator
- object MediatorEvent
- object MediatorEventStage extends Serializable
- object MediatorEventsProcessor
- object MediatorMessageId
- object MediatorNodeBootstrap
- object MediatorReadyCheck
- object ResponseAggregation extends Serializable