Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func VoteToStep ¶ added in v0.6.5
func VoteToStep(vote *tendermintTypes.Vote) int8
this should be unexported, but is needed for testing A vote is either stepPrevote or stepPrecommit.
Types ¶
type AtomicReadWriter ¶
type AtomicReadWriter interface { // Write should overwrite the current value with the given value Write([]byte) error // Read should return the current value // if the value is empty, it should return empty bytes and no error Read() ([]byte, error) }
AtomicReadWriter is an interface for any store that can atomically read and write to a persistent store
type LastSignState ¶
type LastSignState struct { // Height is the height of the block that the message was signed for Height int64 `json:"height"` // Round is the consensus round that the message was signed for // CometBFT can have an arbitrary number of rounds per height Round int32 `json:"round"` // Step is the consensus step that the message was signed for // e.g. propose, prevote, precommit Step int8 `json:"step"` // Signature is the signature generated by the validator Signature []byte `json:"signature"` // SignBytes is the bytes that were signed by the validator SignBytes cmtbytes.HexBytes `json:"sign_bytes"` // contains filtered or unexported fields }
LastSignState tracks the most recent signature made by this validator. It is atomically committed to disk before it is used for anything else, and can be reloaded in case of a crash
type ValidatorSigner ¶
type ValidatorSigner struct {
// contains filtered or unexported fields
}
ValidatorSigner implements CometBFT's cometTypes.PrivValidator It persists its most recent signature, which can be used during recovery to prevent double signing
func NewValidatorSigner ¶
func NewValidatorSigner(privKey cometEd25519.PrivKey, storer AtomicReadWriter) (*ValidatorSigner, error)
NewValidatorSigner returns a new ValidatorSigner it takes in an ed25519 key, and a keyvalue store the key values store should NOT be atomically committed with other KV stores. Instead, it should simply fsync after every write/commit
func (*ValidatorSigner) GetPubKey ¶
func (v *ValidatorSigner) GetPubKey() (crypto.PubKey, error)
GetPubKey returns the public key of the validator It is part of the cometTypes.PrivValidator interface
func (*ValidatorSigner) SignProposal ¶
func (v *ValidatorSigner) SignProposal(chainID string, proposal *tendermintTypes.Proposal) error
SignProposal signs a proposal message It is part of the cometTypes.PrivValidator interface
func (*ValidatorSigner) SignVote ¶
func (v *ValidatorSigner) SignVote(chainID string, vote *tendermintTypes.Vote) error
SignVote signs a vote message It is part of the cometTypes.PrivValidator interface