Packages

package sequencer

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

Package Members

  1. package admin
  2. package block
  3. package config
  4. package errors
  5. package store
  6. package traffic

Type Members

  1. trait AbstractSequencerMemberStatus extends Product with Serializable
  2. trait AbstractSequencerPruningStatus extends AnyRef
  3. final case class AggregatedSender(sender: Member, maxSequencingTime: CantonTimestamp, aggregation: AggregationBySender) extends Product with Serializable
  4. final case class AuthenticationServices(syncCryptoForAuthentication: SynchronizerCryptoClient, memberAuthenticationService: MemberAuthenticationService, sequencerAuthenticationService: GrpcSequencerAuthenticationService, authenticationServerInterceptor: SequencerAuthenticationServerInterceptor) extends Product with Serializable
  5. abstract class BaseSequencer extends Sequencer with NamedLogging with Spanning

    Implements parts of Sequencer interface, common to all sequencers.

    Implements parts of Sequencer interface, common to all sequencers. Adds *Internal methods without implementation for variance among specific sequencer subclasses.

  6. final case class BatchWritten(notifies: WriteNotification, latestTimestamp: CantonTimestamp, events: Seq[NonEmpty[Seq[Sequenced[BytesPayload]]]]) extends Product with Serializable
  7. final case class BlockSequencerConfig(writer: SequencerWriterConfig = SequencerWriterConfig.HighThroughput(), reader: SequencerReaderConfig = SequencerReaderConfig(), testingInterceptor: Option[TestingInterceptor] = None, streamInstrumentation: BlockSequencerStreamInstrumentationConfig = BlockSequencerStreamInstrumentationConfig()) extends UniformCantonConfigValidation with Product with Serializable
  8. final case class BlockSequencerStreamInstrumentationConfig(isEnabled: Boolean = false, bufferSize: PositiveInt = DefaultBufferSize) extends UniformCantonConfigValidation with Product with Serializable
  9. sealed trait CommitMode extends AnyRef
  10. class CommunityDatabaseSequencerFactory extends DatabaseSequencerFactory
  11. final class ConflictingPayloadIdException extends SequencerWriterException

    We intentionally use an unsafe storage method for writing payloads to take advantage of a full connection pool for performance.

    We intentionally use an unsafe storage method for writing payloads to take advantage of a full connection pool for performance. However this means if a HA Sequencer Writer has lost its instance lock it may still attempt to write payloads while another Sequencer Writer is active with the same instance index. As we use this instance index to generate an (almost) conflict free payload id, in this circumstance there is a slim chance that we may attempt to write conflicting payloads with the same id. If we were using a simple idempotent write approach this could result in the active sequencer writing an event with a payload from the offline writer process (and not the payload it is expecting). This would be a terrible and difficult to diagnose corruption issue.

    If this exception is raised we currently just halt the writer and run crash recovery. This is slightly suboptimal as in the above scenario we may crash the active writer (if they were second to write a conflicting payload id). However this will be safe. We could optimise this by checking the active lock status and only halting if this is found to be false.

  12. class DatabaseSequencer extends BaseSequencer with FlagCloseable
  13. trait DatabaseSequencerConfig extends AnyRef

    Unsealed trait so the database sequencer config can be reused between community and enterprise

  14. abstract class DatabaseSequencerFactory extends SequencerFactory with NamedLogging
  15. trait DatabaseSequencerIntegration extends SequencerIntegration
  16. sealed trait DeliverableSubmissionOutcome extends SubmissionOutcome
  17. class DirectSequencerClientTransport extends SequencerClientTransport with SequencerClientTransportPekko with NamedLogging

    This transport is meant to be used to create a sequencer client that connects directly to an in-process sequencer.

    This transport is meant to be used to create a sequencer client that connects directly to an in-process sequencer. Needed for cases when the sequencer node itself needs to listen to specific events such as identity events.

  18. class EnterpriseDatabaseSequencerFactory extends DatabaseSequencerFactory with NamedLogging
  19. trait EventSignaller extends AutoCloseable

    Component to signal to a SequencerReader that more events may be available to read so should attempt fetching events from its store.

  20. final case class FreshInFlightAggregation(firstSequencingTimestamp: CantonTimestamp, maxSequencingTimestamp: CantonTimestamp, rule: AggregationRule) extends Product with Serializable

    The metadata for starting a fresh in-flight aggregation

  21. class HASequencerExclusiveStorageNotifier extends NamedLogging

    The HA-sequencer exclusive storage notifier allows components dependent on exclusive storage to register for notifications when exclusive-storage failover occurs, so that exclusive storage writes can be moved to the active instance.

    The HA-sequencer exclusive storage notifier allows components dependent on exclusive storage to register for notifications when exclusive-storage failover occurs, so that exclusive storage writes can be moved to the active instance.

    This allows building exclusive storage before components depending on exclusive storage and to register for notifications in a delayed fashion after those components have been created.

  22. class HASequencerWriterStoreFactory extends SequencerWriterStoreFactory with FlagCloseable with HasCloseContext with NamedLogging

    com.digitalasset.canton.synchronizer.sequencer.store.SequencerWriterStore factory using resource.DbStorageMulti to ensure each writer has a unique instance index and that all sensitive writes are performed while holding an exclusive lock for that instance index.

  23. final case class InFlightAggregation extends PrettyPrinting with HasLoggerName with Product with Serializable

    Stores the state of an in-flight aggregation of submission requests.

    Stores the state of an in-flight aggregation of submission requests.

    Since the com.digitalasset.canton.sequencing.protocol.AggregationId computationally identifies the envelope contents, their recipients, and the com.digitalasset.canton.sequencing.protocol.SubmissionRequest.topologyTimestamp, we do not need to maintain these data as part of the in-flight tracking. Instead, we can derive them from the submission request that makes the aggregation reach its threshold.

  24. final case class InFlightAggregationUpdate(freshAggregation: Option[FreshInFlightAggregation], aggregatedSenders: Chain[AggregatedSender]) extends Product with Serializable

    Describes an incremental update to the in-flight aggregation state

  25. type InFlightAggregationUpdates = Map[AggregationId, InFlightAggregationUpdate]
  26. type InFlightAggregations = Map[AggregationId, InFlightAggregation]
  27. final case class InternalSequencerMemberStatus(registeredAt: CantonTimestamp, lastAcknowledged: Option[CantonTimestamp]) extends AbstractSequencerMemberStatus with PrettyPrinting with Product with Serializable
  28. class LocalSequencerStateEventSignaller extends EventSignaller with FlagCloseableAsync with NamedLogging

    If all Sequencer writes are occurring locally we pipe write notifications to read subscriptions allowing the SequencerReader to immediately read from the backing store rather than polling.

    If all Sequencer writes are occurring locally we pipe write notifications to read subscriptions allowing the SequencerReader to immediately read from the backing store rather than polling.

    An important caveat is that we only supply signals when a write for a member occurs. If there are no writes from starting the process the member will never receive a read signal. The SequencerReader is responsible for performing at least one initial read from the store to ensure that all prior events are served as required.

    Not suitable or at least very sub-optimal for a horizontally scaled sequencer setup where a reader will not have visibility of all writes locally.

  29. trait MkSequencerFactory extends AnyRef

    Artificial interface for dependency injection

  30. final case class OnboardingStateForSequencer(topologySnapshot: GenericStoredTopologyTransactions, staticSynchronizerParameters: StaticSynchronizerParameters, sequencerSnapshot: SequencerSnapshot)(representativeProtocolVersion: RepresentativeProtocolVersion[OnboardingStateForSequencer.type]) extends HasProtocolVersionedWrapper[OnboardingStateForSequencer] with Product with Serializable
  31. final case class OnlineSequencerCheckConfig(onlineCheckInterval: NonNegativeFiniteDuration = config.NonNegativeFiniteDuration.ofSeconds(5L), offlineDuration: NonNegativeFiniteDuration = config.NonNegativeFiniteDuration.ofSeconds(8L)) extends Product with Serializable
  32. final case class OrderingRequest[+A <: HasCryptographicEvidence] extends HasProtocolVersionedWrapper[OrderingRequest[HasCryptographicEvidence]] with ProtocolVersionedMemoizedEvidence with Product with Serializable

    Wrapper for requests sent by a sequencer to the ordering layer.

  33. class PartitionedTimestampGenerator extends AnyRef

    To generate unique timestamps between many nodes without coordination we partition available timestamps by the node index within a range of the total number of nodes.

  34. final class PayloadMissingException extends SequencerWriterException

    A payload that we should have just stored now seems to be missing.

  35. class PollingEventSignaller extends EventSignaller with NamedLogging

    Ignore local writes and simply trigger reads periodically based on a static polling interval.

    Ignore local writes and simply trigger reads periodically based on a static polling interval. Suitable for horizontally scaled sequencers where the local process will not have in-process visibility of all writes.

  36. class ProgressSupervisor extends NamedLogging

    ProgressSupervisor is a component that is meant to monitor anomalies in the node's operation, (i.e.

    ProgressSupervisor is a component that is meant to monitor anomalies in the node's operation, (i.e. node not making progressing), not covered by the conventional health checks, based on timing and expectations of processing progress of a data flow. It is meant to trigger alerts and possibly remedial actions:

    • Bumping log levels to DEBUG, flushing buffered logs, collecting thread dumps, heap dumps, etc.
    • Restarting the node.
    • Taking a poison pill.
  37. final case class ProgressSupervisorConfig(enabled: Boolean = true, stuckDetectionTimeout: PositiveFiniteDuration = PositiveFiniteDuration.ofSeconds(5), logAtDebugLevelDuration: PositiveFiniteDuration = PositiveFiniteDuration.ofSeconds(60)) extends UniformCantonConfigValidation with Product with Serializable
  38. sealed trait PruningError extends AnyRef

    Errors from pruning

  39. sealed trait PruningSupportError extends PruningError
  40. sealed trait ReadSignal extends AnyRef

    Signal that a reader should attempt to read the latest events as some may have been written

  41. class SendEventGenerator extends AnyRef
  42. sealed trait SequencedWrite extends HasTraceContext

    A write that we've assigned a timestamp to.

    A write that we've assigned a timestamp to. We drag these over the same clock so we can ensure earlier items have lower timestamps and later items have higher timestamps. This is very helpful, essential you may say, for correctly setting the watermark while ensuring an event with an earlier timestamp will not be written.

  43. trait Sequencer extends SequencerPruning with CloseableHealthQuasiComponent with AtomicHealthElement with HasCloseContext with NamedLogging

    Interface for sequencer operations.

    Interface for sequencer operations. The default DatabaseSequencer implementation is backed by a database run by a single operator. Other implementations support operating a Sequencer on top of third party ledgers or other infrastructure.

  44. final case class SequencerAuthenticationConfig(nonceExpirationInterval: NonNegativeFiniteDuration, maxTokenExpirationInterval: NonNegativeFiniteDuration) extends Product with Serializable
  45. final case class SequencerClients(members: Set[Member] = Set.empty) extends Product with Serializable

    Structure housing both members and instances of those members.

    Structure housing both members and instances of those members. Used to list clients that have been or need to be disabled.

  46. sealed trait SequencerConfig extends AnyRef
  47. trait SequencerFactory extends FlagCloseable with HasCloseContext
  48. final case class SequencerHealthConfig(backendCheckPeriod: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofSeconds(5)) extends UniformCantonConfigValidation with Product with Serializable

    Health check related sequencer config

    Health check related sequencer config

    backendCheckPeriod

    interval with which the sequencer will poll the health of its backend connection or state.

  49. final case class SequencerInitialState(synchronizerId: SynchronizerId, snapshot: SequencerSnapshot, latestSequencerEventTimestamp: Option[CantonTimestamp], initialTopologyEffectiveTimestamp: Option[CantonTimestamp]) extends Product with Serializable
  50. trait SequencerIntegration extends AnyRef

    This trait defines the interface for BlockSequencer's BlockUpdateGenerator to use on DatabaseSequencer in order to accept submissions and serve events from it

  51. final case class SequencerMemberStatus(member: Member, registeredAt: CantonTimestamp, lastAcknowledged: Option[CantonTimestamp], enabled: Boolean = true) extends AbstractSequencerMemberStatus with PrettyPrinting with Product with Serializable
  52. class SequencerNode extends CantonNode with NamedLogging with HasUptime
  53. class SequencerNodeBootstrap extends CantonNodeBootstrapImpl[SequencerNode, SequencerNodeConfig, SequencerNodeParameters, SequencerMetrics]
  54. trait SequencerNodeBootstrapFactory extends AnyRef
  55. final class SequencerOfflineException extends SequencerWriterException

    Throw as an error in the pekko stream when we discover that our currently running sequencer writer has been marked as offline.

  56. trait SequencerPruning extends AnyRef

    Sequencer pruning interface.

  57. final case class SequencerPruningStatus(lowerBound: CantonTimestamp, now: CantonTimestamp, members: Set[SequencerMemberStatus]) extends AbstractSequencerPruningStatus with PrettyPrinting with Product with Serializable

    Pruning status of a Sequencer.

    Pruning status of a Sequencer.

    now

    the current time of the sequencer clock

  58. class SequencerReader extends NamedLogging with FlagCloseable with HasCloseContext
  59. final case class SequencerReaderConfig(readBatchSize: Int = SequencerReaderConfig.defaultReadBatchSize, checkpointInterval: NonNegativeFiniteDuration = SequencerReaderConfig.defaultCheckpointInterval, pollingInterval: Option[NonNegativeFiniteDuration] = None, payloadBatchSize: Int = SequencerReaderConfig.defaultPayloadBatchSize, payloadBatchWindow: NonNegativeFiniteDuration = SequencerReaderConfig.defaultPayloadBatchWindow, payloadFetchParallelism: Int = SequencerReaderConfig.defaultPayloadFetchParallelism, eventGenerationParallelism: Int = SequencerReaderConfig.defaultEventGenerationParallelism) extends CustomCantonConfigValidation with Product with Serializable

    Configuration for the database based sequence reader.

    Configuration for the database based sequence reader.

    readBatchSize

    max number of events to fetch from the datastore in one page

    checkpointInterval

    how frequently to checkpoint state

    pollingInterval

    how frequently to poll for new events from the database. only used in the enterprise edition if high availability has been configured, otherwise will rely on local writes performed by this sequencer to indicate that new events are available.

    payloadBatchSize

    max number of payloads to fetch from the datastore in one page

    payloadBatchWindow

    max time window to wait for more payloads before fetching the current batch from the datastore

    payloadFetchParallelism

    how many batches of payloads will be fetched in parallel

    eventGenerationParallelism

    how many events will be generated from the fetched payloads in parallel

  60. class SequencerRuntime extends FlagCloseable with HasCloseContext with NamedLogging

    Run a sequencer and its supporting services.

  61. final case class SequencerSnapshot(lastTs: CantonTimestamp, latestBlockHeight: Long, previousTimestamps: Map[Member, Option[CantonTimestamp]], status: SequencerPruningStatus, inFlightAggregations: InFlightAggregations, additional: Option[ImplementationSpecificInfo], trafficPurchased: Seq[TrafficPurchased], trafficConsumed: Seq[TrafficConsumed])(representativeProtocolVersion: RepresentativeProtocolVersion[SequencerSnapshot.type]) extends HasProtocolVersionedWrapper[SequencerSnapshot] with PrettyPrinting with Product with Serializable
  62. class SequencerWriter extends NamedLogging with FlagCloseableAsync with HasCloseContext

    The Writer component is in practice a little state machine that will run crash recovery on startup then create a running SequencerWriterSource.

    The Writer component is in practice a little state machine that will run crash recovery on startup then create a running SequencerWriterSource. If this materialized Sequencer flow then crashes with an exception that can be recovered by running crash recovery it will then go through this process and attempt to restart the flow.

    Callers must call start to start the writer and will likely have to wait for this completing before accepting calls for the sequencer to direct at send. Note that the crash recovery steps may take a long duration to run:

    • we delete invalid events previously written by the sequencer and then attempt to insert a new online watermark, and these database queries may simply take a long time to run.
    • the SequencerWriter will wait until our clock has reached the new online watermark timestamp before starting the writer to ensure that no events before this timestamp are written. If this online watermark is significantly ahead of the current clock value it will just wait until this is reached. In practice assuming all sequencers in the local topology are kept in sync through NTP or similar, this duration should be very small (<1s).
  63. sealed trait SequencerWriterConfig extends AnyRef

    Configuration for the database based sequencer writer

  64. sealed abstract class SequencerWriterException extends RuntimeException

    Base class for exceptions intentionally thrown during Pekko stream to flag errors

  65. class SequencerWriterQueues extends NamedLogging
  66. trait SequencerWriterStoreFactory extends AutoCloseable

    Create instances for a sequencer.store.SequencerWriterStore and a predicate to know whether we can recreate a sequencer writer on failures encountered potentially during storage.

    Create instances for a sequencer.store.SequencerWriterStore and a predicate to know whether we can recreate a sequencer writer on failures encountered potentially during storage. Implements AutoClosable so implementations can use lifecycle.FlagCloseable to short circuit retry attempts.

  67. trait SignatureVerifier extends AnyRef
  68. sealed trait SubmissionOutcome extends AnyRef
  69. sealed trait Write extends AnyRef

    A write we want to make to the db

  70. sealed trait WriteNotification extends AnyRef

    Who gets notified that a event has been written

  71. trait WriterStartupError extends AnyRef

    Errors that can occur while starting the SequencerWriter.

    Errors that can occur while starting the SequencerWriter. In the HA Sequencer Writer it is possible due to racy assignment of writer locks that the startup may fail. This is by design and starting the writer can simply be retried. However other errors such as discovering incorrect configuration or a unexpected commit mode will not be recoverable and the writer should propagate the failure.

