wire

package
v1.6.0-query-cache-cou... Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	MultipleATXs byte = iota + 1
	MultipleBallots
	HareEquivocation
	InvalidPostIndex
	InvalidPrevATX
)

Variables

This section is empty.

Functions

func MalfeasanceInfo

func MalfeasanceInfo(smesher types.NodeID, mp *MalfeasanceProof) string

Types

type AtxProof

type AtxProof struct {
	Messages [2]AtxProofMsg
}

func (*AtxProof) DecodeScale

func (t *AtxProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*AtxProof) EncodeScale

func (t *AtxProof) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*AtxProof) MarshalLogObject

func (ap *AtxProof) MarshalLogObject(encoder zapcore.ObjectEncoder) error

type AtxProofMsg

type AtxProofMsg struct {
	InnerMsg types.ATXMetadata

	SmesherID types.NodeID
	Signature types.EdSignature
}

func (*AtxProofMsg) DecodeScale

func (t *AtxProofMsg) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*AtxProofMsg) EncodeScale

func (t *AtxProofMsg) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*AtxProofMsg) SignedBytes

func (m *AtxProofMsg) SignedBytes() []byte

SignedBytes returns the actual data being signed in a AtxProofMsg.

type BallotProof

type BallotProof struct {
	Messages [2]BallotProofMsg
}

func (*BallotProof) DecodeScale

func (t *BallotProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*BallotProof) EncodeScale

func (t *BallotProof) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*BallotProof) MarshalLogObject

func (bp *BallotProof) MarshalLogObject(encoder zapcore.ObjectEncoder) error

type BallotProofMsg

type BallotProofMsg struct {
	InnerMsg types.BallotMetadata

	SmesherID types.NodeID
	Signature types.EdSignature
}

func (*BallotProofMsg) DecodeScale

func (t *BallotProofMsg) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*BallotProofMsg) EncodeScale

func (t *BallotProofMsg) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*BallotProofMsg) SignedBytes

func (m *BallotProofMsg) SignedBytes() []byte

SignedBytes returns the actual data being signed in a BallotProofMsg.

type HareMetadata

type HareMetadata struct {
	Layer types.LayerID
	// the round counter (K)
	Round uint32
	// hash of hare.Message.InnerMessage
	MsgHash types.Hash32
}

func (*HareMetadata) DecodeScale

func (t *HareMetadata) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*HareMetadata) EncodeScale

func (t *HareMetadata) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*HareMetadata) Equivocation

func (hm *HareMetadata) Equivocation(other *HareMetadata) bool

Equivocation detects if two messages form an equivocation, based on their HareMetadata. It returns true if the two messages are from the same layer and round, but have different hashes.

func (*HareMetadata) MarshalLogObject

func (hm *HareMetadata) MarshalLogObject(encoder zapcore.ObjectEncoder) error

func (HareMetadata) ToBytes

func (hm HareMetadata) ToBytes() []byte

type HareProof

type HareProof struct {
	Messages [2]HareProofMsg
}

func (*HareProof) DecodeScale

func (t *HareProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*HareProof) EncodeScale

func (t *HareProof) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*HareProof) MarshalLogObject

func (hp *HareProof) MarshalLogObject(encoder zapcore.ObjectEncoder) error

func (*HareProof) ToMalfeasanceProof

func (hp *HareProof) ToMalfeasanceProof() *MalfeasanceProof

type HareProofMsg

type HareProofMsg struct {
	InnerMsg HareMetadata

	SmesherID types.NodeID
	Signature types.EdSignature
}

func (*HareProofMsg) DecodeScale

func (t *HareProofMsg) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*HareProofMsg) EncodeScale

func (t *HareProofMsg) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*HareProofMsg) SignedBytes

func (m *HareProofMsg) SignedBytes() []byte

SignedBytes returns the actual data being signed in a HareProofMsg.

type InvalidPostIndexProof

type InvalidPostIndexProof struct {
	Atx wire.ActivationTxV1

	// Which index in POST is invalid
	InvalidIdx uint32
}

func (*InvalidPostIndexProof) DecodeScale

func (t *InvalidPostIndexProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*InvalidPostIndexProof) EncodeScale

func (t *InvalidPostIndexProof) EncodeScale(enc *scale.Encoder) (total int, err error)

type InvalidPrevATXProof added in v1.5.3

type InvalidPrevATXProof struct {
	Atx1 wire.ActivationTxV1
	Atx2 wire.ActivationTxV1
}

InvalidPrevAtxProof is a proof that a smesher published an ATX with an old previous ATX ID. The proof contains two ATXs that reference the same previous ATX.

func (*InvalidPrevATXProof) DecodeScale added in v1.5.3

func (t *InvalidPrevATXProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*InvalidPrevATXProof) EncodeScale added in v1.5.3

func (t *InvalidPrevATXProof) EncodeScale(enc *scale.Encoder) (total int, err error)

type MalfeasanceGossip

type MalfeasanceGossip struct {
	MalfeasanceProof
	Eligibility *types.HareEligibilityGossip // deprecated - to be removed in the next version
}

func (*MalfeasanceGossip) DecodeScale

func (t *MalfeasanceGossip) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*MalfeasanceGossip) EncodeScale

func (t *MalfeasanceGossip) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*MalfeasanceGossip) MarshalLogObject

func (mg *MalfeasanceGossip) MarshalLogObject(encoder zapcore.ObjectEncoder) error

type MalfeasanceProof

type MalfeasanceProof struct {
	// for network upgrade
	Layer types.LayerID
	Proof Proof
	// contains filtered or unexported fields
}

func (*MalfeasanceProof) DecodeScale

func (t *MalfeasanceProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*MalfeasanceProof) EncodeScale

func (t *MalfeasanceProof) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*MalfeasanceProof) MarshalLogObject

func (mp *MalfeasanceProof) MarshalLogObject(encoder zapcore.ObjectEncoder) error

func (*MalfeasanceProof) Received

func (mp *MalfeasanceProof) Received() time.Time

func (*MalfeasanceProof) SetReceived

func (mp *MalfeasanceProof) SetReceived(received time.Time)

type Proof

type Proof struct {
	// MultipleATXs | MultipleBallots | HareEquivocation | InvalidPostIndex
	Type byte
	// AtxProof | BallotProof | HareProof | InvalidPostIndexProof
	Data ProofData
}

func (*Proof) DecodeScale

func (e *Proof) DecodeScale(dec *scale.Decoder) (int, error)

func (*Proof) EncodeScale

func (e *Proof) EncodeScale(enc *scale.Encoder) (int, error)

type ProofData added in v1.6.0

type ProofData interface {
	scale.Type
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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