TxGossipRuntime

org.sigilaris.node.gossip.tx.TxGossipRuntime
See theTxGossipRuntime companion object
final class TxGossipRuntime[F[_], A](peerAuthenticator: PeerAuthenticator[F], val clock: GossipClock[F], val source: GossipArtifactSource[F, A], val sink: GossipArtifactSink[F, A], val topicContracts: GossipTopicContractRegistry[A], val stateStore: TxGossipStateStore[F], val policy: TxRuntimePolicy, val cascadeStrategy: TxCascadeStrategy[A], val sidecarPlanner: GossipSidecarPlanner[F, A], wakeupBus: Option[TxGossipWakeupBus[F]])(using evidence$1: Sync[F])

Effectful runtime coordinating transaction gossip sessions, event production, event consumption, and control batch processing.

Type parameters

A

the artifact payload type

F

the effect type

Attributes

Companion
object
Source
TxGossipRuntime.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def applyHandshakeAck(ack: SessionOpenAck): F[Either[HandshakeRejected, Unit]]

Applies a received handshake ack to complete an outbound session.

Applies a received handshake ack to complete an outbound session.

Value parameters

ack

the received acknowledgement

Attributes

Returns

unit on success, or a rejection

Source
TxGossipRuntime.scala

Applies an explicit stream-open resume cursor to an outbound producer session.

Applies an explicit stream-open resume cursor to an outbound producer session.

This uses the same subscription validation as ControlOp.SetCursor, but does not allocate a control-batch idempotency key for a stream-open request.

Value parameters

cursor

composite cursor supplied by the stream-open request

sessionId

the outbound producer session

Attributes

Returns

unit on success, or a control-batch rejection describing the invalid resume cursor

Source
TxGossipRuntime.scala

Authorizes that a session exists and is open, touching its activity timestamp.

Authorizes that a session exists and is open, touching its activity timestamp.

Value parameters

sessionId

the session to authorize

Attributes

Returns

the session, or a rejection

Source
TxGossipRuntime.scala

Authorizes that a session exists, is open, and is owned by the given authenticated peer.

Authorizes that a session exists, is open, and is owned by the given authenticated peer.

Value parameters

authenticatedPeer

the peer identity to verify ownership against

sessionId

the session to authorize

Attributes

Returns

the session, or a rejection

Source
TxGossipRuntime.scala

Verifies that a session is owned by the given authenticated peer.

Verifies that a session is owned by the given authenticated peer.

Value parameters

authenticatedPeer

the peer identity to verify ownership against

sessionId

the session to check

Attributes

Returns

the session, or a rejection

Source
TxGossipRuntime.scala
def closeSession(sessionId: DirectionalSessionId): F[Either[HandshakeRejected, Unit]]

Gracefully closes a session.

Gracefully closes a session.

Value parameters

sessionId

the session to close

Attributes

Returns

unit on success, or a rejection

Source
TxGossipRuntime.scala

Generates a keep-alive acknowledgement for an outbound control channel session.

Generates a keep-alive acknowledgement for an outbound control channel session.

Value parameters

sessionId

the outbound session

Attributes

Returns

the ack message, or a rejection

Source
TxGossipRuntime.scala

Generates a keep-alive message for an outbound event stream session.

Generates a keep-alive message for an outbound event stream session.

Value parameters

sessionId

the outbound session

Attributes

Returns

the keep-alive message, or a rejection

Source
TxGossipRuntime.scala

Processes an inbound session open proposal using the initiator as the authenticated peer.

Processes an inbound session open proposal using the initiator as the authenticated peer.

Value parameters

proposal

the received proposal

Attributes

Returns

the handshake result

Source
TxGossipRuntime.scala

Processes an inbound proposal with custom negotiation overrides.

Processes an inbound proposal with custom negotiation overrides.

Value parameters

authenticatedPeer

the peer identity verified by transport authentication

negotiationOverrides

the negotiation parameter overrides

proposal

the received proposal

Attributes

Returns

the handshake result

Source
TxGossipRuntime.scala

Processes an inbound proposal with an externally authenticated peer identity.

Processes an inbound proposal with an externally authenticated peer identity.

Value parameters

authenticatedPeer

the peer identity verified by transport authentication

proposal

the received proposal

Attributes

Returns

the handshake result

Source
TxGossipRuntime.scala
def markSessionDead(sessionId: DirectionalSessionId): F[Either[HandshakeRejected, Unit]]

Marks a session as terminally dead.

Marks a session as terminally dead.

Value parameters

sessionId

the session to mark dead

Attributes

Returns

unit on success, or a rejection

Source
TxGossipRuntime.scala
def pollEvents(sessionId: DirectionalSessionId): F[Either[CanonicalRejection, Vector[EventStreamMessage[A]]]]

Polls available events for an outbound session, batching according to QoS settings.

Polls available events for an outbound session, batching according to QoS settings.

Value parameters

sessionId

the outbound session to poll

Attributes

Returns

the event stream messages, or a rejection

Source
TxGossipRuntime.scala

Receives and applies a control batch from a consumer on an outbound session.

Receives and applies a control batch from a consumer on an outbound session.

Value parameters

batch

the control batch to process

sessionId

the session receiving the batch

Attributes

Returns

the batch outcome, or a rejection

