bft

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: LGPL-3.0 Imports: 14 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 BFTEngine

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

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

func NewEngine

func NewEngine(repo *chain.Repository, mainDB *muxdb.MuxDB, forkConfig thor.ForkConfig, master thor.Address) (*BFTEngine, error)

NewEngine creates a new bft engine.

func (*BFTEngine) Accepts

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

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

func (*BFTEngine) CommitBlock

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

CommitBlock commits bft state to storage.

func (*BFTEngine) Finalized

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

Finalized returns the finalized checkpoint.

func (*BFTEngine) Select

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

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

func (*BFTEngine) ShouldVote

func (engine *BFTEngine) 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