sui_sdk_types

Struct CheckpointSummary

Source
pub struct CheckpointSummary {
    pub epoch: EpochId,
    pub sequence_number: CheckpointSequenceNumber,
    pub network_total_transactions: u64,
    pub content_digest: CheckpointContentsDigest,
    pub previous_digest: Option<CheckpointDigest>,
    pub epoch_rolling_gas_cost_summary: GasCostSummary,
    pub timestamp_ms: CheckpointTimestamp,
    pub checkpoint_commitments: Vec<CheckpointCommitment>,
    pub end_of_epoch_data: Option<EndOfEpochData>,
    pub version_specific_data: Vec<u8>,
}
Expand description

A header for a Checkpoint on the Sui blockchain.

On the Sui network, checkpoints define the history of the blockchain. They are quite similar to the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain, however, forms checkpoints after transaction execution has already happened to provide a certified history of the chain, instead of being formed before execution.

Checkpoints commit to a variety of state including but not limited to:

  • The hash of the previous checkpoint.
  • The set of transaction digests, their corresponding effects digests, as well as the set of user signatures which authorized its execution.
  • The object’s produced by a transaction.
  • The set of live objects that make up the current state of the chain.
  • On epoch transitions, the next validator committee.

CheckpointSummarys themselves don’t directly include all of the above information but they are the top-level type by which all the above are committed to transitively via cryptographic hashes included in the summary. CheckpointSummarys are signed and certified by a quorum of the validator committee in a given epoch in order to allow verification of the chain’s state.

§BCS

The BCS serialized form for this type is defined by the following ABNF:

checkpoint-summary = u64                            ; epoch
                     u64                            ; sequence_number
                     u64                            ; network_total_transactions
                     digest                         ; content_digest
                     (option digest)                ; previous_digest
                     gas-cost-summary               ; epoch_rolling_gas_cost_summary
                     u64                            ; timestamp_ms
                     (vector checkpoint-commitment) ; checkpoint_commitments
                     (option end-of-epoch-data)     ; end_of_epoch_data
                     bytes                          ; version_specific_data

Fields§

§epoch: EpochId

Epoch that this checkpoint belongs to.

§sequence_number: CheckpointSequenceNumber

The height of this checkpoint.

§network_total_transactions: u64

Total number of transactions committed since genesis, including those in this checkpoint.

§content_digest: CheckpointContentsDigest

The hash of the CheckpointContents for this checkpoint.

§previous_digest: Option<CheckpointDigest>

The hash of the previous CheckpointSummary.

This will be only be None for the first, or genesis checkpoint.

§epoch_rolling_gas_cost_summary: GasCostSummary

The running total gas costs of all transactions included in the current epoch so far until this checkpoint.

§timestamp_ms: CheckpointTimestamp

Timestamp of the checkpoint - number of milliseconds from the Unix epoch Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent checkpoints can have same timestamp if they originate from the same underlining consensus commit

§checkpoint_commitments: Vec<CheckpointCommitment>

Commitments to checkpoint-specific state.

§end_of_epoch_data: Option<EndOfEpochData>

Extra data only present in the final checkpoint of an epoch.

§version_specific_data: Vec<u8>

CheckpointSummary is not an evolvable structure - it must be readable by any version of the code. Therefore, in order to allow extensions to be added to CheckpointSummary, we allow opaque data to be added to checkpoints which can be deserialized based on the current protocol version.

Implementations§

Source§

impl CheckpointSummary

Source

pub fn digest(&self) -> CheckpointDigest

Available on crate features hash and serde only.

Trait Implementations§

Source§

impl Arbitrary for CheckpointSummary

Source§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
Source§

type Strategy = BoxedStrategy<CheckpointSummary>

The type of Strategy used to generate values of type Self.
Source§

fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
Source§

impl Clone for CheckpointSummary

Source§

fn clone(&self) -> CheckpointSummary

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckpointSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CheckpointSummary

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CheckpointSummary

Source§

fn eq(&self, other: &CheckpointSummary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CheckpointSummary

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CheckpointSummary

Source§

impl StructuralPartialEq for CheckpointSummary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,