Documentation
¶
Index ¶
- func IsValidRootSnapshot(snap protocol.Snapshot, verifyResultID bool) error
- func IsValidRootSnapshotQCs(snap protocol.Snapshot) error
- func ReadFinalizedRoot(db storage.DB) (*flow.Header, error)
- func ReadGlobalParams(db storage.DB) (*inmem.Params, error)
- func ValidRootSnapshotContainsEntityExpiryRange(snapshot protocol.Snapshot) error
- type InstanceParams
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidRootSnapshot ¶
IsValidRootSnapshot checks internal consistency of root state snapshot if verifyResultID allows/disallows Result ID verification
func IsValidRootSnapshotQCs ¶
IsValidRootSnapshotQCs checks internal consistency of QCs that are included in the root state snapshot It verifies QCs for main consensus and for each collection cluster.
func ReadFinalizedRoot ¶
ReadFinalizedRoot retrieves the root block's header from the database. This information is immutable for the runtime of the software and may be cached.
func ReadGlobalParams ¶
ReadGlobalParams reads the global parameters from the database and returns them as in-memory representation. No errors are expected during normal operation.
func ValidRootSnapshotContainsEntityExpiryRange ¶
ValidRootSnapshotContainsEntityExpiryRange performs a sanity check to make sure the root snapshot has enough history to encompass at least one full entity expiry window. Entities (in particular transactions and collections) may reference a block within the past `flow.DefaultTransactionExpiry` blocks, so a new node must begin with at least this many blocks worth of history leading up to the snapshot's root block.
Currently, Access Nodes and Consensus Nodes require root snapshots passing this validator function.
- Consensus Nodes because they process guarantees referencing past blocks
- Access Nodes because they index transactions referencing past blocks
One of the following conditions must be satisfied to pass this validation:
- This is a snapshot build from a first block of spork -> there is no earlier history which transactions/collections could reference
- This snapshot sealing segment contains at least one expiry window of blocks -> all possible reference blocks in future transactions/collections will be within the initial history.
- This snapshot sealing segment includes the spork root block -> there is no earlier history which transactions/collections could reference
Types ¶
type InstanceParams ¶
type InstanceParams struct {
// contains filtered or unexported fields
}
InstanceParams implements the interface protocol.InstanceParams. All functions are served on demand directly from the database, _without_ any caching.
func ReadInstanceParams ¶
func ReadInstanceParams(db storage.DB, headers storage.Headers, seals storage.Seals) (*InstanceParams, error)
ReadInstanceParams reads the instance parameters from the database and returns them as in-memory representation. No errors are expected during normal operation.
func (*InstanceParams) FinalizedRoot ¶
func (p *InstanceParams) FinalizedRoot() *flow.Header
FinalizedRoot returns the finalized root header of the current protocol state. This will be the head of the protocol state snapshot used to bootstrap this state and may differ from node to node for the same protocol state.
func (*InstanceParams) Seal ¶
func (p *InstanceParams) Seal() *flow.Seal
Seal returns the root block seal of the current protocol state. This is the seal for the `SealedRoot` block that was used to bootstrap this state. It may differ from node to node.
func (*InstanceParams) SealedRoot ¶
func (p *InstanceParams) SealedRoot() *flow.Header
SealedRoot returns the sealed root block. If it's different from FinalizedRoot() block, it means the node is bootstrapped from mid-spork.
type Params ¶
type Params struct { protocol.GlobalParams protocol.InstanceParams }