Documentation ¶
Index ¶
- Constants
- Variables
- func CanonicalTime(t time.Time) string
- func CanonicalizeBlockID(bid cmtproto.BlockID) (*cmtproto.CanonicalBlockID, error)
- func CanonicalizePartSetHeader(psh cmtproto.PartSetHeader) cmtproto.CanonicalPartSetHeader
- func CanonicalizeProposal(chainID string, proposal *cmtproto.Proposal) (cmtproto.CanonicalProposal, error)
- func CanonicalizeVote(chainID string, vote *cmtproto.Vote) (cmtproto.CanonicalVote, error)
- func ComputeProtoSizeForTxs(txs []Tx) int64
- func EventQueryTxFor(tx Tx) cmtpubsub.Query
- func EvidenceToProto(evidence Evidence) (*cmtproto.Evidence, error)
- func IsErrNotEnoughVotingPowerSigned(err error) bool
- func IsValidPubkeyType(params ValidatorParams, pubkeyType string) bool
- func IsVoteTypeValid(t cmtproto.SignedMsgType) bool
- func MaxCommitBytes(valCount int) int64
- func MaxDataBytes(maxBytes, evidenceBytes int64, valsCount int) int64
- func MaxDataBytesNoEvidence(maxBytes int64, valsCount int) int64
- func MustCanonicalizeBlockID(bid cmtproto.BlockID) *cmtproto.CanonicalBlockID
- func MustCanonicalizeProposal(chainID string, proposal *cmtproto.Proposal) cmtproto.CanonicalProposal
- func MustCanonicalizeVote(chainID string, vote *cmtproto.Vote) cmtproto.CanonicalVote
- func ProposalSignBytes(chainID string, p *cmtproto.Proposal) []byte
- func QueryForEvent(eventType string) cmtpubsub.Query
- func RandValidatorSet(numValidators int, votingPower int64) (*ValidatorSet, []PrivValidator)
- func TestVoteBasics(t *testing.T)
- func TestVoteProto(t *testing.T)
- func TestVoteVerification(t *testing.T)
- func ValidateEmpty(data interface{}, logger log.Logger) bool
- func ValidateHash(h []byte) error
- func ValidateTime(t time.Time) error
- func ValidateTimeAndHash(t time.Time, h []byte) error
- func ValidatorListString(vals []*Validator) string
- func VerifyPQCCommit(commit []byte, pubKey kyber.PublicKey) error
- type ABCIResults
- type AIParams
- type Block
- func (b *Block) Hash() cmtbytes.HexBytes
- func (b *Block) HashesTo(hash []byte) bool
- func (b *Block) MakePartSet(partSize uint32) (*PartSet, error)
- func (b *Block) Size() int
- func (b *Block) String() string
- func (b *Block) StringIndented(indent string) string
- func (b *Block) StringShort() string
- func (b *Block) ToProto() (*cmtproto.Block, error)
- func (b *Block) ValidateBasic() error
- type BlockEventPublisher
- type BlockID
- type BlockIDFlag
- type BlockMeta
- type BlockParams
- type Canonicalizer
- type Commit
- func (commit *Commit) BitArray() *bits.BitArray
- func (commit *Commit) GetByIndex(valIdx int32) *Vote
- func (commit *Commit) GetHeight() int64
- func (commit *Commit) GetRound() int32
- func (commit *Commit) GetVote(valIdx int32) *Vote
- func (commit *Commit) Hash() cmtbytes.HexBytes
- func (commit *Commit) IsCommit() bool
- func (commit *Commit) Size() int
- func (commit *Commit) StringIndented(indent string) string
- func (commit *Commit) ToProto() *cmtproto.Commit
- func (commit *Commit) Type() byte
- func (commit *Commit) ValidateBasic() error
- func (commit *Commit) VoteSignBytes(chainID string, valIdx int32) []byte
- type CommitHeightError
- type CommitSig
- func (cs CommitSig) Absent() bool
- func (cs CommitSig) BlockID(commitBlockID BlockID) BlockID
- func (cs CommitSig) ForBlock() bool
- func (cs *CommitSig) FromProto(csp cmtproto.CommitSig) error
- func (cs CommitSig) String() string
- func (cs *CommitSig) ToProto() *cmtproto.CommitSig
- func (cs CommitSig) ValidateBasic() error
- type CommitSignatureError
- type ConsensusParams
- type Data
- type DuplicateVoteEvidence
- func DuplicateVoteEvidenceFromProto(pb *cmtproto.DuplicateVoteEvidence) (*DuplicateVoteEvidence, error)
- func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *ValidatorSet) (*DuplicateVoteEvidence, error)
- func NewMockDuplicateVoteEvidence(height int64, time time.Time, chainID string) (*DuplicateVoteEvidence, error)
- func NewMockDuplicateVoteEvidenceWithValidator(height int64, time time.Time, pv PrivValidator, chainID string) (*DuplicateVoteEvidence, error)
- func (dve *DuplicateVoteEvidence) ABCI() []abci.Misbehavior
- func (dve *DuplicateVoteEvidence) Bytes() []byte
- func (dve *DuplicateVoteEvidence) Hash() []byte
- func (dve *DuplicateVoteEvidence) Height() int64
- func (dve *DuplicateVoteEvidence) String() string
- func (dve *DuplicateVoteEvidence) Time() time.Time
- func (dve *DuplicateVoteEvidence) ToProto() *cmtproto.DuplicateVoteEvidence
- func (dve *DuplicateVoteEvidence) ValidateBasic() error
- func (dve *DuplicateVoteEvidence) VerifyPQC() error
- type ErrEvidenceOverflow
- type ErrInvalidEvidence
- type ErrNotEnoughVotingPowerSigned
- type ErroringMockPV
- type EventBus
- func (b *EventBus) NumClientSubscriptions(clientID string) int
- func (b *EventBus) NumClients() int
- func (b *EventBus) OnStart() error
- func (b *EventBus) OnStop()
- func (b *EventBus) Publish(eventType string, eventData TMEventData) error
- func (b *EventBus) PublishEventCompleteProposal(data EventDataCompleteProposal) error
- func (b *EventBus) PublishEventLock(data EventDataRoundState) error
- func (b *EventBus) PublishEventNewBlock(data EventDataNewBlock) error
- func (b *EventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error
- func (b *EventBus) PublishEventNewEvidence(evidence EventDataNewEvidence) error
- func (b *EventBus) PublishEventNewRound(data EventDataNewRound) error
- func (b *EventBus) PublishEventNewRoundStep(data EventDataRoundState) error
- func (b *EventBus) PublishEventPolka(data EventDataRoundState) error
- func (b *EventBus) PublishEventRelock(data EventDataRoundState) error
- func (b *EventBus) PublishEventTimeoutPropose(data EventDataRoundState) error
- func (b *EventBus) PublishEventTimeoutWait(data EventDataRoundState) error
- func (b *EventBus) PublishEventTx(data EventDataTx) error
- func (b *EventBus) PublishEventUnlock(data EventDataRoundState) error
- func (b *EventBus) PublishEventValidBlock(data EventDataRoundState) error
- func (b *EventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error
- func (b *EventBus) PublishEventVote(data EventDataVote) error
- func (b *EventBus) SetLogger(l log.Logger)
- func (b *EventBus) Subscribe(ctx context.Context, subscriber string, query cmtpubsub.Query, ...) (Subscription, error)
- func (b *EventBus) SubscribeUnbuffered(ctx context.Context, subscriber string, query cmtpubsub.Query) (Subscription, error)
- func (b *EventBus) Unsubscribe(ctx context.Context, subscriber string, query cmtpubsub.Query) error
- func (b *EventBus) UnsubscribeAll(ctx context.Context, subscriber string) error
- type EventBusSubscriber
- type EventDataCompleteProposal
- type EventDataNewBlock
- type EventDataNewBlockHeader
- type EventDataNewEvidence
- type EventDataNewRound
- type EventDataRoundState
- type EventDataString
- type EventDataTx
- type EventDataValidatorSetUpdates
- type EventDataVote
- type Evidence
- type EvidenceData
- type EvidenceList
- type EvidenceParams
- type GenesisDoc
- type GenesisValidator
- type Header
- type LightBlock
- type LightClientAttackEvidence
- func (l *LightClientAttackEvidence) ABCI() []abci.Misbehavior
- func (l *LightClientAttackEvidence) Bytes() []byte
- func (l *LightClientAttackEvidence) ConflictingHeaderIsInvalid(trustedHeader *Header) bool
- func (l *LightClientAttackEvidence) GetByzantineValidators(commonVals *ValidatorSet, trusted *SignedHeader) []*Validator
- func (l *LightClientAttackEvidence) Hash() []byte
- func (l *LightClientAttackEvidence) Height() int64
- func (l *LightClientAttackEvidence) String() string
- func (l *LightClientAttackEvidence) Time() time.Time
- func (l *LightClientAttackEvidence) ToProto() (*cmtproto.LightClientAttackEvidence, error)
- func (l *LightClientAttackEvidence) ValidateBasic() error
- type MockPV
- func (pv MockPV) DisableChecks()
- func (pv MockPV) ExtractIntoValidator(votingPower int64) *Validator
- func (pv MockPV) GetPubKey() (crypto.PubKey, error)
- func (pv MockPV) SignProposal(chainID string, proposal *cmtproto.Proposal) error
- func (pv MockPV) SignVote(chainID string, vote *cmtproto.Vote) error
- func (pv MockPV) String() string
- type NopEventBus
- func (NopEventBus) PublishEventCompleteProposal(data EventDataRoundState) error
- func (NopEventBus) PublishEventLock(data EventDataRoundState) error
- func (NopEventBus) PublishEventNewBlock(data EventDataNewBlock) error
- func (NopEventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error
- func (NopEventBus) PublishEventNewEvidence(evidence EventDataNewEvidence) error
- func (NopEventBus) PublishEventNewRound(data EventDataRoundState) error
- func (NopEventBus) PublishEventNewRoundStep(data EventDataRoundState) error
- func (NopEventBus) PublishEventPolka(data EventDataRoundState) error
- func (NopEventBus) PublishEventRelock(data EventDataRoundState) error
- func (NopEventBus) PublishEventTimeoutPropose(data EventDataRoundState) error
- func (NopEventBus) PublishEventTimeoutWait(data EventDataRoundState) error
- func (NopEventBus) PublishEventTx(data EventDataTx) error
- func (NopEventBus) PublishEventUnlock(data EventDataRoundState) error
- func (NopEventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error
- func (NopEventBus) PublishEventVote(data EventDataVote) error
- func (NopEventBus) Subscribe(ctx context.Context, subscriber string, query cmtpubsub.Query, ...) error
- func (NopEventBus) Unsubscribe(ctx context.Context, subscriber string, query cmtpubsub.Query) error
- func (NopEventBus) UnsubscribeAll(ctx context.Context, subscriber string) error
- type P2PID
- type PQCError
- type Part
- type PartSet
- func (ps *PartSet) AddPart(part *Part) (bool, error)
- func (ps *PartSet) BitArray() *bits.BitArray
- func (ps *PartSet) ByteSize() int64
- func (ps *PartSet) Count() uint32
- func (ps *PartSet) GetPart(index int) *Part
- func (ps *PartSet) GetReader() io.Reader
- func (ps *PartSet) HasHeader(header PartSetHeader) bool
- func (ps *PartSet) Hash() []byte
- func (ps *PartSet) HashesTo(hash []byte) bool
- func (ps *PartSet) Header() PartSetHeader
- func (ps *PartSet) IsComplete() bool
- func (ps *PartSet) MarshalJSON() ([]byte, error)
- func (ps *PartSet) StringShort() string
- func (ps *PartSet) Total() uint32
- type PartSetHeader
- type PartSetReader
- type PrivValidator
- type PrivValidatorsByAddress
- type Proposal
- type QuantumParams
- type Signable
- type SignedHeader
- type Subscription
- type TMEventData
- type Tx
- type TxEventPublisher
- type TxKey
- type TxProof
- type Txs
- func (txs Txs) Hash() []byte
- func (txs Txs) Index(tx Tx) int
- func (txs Txs) IndexByHash(hash []byte) int
- func (txs Txs) Len() int
- func (txs Txs) Less(i, j int) bool
- func (txs Txs) Proof(i int) TxProof
- func (txs Txs) Swap(i, j int)
- func (txs Txs) ToSliceOfBytes() [][]byte
- func (txs Txs) Validate(maxSizeBytes int64) error
- type Validator
- type ValidatorInfo
- type ValidatorParams
- type ValidatorSet
- func (vals *ValidatorSet) Copy() *ValidatorSet
- func (vals *ValidatorSet) CopyIncrementProposerPriority(times int32) *ValidatorSet
- func (vals *ValidatorSet) GetByAddress(address []byte) (index int32, val *Validator)
- func (vals *ValidatorSet) GetByIndex(index int32) (address []byte, val *Validator)
- func (vals *ValidatorSet) GetProposer() (proposer *Validator)
- func (vals *ValidatorSet) HasAddress(address []byte) bool
- func (vals *ValidatorSet) Hash() []byte
- func (vals *ValidatorSet) IncrementProposerPriority(times int32)
- func (vals *ValidatorSet) IsNilOrEmpty() bool
- func (vals *ValidatorSet) Iterate(fn func(index int, val *Validator) bool)
- func (vals *ValidatorSet) Size() int
- func (vals *ValidatorSet) String() string
- func (vals *ValidatorSet) StringIndented(indent string) string
- func (vals *ValidatorSet) ToProto() (*cmtproto.ValidatorSet, error)
- func (vals *ValidatorSet) TotalVotingPower() int64
- func (vals *ValidatorSet) UpdateWithChangeSet(changes []*Validator) error
- func (vals *ValidatorSet) ValidateBasic() error
- func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height int64, commit *Commit) error
- func (vals *ValidatorSet) VerifyCommitLight(chainID string, blockID BlockID, height int64, commit *Commit) error
- func (vals *ValidatorSet) VerifyCommitLightTrusting(chainID string, commit *Commit, trustLevel cmtmath.Fraction) error
- type ValidatorsByAddress
- type ValidatorsByVotingPower
- type VersionParams
- type VoteSet
- func (voteSet *VoteSet) AddVote(vote *Vote) (added bool, err error)
- func (voteSet *VoteSet) BitArray() *bits.BitArray
- func (voteSet *VoteSet) BitArrayByBlockID(blockID BlockID) *bits.BitArray
- func (voteSet *VoteSet) BitArrayString() string
- func (voteSet *VoteSet) ChainID() string
- func (voteSet *VoteSet) GetByAddress(address []byte) *Vote
- func (voteSet *VoteSet) GetByIndex(valIndex int32) *Vote
- func (voteSet *VoteSet) GetHeight() int64
- func (voteSet *VoteSet) GetRound() int32
- func (voteSet *VoteSet) GetVotes() []*Vote
- func (voteSet *VoteSet) HasAll() bool
- func (voteSet *VoteSet) HasTwoThirdsAny() bool
- func (voteSet *VoteSet) HasTwoThirdsMajority() bool
- func (voteSet *VoteSet) IsCommit() bool
- func (voteSet *VoteSet) List() []Vote
- func (voteSet *VoteSet) LogString() string
- func (voteSet *VoteSet) MakeCommit() *Commit
- func (voteSet *VoteSet) MarshalJSON() ([]byte, error)
- func (voteSet *VoteSet) SetPeerMaj23(peerID P2PID, blockID BlockID) error
- func (voteSet *VoteSet) Size() int
- func (voteSet *VoteSet) String() string
- func (voteSet *VoteSet) StringIndented(indent string) string
- func (voteSet *VoteSet) StringShort() string
- func (voteSet *VoteSet) TwoThirdsMajority() (blockID BlockID, ok bool)
- func (voteSet *VoteSet) TwoThirdsMajorityWithAI() (blockID BlockID, ok bool)
- func (voteSet *VoteSet) Type() byte
- func (voteSet *VoteSet) VoteStrings() []string
- type VoteSetJSON
- type VoteSetReader
Constants ¶
const ( // MaxHeaderBytes is a maximum header size. // NOTE: Because app hash can be of arbitrary size, the header is therefore not // capped in size and thus this number should be seen as a soft max MaxHeaderBytes int64 = 626 // MaxOverheadForBlock - maximum overhead to encode a block (up to // MaxBlockSizeBytes in size) not including it's parts except Data. // This means it also excludes the overhead for individual transactions. // // Uvarint length of MaxBlockSizeBytes: 4 bytes // 2 fields (2 embedded): 2 bytes // Uvarint length of Data.Txs: 4 bytes // Data.Txs field: 1 byte MaxOverheadForBlock int64 = 11 )
const ( // Max size of commit without any commitSigs -> 82 for BlockID, 8 for Height, 4 for Round. MaxCommitOverheadBytes int64 = 94 // Commit sig size is made up of 64 bytes for the signature, 20 bytes for the address, // 1 byte for the flag and 14 bytes for the timestamp MaxCommitSigBytes int64 = 109 )
const ( // Block level events for mass consumption by users. // These events are triggered from the state package, // after a block has been committed. // These are also used by the tx indexer for async indexing. // All of this data can be fetched through the rpc. EventNewBlock = "NewBlock" EventNewBlockHeader = "NewBlockHeader" EventNewEvidence = "NewEvidence" EventTx = "Tx" EventValidatorSetUpdates = "ValidatorSetUpdates" // Internal consensus events. // These are used for testing the consensus state machine. // They can also be used to build real-time consensus visualizers. EventCompleteProposal = "CompleteProposal" EventLock = "Lock" EventNewRound = "NewRound" EventNewRoundStep = "NewRoundStep" EventPolka = "Polka" EventRelock = "Relock" EventTimeoutPropose = "TimeoutPropose" EventTimeoutWait = "TimeoutWait" EventUnlock = "Unlock" EventValidBlock = "ValidBlock" EventVote = "Vote" )
Reserved event types (alphabetically sorted).
const ( // EventTypeKey is a reserved composite key for event name. EventTypeKey = "tm.event" // TxHashKey is a reserved key, used to specify transaction's hash. // see EventBus#PublishEventTx TxHashKey = "tx.hash" // TxHeightKey is a reserved key, used to specify transaction block's height. // see EventBus#PublishEventTx TxHeightKey = "tx.height" // BlockHeightKey is a reserved key used for indexing BeginBlock and Endblock // events. BlockHeightKey = "block.height" )
const ( MaxChainIDLen = 50 MinPower = 1 )
const ( // PeerPQCStateKey identifies quantum-safe state for peers PeerPQCStateKey = "BaronChainConsensus.PeerPQCState" // PeerAIStateKey identifies AI-based peer metrics state PeerAIStateKey = "BaronChainConsensus.PeerAIState" )
Constants for quantum-safe peer state
const ( MaxBlockSizeBytes = 104857600 // 100MB BlockPartSizeBytes uint32 = 65536 // 64kB MaxBlockPartsCount = (MaxBlockSizeBytes / BlockPartSizeBytes) + 1 // Supported key types PubKeyTypeEd25519 = ed25519.KeyType PubKeyTypeSecp256k1 = secp256k1.KeyType PubKeyTypeKyber = kyber.KeyType )
const ( MaxTotalVotingPower = int64(math.MaxInt64) / 8 PriorityWindowSizeFactor = 2 )
const MaxVotesCount = 10000
const (
// PeerConsensusStateKey identifies peer state data for baron chain consensus
PeerConsensusStateKey = "BaronChainConsensus.PeerState"
)
Peer state constants for consensus reactor
const PeerStateKey = PeerConsensusStateKey
Deprecated: Use PeerConsensusStateKey instead
const TimeFormat = time.RFC3339Nano
TimeFormat defines the canonical time format for use in signatures
const TxKeySize = sha256.Size
Variables ¶
var ( EventQueryCompleteProposal = QueryForEvent(EventCompleteProposal) EventQueryLock = QueryForEvent(EventLock) EventQueryNewBlock = QueryForEvent(EventNewBlock) EventQueryNewBlockHeader = QueryForEvent(EventNewBlockHeader) EventQueryNewEvidence = QueryForEvent(EventNewEvidence) EventQueryNewRound = QueryForEvent(EventNewRound) EventQueryNewRoundStep = QueryForEvent(EventNewRoundStep) EventQueryPolka = QueryForEvent(EventPolka) EventQueryRelock = QueryForEvent(EventRelock) EventQueryTimeoutPropose = QueryForEvent(EventTimeoutPropose) EventQueryTimeoutWait = QueryForEvent(EventTimeoutWait) EventQueryTx = QueryForEvent(EventTx) EventQueryUnlock = QueryForEvent(EventUnlock) EventQueryValidatorSetUpdates = QueryForEvent(EventValidatorSetUpdates) EventQueryValidBlock = QueryForEvent(EventValidBlock) EventQueryVote = QueryForEvent(EventVote) )
var ( ErrPartSetUnexpectedIndex = errors.New("part set unexpected index") ErrPartSetInvalidProof = errors.New("part set invalid proof") ErrPartSetInvalidPQC = errors.New("part set invalid quantum signature") )
var ( ErrInvalidBlockPartSignature = errors.New("error invalid block part signature") ErrInvalidBlockPartHash = errors.New("error invalid block part hash") )
var ErroringMockPVErr = errors.New("erroringMockPV always returns an error")
var (
MaxSignatureSize = cmtmath.MaxInt(ed25519.SignatureSize, 64)
)
var PB2TM = pb2tm{}
PB2TM is used for converting protobuf ABCI to CometBFT ABCI. UNSTABLE
var PubKeyTypesToNames = map[string]string{ PubKeyTypeEd25519: ed25519.PubKeyName, PubKeyTypeSecp256k1: secp256k1.PubKeyName, PubKeyTypeKyber: kyber.PubKeyName, }
var TM2PB = tm2pb{}
Functions ¶
func CanonicalTime ¶
CanonicalTime formats time in the canonical format, ensuring UTC timezone
func CanonicalizeBlockID ¶
func CanonicalizeBlockID(bid cmtproto.BlockID) (*cmtproto.CanonicalBlockID, error)
CanonicalizeBlockID converts a BlockID to its canonical form Returns nil if the input represents a zero or nil BlockID
func CanonicalizePartSetHeader ¶
func CanonicalizePartSetHeader(psh cmtproto.PartSetHeader) cmtproto.CanonicalPartSetHeader
CanonicalizePartSetHeader converts a PartSetHeader to its canonical form
func CanonicalizeProposal ¶
func CanonicalizeProposal(chainID string, proposal *cmtproto.Proposal) (cmtproto.CanonicalProposal, error)
CanonicalizeProposal converts a Proposal to its canonical form for signing
func CanonicalizeVote ¶
CanonicalizeVote converts a Vote to its canonical form for signing The canonical form excludes ValidatorIndex and ValidatorAddress fields
func ComputeProtoSizeForTxs ¶
ComputeProtoSizeForTxs wraps the transactions in cmtproto.Data{} and calculates the size. https://developers.google.com/protocol-buffers/docs/encoding
func EventQueryTxFor ¶
func EvidenceToProto ¶
EvidenceToProto is a generalized function for encoding evidence that conforms to the evidence interface to protobuf
func IsErrNotEnoughVotingPowerSigned ¶
IsErrNotEnoughVotingPowerSigned returns true if err is ErrNotEnoughVotingPowerSigned.
func IsValidPubkeyType ¶
func IsValidPubkeyType(params ValidatorParams, pubkeyType string) bool
func IsVoteTypeValid ¶
func IsVoteTypeValid(t cmtproto.SignedMsgType) bool
func MaxCommitBytes ¶
func MaxDataBytes ¶
MaxDataBytes returns the maximum size of block's data.
XXX: Panics on negative result.
func MaxDataBytesNoEvidence ¶
MaxDataBytesNoEvidence returns the maximum size of block's data when evidence count is unknown. MaxEvidencePerBlock will be used for the size of evidence.
XXX: Panics on negative result.
func MustCanonicalizeBlockID ¶
func MustCanonicalizeBlockID(bid cmtproto.BlockID) *cmtproto.CanonicalBlockID
MustCanonicalizeBlockID is like CanonicalizeBlockID but panics on error
func MustCanonicalizeProposal ¶
func MustCanonicalizeProposal(chainID string, proposal *cmtproto.Proposal) cmtproto.CanonicalProposal
MustCanonicalizeProposal is like CanonicalizeProposal but panics on error
func MustCanonicalizeVote ¶
func MustCanonicalizeVote(chainID string, vote *cmtproto.Vote) cmtproto.CanonicalVote
MustCanonicalizeVote is like CanonicalizeVote but panics on error
func ProposalSignBytes ¶
ProposalSignBytes returns the proto-encoding of the canonicalized Proposal, for signing. Panics if the marshaling fails.
The encoded Protobuf message is varint length-prefixed (using MarshalDelimited) for backwards-compatibility with the Amino encoding, due to e.g. hardware devices that rely on this encoding.
See CanonicalizeProposal
func QueryForEvent ¶
func RandValidatorSet ¶
func RandValidatorSet(numValidators int, votingPower int64) (*ValidatorSet, []PrivValidator)
RandValidatorSet returns a randomized validator set (size: +numValidators+), where each validator has a voting power of +votingPower+.
EXPOSED FOR TESTING.
func TestVoteBasics ¶
func TestVoteProto ¶
func TestVoteVerification ¶
func ValidateEmpty ¶
ValidateEmpty validates if a blockchain data structure is empty
func ValidateHash ¶
ValidateHash ensures hash sizes meet Baron Chain's quantum-safe requirements
func ValidateTime ¶
ValidateTime ensures timestamps are within acceptable range for Baron Chain Prevents time-based attacks while maintaining network synchronization
func ValidateTimeAndHash ¶
ValidateTimeAndHash combines time and hash validation for atomic operations
func ValidatorListString ¶
Types ¶
type ABCIResults ¶
type ABCIResults []*abci.ResponseDeliverTx
ABCIResults wraps the deliver tx results to return a proof.
func NewResults ¶
func NewResults(responses []*abci.ResponseDeliverTx) ABCIResults
func (ABCIResults) Hash ¶
func (a ABCIResults) Hash() []byte
Hash returns a merkle hash of all results.
func (ABCIResults) ProveResult ¶
func (a ABCIResults) ProveResult(i int) merkle.Proof
ProveResult returns a merkle proof of one result from the set
type AIParams ¶
type AIParams struct { Enabled bool `json:"enabled"` MinTrustScore float64 `json:"min_trust_score"` ValidationInterval int64 `json:"validation_interval"` }
New params for AI features
func DefaultAIParams ¶
func DefaultAIParams() AIParams
type Block ¶
type Block struct { Header `json:"header"` Data `json:"data"` Evidence EvidenceData `json:"evidence"` LastCommit *Commit `json:"last_commit"` // contains filtered or unexported fields }
Block defines the atomic unit of a CometBFT blockchain.
func BlockFromProto ¶
FromProto sets a protobuf Block to the given pointer. It returns an error if the block is invalid.
func (*Block) Hash ¶
Hash computes and returns the block hash. If the block is incomplete, block hash is nil for safety.
func (*Block) HashesTo ¶
HashesTo is a convenience function that checks if a block hashes to the given argument. Returns false if the block is nil or the hash is empty.
func (*Block) MakePartSet ¶
MakePartSet returns a PartSet containing parts of a serialized block. This is the form in which the block is gossipped to peers. CONTRACT: partSize is greater than zero.
func (*Block) StringIndented ¶
StringIndented returns an indented String.
Header Data Evidence LastCommit Hash
func (*Block) StringShort ¶
StringShort returns a shortened string representation of the block.
func (*Block) ValidateBasic ¶
ValidateBasic performs basic validation that doesn't involve state data. It checks the internal consistency of the block. Further validation is done using state#ValidateBlock.
type BlockEventPublisher ¶
type BlockEventPublisher interface { PublishEventNewBlock(block EventDataNewBlock) error PublishEventNewBlockHeader(header EventDataNewBlockHeader) error PublishEventNewEvidence(evidence EventDataNewEvidence) error PublishEventTx(EventDataTx) error PublishEventValidatorSetUpdates(EventDataValidatorSetUpdates) error }
BlockEventPublisher publishes all block related events
type BlockID ¶
type BlockID struct { Hash cmtbytes.HexBytes `json:"hash"` PartSetHeader PartSetHeader `json:"parts"` }
BlockID
func BlockIDFromProto ¶
FromProto sets a protobuf BlockID to the given pointer. It returns an error if the block id is invalid.
func (BlockID) IsComplete ¶
IsComplete returns true if this is a valid BlockID of a non-nil block.
func (BlockID) String ¶
String returns a human readable string representation of the BlockID.
1. hash 2. part set header
See PartSetHeader#String
func (BlockID) ValidateBasic ¶
ValidateBasic performs basic validation.
type BlockIDFlag ¶
type BlockIDFlag byte
BlockIDFlag indicates which BlockID the signature is for.
const ( // BlockIDFlagAbsent - no vote was received from a validator. BlockIDFlagAbsent BlockIDFlag = iota + 1 // BlockIDFlagCommit - voted for the Commit.BlockID. BlockIDFlagCommit // BlockIDFlagNil - voted for nil. BlockIDFlagNil )
type BlockMeta ¶
type BlockMeta struct { BlockID BlockID `json:"block_id"` BlockSize int `json:"block_size"` Header Header `json:"header"` NumTxs int `json:"num_txs"` }
BlockMeta contains meta information.
func NewBlockMeta ¶
NewBlockMeta returns a new BlockMeta.
func (*BlockMeta) ValidateBasic ¶
ValidateBasic performs basic validation.
type BlockParams ¶
type BlockParams struct { MaxBytes int64 `json:"max_bytes"` MaxGas int64 `json:"max_gas"` MaxTransactions int64 `json:"max_transactions"` // Added for transaction limiting }
func DefaultBlockParams ¶
func DefaultBlockParams() BlockParams
type Canonicalizer ¶
type Canonicalizer[T any] interface { Canonicalize() T }
Canonicalizer is an interface for types that can be converted to their canonical form
type Commit ¶
type Commit struct { // NOTE: The signatures are in order of address to preserve the bonded // ValidatorSet order. // Any peer with a block can gossip signatures by index with a peer without // recalculating the active ValidatorSet. Height int64 `json:"height"` Round int32 `json:"round"` BlockID BlockID `json:"block_id"` Signatures []CommitSig `json:"signatures"` // contains filtered or unexported fields }
Commit contains the evidence that a block was committed by a set of validators. NOTE: Commit is empty for height 1, but never nil.
func CommitFromProto ¶
FromProto sets a protobuf Commit to the given pointer. It returns an error if the commit is invalid.
func MakeCommit ¶
func (*Commit) BitArray ¶
BitArray returns a BitArray of which validators voted for BlockID or nil in this commit. Implements VoteSetReader.
func (*Commit) GetByIndex ¶
GetByIndex returns the vote corresponding to a given validator index. Panics if `index >= commit.Size()`. Implements VoteSetReader.
func (*Commit) GetVote ¶
GetVote converts the CommitSig for the given valIdx to a Vote. Returns nil if the precommit at valIdx is nil. Panics if valIdx >= commit.Size().
func (*Commit) IsCommit ¶
IsCommit returns true if there is at least one signature. Implements VoteSetReader.
func (*Commit) Size ¶
Size returns the number of signatures in the commit. Implements VoteSetReader.
func (*Commit) StringIndented ¶
StringIndented returns a string representation of the commit.
func (*Commit) Type ¶
Type returns the vote type of the commit, which is always VoteTypePrecommit Implements VoteSetReader.
func (*Commit) ValidateBasic ¶
ValidateBasic performs basic validation that doesn't involve state data. Does not actually check the cryptographic signatures.
func (*Commit) VoteSignBytes ¶
VoteSignBytes returns the bytes of the Vote corresponding to valIdx for signing.
The only unique part is the Timestamp - all other fields signed over are otherwise the same for all validators.
Panics if valIdx >= commit.Size().
See VoteSignBytes
type CommitHeightError ¶
CommitHeightError represents mismatch between expected and actual commit heights
func NewCommitHeightError ¶
func NewCommitHeightError(expected, actual int64) CommitHeightError
func (CommitHeightError) Error ¶
func (e CommitHeightError) Error() string
type CommitSig ¶
type CommitSig struct { BlockIDFlag BlockIDFlag `json:"block_id_flag"` ValidatorAddress Address `json:"validator_address"` Timestamp time.Time `json:"timestamp"` Signature []byte `json:"signature"` }
CommitSig is a part of the Vote included in a Commit.
func NewCommitSigAbsent ¶
func NewCommitSigAbsent() CommitSig
NewCommitSigAbsent returns new CommitSig with BlockIDFlagAbsent. Other fields are all empty.
func NewCommitSigForBlock ¶
NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit.
func (CommitSig) BlockID ¶
BlockID returns the Commit's BlockID if CommitSig indicates signing, otherwise - empty BlockID.
func (*CommitSig) FromProto ¶
FromProto sets a protobuf CommitSig to the given pointer. It returns an error if the CommitSig is invalid.
func (CommitSig) String ¶
CommitSig returns a string representation of CommitSig.
1. first 6 bytes of signature 2. first 6 bytes of validator address 3. block ID flag 4. timestamp
func (CommitSig) ValidateBasic ¶
ValidateBasic performs basic validation.
type CommitSignatureError ¶
CommitSignatureError represents mismatch between expected and actual signature counts
func NewCommitSignatureError ¶
func NewCommitSignatureError(expected, actual int) CommitSignatureError
func (CommitSignatureError) Error ¶
func (e CommitSignatureError) Error() string
type ConsensusParams ¶
type ConsensusParams struct { Block BlockParams `json:"block"` Evidence EvidenceParams `json:"evidence"` Validator ValidatorParams `json:"validator"` Version VersionParams `json:"version"` QuantumSafe QuantumParams `json:"quantum_safe,omitempty"` // New quantum params AI AIParams `json:"ai,omitempty"` // New AI params }
func ConsensusParamsFromProto ¶
func ConsensusParamsFromProto(pbParams cmtproto.ConsensusParams) ConsensusParams
func DefaultConsensusParams ¶
func DefaultConsensusParams() *ConsensusParams
func (ConsensusParams) Hash ¶
func (params ConsensusParams) Hash() []byte
Hash returns a hash of a subset of the parameters to store in the block header. Only the Block.MaxBytes and Block.MaxGas are included in the hash. This allows the ConsensusParams to evolve more without breaking the block protocol. No need for a Merkle tree here, just a small struct to hash.
func (*ConsensusParams) ToProto ¶
func (params *ConsensusParams) ToProto() cmtproto.ConsensusParams
func (ConsensusParams) Update ¶
func (params ConsensusParams) Update(params2 *cmtproto.ConsensusParams) ConsensusParams
Update returns a copy of the params with updates from the non-zero fields of p2. NOTE: note: must not modify the original
func (ConsensusParams) ValidateBasic ¶
func (params ConsensusParams) ValidateBasic() error
Validate validates the ConsensusParams to ensure all values are within their allowed limits, and returns an error if they are not.
type Data ¶
type Data struct { // Txs that will be applied by state @ block.Height+1. // NOTE: not all txs here are valid. We're just agreeing on the order first. // This means that block.AppHash does not include these txs. Txs Txs `json:"txs"` // contains filtered or unexported fields }
Data contains the set of transactions included in the block
func DataFromProto ¶
DataFromProto takes a protobuf representation of Data & returns the native type.
func (*Data) StringIndented ¶
StringIndented returns an indented string representation of the transactions.
type DuplicateVoteEvidence ¶
type DuplicateVoteEvidence struct { VoteA *Vote VoteB *Vote TotalVotingPower int64 ValidatorPower int64 Timestamp time.Time PQCSignature []byte // Quantum-safe signature }
func DuplicateVoteEvidenceFromProto ¶
func DuplicateVoteEvidenceFromProto(pb *cmtproto.DuplicateVoteEvidence) (*DuplicateVoteEvidence, error)
DuplicateVoteEvidenceFromProto decodes protobuf into DuplicateVoteEvidence
func NewDuplicateVoteEvidence ¶
func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, valSet *ValidatorSet, ) (*DuplicateVoteEvidence, error)
NewDuplicateVoteEvidence creates DuplicateVoteEvidence with right ordering given two conflicting votes. If either of the votes is nil, the val set is nil or the voter is not in the val set, an error is returned
func NewMockDuplicateVoteEvidence ¶
func NewMockDuplicateVoteEvidence(height int64, time time.Time, chainID string) (*DuplicateVoteEvidence, error)
assumes the round to be 0 and the validator index to be 0
func NewMockDuplicateVoteEvidenceWithValidator ¶
func NewMockDuplicateVoteEvidenceWithValidator(height int64, time time.Time, pv PrivValidator, chainID string) (*DuplicateVoteEvidence, error)
assumes voting power to be 10 and validator to be the only one in the set
func (*DuplicateVoteEvidence) ABCI ¶
func (dve *DuplicateVoteEvidence) ABCI() []abci.Misbehavior
ABCI returns the application relevant representation of the evidence
func (*DuplicateVoteEvidence) Bytes ¶
func (dve *DuplicateVoteEvidence) Bytes() []byte
Bytes returns the proto-encoded evidence as a byte array.
func (*DuplicateVoteEvidence) Hash ¶
func (dve *DuplicateVoteEvidence) Hash() []byte
Hash returns the hash of the evidence.
func (*DuplicateVoteEvidence) Height ¶
func (dve *DuplicateVoteEvidence) Height() int64
Height returns the height of the infraction
func (*DuplicateVoteEvidence) String ¶
func (dve *DuplicateVoteEvidence) String() string
String returns a string representation of the evidence.
func (*DuplicateVoteEvidence) Time ¶
func (dve *DuplicateVoteEvidence) Time() time.Time
Time returns the time of the infraction
func (*DuplicateVoteEvidence) ToProto ¶
func (dve *DuplicateVoteEvidence) ToProto() *cmtproto.DuplicateVoteEvidence
ToProto encodes DuplicateVoteEvidence to protobuf
func (*DuplicateVoteEvidence) ValidateBasic ¶
func (dve *DuplicateVoteEvidence) ValidateBasic() error
ValidateBasic performs basic validation.
func (*DuplicateVoteEvidence) VerifyPQC ¶
func (dve *DuplicateVoteEvidence) VerifyPQC() error
type ErrEvidenceOverflow ¶
ErrEvidenceOverflow is for when there the amount of evidence exceeds the max bytes.
func NewErrEvidenceOverflow ¶
func NewErrEvidenceOverflow(max, got int64) *ErrEvidenceOverflow
NewErrEvidenceOverflow returns a new ErrEvidenceOverflow where got > max.
func (*ErrEvidenceOverflow) Error ¶
func (err *ErrEvidenceOverflow) Error() string
Error returns a string representation of the error.
type ErrInvalidEvidence ¶
ErrInvalidEvidence wraps a piece of evidence and the error denoting how or why it is invalid.
func NewErrInvalidEvidence ¶
func NewErrInvalidEvidence(ev Evidence, err error) *ErrInvalidEvidence
NewErrInvalidEvidence returns a new EvidenceInvalid with the given err.
func (*ErrInvalidEvidence) Error ¶
func (err *ErrInvalidEvidence) Error() string
Error returns a string representation of the error.
type ErrNotEnoughVotingPowerSigned ¶
ErrNotEnoughVotingPowerSigned is returned when not enough validators signed a commit.
func (ErrNotEnoughVotingPowerSigned) Error ¶
func (e ErrNotEnoughVotingPowerSigned) Error() string
type ErroringMockPV ¶
type ErroringMockPV struct {
MockPV
}
func NewErroringMockPV ¶
func NewErroringMockPV() *ErroringMockPV
func (*ErroringMockPV) SignProposal ¶
func (pv *ErroringMockPV) SignProposal(chainID string, proposal *cmtproto.Proposal) error
Implements PrivValidator.
type EventBus ¶
type EventBus struct { service.BaseService // contains filtered or unexported fields }
EventBus is a common bus for all events going through the system. All calls are proxied to underlying pubsub server. All events must be published using EventBus to ensure correct data types.
func NewEventBusWithBufferCapacity ¶
NewEventBusWithBufferCapacity returns a new event bus with the given buffer capacity.
func (*EventBus) NumClientSubscriptions ¶
func (*EventBus) NumClients ¶
func (*EventBus) Publish ¶
func (b *EventBus) Publish(eventType string, eventData TMEventData) error
func (*EventBus) PublishEventCompleteProposal ¶
func (b *EventBus) PublishEventCompleteProposal(data EventDataCompleteProposal) error
func (*EventBus) PublishEventLock ¶
func (b *EventBus) PublishEventLock(data EventDataRoundState) error
func (*EventBus) PublishEventNewBlock ¶
func (b *EventBus) PublishEventNewBlock(data EventDataNewBlock) error
func (*EventBus) PublishEventNewBlockHeader ¶
func (b *EventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error
func (*EventBus) PublishEventNewEvidence ¶
func (b *EventBus) PublishEventNewEvidence(evidence EventDataNewEvidence) error
func (*EventBus) PublishEventNewRound ¶
func (b *EventBus) PublishEventNewRound(data EventDataNewRound) error
func (*EventBus) PublishEventNewRoundStep ¶
func (b *EventBus) PublishEventNewRoundStep(data EventDataRoundState) error
func (*EventBus) PublishEventPolka ¶
func (b *EventBus) PublishEventPolka(data EventDataRoundState) error
func (*EventBus) PublishEventRelock ¶
func (b *EventBus) PublishEventRelock(data EventDataRoundState) error
func (*EventBus) PublishEventTimeoutPropose ¶
func (b *EventBus) PublishEventTimeoutPropose(data EventDataRoundState) error
func (*EventBus) PublishEventTimeoutWait ¶
func (b *EventBus) PublishEventTimeoutWait(data EventDataRoundState) error
func (*EventBus) PublishEventTx ¶
func (b *EventBus) PublishEventTx(data EventDataTx) error
PublishEventTx publishes tx event with events from Result. Note it will add predefined keys (EventTypeKey, TxHashKey). Existing events with the same keys will be overwritten.
func (*EventBus) PublishEventUnlock ¶
func (b *EventBus) PublishEventUnlock(data EventDataRoundState) error
func (*EventBus) PublishEventValidBlock ¶
func (b *EventBus) PublishEventValidBlock(data EventDataRoundState) error
func (*EventBus) PublishEventValidatorSetUpdates ¶
func (b *EventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error
func (*EventBus) PublishEventVote ¶
func (b *EventBus) PublishEventVote(data EventDataVote) error
func (*EventBus) SubscribeUnbuffered ¶
func (b *EventBus) SubscribeUnbuffered( ctx context.Context, subscriber string, query cmtpubsub.Query, ) (Subscription, error)
This method can be used for a local consensus explorer and synchronous testing. Do not use for for public facing / untrusted subscriptions!
func (*EventBus) Unsubscribe ¶
type EventBusSubscriber ¶
type EventBusSubscriber interface { Subscribe(ctx context.Context, subscriber string, query cmtpubsub.Query, outCapacity ...int) (Subscription, error) Unsubscribe(ctx context.Context, subscriber string, query cmtpubsub.Query) error UnsubscribeAll(ctx context.Context, subscriber string) error NumClients() int NumClientSubscriptions(clientID string) int }
type EventDataNewBlock ¶
type EventDataNewBlock struct { Block *Block `json:"block"` ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` }
type EventDataNewBlockHeader ¶
type EventDataNewBlockHeader struct { Header Header `json:"header"` NumTxs int64 `json:"num_txs"` // Number of txs in a block ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"` ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"` }
type EventDataNewEvidence ¶
type EventDataNewRound ¶
type EventDataNewRound struct { Height int64 `json:"height"` Round int32 `json:"round"` Step string `json:"step"` Proposer ValidatorInfo `json:"proposer"` }
type EventDataRoundState ¶
type EventDataRoundState struct { Height int64 `json:"height"` Round int32 `json:"round"` Step string `json:"step"` }
NOTE: This goes into the replay WAL
type EventDataString ¶
type EventDataString string
type EventDataValidatorSetUpdates ¶
type EventDataValidatorSetUpdates struct {
ValidatorUpdates []*Validator `json:"validator_updates"`
}
type EventDataVote ¶
type EventDataVote struct {
Vote *Vote
}
type Evidence ¶
type Evidence interface { ABCI() []abci.Misbehavior Bytes() []byte Hash() []byte Height() int64 String() string Time() time.Time ValidateBasic() error VerifyPQC() error // New method for quantum-safe verification }
func EvidenceFromProto ¶
EvidenceFromProto is a generalized function for decoding protobuf into the evidence interface
type EvidenceData ¶
type EvidenceData struct { Evidence EvidenceList `json:"evidence"` // contains filtered or unexported fields }
EvidenceData contains any evidence of malicious wrong-doing by validators
func (*EvidenceData) ByteSize ¶
func (data *EvidenceData) ByteSize() int64
ByteSize returns the total byte size of all the evidence
func (*EvidenceData) FromProto ¶
func (data *EvidenceData) FromProto(eviData *cmtproto.EvidenceList) error
FromProto sets a protobuf EvidenceData to the given pointer.
func (*EvidenceData) Hash ¶
func (data *EvidenceData) Hash() cmtbytes.HexBytes
Hash returns the hash of the data.
func (*EvidenceData) StringIndented ¶
func (data *EvidenceData) StringIndented(indent string) string
StringIndented returns a string representation of the evidence.
func (*EvidenceData) ToProto ¶
func (data *EvidenceData) ToProto() (*cmtproto.EvidenceList, error)
ToProto converts EvidenceData to protobuf
type EvidenceList ¶
type EvidenceList []Evidence
EvidenceList is a list of Evidence. Evidences is not a word.
func (EvidenceList) Hash ¶
func (evl EvidenceList) Hash() []byte
Hash returns the simple merkle root hash of the EvidenceList.
func (EvidenceList) ToABCI ¶
func (evl EvidenceList) ToABCI() []abci.Misbehavior
ToABCI converts the evidence list to a slice of the ABCI protobuf messages for use when communicating the evidence to an application.
func (EvidenceList) ValidateBasic ¶
func (evl EvidenceList) ValidateBasic() error
type EvidenceParams ¶
type EvidenceParams struct { MaxAgeNumBlocks int64 `json:"max_age_num_blocks"` MaxAgeDuration time.Duration `json:"max_age_duration"` MaxBytes int64 `json:"max_bytes"` }
func DefaultEvidenceParams ¶
func DefaultEvidenceParams() EvidenceParams
DefaultEvidenceParams returns a default EvidenceParams.
type GenesisDoc ¶
type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` InitialHeight int64 `json:"initial_height"` ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"` Validators []GenesisValidator `json:"validators,omitempty"` AppHash bcbytes.HexBytes `json:"app_hash"` AppState json.RawMessage `json:"app_state,omitempty"` // Baron Chain specific fields PQCEnabled bool `json:"pqc_enabled"` AIValidation bool `json:"ai_validation"` SidechainConfig json.RawMessage `json:"sidechain_config,omitempty"` }
func GenesisDocFromFile ¶
func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error)
func GenesisDocFromJSON ¶
func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error)
func (*GenesisDoc) SaveAs ¶
func (genDoc *GenesisDoc) SaveAs(file string) error
func (*GenesisDoc) ValidateAndComplete ¶
func (genDoc *GenesisDoc) ValidateAndComplete() error
func (*GenesisDoc) ValidatorHash ¶
func (genDoc *GenesisDoc) ValidatorHash() []byte
type GenesisValidator ¶
type GenesisValidator struct { Address Address `json:"address"` PubKey crypto.PubKey `json:"pub_key"` Power int64 `json:"power"` Name string `json:"name"` PQCPublicKey []byte `json:"pqc_pub_key,omitempty"` // Quantum-safe public key AIScore float64 `json:"ai_score,omitempty"` // AI-based reputation score }
type Header ¶
type Header struct { // basic block info Version cmtversion.Consensus `json:"version"` ChainID string `json:"chain_id"` Height int64 `json:"height"` Time time.Time `json:"time"` // prev block info LastBlockID BlockID `json:"last_block_id"` // hashes of block data LastCommitHash cmtbytes.HexBytes `json:"last_commit_hash"` // commit from validators from the last block DataHash cmtbytes.HexBytes `json:"data_hash"` // transactions // hashes from the app output from the prev block ValidatorsHash cmtbytes.HexBytes `json:"validators_hash"` // validators for the current block NextValidatorsHash cmtbytes.HexBytes `json:"next_validators_hash"` // validators for the next block ConsensusHash cmtbytes.HexBytes `json:"consensus_hash"` // consensus params for current block AppHash cmtbytes.HexBytes `json:"app_hash"` // state after txs from the previous block // root hash of all results from the txs from the previous block // see `deterministicResponseDeliverTx` to understand which parts of a tx is hashed into here LastResultsHash cmtbytes.HexBytes `json:"last_results_hash"` // consensus info EvidenceHash cmtbytes.HexBytes `json:"evidence_hash"` // evidence included in the block ProposerAddress Address `json:"proposer_address"` // original proposer of the block }
Header defines the structure of a CometBFT block header. NOTE: changes to the Header should be duplicated in: - header.Hash() - abci.Header - https://github.com/cometbft/cometbft/blob/v0.37.x/spec/blockchain/blockchain.md
func HeaderFromProto ¶
FromProto sets a protobuf Header to the given pointer. It returns an error if the header is invalid.
func (*Header) Hash ¶
Hash returns the hash of the header. It computes a Merkle tree from the header fields ordered as they appear in the Header. Returns nil if ValidatorHash is missing, since a Header is not valid unless there is a ValidatorsHash (corresponding to the validator set).
func (*Header) Populate ¶
func (h *Header) Populate( version cmtversion.Consensus, chainID string, timestamp time.Time, lastBlockID BlockID, valHash, nextValHash []byte, consensusHash, appHash, lastResultsHash []byte, proposerAddress Address, )
Populate the Header with state-derived data. Call this after MakeBlock to complete the Header.
func (*Header) StringIndented ¶
StringIndented returns an indented string representation of the header.
func (Header) ValidateBasic ¶
ValidateBasic performs stateless validation on a Header returning an error if any validation fails.
NOTE: Timestamp validation is subtle and handled elsewhere.
type LightBlock ¶
type LightBlock struct { *SignedHeader `json:"signed_header"` ValidatorSet *ValidatorSet `json:"validator_set"` PQCSignature []byte `json:"pqc_signature,omitempty"` // Quantum-safe signature AITrustScore float64 `json:"ai_trust_score,omitempty"` // AI-based trust score }
LightBlock represents a lightweight version of a block for light client verification
func LightBlockFromProto ¶
func LightBlockFromProto(pb *bcproto.LightBlock) (*LightBlock, error)
func (LightBlock) String ¶
func (lb LightBlock) String() string
Helper methods for string representation
func (LightBlock) StringIndented ¶
func (lb LightBlock) StringIndented(indent string) string
func (*LightBlock) ToProto ¶
func (lb *LightBlock) ToProto() (*bcproto.LightBlock, error)
func (LightBlock) ValidateBasic ¶
func (lb LightBlock) ValidateBasic(chainID string) error
type LightClientAttackEvidence ¶
type LightClientAttackEvidence struct { ConflictingBlock *LightBlock CommonHeight int64 // abci specific information ByzantineValidators []*Validator // validators in the validator set that misbehaved in creating the conflicting block TotalVotingPower int64 // total voting power of the validator set at the common height Timestamp time.Time // timestamp of the block at the common height }
LightClientAttackEvidence is a generalized evidence that captures all forms of known attacks on a light client such that a full node can verify, propose and commit the evidence on-chain for punishment of the malicious validators. There are three forms of attacks: Lunatic, Equivocation and Amnesia. These attacks are exhaustive. You can find a more detailed overview of this at cometbft/docs/architecture/adr-047-handling-evidence-from-light-client.md
func LightClientAttackEvidenceFromProto ¶
func LightClientAttackEvidenceFromProto(lpb *cmtproto.LightClientAttackEvidence) (*LightClientAttackEvidence, error)
LightClientAttackEvidenceFromProto decodes protobuf
func (*LightClientAttackEvidence) ABCI ¶
func (l *LightClientAttackEvidence) ABCI() []abci.Misbehavior
ABCI forms an array of abci.Misbehavior for each byzantine validator
func (*LightClientAttackEvidence) Bytes ¶
func (l *LightClientAttackEvidence) Bytes() []byte
Bytes returns the proto-encoded evidence as a byte array
func (*LightClientAttackEvidence) ConflictingHeaderIsInvalid ¶
func (l *LightClientAttackEvidence) ConflictingHeaderIsInvalid(trustedHeader *Header) bool
ConflictingHeaderIsInvalid takes a trusted header and matches it againt a conflicting header to determine whether the conflicting header was the product of a valid state transition or not. If it is then all the deterministic fields of the header should be the same. If not, it is an invalid header and constitutes a lunatic attack.
func (*LightClientAttackEvidence) GetByzantineValidators ¶
func (l *LightClientAttackEvidence) GetByzantineValidators(commonVals *ValidatorSet, trusted *SignedHeader) []*Validator
GetByzantineValidators finds out what style of attack LightClientAttackEvidence was and then works out who the malicious validators were and returns them. This is used both for forming the ByzantineValidators field and for validating that it is correct. Validators are ordered based on validator power
func (*LightClientAttackEvidence) Hash ¶
func (l *LightClientAttackEvidence) Hash() []byte
Hash returns the hash of the header and the commonHeight. This is designed to cause hash collisions with evidence that have the same conflicting header and common height but different permutations of validator commit signatures. The reason for this is that we don't want to allow several permutations of the same evidence to be committed on chain. Ideally we commit the header with the most commit signatures (captures the most byzantine validators) but anything greater than 1/3 is sufficient. TODO: We should change the hash to include the commit, header, total voting power, byzantine validators and timestamp
func (*LightClientAttackEvidence) Height ¶
func (l *LightClientAttackEvidence) Height() int64
Height returns the last height at which the primary provider and witness provider had the same header. We use this as the height of the infraction rather than the actual conflicting header because we know that the malicious validators were bonded at this height which is important for evidence expiry
func (*LightClientAttackEvidence) String ¶
func (l *LightClientAttackEvidence) String() string
String returns a string representation of LightClientAttackEvidence
func (*LightClientAttackEvidence) Time ¶
func (l *LightClientAttackEvidence) Time() time.Time
Time returns the time of the common block where the infraction leveraged off.
func (*LightClientAttackEvidence) ToProto ¶
func (l *LightClientAttackEvidence) ToProto() (*cmtproto.LightClientAttackEvidence, error)
ToProto encodes LightClientAttackEvidence to protobuf
func (*LightClientAttackEvidence) ValidateBasic ¶
func (l *LightClientAttackEvidence) ValidateBasic() error
ValidateBasic performs basic validation such that the evidence is consistent and can now be used for verification.
type MockPV ¶
MockPV implements PrivValidator without any safety or persistence. Only use it for testing.
func NewMockPVWithParams ¶
func NewMockPVWithParams(privKey crypto.PrivKey, breakProposalSigning, breakVoteSigning bool) MockPV
NewMockPVWithParams allows one to create a MockPV instance, but with finer grained control over the operation of the mock validator. This is useful for mocking test failures.
func (MockPV) ExtractIntoValidator ¶
func (MockPV) SignProposal ¶
Implements PrivValidator.
type NopEventBus ¶
type NopEventBus struct{}
-----------------------------------------------------------------------------
func (NopEventBus) PublishEventCompleteProposal ¶
func (NopEventBus) PublishEventCompleteProposal(data EventDataRoundState) error
func (NopEventBus) PublishEventLock ¶
func (NopEventBus) PublishEventLock(data EventDataRoundState) error
func (NopEventBus) PublishEventNewBlock ¶
func (NopEventBus) PublishEventNewBlock(data EventDataNewBlock) error
func (NopEventBus) PublishEventNewBlockHeader ¶
func (NopEventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error
func (NopEventBus) PublishEventNewEvidence ¶
func (NopEventBus) PublishEventNewEvidence(evidence EventDataNewEvidence) error
func (NopEventBus) PublishEventNewRound ¶
func (NopEventBus) PublishEventNewRound(data EventDataRoundState) error
func (NopEventBus) PublishEventNewRoundStep ¶
func (NopEventBus) PublishEventNewRoundStep(data EventDataRoundState) error
func (NopEventBus) PublishEventPolka ¶
func (NopEventBus) PublishEventPolka(data EventDataRoundState) error
func (NopEventBus) PublishEventRelock ¶
func (NopEventBus) PublishEventRelock(data EventDataRoundState) error
func (NopEventBus) PublishEventTimeoutPropose ¶
func (NopEventBus) PublishEventTimeoutPropose(data EventDataRoundState) error
func (NopEventBus) PublishEventTimeoutWait ¶
func (NopEventBus) PublishEventTimeoutWait(data EventDataRoundState) error
func (NopEventBus) PublishEventTx ¶
func (NopEventBus) PublishEventTx(data EventDataTx) error
func (NopEventBus) PublishEventUnlock ¶
func (NopEventBus) PublishEventUnlock(data EventDataRoundState) error
func (NopEventBus) PublishEventValidatorSetUpdates ¶
func (NopEventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error
func (NopEventBus) PublishEventVote ¶
func (NopEventBus) PublishEventVote(data EventDataVote) error
func (NopEventBus) Unsubscribe ¶
func (NopEventBus) UnsubscribeAll ¶
func (NopEventBus) UnsubscribeAll(ctx context.Context, subscriber string) error
type Part ¶
type Part struct { Index uint32 `json:"index"` Bytes bcbytes.HexBytes `json:"bytes"` Proof merkle.Proof `json:"proof"` PQCSignature bcbytes.HexBytes `json:"pqc_signature,omitempty"` // Quantum-safe signature }
func PartFromProto ¶
func (*Part) StringIndented ¶
StringIndented returns an indented Part.
See merkle.Proof#StringIndented
func (*Part) ValidateBasic ¶
type PartSet ¶
type PartSet struct {
// contains filtered or unexported fields
}
func NewPartSetFromData ¶
func NewPartSetFromHeader ¶
func NewPartSetFromHeader(header PartSetHeader) *PartSet
Returns an empty PartSet ready to be populated.
func (*PartSet) IsComplete ¶
func (ps *PartSet) IsComplete() bool
func (*PartSet) MarshalJSON ¶
func (*PartSet) StringShort ¶
func (ps *PartSet) StringShort() string
StringShort returns a short version of String.
(Count of Total)
type PartSetHeader ¶
type PartSetHeader struct { Total uint32 `json:"total"` Hash cmtbytes.HexBytes `json:"hash"` }
func PartSetHeaderFromProto ¶
func PartSetHeaderFromProto(ppsh *cmtproto.PartSetHeader) (*PartSetHeader, error)
FromProto sets a protobuf PartSetHeader to the given pointer
func (PartSetHeader) String ¶
func (psh PartSetHeader) String() string
String returns a string representation of PartSetHeader.
1. total number of parts 2. first 6 bytes of the hash
func (*PartSetHeader) ToProto ¶
func (psh *PartSetHeader) ToProto() cmtproto.PartSetHeader
ToProto converts PartSetHeader to protobuf
func (PartSetHeader) ValidateBasic ¶
func (psh PartSetHeader) ValidateBasic() error
ValidateBasic performs basic validation.
type PartSetReader ¶
type PartSetReader struct {
// contains filtered or unexported fields
}
func NewPartSetReader ¶
func NewPartSetReader(parts []*Part) *PartSetReader
type PrivValidator ¶
type PrivValidatorsByAddress ¶
type PrivValidatorsByAddress []PrivValidator
func (PrivValidatorsByAddress) Len ¶
func (pvs PrivValidatorsByAddress) Len() int
func (PrivValidatorsByAddress) Less ¶
func (pvs PrivValidatorsByAddress) Less(i, j int) bool
func (PrivValidatorsByAddress) Swap ¶
func (pvs PrivValidatorsByAddress) Swap(i, j int)
type Proposal ¶
type Proposal struct { Type cmtproto.SignedMsgType Height int64 `json:"height"` Round int32 `json:"round"` // there can not be greater than 2_147_483_647 rounds POLRound int32 `json:"pol_round"` // -1 if null. BlockID BlockID `json:"block_id"` Timestamp time.Time `json:"timestamp"` Signature []byte `json:"signature"` }
func NewProposal ¶
NewProposal returns a new Proposal. If there is no POLRound, polRound should be -1.
func ProposalFromProto ¶
FromProto sets a protobuf Proposal to the given pointer. It returns an error if the proposal is invalid.
func (*Proposal) String ¶
String returns a string representation of the Proposal.
1. height 2. round 3. block ID 4. POL round 5. first 6 bytes of signature 6. timestamp
See BlockID#String.
func (*Proposal) ValidateBasic ¶
ValidateBasic performs basic validation.
type QuantumParams ¶
type QuantumParams struct { Enabled bool `json:"enabled"` MinKeySize int `json:"min_key_size"` RequiredKeyTypes []string `json:"required_key_types"` }
New params for quantum-safe features
func DefaultQuantumParams ¶
func DefaultQuantumParams() QuantumParams
type SignedHeader ¶
func (SignedHeader) ValidateBasic ¶
func (sh SignedHeader) ValidateBasic(chainID string) error
type Subscription ¶
type Tx ¶
type Tx []byte
Tx is an arbitrary byte array. NOTE: Tx has no types at this level, so when wire encoded it's just length-prefixed. Might we want types here ?
type TxEventPublisher ¶
type TxEventPublisher interface {
PublishEventTx(EventDataTx) error
}
type TxProof ¶
type TxProof struct { RootHash cmtbytes.HexBytes `json:"root_hash"` Data Tx `json:"data"` Proof merkle.Proof `json:"proof"` }
TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
type Txs ¶
type Txs []Tx
Txs is a slice of Tx.
func (Txs) Hash ¶
Hash returns the Merkle root hash of the transaction hashes. i.e. the leaves of the tree are the hashes of the txs.
func (Txs) IndexByHash ¶
IndexByHash returns the index of this transaction hash in the list, or -1 if not found
func (Txs) Len ¶
Txs is a slice of transactions. Sorting a Txs value orders the transactions lexicographically.
func (Txs) ToSliceOfBytes ¶
ToSliceOfBytes converts a Txs to slice of byte slices.
type Validator ¶
type Validator struct { Address Address `json:"address"` PubKey crypto.PubKey `json:"pub_key"` VotingPower int64 `json:"voting_power"` ProposerPriority int64 `json:"proposer_priority"` ReputationScore float64 `json:"reputation_score"` }
func (*Validator) CompareProposerPriority ¶
func (*Validator) ValidateBasic ¶
type ValidatorInfo ¶
type ValidatorInfo struct { Address Address `json:"address"` Index int32 `json:"index"` }
type ValidatorParams ¶
type ValidatorParams struct {
PubKeyTypes []string `json:"pub_key_types"`
}
func DefaultValidatorParams ¶
func DefaultValidatorParams() ValidatorParams
DefaultValidatorParams returns a default ValidatorParams, which allows only ed25519 pubkeys.
type ValidatorSet ¶
type ValidatorSet struct { Validators []*Validator `json:"validators"` Proposer *Validator `json:"proposer"` // contains filtered or unexported fields }
func NewValidatorSet ¶
func NewValidatorSet(valz []*Validator) *ValidatorSet
func ValidatorSetFromExistingValidators ¶
func ValidatorSetFromExistingValidators(valz []*Validator) (*ValidatorSet, error)
ValidatorSetFromExistingValidators takes an existing array of validators and rebuilds the exact same validator set that corresponds to it without changing the proposer priority or power if any of the validators fail validate basic then an empty set is returned.
func ValidatorSetFromProto ¶
func ValidatorSetFromProto(vp *cmtproto.ValidatorSet) (*ValidatorSet, error)
ValidatorSetFromProto sets a protobuf ValidatorSet to the given pointer. It returns an error if any of the validators from the set or the proposer is invalid
func (*ValidatorSet) Copy ¶
func (vals *ValidatorSet) Copy() *ValidatorSet
Copy each validator into a new ValidatorSet.
func (*ValidatorSet) CopyIncrementProposerPriority ¶
func (vals *ValidatorSet) CopyIncrementProposerPriority(times int32) *ValidatorSet
func (*ValidatorSet) GetByAddress ¶
func (vals *ValidatorSet) GetByAddress(address []byte) (index int32, val *Validator)
GetByAddress returns an index of the validator with address and validator itself (copy) if found. Otherwise, -1 and nil are returned.
func (*ValidatorSet) GetByIndex ¶
func (vals *ValidatorSet) GetByIndex(index int32) (address []byte, val *Validator)
GetByIndex returns the validator's address and validator itself (copy) by index. It returns nil values if index is less than 0 or greater or equal to len(ValidatorSet.Validators).
func (*ValidatorSet) GetProposer ¶
func (vals *ValidatorSet) GetProposer() (proposer *Validator)
GetProposer returns the current proposer. If the validator set is empty, nil is returned.
func (*ValidatorSet) HasAddress ¶
func (vals *ValidatorSet) HasAddress(address []byte) bool
HasAddress returns true if address given is in the validator set, false - otherwise.
func (*ValidatorSet) Hash ¶
func (vals *ValidatorSet) Hash() []byte
Hash returns the Merkle root hash build using validators (as leaves) in the set.
func (*ValidatorSet) IncrementProposerPriority ¶
func (vals *ValidatorSet) IncrementProposerPriority(times int32)
func (*ValidatorSet) IsNilOrEmpty ¶
func (vals *ValidatorSet) IsNilOrEmpty() bool
func (*ValidatorSet) Iterate ¶
func (vals *ValidatorSet) Iterate(fn func(index int, val *Validator) bool)
Iterate will run the given function over the set.
func (*ValidatorSet) Size ¶
func (vals *ValidatorSet) Size() int
Size returns the length of the validator set.
func (*ValidatorSet) String ¶
func (vals *ValidatorSet) String() string
String returns a string representation of ValidatorSet.
See StringIndented.
func (*ValidatorSet) StringIndented ¶
func (vals *ValidatorSet) StringIndented(indent string) string
StringIndented returns an intended String.
See Validator#String.
func (*ValidatorSet) ToProto ¶
func (vals *ValidatorSet) ToProto() (*cmtproto.ValidatorSet, error)
ToProto converts ValidatorSet to protobuf
func (*ValidatorSet) TotalVotingPower ¶
func (vals *ValidatorSet) TotalVotingPower() int64
TotalVotingPower returns the sum of the voting powers of all validators. It recomputes the total voting power if required.
func (*ValidatorSet) UpdateWithChangeSet ¶
func (vals *ValidatorSet) UpdateWithChangeSet(changes []*Validator) error
UpdateWithChangeSet attempts to update the validator set with 'changes'. It performs the following steps:
- validates the changes making sure there are no duplicates and splits them in updates and deletes
- verifies that applying the changes will not result in errors
- computes the total voting power BEFORE removals to ensure that in the next steps the priorities across old and newly added validators are fair
- computes the priorities of new validators against the final set
- applies the updates against the validator set
- applies the removals against the validator set
- performs scaling and centering of priority values
If an error is detected during verification steps, it is returned and the validator set is not changed.
func (*ValidatorSet) ValidateBasic ¶
func (vals *ValidatorSet) ValidateBasic() error
func (*ValidatorSet) VerifyCommit ¶
func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height int64, commit *Commit) error
VerifyCommit verifies +2/3 of the set had signed the given commit.
It checks all the signatures! While it's safe to exit as soon as we have 2/3+ signatures, doing so would impact incentivization logic in the ABCI application that depends on the LastCommitInfo sent in BeginBlock, which includes which validators signed. For instance, Gaia incentivizes proposers with a bonus for including more than +2/3 of the signatures.
func (*ValidatorSet) VerifyCommitLight ¶
func (vals *ValidatorSet) VerifyCommitLight(chainID string, blockID BlockID, height int64, commit *Commit) error
VerifyCommitLight verifies +2/3 of the set had signed the given commit.
This method is primarily used by the light client and does not check all the signatures.
func (*ValidatorSet) VerifyCommitLightTrusting ¶
func (vals *ValidatorSet) VerifyCommitLightTrusting(chainID string, commit *Commit, trustLevel cmtmath.Fraction) error
VerifyCommitLightTrusting verifies that trustLevel of the validator set signed this commit.
NOTE the given validators do not necessarily correspond to the validator set for this commit, but there may be some intersection.
This method is primarily used by the light client and does not check all the signatures.
type ValidatorsByAddress ¶
type ValidatorsByAddress []*Validator
ValidatorsByAddress implements sort.Interface for []*Validator based on the Address field.
func (ValidatorsByAddress) Len ¶
func (valz ValidatorsByAddress) Len() int
func (ValidatorsByAddress) Less ¶
func (valz ValidatorsByAddress) Less(i, j int) bool
func (ValidatorsByAddress) Swap ¶
func (valz ValidatorsByAddress) Swap(i, j int)
type ValidatorsByVotingPower ¶
type ValidatorsByVotingPower []*Validator
ValidatorsByVotingPower implements sort.Interface for []*Validator based on the VotingPower and Address fields.
func (ValidatorsByVotingPower) Len ¶
func (valz ValidatorsByVotingPower) Len() int
func (ValidatorsByVotingPower) Less ¶
func (valz ValidatorsByVotingPower) Less(i, j int) bool
func (ValidatorsByVotingPower) Swap ¶
func (valz ValidatorsByVotingPower) Swap(i, j int)
type VersionParams ¶
type VersionParams struct {
App uint64 `json:"app"`
}
func DefaultVersionParams ¶
func DefaultVersionParams() VersionParams
type VoteSet ¶
type VoteSet struct {
// contains filtered or unexported fields
}
func CommitToVoteSet ¶
func CommitToVoteSet(chainID string, commit *Commit, vals *ValidatorSet) *VoteSet
CommitToVoteSet constructs a VoteSet from the Commit and validator set. Panics if signatures from the commit can't be added to the voteset. Inverse of VoteSet.MakeCommit().
func NewVoteSet ¶
func NewVoteSet(chainID string, height int64, round int32, signedMsgType bcproto.SignedMsgType, valSet *ValidatorSet) *VoteSet
func (*VoteSet) BitArrayByBlockID ¶
func (*VoteSet) BitArrayString ¶
Return the bit-array of votes including the fraction of power that has voted like: "BA{29:xx__x__x_x___x__x_______xxx__} 856/1304 = 0.66"
func (*VoteSet) GetByAddress ¶
func (*VoteSet) GetByIndex ¶
NOTE: if validator has conflicting votes, returns "canonical" vote Implements VoteSetReader.
func (*VoteSet) HasTwoThirdsAny ¶
func (*VoteSet) HasTwoThirdsMajority ¶
func (*VoteSet) List ¶
func (voteSet *VoteSet) List() []Vote
List returns a copy of the list of votes stored by the VoteSet.
func (*VoteSet) LogString ¶
LogString produces a logging suitable string representation of the vote set.
func (*VoteSet) MakeCommit ¶
MakeCommit constructs a Commit from the VoteSet. It only includes precommits for the block, which has 2/3+ majority, and nil.
Panics if the vote type is not PrecommitType or if there's no +2/3 votes for a single block.
func (*VoteSet) MarshalJSON ¶
Marshal the VoteSet to JSON. Same as String(), just in JSON, and without the height/round/signedMsgType (since its already included in the votes).
func (*VoteSet) SetPeerMaj23 ¶
If a peer claims that it has 2/3 majority for given blockKey, call this. NOTE: if there are too many peers, or too much peer churn, this can cause memory issues. TODO: implement ability to remove peers too NOTE: VoteSet must not be nil
func (*VoteSet) StringIndented ¶
StringIndented returns an indented String.
Height Round Type Votes Votes bit array 2/3+ majority
See Vote#String.
func (*VoteSet) StringShort ¶
StringShort returns a short representation of VoteSet.
1. height 2. round 3. signed msg type 4. first 2/3+ majority 5. fraction of voted power 6. votes bit array 7. 2/3+ majority for each peer
func (*VoteSet) TwoThirdsMajority ¶
If there was a +2/3 majority for blockID, return blockID and true. Else, return the empty BlockID{} and false.
func (*VoteSet) TwoThirdsMajorityWithAI ¶
func (*VoteSet) VoteStrings ¶
Returns a list of votes compressed to more readable strings.
type VoteSetJSON ¶
type VoteSetJSON struct { Votes []string `json:"votes"` VotesBitArray string `json:"votes_bit_array"` PeerMaj23s map[P2PID]BlockID `json:"peer_maj_23s"` }
More human readable JSON of the vote set NOTE: insufficient for unmarshalling from (compressed votes) TODO: make the peerMaj23s nicer to read (eg just the block hash)
Source Files ¶
- block.go
- block_meta.go
- canonical.go
- encoding_helper.go
- errors.go
- event_bus.go
- events.go
- evidence.go
- genesis.go
- keys.go
- light.go
- params.go
- part_set.go
- priv_validator.go
- proposal.go
- protobuf.go
- results.go
- signable.go
- signed_msg_type.go
- test_util.go
- tx.go
- utils.go
- validation.go
- validator.go
- validator_set.go
- vote.go
- vote_set.go