Value Members

  1. object AggregatedSender extends Serializable
  2. object AssertMonotonicBlockSequencerTimestampsFlow
    Annotations
    @SuppressWarnings()
  3. object BatchWritten extends Serializable
  4. object BlockSequencerConfig extends Serializable
  5. object BlockSequencerStreamInstrumentationConfig extends Serializable
  6. object CommitMode
  7. object CommunitySequencerFactory extends MkSequencerFactory
  8. object CommunitySequencerNodeBootstrapFactory extends SequencerNodeBootstrapFactory
  9. object DatabaseSequencer
  10. object DatabaseSequencerConfig
  11. object DirectSequencerClientTransport
  12. object EnterpriseSequencerFactory extends MkSequencerFactory
  13. object EnterpriseSequencerNodeBootstrapFactory extends SequencerNodeBootstrapFactory
  14. object FetchLatestEventsFlow

    Flow that upon read signals will attempt to fetch all events until head is reached.

    Flow that upon read signals will attempt to fetch all events until head is reached. Events are paged in within a sub-source to prevent all events being held in memory at once.

  15. object HASequencerExclusiveStorageNotifier
  16. object InFlightAggregation extends Serializable
  17. object InFlightAggregationUpdate extends Serializable
  18. object InFlightAggregations
  19. object NotifyEventSignallerFlow
  20. object OnboardingStateForSequencer extends VersioningCompanion[OnboardingStateForSequencer] with Serializable
  21. object OrderingRequest extends VersioningCompanionMemoization2[OrderingRequest[HasCryptographicEvidence], OrderingRequest[BytestringWithCryptographicEvidence]] with Serializable
  22. object ProgressSupervisorConfig extends Serializable
  23. object PruningError
  24. case object ReadSignal extends ReadSignal with Product with Serializable
  25. object RecordWatermarkDelayMetricFlow
  26. object SequenceWritesFlow
  27. object SequencedWrite
  28. object Sequencer extends HasLoggerName
  29. object SequencerAuthenticationConfig extends Serializable
  30. object SequencerConfig
  31. object SequencerHealthConfig extends Serializable
  32. object SequencerInitialState extends Serializable
  33. object SequencerIntegration
  34. object SequencerMemberStatus extends Serializable
  35. object SequencerNodeBootstrap
  36. object SequencerPruningStatus extends Serializable
  37. object SequencerReader
  38. object SequencerReaderConfig extends Serializable
  39. object SequencerRuntime
  40. object SequencerSnapshot extends VersioningCompanion[SequencerSnapshot] with Serializable
  41. object SequencerUtils
  42. object SequencerWriter
  43. object SequencerWriterConfig

    Expose config as different named versions using different default values to allow easy switching for the different setups we can run in (high-throughput, low-latency).

    Expose config as different named versions using different default values to allow easy switching for the different setups we can run in (high-throughput, low-latency). However as each value is only a default so they can also be easily overridden if required.

  44. object SequencerWriterSource

    Pekko stream for writing as a Sequencer

  45. object SequencerWriterStoreFactory
  46. object SignatureVerifier
  47. object SubmissionOutcome
  48. object TotalNodeCountValues
  49. object UpdateWatermarkFlow
  50. object Write
  51. object WriteNotification
  52. object WritePayloadsFlow

    Extract the payloads of events and write them in batches to the payloads table.

    Extract the payloads of events and write them in batches to the payloads table. As order does not matter at this point allow writing batches concurrently up to the concurrency specified by SequencerWriterConfig.payloadWriteMaxConcurrency. Pass on the events with the payloads dropped and replaced by their payload ids.

  53. object WriterStartupError

Inherited from AnyRef

Inherited from Any

Ungrouped