trait SequencerDriver extends AutoCloseable
Defines methods for synchronizing data in blocks among all sequencer nodes of a domain.
The write operations sequence and distribute different kinds of requests. They can all be implemented by the same mechanism of sequencing a bytestring, but are kept separately for legacy reasons: The Fabric and Ethereum drivers have separate entry points or messages for the different request kinds.
Sequenced requests are delivered in a stream of RawLedgerBlocks ordered by their block height.
The driver must make sure that all sequencer nodes of a domain receive the same stream of RawLedgerBlocks eventually.
That is, if one sequencer node receives a block b
at block height h
, then every other sequencer node has already
or will eventually receive b
at height h
unless the node fails permanently.
Each RawLedgerBlock contains com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvents
that correspond to the sequenced requests. The com.digitalasset.canton.tracing.TraceContext
passed to the write operations should be propagated into the corresponding
com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.
All write operations are asynchronous: the scala.concurrent.Future may complete before the request is actually sequenced. Under normal circumstances, the request should then also eventually be delivered in a com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent, but there is no guarantee. A write operation may fail with an exception; in that case, the request must not be sequenced. Every write operation may result in at most one corresponding com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.
The SequencerDriver is responsible for assigning timestamps to
com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.Send events.
The assigned timestamps must be close to real-world time given the trust assumptions of the SequencerDriver.
For example, assume that the clocks among all honest sequencer nodes are synchronized up to a given skew
.
Let ts0
be the local sequencer's time when an honest sequencer node calls SequencerDriver.send.
Let ts1
be the local sequencer's time when it receives the corresponding
com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.Send.
Then the assigned timestamp ts
must satisfy ts0 - skew <= ts <= ts1 + skew
.
Several com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.Send events may have the same timestamp or go backwards, as long as they remain close to real-world time.
- Alphabetic
- By Inheritance
- SequencerDriver
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def acknowledge(acknowledgement: ByteString)(implicit traceContext: TraceContext): Future[Unit]
Distribute an acknowledgement request.
Distribute an acknowledgement request. Results in a com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.Acknowledgment.
- abstract def adminServices: Seq[BindableService]
Services for administering the ledger driver.
Services for administering the ledger driver. These services will be exposed on the sequencer node's admin API endpoint.
- abstract def close(): Unit
- Definition Classes
- AutoCloseable
- Annotations
- @throws(classOf[java.lang.Exception])
- abstract def health(implicit traceContext: TraceContext): Future[SequencerDriverHealthStatus]
- abstract def registerMember(member: String)(implicit traceContext: TraceContext): Future[Unit]
Register the given member.
Register the given member. Results in a com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.AddMember.
- abstract def send(request: ByteString)(implicit traceContext: TraceContext): Future[Unit]
Send a submission request.
Send a submission request. Results in a com.digitalasset.canton.domain.block.RawLedgerBlock.RawBlockEvent.Send.
- abstract def subscribe()(implicit traceContext: TraceContext): Source[RawLedgerBlock, KillSwitch]
Delivers a stream of blocks starting with
firstBlockHeight
(if specified in the factory call) or the first block serveable.Delivers a stream of blocks starting with
firstBlockHeight
(if specified in the factory call) or the first block serveable. Block heights must be consecutive.If
firstBlockHeight
refers to a block whose sequencing number the sequencer node has not yet observed, returns a source that will eventually serve that block when it gets created.Must succeed if an earlier call to
subscribe
delivered a block with heightfirstBlockHeight
unless the block has been pruned in between, in which case it failsThis method will be called only once, so implementations do not have to try to create separate sources on every call to this method. It is acceptable to for the driver to have one internal source and just return it here.
Concrete 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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])