package update
- Alphabetic
- Public
- Protected
Type Members
- final class BlockChunkProcessor extends NamedLogging
Processes a chunk of events in a block, yielding a ChunkUpdate.
- sealed trait BlockUpdate extends Product with Serializable
Summarizes the updates that are to be persisted and signalled individually
- trait BlockUpdateGenerator extends AnyRef
Exposes functions that take the deserialized contents of a block from a blockchain integration and compute the new BlockUpdates.
Exposes functions that take the deserialized contents of a block from a blockchain integration and compute the new BlockUpdates.
These functions correspond to the following steps in the block processing stream pipeline:
- Extracting block events from a raw ledger block (extractBlockEvents).
- Chunking such block events into either event chunks terminated by a sequencer-addessed event or a block completion (chunkBlock).
- Validating and enriching chunks to yield block updates (processBlockChunk).
In particular, these functions are responsible for the final timestamp assignment of a given submission request. The timestamp assignment works as follows:
- an initial timestamp is assigned to the submission request by the sequencer that writes it to the ledger
- each sequencer that reads the block potentially adapts the previously assigned timestamp
deterministically via
ensureStrictlyIncreasingTimestamp
- this timestamp is used to compute the 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).
- class BlockUpdateGeneratorImpl extends BlockUpdateGenerator with NamedLogging
- final case class ChunkUpdate(acknowledgements: Map[Member, CantonTimestamp] = Map.empty, invalidAcknowledgements: Seq[(Member, CantonTimestamp, BaseAlarm)] = Seq.empty, inFlightAggregationUpdates: InFlightAggregationUpdates = Map.empty, lastSequencerEventTimestamp: Option[CantonTimestamp], inFlightAggregations: InFlightAggregations, submissionsOutcomes: Seq[SubmissionOutcome] = Seq.empty) extends OrderedBlockUpdate with 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
- acknowledgements
The highest valid acknowledged timestamp for each member in the block.
- invalidAcknowledgements
All invalid acknowledgement timestamps in the block for each member.
- inFlightAggregationUpdates
The updates to the in-flight aggregation states. Includes the clean-up of expired aggregations.
- lastSequencerEventTimestamp
The highest timestamp of an event in
events
addressed to the sequencer, if any.- inFlightAggregations
Updated inFlightAggregations to be used for processing subsequent chunks.
- submissionsOutcomes
A list of internal block sequencer states after processing submissions for the chunk. This is used by the unified sequencer to generate and write events in the database sequencer.
- final case class CompleteBlockUpdate(block: BlockInfo) extends OrderedBlockUpdate 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.synchronizer.block.data.BlockInfo must be consistent with the updates in all earlier ChunkUpdates. In particular:
- com.digitalasset.canton.synchronizer.block.data.BlockInfo.lastTs must be at least the one from the last chunk or previous block
- com.digitalasset.canton.synchronizer.block.data.BlockInfo.latestSequencerEventTimestamp must be at least the one from the last chunk or previous block.
- com.digitalasset.canton.synchronizer.block.data.BlockInfo.height must be exactly one
higher than the previous block The consistency conditions are checked in
com.digitalasset.canton.synchronizer.block.BlockSequencerStateManager's
handleComplete
.
- sealed trait OrderedBlockUpdate extends BlockUpdate
Denotes an update that is generated from a block that went through ordering
Value Members
- object BlockUpdateGenerator
- object BlockUpdateGeneratorImpl