comet

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 25

Documentation

Overview

Package comet defines the Comet Service interface and BlockInfo types which applications should use in order to get access to the current block's evidence, validators hash, proposer address.

This information is specific to Comet

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockInfo

type BlockInfo interface {
	GetEvidence() EvidenceList // Evidence misbehavior of the block
	// ValidatorsHash returns the hash of the validators
	// For Comet, it is the hash of the next validator set
	GetValidatorsHash() []byte
	GetProposerAddress() []byte // ProposerAddress returns the address of the block proposer
	GetLastCommit() CommitInfo  // DecidedLastCommit returns the last commit info
}

BlockInfo is the information comet provides apps in ABCI

type BlockInfoService

type BlockInfoService interface {
	GetCometBlockInfo(context.Context) BlockInfo
}

BlockInfoService is an interface that can be used to get information specific to Comet

type CommitInfo

type CommitInfo interface {
	Round() int32
	Votes() VoteInfos
}

CommitInfo is the commit information of ABCI

type Evidence

type Evidence interface {
	Type() MisbehaviorType
	Validator() Validator
	Height() int64
	Time() time.Time
	TotalVotingPower() int64
}

Evidence is the misbehavior information of ABCI

type EvidenceList

type EvidenceList interface {
	Len() int
	Get(int) Evidence
}

type MisbehaviorType

type MisbehaviorType int32

MisbehaviorType is the type of misbehavior for a validator

const (
	Unknown           MisbehaviorType = 0
	DuplicateVote     MisbehaviorType = 1
	LightClientAttack MisbehaviorType = 2
)

type Validator

type Validator interface {
	Address() []byte
	Power() int64
}

Validator is the validator information of ABCI

type VoteInfo

type VoteInfo interface {
	Validator() Validator
	SignedLastBlock() bool
}

VoteInfo is the vote information of ABCI

type VoteInfos

type VoteInfos interface {
	Len() int
	Get(int) VoteInfo
}

VoteInfos is an interface to get specific votes in a efficient way

Jump to

Keyboard shortcuts

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