pengings

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: LGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxKnownVotes              = 10000
	VotesLag                   = 3
	PropagateFutureVotesPeriod = 30
)
View Source
const (
	DeferFutureProposalsPeriod = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proposals

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

func NewProposals

func NewProposals(chain *blockchain.Blockchain, appState *appstate.AppState, detector *blockchain.OfflineDetector, upgrader *upgrade.Upgrader, statsCollector collector.StatsCollector) (*Proposals, *sync.Map)

func (*Proposals) AddBlock added in v0.19.3

func (proposals *Proposals) AddBlock(block *types.Block)

func (*Proposals) AddProposeProof

func (proposals *Proposals) AddProposeProof(proposal *types.ProofProposal) (added bool, pending bool)

func (*Proposals) AddProposedBlock

func (proposals *Proposals) AddProposedBlock(proposal *types.BlockProposal, peerId peer.ID, receivingTime time.Time) (added bool, pending bool)

func (*Proposals) ApproveBlock added in v0.19.3

func (proposals *Proposals) ApproveBlock(hash common.Hash)

mark block as approved for adding to blockCache

func (*Proposals) AvgTimeDiff

func (proposals *Proposals) AvgTimeDiff(round uint64, start int64) decimal.Decimal

func (*Proposals) ClearPotentialForks

func (proposals *Proposals) ClearPotentialForks()

func (*Proposals) CompleteRound

func (proposals *Proposals) CompleteRound(height uint64)

func (*Proposals) GetBlock added in v0.19.3

func (proposals *Proposals) GetBlock(hash common.Hash) *types.Block

func (*Proposals) GetBlockByHash

func (proposals *Proposals) GetBlockByHash(round uint64, hash common.Hash) (*types.Block, error)

func (*Proposals) GetForkedPeers

func (proposals *Proposals) GetForkedPeers() mapset.Set

func (*Proposals) GetProposedBlock

func (proposals *Proposals) GetProposedBlock(round uint64, proposerPubKey []byte, timeout time.Duration) (*types.Block, error)

func (*Proposals) GetProposerPubKey

func (proposals *Proposals) GetProposerPubKey(round uint64) []byte

func (*Proposals) HasPotentialFork

func (proposals *Proposals) HasPotentialFork() bool

func (*Proposals) ProcessPendingBlocks

func (proposals *Proposals) ProcessPendingBlocks() []*types.BlockProposal

func (*Proposals) ProcessPendingProofs

func (proposals *Proposals) ProcessPendingProofs() []*types.ProofProposal

func (*Proposals) ProposerByRound added in v0.21.0

func (proposals *Proposals) ProposerByRound(round uint64) (hash common.Hash, proposer []byte, ok bool)

type ProposerByRound added in v0.21.0

type ProposerByRound func(round uint64) (hash common.Hash, proposer []byte, ok bool)

type Votes

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

func NewVotes

func NewVotes(state *appstate.AppState, bus eventbus.Bus, offlineDetector *blockchain.OfflineDetector, upgrade *upgrade.Upgrader) *Votes

func (*Votes) AddVote

func (votes *Votes) AddVote(vote *types.Vote) bool

func (*Votes) CompleteRound

func (votes *Votes) CompleteRound(round uint64)

func (*Votes) GetVotesOfRound

func (votes *Votes) GetVotesOfRound(round uint64) *sync.Map

func (*Votes) Initialize

func (votes *Votes) Initialize(head *types.Header)

Jump to

Keyboard shortcuts

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