package
0.0.0-20241205214608-2be76b0ad5fc
Repository: https://github.com/baron-chain/cometbft-bc.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
FromProto sets a protobuf Block to the given pointer.
FromProto sets a protobuf BlockID to the given pointer.
No description provided by the author
CanonicalizeBlockID converts a BlockID to its canonical form Returns nil if the input represents a zero or nil BlockID.
CanonicalizePartSetHeader converts a PartSetHeader to its canonical form.
CanonicalizeProposal converts a Proposal to its canonical form for signing.
CanonicalizeVote converts a Vote to its canonical form for signing The canonical form excludes ValidatorIndex and ValidatorAddress fields.
CanonicalTime formats time in the canonical format, ensuring UTC timezone.
FromProto sets a protobuf Commit to the given pointer.
CommitToVoteSet constructs a VoteSet from the Commit and validator set.
ComputeProtoSizeForTxs wraps the transactions in cmtproto.Data{} and calculates the size.
No description provided by the author
DataFromProto takes a protobuf representation of Data & returns the native type.
No description provided by the author
No description provided by the author
No description provided by the author
DefaultEvidenceParams returns a default EvidenceParams.
No description provided by the author
DefaultValidatorParams returns a default ValidatorParams, which allows only ed25519 pubkeys.
No description provided by the author
DuplicateVoteEvidenceFromProto decodes protobuf into DuplicateVoteEvidence.
No description provided by the author
EvidenceFromProto is a generalized function for decoding protobuf into the evidence interface.
EvidenceToProto is a generalized function for encoding evidence that conforms to the evidence interface to protobuf.
No description provided by the author
No description provided by the author
FromProto sets a protobuf Header to the given pointer.
IsErrNotEnoughVotingPowerSigned returns true if err is ErrNotEnoughVotingPowerSigned.
No description provided by the author
No description provided by the author
No description provided by the author
LightClientAttackEvidenceFromProto decodes protobuf.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MaxDataBytes returns the maximum size of block's data.
MaxDataBytesNoEvidence returns the maximum size of block's data when evidence count is unknown.
MustCanonicalizeBlockID is like CanonicalizeBlockID but panics on error.
MustCanonicalizeProposal is like CanonicalizeProposal but panics on error.
MustCanonicalizeVote is like CanonicalizeVote but panics on error.
NewBlockMeta returns a new BlockMeta.
NewCommit returns a new Commit.
No description provided by the author
NewCommitSigAbsent returns new CommitSig with BlockIDFlagAbsent.
NewCommitSigForBlock returns new CommitSig with BlockIDFlagCommit.
No description provided by the author
No description provided by the author
NewDuplicateVoteEvidence creates DuplicateVoteEvidence with right ordering given two conflicting votes.
NewErrEvidenceOverflow returns a new ErrEvidenceOverflow where got > max.
NewErrInvalidEvidence returns a new EvidenceInvalid with the given err.
No description provided by the author
NewEventBus returns a new event bus.
NewEventBusWithBufferCapacity returns a new event bus with the given buffer capacity.
assumes the round to be 0 and the validator index to be 0.
assumes voting power to be 10 and validator to be the only one in the set.
No description provided by the author
NewMockPVWithParams allows one to create a MockPV instance, but with finer grained control over the operation of the mock validator.
No description provided by the author
No description provided by the author
Returns an empty PartSet ready to be populated.
No description provided by the author
No description provided by the author
NewProposal returns a new Proposal.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FromProto sets a protobuf PartSetHeader to the given pointer.
FromProto sets a protobuf Proposal to the given pointer.
ProposalSignBytes returns the proto-encoding of the canonicalized Proposal, for signing.
No description provided by the author
RandValidatorSet returns a randomized validator set (size: +numValidators+), where each validator has a voting power of +votingPower+.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ValidateEmpty validates if a blockchain data structure is empty.
ValidateHash ensures hash sizes meet Baron Chain's quantum-safe requirements.
ValidateTime ensures timestamps are within acceptable range for Baron Chain Prevents time-based attacks while maintaining network synchronization.
ValidateTimeAndHash combines time and hash validation for atomic operations.
No description provided by the author
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.
ValidatorSetFromProto sets a protobuf ValidatorSet to the given pointer.
No description provided by the author
# Constants
BlockHeightKey is a reserved key used for indexing BeginBlock and Endblock events.
BlockIDFlagAbsent - no vote was received from a validator.
BlockIDFlagCommit - voted for the Commit.BlockID.
BlockIDFlagNil - voted for nil.
64kB.
Internal consensus events.
Reserved event types (alphabetically sorted).
Block level events for mass consumption by users.
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
EventTypeKey is a reserved composite key for event name.
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
Reserved event types (alphabetically sorted).
No description provided by the author
100MB.
No description provided by the author
Max size of commit without any commitSigs -> 82 for BlockID, 8 for Height, 4 for Round.
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.
MaxHeaderBytes is a maximum header size.
MaxOverheadForBlock - maximum overhead to encode a block (up to MaxBlockSizeBytes in size) not including it's parts except Data.
No description provided by the author
No description provided by the author
No description provided by the author
PeerAIStateKey identifies AI-based peer metrics state.
PeerConsensusStateKey identifies peer state data for baron chain consensus.
PeerPQCStateKey identifies quantum-safe state for peers.
Deprecated: Use PeerConsensusStateKey instead.
No description provided by the author
Supported key types.
No description provided by the author
No description provided by the author
TimeFormat defines the canonical time format for use in signatures.
TxHashKey is a reserved key, used to specify transaction's hash.
TxHeightKey is a reserved key, used to specify transaction block's height.
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PB2TM is used for converting protobuf ABCI to CometBFT ABCI.
No description provided by the author
No description provided by the author
# Structs
New params for AI features.
Block defines the atomic unit of a CometBFT blockchain.
BlockID.
BlockMeta contains meta information.
No description provided by the author
Commit contains the evidence that a block was committed by a set of validators.
No description provided by the author
CommitSig is a part of the Vote included in a Commit.
No description provided by the author
No description provided by the author
Data contains the set of transactions included in the block.
No description provided by the author
ErrEvidenceOverflow is for when there the amount of evidence exceeds the max bytes.
ErrInvalidEvidence wraps a piece of evidence and the error denoting how or why it is invalid.
ErrNotEnoughVotingPowerSigned is returned when not enough validators signed a commit.
No description provided by the author
EventBus is a common bus for all events going through the system.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NOTE: This goes into the replay WAL.
All txs fire EventDataTx.
No description provided by the author
No description provided by the author
EvidenceData contains any evidence of malicious wrong-doing by validators.
No description provided by the author
No description provided by the author
No description provided by the author
Header defines the structure of a CometBFT block header.
LightBlock represents a lightweight version of a block for light client verification.
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.
MockPV implements PrivValidator without any safety or persistence.
-----------------------------------------------------------------------------.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
New params for quantum-safe features.
No description provided by the author
TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
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).
# Interfaces
BlockEventPublisher publishes all block related events.
Canonicalizer is an interface for types that can be converted to their canonical form.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TMEventData implements events.EventData.
No description provided by the author
Common interface between *consensus.VoteSet and types.Commit.
# Type aliases
ABCIResults wraps the deliver tx results to return a proof.
BlockIDFlag indicates which BlockID the signature is for.
No description provided by the author
No description provided by the author
EvidenceList is a list of Evidence.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Txs is a slice of Tx.
ValidatorsByAddress implements sort.Interface for []*Validator based on the Address field.
ValidatorsByVotingPower implements sort.Interface for []*Validator based on the VotingPower and Address fields.