endorsementpool

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const EndorsementIDCacheSizeDefault = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type EndorsementIDsCache

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

func NewEndorsementIDsCache

func NewEndorsementIDsCache(cacheLimit int) *EndorsementIDsCache

func (*EndorsementIDsCache) Clear

func (cache *EndorsementIDsCache) Clear()

func (*EndorsementIDsCache) RememberEndorsement

func (cache *EndorsementIDsCache) RememberEndorsement(id crypto.Digest)

func (*EndorsementIDsCache) SeenEndorsement

func (cache *EndorsementIDsCache) SeenEndorsement(id crypto.Digest) bool

type EndorsementPool

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

func NewEndorsementPool

func NewEndorsementPool(maxGenerators int) (*EndorsementPool, error)

func (*EndorsementPool) Add

func (p *EndorsementPool) Add(e *proto.EndorseBlock, pk bls.PublicKey,
	lastFinalizedHeight proto.Height, lastFinalizedBlockID proto.BlockID, balance uint64,
	parentBlockID proto.BlockID) (bool, error)

Add inserts an endorsement into the heap with priority based on balance desc, seq asc.

func (*EndorsementPool) BlockGenerator

func (p *EndorsementPool) BlockGenerator() (crypto.PublicKey, error)

func (*EndorsementPool) CleanAll

func (p *EndorsementPool) CleanAll()

func (*EndorsementPool) ConflictEndorsements

func (p *EndorsementPool) ConflictEndorsements() []proto.EndorseBlock

func (*EndorsementPool) FormFinalization

func (p *EndorsementPool) FormFinalization() (proto.FinalizationVoting, error)

func (*EndorsementPool) GetAll

func (p *EndorsementPool) GetAll() []proto.EndorseBlock

func (*EndorsementPool) GetEndorsers

func (p *EndorsementPool) GetEndorsers() []bls.PublicKey

func (*EndorsementPool) Len

func (p *EndorsementPool) Len() int

func (*EndorsementPool) SaveBlockGenerator

func (p *EndorsementPool) SaveBlockGenerator(blockGenerator *crypto.PublicKey)

func (*EndorsementPool) ShouldIgnoreEndorsement

func (p *EndorsementPool) ShouldIgnoreEndorsement(
	e *proto.EndorseBlock,
	pk bls.PublicKey,
	lastFinalizedHeight proto.Height,
	parentBlockID proto.BlockID,
) bool

ShouldIgnoreEndorsement checks if the endorsement must be ignored and not added to pool/conflicts.

func (*EndorsementPool) Verify

func (p *EndorsementPool) Verify() (bool, error)

Jump to

Keyboard shortcuts

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