Packages

package block

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. block
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package data

Type Members

  1. final case class BlockEvents(height: Long, events: Seq[Traced[LedgerBlockEvent]]) extends Product with Serializable
  2. trait BlockOrderer extends AutoCloseable

    Only the differences w.r.t.

    Only the differences w.r.t. SequencerDriver are documented.

  3. trait BlockOrdererFactory extends AnyRef

    Only the differences w.r.t.

    Only the differences w.r.t. SequencerDriverFactory are documented.

  4. class BlockSequencerStateManager extends BlockSequencerStateManagerBase with NamedLogging
  5. trait BlockSequencerStateManagerBase extends FlagCloseableAsync

    State manager for operating a sequencer using Blockchain based infrastructure (such as fabric or ethereum)

  6. class BlockUpdateGenerator extends NamedLogging

    Exposes functions that take the deserialized contents of a block from a blockchain integration and computes the new com.digitalasset.canton.domain.block.BlockUpdates.

    Exposes functions that take the deserialized contents of a block from a blockchain integration and computes the new com.digitalasset.canton.domain.block.BlockUpdates. Used by Ethereum and Fabric integrations.

    In particular, these functions are responsible for the final timestamp assignment of a given submission request. The timestamp assignment works as follows: 1. an initial timestamp is assigned to the submission request by the sequencer that writes it to the ledger 2. each sequencer that reads the block potentially adapts the previously assigned timestamp deterministically via ensureStrictlyIncreasingTimestamp 3. this timestamp is used to compute the com.digitalasset.canton.domain.block.BlockUpdates

    Reasoning: Step 1 is done so that every sequencer sees the same timestamp for a given event. Step 2 is needed because different sequencers may assign the same timestamps to different events or may not assign strictly increasing timestamps due to clock skews.

    Invariants: For step 2, we assume that every sequencer observes the same stream of events from the underlying ledger (and especially that events are always read in the same order).

  7. sealed trait BlockUpdates extends Product with Serializable

    A series of changes from processing the chunks of updates within a block.

  8. final case class ChunkUpdate(newMembers: Map[Member, CantonTimestamp] = Map.empty, membersDisabled: Seq[Member] = Seq.empty, acknowledgements: Map[Member, CantonTimestamp] = Map.empty, invalidAcknowledgements: Seq[(Member, CantonTimestamp, BaseError)] = Seq.empty, signedEvents: Seq[SignedEvents] = Seq.empty, pruningRequests: Seq[Traced[CantonTimestamp]] = Seq.empty, lastTopologyClientTimestamp: Option[CantonTimestamp], state: EphemeralState) extends Product with Serializable

    Changes from processing a consecutive part of updates within a block from the blockchain.

    Changes from processing a consecutive part of updates within a block from the blockchain. We expect all values to be consistent with one another:

    • new members must exist in the registered members
    • the provided timestamps must be at or after the latest sequencer timestamp of the previous chunk or block
    • members receiving events must be registered
    • timestamps of events must not after the latest sequencer timestamp of the previous chunk or block
    • counter values for each member should be continuous
    newMembers

    Members that were added along with the timestamp that they are considered registered from.

    membersDisabled

    Members that were disabled.

    acknowledgements

    The highest valid acknowledged timestamp for each member in the block.

    invalidAcknowledgements

    All invalid acknowledgement timestamps in the block for each member.

    signedEvents

    New sequenced events for members.

    pruningRequests

    Upper bound timestamps to prune the sequencer's local state.

    lastTopologyClientTimestamp

    The highest timestamp of an event in events addressed to the sequencer's topology client, if any.

    state

    Updated ephemeral state to be used for processing subsequent chunks.

  9. final case class CompleteBlockUpdate(block: BlockInfo) extends BlockUpdates with Product with Serializable

    Signals that all updates in a block have been delivered as chunks.

    Signals that all updates in a block have been delivered as chunks. The com.digitalasset.canton.domain.block.data.BlockInfo must be consistent with the updates in all earlier ChunkUpdates. In particular: - com.digitalasset.canton.domain.block.data.BlockInfo.lastTs must be at least the one from the last chunk or previous block - com.digitalasset.canton.domain.block.data.BlockInfo.latestTopologyClientTimestamp must be at least the one from the last chunk or previous block. - com.digitalasset.canton.domain.block.data.BlockInfo.height must be exactly one higher than the previous block The consistency conditions are checked in handleUpdate

  10. sealed trait LedgerBlockEvent extends Product with Serializable

    Trait that generalizes over the kind of events that could be observed in a blockchain integration.

    Trait that generalizes over the kind of events that could be observed in a blockchain integration.

    Used by Ethereum and Fabric.

  11. final case class PartialBlockUpdate(chunk: ChunkUpdate, continuation: Future[BlockUpdates]) extends BlockUpdates with Product with Serializable

    A chunk of updates within a block.

    A chunk of updates within a block. The updates can be delivered to com.digitalasset.canton.sequencing.client.SequencerClients immediately, before fully processing the block.

    The next partial block update may depend on the events in the current chunk, e.g., by the topology processor processing them via its sequencer client subscription. For this reason, the next partial block update is wrapped in its own future, which can sync the topology updates via the topology client.

    continuation

    Computes the remainder of updates in a given block

  12. final case class RawLedgerBlock(blockHeight: Long, events: Seq[Traced[RawBlockEvent]]) extends Product with Serializable

    A block that a SequencerDriver delivers to the sequencer node.

    A block that a SequencerDriver delivers to the sequencer node.

    blockHeight

    The height of the block. Block heights must be consecutive.

    events

    The events in the given block.

  13. trait SequencerDriver extends AutoCloseable

    Defines methods for synchronizing data in blocks among all sequencer nodes of a domain.

    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.

  14. trait SequencerDriverFactory extends AnyRef

    Factory for creating a SequencerDriver for a block-based sequencer, including methods for dealing with configuration of the ledger driver.

  15. final case class SequencerDriverHealthStatus(isActive: Boolean, description: Option[String]) extends Product with Serializable
  16. class SequencerUnexpectedStateChange extends RuntimeException

    Thrown if the ephemeral state does not match what is expected in the persisted store.

    Thrown if the ephemeral state does not match what is expected in the persisted store. This is not expected to be able to occur, but if it does likely means that the ephemeral state is inconsistent with the persisted state. The sequencer should be restarted and logs verified to ensure that the persisted state is correct.

Value Members

  1. val UninitializedBlockHeight: Long

    Height used by the block stores before a height has been set.

    Height used by the block stores before a height has been set. The DB store should be initialized to this value in its initial migration.

  2. object BlockOrderer
  3. object BlockOrderingSequencer

    Adapts a com.digitalasset.canton.domain.block.BlockOrderer implementation to the sequencer driver API.

  4. object BlockSequencerStateManager
  5. object BlockUpdateGenerator
  6. object LedgerBlockEvent extends HasLoggerName with Serializable
  7. object RawLedgerBlock extends Serializable
  8. object SequencerDriver

Inherited from AnyRef

Inherited from Any

Ungrouped