Documentation
¶
Index ¶
Constants ¶
const ( // EventTypeKey is a reserved composite key for event name. EventTypeKey = "dvs.event" // DVSHashKey is a reserved key, used to specify DVS request's hash. // see EventBus#PublishEventTx DVSHashKey = "dvs.hash" // DVSHeightKey is a reserved key, used to specify DVS request block's height. DVSHeightKey = "dvs.height" DVSChainID = "dvs.chainid" )
const ( EventTx = "Tx" EventDVS = "Dvs" )
Reserved event types (alphabetically sorted).
const DvsRequestKeySize = sha256.Size
DvsRequestKeySize is the size of the DVS request key index
Variables ¶
var ErroringMockPVErr = errors.New("erroringMockPV always returns an error")
var ( // MaxSignatureSize is a maximum allowed signature size for the Proposal // and Vote. // XXX: secp256k1 does not have Size nor MaxSize defined. MaxSignatureSize = cmtmath.MaxInt(ed25519.SignatureSize, 64) )
var (
PeerStateKey = "ConsensusReactor.peerState"
)
UNSTABLE
Functions ¶
This section is empty.
Types ¶
type DvsRequest ¶
type DvsRequest []byte
func (DvsRequest) Hash ¶
func (dvs DvsRequest) Hash() []byte
Hash computes the TMHASH hash of the wire encoded DVS request.
func (DvsRequest) Key ¶
func (dvs DvsRequest) Key() DvsRequestKey
func (DvsRequest) String ¶
func (dvs DvsRequest) String() string
String returns the hex-encoded DVS request as a string.
type DvsRequestKey ¶
type DvsRequestKey [DvsRequestKeySize]byte
TxKey is the fixed length array key used as an index.
type ErrInvalidCommitHeight ¶
ErrInvalidCommitHeight is returned when we encounter a commit with an unexpected height.
func NewErrInvalidCommitHeight ¶
func NewErrInvalidCommitHeight(expected, actual int64) ErrInvalidCommitHeight
func (ErrInvalidCommitHeight) Error ¶
func (e ErrInvalidCommitHeight) Error() string
type ErrInvalidCommitSignatures ¶
ErrInvalidCommitSignatures is returned when we encounter a commit where the number of signatures doesn't match the number of validators.
func NewErrInvalidCommitSignatures ¶
func NewErrInvalidCommitSignatures(expected, actual int) ErrInvalidCommitSignatures
func (ErrInvalidCommitSignatures) Error ¶
func (e ErrInvalidCommitSignatures) Error() string
type ErroringMockPV ¶
type ErroringMockPV struct {
MockPV
}
func NewErroringMockPV ¶
func NewErroringMockPV() *ErroringMockPV
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.
type OperatorID ¶
type OperatorID [32]byte
func GenOperatorIDByAddress ¶
func GenOperatorIDByAddress(operatorAddress common.Address) OperatorID
GenOperatorIDByAddress by eth address
func GenOperatorIDOffChain ¶
func GenOperatorIDOffChain(pubkey *bls.G1Point) OperatorID
GenOperatorIDOffChain by bls pubkey
func (*OperatorID) LogValue ¶
func (o *OperatorID) LogValue() slog.Value
type PrivValidator ¶
type PrivValidator interface { GetPubKey() (*bls.G1Point, error) SignBytes(bytes []byte) (*bls.Signature, error) }
PrivValidator defines the functionality of a local PellDVS validator that signs votes and proposals, and never double signs.