Struct solana_ledger::entry::Entry[][src]

pub struct Entry {
    pub num_hashes: u64,
    pub hash: Hash,
    pub transactions: Vec<Transaction>,
}
Expand description

Each Entry contains three pieces of data. The num_hashes field is the number of hashes performed since the previous entry. The hash field is the result of hashing hash from the previous entry num_hashes times. The transactions field points to Transactions that took place shortly before hash was generated.

If you divide num_hashes by the amount of time it takes to generate a new hash, you get a duration estimate since the last Entry. Since processing power increases over time, one should expect the duration num_hashes represents to decrease proportionally. An upper bound on Duration can be estimated by assuming each hash was generated by the world’s fastest processor at the time the entry was recorded. Or said another way, it is physically not possible for a shorter duration to have occurred if one assumes the hash was computed by the world’s fastest processor at that time. The hash chain is both a Verifiable Delay Function (VDF) and a Proof of Work (not to be confused with Proof of Work consensus!)

Fields

num_hashes: u64

The number of hashes since the previous Entry ID.

hash: Hash

The SHA-256 hash num_hashes after the previous Entry ID.

transactions: Vec<Transaction>

An unordered list of transactions that were observed before the Entry ID was generated. They may have been observed before a previous Entry ID but were pushed back into this list to ensure deterministic interpretation of the ledger.

Implementations

Creates the next Entry num_hashes after start_hash.

Verifies self.hash is the result of hashing a start_hash self.num_hashes times. If the transaction is not a Tick, then hash that as well.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more