com.digitalasset.canton.participant.protocol
TransactionProcessingSteps
Companion object TransactionProcessingSteps
class TransactionProcessingSteps extends ProcessingSteps[SubmissionParam, TransactionSubmitted, TransactionViewType, TransactionResultMessage, TransactionSubmissionError] with NamedLogging
The transaction processor that coordinates the Canton transaction protocol.
- Annotations
- @nowarn()
- Alphabetic
- By Inheritance
- TransactionProcessingSteps
- NamedLogging
- ProcessingSteps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TransactionProcessingSteps(domainId: DomainId, participantId: ParticipantId, confirmationRequestFactory: ConfirmationRequestFactory, confirmationResponseFactory: ConfirmationResponseFactory, modelConformanceChecker: ModelConformanceChecker, staticDomainParameters: StaticDomainParameters, crypto: DomainSyncCryptoClient, storedContractManager: StoredContractManager, metrics: TransactionProcessingMetrics, serializableContractAuthenticator: SerializableContractAuthenticator, authenticationValidator: AuthenticationValidator, authorizationValidator: AuthorizationValidator, internalConsistencyChecker: InternalConsistencyChecker, loggerFactory: NamedLoggerFactory, futureSupervisor: FutureSupervisor)(implicit ec: ExecutionContext)
- participantId
The participant id hosting the transaction processor.
Type Members
- case class CheckActivenessAndWritePendingContracts(activenessSet: ActivenessSet, pendingContracts: Seq[WithTransactionId[SerializableContract]], pendingDataAndResponseArgs: PendingDataAndResponseArgs) extends Product with Serializable
Phase 3
Phase 3
- activenessSet
The activeness set for the activeness check
- pendingContracts
The pending contracts to be added to the com.digitalasset.canton.participant.store.StoredContractManager, along with the com.digitalasset.canton.protocol.TransactionId that created the contract
- pendingDataAndResponseArgs
The implementation-specific arguments needed to create the pending data and response
- Definition Classes
- ProcessingSteps
- case class CommitAndStoreContractsAndPublishEvent(commitSet: Option[Future[CommitSet]], contractsToBeStored: Set[LfContractId], maybeEvent: Option[TimestampedEvent]) extends Product with Serializable
Phase 7, step 3:
Phase 7, step 3:
- commitSet
scala.None$ if the request should be rejected scala.Some$ a future that will produce the commit set for updating the active contract store
- contractsToBeStored
The contracts to be persisted to the contract store. Must be a subset of the contracts produced in Phase 3, step 2 in CheckActivenessAndWritePendingContracts.
- maybeEvent
The event to be published via the com.digitalasset.canton.participant.event.RecordOrderPublisher
- Definition Classes
- ProcessingSteps
- case class DecryptedViews(views: Seq[(WithRecipients[DecryptedView], Option[Signature])], decryptionErrors: Seq[EncryptedViewMessageError[RequestViewType]]) extends Product with Serializable
Phase 3:
Phase 3:
- views
The successfully decrypted views and their signatures. Signatures are only present for top-level views (where the submitter metadata is not blinded)
- decryptionErrors
The decryption errors while trying to decrypt the views
- Definition Classes
- ProcessingSteps
- trait PreparedBatch extends AnyRef
The actual batch to be sent for a TrackedSubmission
The actual batch to be sent for a TrackedSubmission
- Definition Classes
- ProcessingSteps
- case class StorePendingDataAndSendResponseAndCreateTimeout(pendingData: RequestType.PendingRequestData, mediatorResponses: Seq[(MediatorResponse, Recipients)], rejectionArgs: RejectionArgs) extends Product with Serializable
Phase 3:
Phase 3:
- pendingData
The
requestType.PendingRequestData
to be stored until Phase 7- mediatorResponses
The responses to be sent to the mediator
- rejectionArgs
The implementation-specific arguments needed to create a rejection event on timeout
- Definition Classes
- ProcessingSteps
- sealed trait Submission extends AnyRef
- Definition Classes
- ProcessingSteps
- trait TrackedSubmission extends Submission
Submission to be tracked in-flight and with deduplication.
Submission to be tracked in-flight and with deduplication.
The actual batch to be sent is computed only later by TrackedSubmission.prepareBatch so that tracking information (e.g., the chosen deduplication period) can be incorporated into the batch.
- Definition Classes
- ProcessingSteps
- trait UntrackedSubmission extends Submission
Submission to be sent off without tracking the in-flight submission and without deduplication.
Submission to be sent off without tracking the in-flight submission and without deduplication.
- Definition Classes
- ProcessingSteps
- type DecryptedView = View
The type of decrypted view trees
The type of decrypted view trees
- Definition Classes
- ProcessingSteps
- type FullView = data.ViewType.TransactionViewType.FullView
- Definition Classes
- ProcessingSteps
- type PendingDataAndResponseArgs = TransactionProcessingSteps.PendingDataAndResponseArgs
The type of data needed to generate the pending data and response in constructPendingDataAndResponse.
The type of data needed to generate the pending data and response in constructPendingDataAndResponse. The data is created by decryptViews
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type PendingSubmissionData = Nothing
The data stored for submissions that have been sent out, if any
The data stored for submissions that have been sent out, if any
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type PendingSubmissionId = Unit
The type used for look-ups into the PendingSubmissions
The type used for look-ups into the PendingSubmissions
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type PendingSubmissions = Unit
A store of data on submissions that have been sent out, if any
A store of data on submissions that have been sent out, if any
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type RejectionArgs = TransactionProcessingSteps.RejectionArgs
The type of data needed to create a rejection event in createRejectionEvent.
The type of data needed to create a rejection event in createRejectionEvent. Created by constructPendingDataAndResponse
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type RequestBatch = RequestAndRootHashMessage[OpenEnvelope[EncryptedViewMessage[TransactionViewType]]]
The type of request messages
The type of request messages
- Definition Classes
- ProcessingSteps
- type RequestError = TransactionProcessorError
The type of errors that can occur during request processing
The type of errors that can occur during request processing
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type RequestType = Transaction.type
The type of the request (transaction, transfer-out, transfer-in)
The type of the request (transaction, transfer-out, transfer-in)
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type ResultError = TransactionProcessorError
The type of errors that can occur during result processing
The type of errors that can occur during result processing
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type SubmissionResultArgs = Unit
The type of data needed to generate the submission result in createSubmissionResult.
The type of data needed to generate the submission result in createSubmissionResult. The data is created by updatePendingSubmissions.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- type SubmissionSendError = Error
The submission errors that can occur during sending the batch to the sequencer and updating the pending submission map.
The submission errors that can occur during sending the batch to the sequencer and updating the pending submission map.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
Value Members
- object DecryptedViews extends Serializable
- Definition Classes
- ProcessingSteps
- 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def authenticateInputContracts(pendingDataAndResponseArgs: PendingDataAndResponseArgs)(implicit traceContext: TraceContext): EitherT[Future, TransactionProcessorError, Unit]
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def computeActivenessSetAndPendingContracts(ts: CantonTimestamp, rc: RequestCounter, sc: SequencerCounter, fullViewsWithSignatures: NonEmpty[Seq[(WithRecipients[FullView], Option[Signature])]], malformedPayloads: Seq[MalformedPayload], snapshot: DomainSnapshotSyncCryptoApi, mediator: MediatorRef)(implicit traceContext: TraceContext): EitherT[Future, TransactionProcessorError, CheckActivenessAndWritePendingContracts]
Phase 3, step 2 (some good views):
Phase 3, step 2 (some good views):
- ts
The timestamp of the request
- rc
The com.digitalasset.canton.RequestCounter of the request
- sc
The com.digitalasset.canton.SequencerCounter of the request
- fullViewsWithSignatures
The decrypted views from step 1 with the right root hash and their respective signatures
- malformedPayloads
The decryption errors and decrypted views with a wrong root hash
- snapshot
Snapshot of the topology state at the request timestamp
- returns
The activeness set and the pending contracts to add to the com.digitalasset.canton.participant.store.StoredContractManager, and the arguments for step 2.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def computeFullViews(decryptedViewsWithSignatures: Seq[(WithRecipients[DecryptedView], Option[Signature])]): (Seq[(WithRecipients[FullView], Option[Signature])], Seq[MalformedPayload])
Converts the decrypted (possible light-weight) view trees to the corresponding full view trees.
Converts the decrypted (possible light-weight) view trees to the corresponding full view trees. Views that cannot be converted are mapped to ProtocolProcessor.MalformedPayload errors.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def constructPendingDataAndResponse(pendingDataAndResponseArgs: PendingDataAndResponseArgs, transferLookup: TransferLookup, contractLookup: ContractLookup, activenessResultFuture: FutureUnlessShutdown[ActivenessResult], pendingCursor: Future[Unit], mediator: MediatorRef, freshOwnTimelyTx: Boolean)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, TransactionProcessorError, StorePendingDataAndSendResponseAndCreateTimeout]
Phase 3, step 3: Yields the pending data and mediator responses for the case that at least one payload is well-formed.
Phase 3, step 3: Yields the pending data and mediator responses for the case that at least one payload is well-formed.
- pendingDataAndResponseArgs
Implementation-specific data passed from decryptViews
- transferLookup
Read-only interface of the com.digitalasset.canton.participant.store.memory.TransferCache
- contractLookup
Read-only interface to the com.digitalasset.canton.participant.store.StoredContractManager, which includes the pending contracts
- activenessResultFuture
Future of the result of the activeness check<
- pendingCursor
Future to complete when the com.digitalasset.canton.participant.protocol.RequestJournal's cursor for the com.digitalasset.canton.participant.protocol.RequestJournal.RequestState.Pending reaching the current request. Block on this future to ensure that all earlier contract store writes are visible.
- returns
Returns the
requestType.PendingRequestData
to be stored until Phase 7 and the responses to be sent to the mediator.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def constructResponsesForMalformedPayloads(requestId: RequestId, malformedPayloads: Seq[MalformedPayload])(implicit traceContext: TraceContext): Seq[MediatorResponse]
Phase 3: Yields the mediator responses (i.e.
Phase 3: Yields the mediator responses (i.e. rejections) for the case that all payloads are malformed.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def createRejectionEvent(rejectionArgs: TransactionProcessingSteps.RejectionArgs)(implicit traceContext: TraceContext): Either[TransactionProcessorError, Option[TimestampedEvent]]
Phase 3, step 4:
Phase 3, step 4:
- rejectionArgs
The implementation-specific information needed for the creation of the rejection event
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def createSubmissionResult(deliver: Deliver[Envelope[_]], unit: Unit): TransactionSubmitted
Phase 1, step 3:
Phase 1, step 3:
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def decisionTimeFor(parameters: DynamicDomainParametersWithValidity, requestTs: CantonTimestamp): Either[TransactionProcessorError, CantonTimestamp]
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def decryptViews(batch: NonEmpty[Seq[OpenEnvelope[EncryptedViewMessage[TransactionViewType]]]], snapshot: DomainSnapshotSyncCryptoApi)(implicit traceContext: TraceContext): EitherT[Future, TransactionProcessorError, DecryptedViews]
Phase 3, step 1:
Phase 3, step 1:
- batch
The batch of messages in the request to be processed
- snapshot
Snapshot of the topology state at the request timestamp
- returns
The decrypted views and the errors encountered during decryption
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- implicit val ec: ExecutionContext
- def embedNoMediatorError(error: NoMediatorError): TransactionSubmissionError
Convert com.digitalasset.canton.participant.protocol.ProtocolProcessor.NoMediatorError into a submission error
Convert com.digitalasset.canton.participant.protocol.ProtocolProcessor.NoMediatorError into a submission error
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def embedRequestError(err: RequestProcessingError): TransactionProcessorError
Wrap an error in request processing from the generic request processor
Wrap an error in request processing from the generic request processor
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def embedResultError(err: ResultProcessingError): TransactionProcessorError
Wrap an error in result processing from the generic request processor
Wrap an error in result processing from the generic request processor
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- 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
- def eventAndSubmissionIdForInactiveMediator(ts: CantonTimestamp, rc: RequestCounter, sc: SequencerCounter, fullViews: NonEmpty[Seq[WithRecipients[FullView]]], freshOwnTimelyTx: Boolean)(implicit traceContext: TraceContext): (Option[TimestampedEvent], Option[PendingSubmissionId])
Phase 3, step 2 (some good views, but the chosen mediator is inactive)
Phase 3, step 2 (some good views, but the chosen mediator is inactive)
- ts
The timestamp of the request
- rc
The com.digitalasset.canton.RequestCounter of the request
- sc
The com.digitalasset.canton.SequencerCounter of the request
- fullViews
The decrypted views from step 1 with the right root hash
- returns
The optional rejection event to be published in the event log, and the optional submission ID corresponding to this request
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getCommitSetAndContractsToBeStoredAndEvent(eventE: Either[EventWithErrors[Deliver[DefaultOpenEnvelope]], SignedContent[Deliver[DefaultOpenEnvelope]]], resultE: Either[MalformedMediatorRequestResult, TransactionResultMessage], pendingRequestData: PendingRequestData, pendingSubmissionMap: PendingSubmissions, hashOps: HashOps)(implicit traceContext: TraceContext): EitherT[Future, TransactionProcessorError, CommitAndStoreContractsAndPublishEvent]
Phase 7, step 2:
Phase 7, step 2:
- eventE
The signed com.digitalasset.canton.sequencing.protocol.Deliver event containing the mediator result. It is ensured that the
event
contains exactly one com.digitalasset.canton.protocol.messages.MediatorResult- resultE
The unpacked mediator result that is contained in the
event
- pendingRequestData
The
requestType.PendingRequestData
produced in Phase 3- returns
The com.digitalasset.canton.participant.protocol.conflictdetection.CommitSet, the contracts from Phase 3 to be persisted to the contract store, and the event to be published
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def getSubmissionDataForTracker(views: Seq[FullView]): Option[SubmissionData]
Return the submission data needed by the SubmissionTracker to decide on transaction validity
Return the submission data needed by the SubmissionTracker to decide on transaction validity
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Attributes
- protected
- Definition Classes
- TransactionProcessingSteps → NamedLogging
- 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() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def participantResponseDeadlineFor(parameters: DynamicDomainParametersWithValidity, requestTs: CantonTimestamp): Either[TransactionProcessorError, CantonTimestamp]
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def pendingSubmissions(state: SyncDomainEphemeralState): Unit
Selector to get the PendingSubmissions, if any
Selector to get the PendingSubmissions, if any
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def postProcessResult(verdict: Verdict, pendingSubmission: Nothing)(implicit traceContext: TraceContext): Unit
Phase 7, step 4:
Phase 7, step 4:
Called after the request reached the state com.digitalasset.canton.participant.protocol.RequestJournal.RequestState.Clean in the request journal, if the participant is the submitter. Also called if a timeout occurs with com.digitalasset.canton.protocol.messages.Verdict.MediatorReject.
- verdict
The verdict on the request
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def postProcessSubmissionForInactiveMediator(declaredMediator: MediatorRef, ts: CantonTimestamp, pendingSubmission: Nothing)(implicit traceContext: TraceContext): Unit
Phase 3, step 2 (submission where the chosen mediator is inactive)
Phase 3, step 2 (submission where the chosen mediator is inactive)
Called if the chosen mediator is inactive and eventAndSubmissionIdForInactiveMediator returned a submission ID that was pending.
- pendingSubmission
The PendingSubmissionData for the submission ID returned by eventAndSubmissionIdForInactiveMediator
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- See also
com.digitalasset.canton.participant.protocol.ProcessingSteps.postProcessResult
- def prepareSubmission(param: SubmissionParam, mediator: MediatorRef, ephemeralState: SyncDomainEphemeralStateLookup, recentSnapshot: DomainSnapshotSyncCryptoApi)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, TransactionSubmissionError, Submission]
Phase 1, step 1:
Phase 1, step 1:
- param
The parameter object encapsulating the parameters of the submit method
- ephemeralState
Read-only access to the com.digitalasset.canton.participant.store.SyncDomainEphemeralState
- recentSnapshot
A recent snapshot of the topology state to be used for submission
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def removePendingSubmission(pendingSubmissions: Unit, pendingSubmissionId: Unit): Option[Nothing]
Phase 1, step 4; and Phase 7, step 1:
Phase 1, step 4; and Phase 7, step 1:
Remove the pending submission from the pending submissions. Called when sending the submission failed or did not lead to a result in time or a result has arrived for the request.
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def requestKind: String
The kind of request, used for logging and error reporting
The kind of request, used for logging and error reporting
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- val requestType: RequestType
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def submissionDescription(param: SubmissionParam): String
Extract a description for a submission, used for logging and error reporting
Extract a description for a submission, used for logging and error reporting
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- def submissionIdOfPendingRequest(pendingData: PendingTransaction): Unit
Extract the submission ID that corresponds to a pending request, if any
Extract the submission ID that corresponds to a pending request, if any
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updatePendingSubmissions(pendingSubmissionMap: Unit, submissionParam: SubmissionParam, pendingSubmissionId: PendingSubmissionId): EitherT[Future, SubmissionSendError, SubmissionResultArgs]
Phase 1, step 2:
Phase 1, step 2:
- submissionParam
Implementation-specific details on the submission, used for logging
- pendingSubmissionId
The key used for updates to the pendingSubmissions
- Definition Classes
- TransactionProcessingSteps → ProcessingSteps
- 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])