Help us shape the future of Go! Take the 2026 Go Developer Survey

protocol

package
v0.31.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: AGPL-3.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindLatest

func FindLatest(state protocol.State, headers storage.Headers) (*flow.Header, []*flow.Header, error)

FindLatest returns:

  • [first value] latest finalized header
  • [second value] all known descendants (i.e. pending blocks)
  • No errors expected during normal operations.

All returned blocks have been verified by the compliance layer, i.e. they are guaranteed to be valid. The descendants are listed in ancestor-first order, i.e. for any block B = descendants[i], B's parent must be included at an index _smaller_ than i, unless B's parent is the latest finalized block.

Note: this is an expensive method, which is intended to help recover from a crash, e.g. help to re-built the in-memory consensus state.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL