vote

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatorsCapacity = 256

	QueryVotepoolMaxRetryTimes = 5

	VotePoolQueryRetryInterval = 300 * time.Millisecond
)

Variables

This section is empty.

Functions

func AggregateSignatureAndValidatorBitSet

func AggregateSignatureAndValidatorBitSet(votes []*model.Vote, validators interface{}) ([]byte, *bitset.BitSet, error)

AggregateSignatureAndValidatorBitSet aggregates signature from multiple votes, and marks the bitset of validators who contribute votes

func DtoToEntity

func DtoToEntity(v *model.Vote) (*votepool.Vote, error)

func EntityToDto

func EntityToDto(from *votepool.Vote, channelId uint8, sequence uint64, payload []byte, height int64) *model.Vote

func VerifySignature

func VerifySignature(vote *votepool.Vote, eventHash []byte) error

VerifySignature verifies vote signature

Types

type BSCVoteProcessor

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

func NewBSCVoteProcessor

func NewBSCVoteProcessor(cfg *config.Config, dao *dao.DaoManager, signer *VoteSigner, bscExecutor *executor.BSCExecutor) *BSCVoteProcessor

func (*BSCVoteProcessor) CollectVotesLoop

func (p *BSCVoteProcessor) CollectVotesLoop()

func (*BSCVoteProcessor) SignAndBroadcastVoteLoop

func (p *BSCVoteProcessor) SignAndBroadcastVoteLoop()

type GreenfieldVoteProcessor

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

func NewGreenfieldVoteProcessor

func NewGreenfieldVoteProcessor(cfg *config.Config, dao *dao.DaoManager, signer *VoteSigner,
	greenfieldExecutor *executor.GreenfieldExecutor) *GreenfieldVoteProcessor

func (*GreenfieldVoteProcessor) CollectVotesLoop

func (p *GreenfieldVoteProcessor) CollectVotesLoop()

func (*GreenfieldVoteProcessor) SignAndBroadcastLoop

func (p *GreenfieldVoteProcessor) SignAndBroadcastLoop()

SignAndBroadcastLoop signs tx using the relayer's bls private key, then broadcasts the vote to Greenfield votepool

type VoteSigner

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

func NewVoteSigner

func NewVoteSigner(pk []byte) *VoteSigner

func (*VoteSigner) SignVote

func (signer *VoteSigner) SignVote(vote *votepool.Vote)

SignVote signs a vote by relayer's private key

Jump to

Keyboard shortcuts

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