bft

package
v0.0.0-...-f359c53 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>

Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>

Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>

Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Committer

type Committer interface {
	Finalized() thor.Bytes32
	Justified() (thor.Bytes32, error)
}

type Engine

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

Engine tracks all votes of blocks, computes the finalized checkpoint. Not thread-safe!

func (*Engine) Accepts

func (engine *Engine) Accepts(parentID thor.Bytes32) (bool, error)

Accepts checks if the given block is on the same branch of finalized checkpoint.

func (*Engine) CommitBlock

func (engine *Engine) CommitBlock(header *block.Header, isPacking bool) error

CommitBlock commits bft state to storage.

func (*Engine) Finalized

func (engine *Engine) Finalized() thor.Bytes32

Finalized returns the finalized checkpoint.

func (*Engine) Justified

func (engine *Engine) Justified() (thor.Bytes32, error)

Justified returns the justified checkpoint.

func (*Engine) Select

func (engine *Engine) Select(header *block.Header) (bool, error)

Select selects between the new block and the current best, return true if new one is better.

func (*Engine) ShouldVote

func (engine *Engine) ShouldVote(parentID thor.Bytes32) (bool, error)

ShouldVote decides if vote COM for a given parent block ID. Packer only.

Jump to

Keyboard shortcuts

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