Source
TxGossipRuntime.scala
def receiveEvents(sessionId: DirectionalSessionId, messages: Vector[EventStreamMessage[A]]): F[Either[CanonicalRejection, TxReceiveEventsResult[A]]]

Receives and applies inbound event stream messages on a consumer session.

Receives and applies inbound event stream messages on a consumer session.

Value parameters

messages

the event stream messages

sessionId

the inbound session receiving events

Attributes

Returns

the receive result, or a rejection

Source
TxGossipRuntime.scala

Returns the current relationship with the given peer, if any.

Returns the current relationship with the given peer, if any.

Value parameters

peer

the peer identity

Attributes

Returns

the relationship, or None

Source
TxGossipRuntime.scala

Returns a snapshot of the current runtime state after expiring timed-out sessions.

Returns a snapshot of the current runtime state after expiring timed-out sessions.

Attributes

Returns

the current runtime state

Source
TxGossipRuntime.scala

Initiates an outbound session to a peer with custom negotiation overrides.

Initiates an outbound session to a peer with custom negotiation overrides.

Value parameters

negotiationOverrides

the negotiation parameter overrides

peer

the target peer

subscriptions

the chain-topic pairs to subscribe to

Attributes

Returns

the proposal, or a rejection

Source
TxGossipRuntime.scala
def streamEvents(sessionId: DirectionalSessionId)(using Temporal[F]): Stream[F, EventStreamMessage[A]]

Streams outbound event session messages from retained source state and runtime wakeups.

Streams outbound event session messages from retained source state and runtime wakeups.

The stream waits on source/control/session wakeups or the exact next keepalive/flush deadline; it does not contain a fixed polling loop.

Value parameters

sessionId

the outbound session to stream

Attributes

Returns

the event stream messages for the session

Source
TxGossipRuntime.scala

Inherited methods

final protected def appendUnique(existing: Vector[StableArtifactId], additions: Vector[StableArtifactId]): Vector[StableArtifactId]

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def applyControlBatch(now: Instant, batch: ControlBatch, sessionState: TxProducerSessionState): Either[ControlBatchRejected, (TxProducerSessionState, ControlBatchOutcome)]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala
final protected def applyControlOp(now: Instant, sessionState: TxProducerSessionState, op: ControlOp): Either[ControlBatchRejected, TxProducerSessionState]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala
final protected def controlRejected(reason: String, detail: String): ControlBatchRejected

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def expireState(state: TxGossipRuntimeState, now: Instant): TxGossipRuntimeState

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def handshakeRejected(reason: String, detail: String): HandshakeRejected

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def nextFlushDeadline(now: Instant, sessionState: TxProducerSessionState): F[Option[Instant]]

Attributes

Inherited from:
TxGossipRuntimePollingOps (hidden)
Source
TxGossipRuntimePollingOps.scala

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def pollExactKnownChain(now: Instant, sessionState: TxProducerSessionState, chainTopic: ChainTopic, contract: GossipTopicContract[A]): F[Either[CanonicalRejection, (TxProducerSessionState, Vector[GossipEvent[A]])]]

Attributes

Inherited from:
TxGossipRuntimePollingOps (hidden)
Source
TxGossipRuntimePollingOps.scala
final protected def pollOpenSession(now: Instant, sessionState: TxProducerSessionState): F[Either[CanonicalRejection, (TxProducerSessionState, Vector[GossipEvent[A]])]]

Attributes

Inherited from:
TxGossipRuntimePollingOps (hidden)
Source
TxGossipRuntimePollingOps.scala
final protected def pollTxChain(now: Instant, sessionState: TxProducerSessionState, chainTopic: ChainTopic): F[Either[CanonicalRejection, (TxProducerSessionState, Vector[GossipEvent[A]])]]

Attributes

Inherited from:
TxGossipRuntimePollingOps (hidden)
Source
TxGossipRuntimePollingOps.scala
final protected def positiveIntConfig(key: String, value: Long): Either[ControlBatchRejected, Int]

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def prevalidateControlBatch(state: TxGossipRuntimeState, sessionId: DirectionalSessionId, batch: ControlBatch): F[Either[ControlBatchRejected, Unit]]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala
final protected def pruneIdempotencyKeys(now: Instant, sessionState: TxProducerSessionState): Map[ControlIdempotencyKey, Instant]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def selectArtifacts(candidates: Vector[AvailableGossipEvent[A]], selectedEvents: Vector[GossipEvent[A]]): Vector[AvailableGossipEvent[A]]

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def snapshotAt(now: Instant): F[TxGossipRuntimeState]

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala
final protected def touchSessionActivity(state: TxGossipRuntimeState, sessionId: DirectionalSessionId, now: Instant): Either[HandshakeRejected, TxGossipRuntimeState]

Attributes

Inherited from:
TxGossipRuntimeSharedOps (hidden)
Source
TxGossipRuntimeSharedOps.scala

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala
final protected def validateSubscription(sessionState: TxProducerSessionState, chainId: ChainId, topic: GossipTopic): Either[ControlBatchRejected, Unit]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala
final protected def validateTxSubscription(sessionState: TxProducerSessionState, chainId: ChainId, topic: GossipTopic): Either[ControlBatchRejected, Unit]

Attributes

Inherited from:
TxGossipRuntimeControlOps (hidden)
Source
TxGossipRuntimeControlOps.scala