collection

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: AGPL-3.0 Imports: 13 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is the builder for collection block payloads. Upon providing a payload hash, it also memorizes the payload contents.

NOTE: Builder is NOT safe for use with multiple goroutines. Since the HotStuff event loop is the only consumer of this interface and is single threaded, this is OK.

func NewBuilder

func NewBuilder(
	db *badger.DB,
	mainHeaders storage.Headers,
	clusterHeaders storage.Headers,
	payloads storage.ClusterPayloads,
	transactions mempool.Transactions,
	tracer module.Tracer,
	opts ...Opt,
) *Builder

func (*Builder) BuildOn

func (b *Builder) BuildOn(parentID flow.Identifier, setter func(*flow.Header) error) (*flow.Header, error)

BuildOn creates a new block built on the given parent. It produces a payload that is valid with respect to the un-finalized chain it extends.

type Opt

type Opt func(*Builder)

func WithExpiryBuffer

func WithExpiryBuffer(buf uint) Opt

func WithMaxCollectionSize

func WithMaxCollectionSize(size uint) Opt

Jump to

Keyboard shortcuts

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