proto

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RoundState_name = map[int32]string{
		0: "NotStarted",
		1: "PrePrepare",
		2: "Prepare",
		3: "Commit",
		4: "ChangeRound",
		5: "Decided",
		6: "Stopped",
	}
	RoundState_value = map[string]int32{
		"NotStarted":  0,
		"PrePrepare":  1,
		"Prepare":     2,
		"Commit":      3,
		"ChangeRound": 4,
		"Decided":     5,
		"Stopped":     6,
	}
)

Enum value maps for RoundState.

View Source
var File_beacon_proto protoreflect.FileDescriptor
View Source
var File_params_proto protoreflect.FileDescriptor
View Source
var File_state_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ChangeRoundData

type ChangeRoundData struct {
	PreparedRound    uint64   `protobuf:"varint,1,opt,name=prepared_round,json=preparedRound,proto3" json:"prepared_round,omitempty"`
	PreparedValue    []byte   `protobuf:"bytes,2,opt,name=prepared_value,json=preparedValue,proto3" json:"prepared_value,omitempty"`
	JustificationMsg *Message `protobuf:"bytes,3,opt,name=justification_msg,json=justificationMsg,proto3" json:"justification_msg,omitempty"`
	JustificationSig []byte   `protobuf:"bytes,4,opt,name=justification_sig,json=justificationSig,proto3" json:"justification_sig,omitempty"`
	SignerIds        []uint64 `protobuf:"varint,5,rep,packed,name=signer_ids,json=signerIds,proto3" json:"signer_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*ChangeRoundData) Descriptor deprecated

func (*ChangeRoundData) Descriptor() ([]byte, []int)

Deprecated: Use ChangeRoundData.ProtoReflect.Descriptor instead.

func (*ChangeRoundData) GetJustificationMsg

func (x *ChangeRoundData) GetJustificationMsg() *Message

func (*ChangeRoundData) GetJustificationSig

func (x *ChangeRoundData) GetJustificationSig() []byte

func (*ChangeRoundData) GetPreparedRound

func (x *ChangeRoundData) GetPreparedRound() uint64

func (*ChangeRoundData) GetPreparedValue

func (x *ChangeRoundData) GetPreparedValue() []byte

func (*ChangeRoundData) GetSignerIds

func (x *ChangeRoundData) GetSignerIds() []uint64

func (*ChangeRoundData) ProtoMessage

func (*ChangeRoundData) ProtoMessage()

func (*ChangeRoundData) ProtoReflect added in v0.0.4

func (x *ChangeRoundData) ProtoReflect() protoreflect.Message

func (*ChangeRoundData) Reset

func (x *ChangeRoundData) Reset()

func (*ChangeRoundData) String

func (x *ChangeRoundData) String() string

func (*ChangeRoundData) VerifySig

func (d *ChangeRoundData) VerifySig(pk bls.PublicKey) (bool, error)

VerifySig returns true if the justification signed msg verifies against the public key, false otherwise

type InputValue

type InputValue struct {

	// Types that are assignable to Data:
	//	*InputValue_AttestationData
	//	*InputValue_AggregationData
	//	*InputValue_BeaconBlock
	Data isInputValue_Data `protobuf_oneof:"data"`
	// Types that are assignable to SignedData:
	//	*InputValue_Attestation
	//	*InputValue_Aggregation
	//	*InputValue_Block
	SignedData isInputValue_SignedData `protobuf_oneof:"signed_data"`
	// contains filtered or unexported fields
}

func (*InputValue) Descriptor deprecated

func (*InputValue) Descriptor() ([]byte, []int)

Deprecated: Use InputValue.ProtoReflect.Descriptor instead.

func (*InputValue) GetAggregation

func (*InputValue) GetAggregationData

func (x *InputValue) GetAggregationData() *v1alpha1.AggregateAttestationAndProof

func (*InputValue) GetAttestation

func (x *InputValue) GetAttestation() *v1alpha1.Attestation

func (*InputValue) GetAttestationData

func (x *InputValue) GetAttestationData() *v1alpha1.AttestationData

func (*InputValue) GetBeaconBlock

func (x *InputValue) GetBeaconBlock() *v1alpha1.BeaconBlock

func (*InputValue) GetBlock

func (x *InputValue) GetBlock() *v1alpha1.SignedBeaconBlock

func (*InputValue) GetData

func (m *InputValue) GetData() isInputValue_Data

func (*InputValue) GetSignedData

func (m *InputValue) GetSignedData() isInputValue_SignedData

func (*InputValue) ProtoMessage

func (*InputValue) ProtoMessage()

func (*InputValue) ProtoReflect added in v0.0.13

func (x *InputValue) ProtoReflect() protoreflect.Message

func (*InputValue) Reset

func (x *InputValue) Reset()

func (*InputValue) String

func (x *InputValue) String() string

type InputValue_Aggregation

type InputValue_Aggregation struct {
	Aggregation *v1alpha1.SignedAggregateAttestationAndProof `protobuf:"bytes,6,opt,name=aggregation,proto3,oneof"`
}

type InputValue_AggregationData

type InputValue_AggregationData struct {
	AggregationData *v1alpha1.AggregateAttestationAndProof `protobuf:"bytes,3,opt,name=aggregation_data,json=aggregationData,proto3,oneof"`
}

type InputValue_Attestation

type InputValue_Attestation struct {
	Attestation *v1alpha1.Attestation `protobuf:"bytes,5,opt,name=attestation,proto3,oneof"`
}

type InputValue_AttestationData

type InputValue_AttestationData struct {
	AttestationData *v1alpha1.AttestationData `protobuf:"bytes,2,opt,name=attestation_data,json=attestationData,proto3,oneof"`
}

type InputValue_BeaconBlock

type InputValue_BeaconBlock struct {
	BeaconBlock *v1alpha1.BeaconBlock `protobuf:"bytes,4,opt,name=beacon_block,json=beaconBlock,proto3,oneof"`
}

type InputValue_Block

type InputValue_Block struct {
	Block *v1alpha1.SignedBeaconBlock `protobuf:"bytes,7,opt,name=block,proto3,oneof"`
}

type InstanceConfig

type InstanceConfig struct {
	RoundChangeDurationSeconds   float32 `` /* 145-byte string literal not displayed */
	LeaderPreprepareDelaySeconds float32 `` // The time a round leader waits before broadcasting pre-prepare message
	/* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func DefaultConsensusParams

func DefaultConsensusParams() *InstanceConfig

DefaultConsensusParams returns the default round change duration time

func (*InstanceConfig) Descriptor deprecated

func (*InstanceConfig) Descriptor() ([]byte, []int)

Deprecated: Use InstanceConfig.ProtoReflect.Descriptor instead.

func (*InstanceConfig) GetLeaderPreprepareDelaySeconds added in v0.0.5

func (x *InstanceConfig) GetLeaderPreprepareDelaySeconds() float32

func (*InstanceConfig) GetRoundChangeDurationSeconds added in v0.0.5

func (x *InstanceConfig) GetRoundChangeDurationSeconds() float32

func (*InstanceConfig) ProtoMessage

func (*InstanceConfig) ProtoMessage()

func (*InstanceConfig) ProtoReflect added in v0.0.13

func (x *InstanceConfig) ProtoReflect() protoreflect.Message

func (*InstanceConfig) Reset

func (x *InstanceConfig) Reset()

func (*InstanceConfig) String

func (x *InstanceConfig) String() string

type Message

type Message struct {
	Type   RoundState `protobuf:"varint,1,opt,name=type,proto3,enum=proto.RoundState" json:"type,omitempty"`
	Round  uint64     `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	Lambda []byte     `protobuf:"bytes,3,opt,name=lambda,proto3" json:"lambda,omitempty"`
	// sequence number is an incremental number for each instance, much like a block number would be in a blockchain
	SeqNumber uint64 `protobuf:"varint,4,opt,name=seq_number,json=seqNumber,proto3" json:"seq_number,omitempty"`
	Value     []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Compare

func (msg *Message) Compare(other *Message) bool

Compare returns true if both messages are equal. DOES NOT compare signatures

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetLambda

func (x *Message) GetLambda() []byte

func (*Message) GetRound

func (x *Message) GetRound() uint64

func (*Message) GetSeqNumber

func (x *Message) GetSeqNumber() uint64

func (*Message) GetType

func (x *Message) GetType() RoundState

func (*Message) GetValue

func (x *Message) GetValue() []byte

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect added in v0.0.4

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) Sign

func (msg *Message) Sign(sk *bls.SecretKey) (*bls.Sign, error)

Sign takes a secret key and signs the Message

func (*Message) SigningRoot

func (msg *Message) SigningRoot() ([]byte, error)

SigningRoot returns a signing root (bytes)

func (*Message) String

func (x *Message) String() string

type Node

type Node struct {
	IbftId uint64 `protobuf:"varint,1,opt,name=ibft_id,json=ibftId,proto3" json:"ibft_id,omitempty"`
	Pk     []byte `protobuf:"bytes,2,opt,name=pk,proto3" json:"pk,omitempty"`
	Sk     []byte `protobuf:"bytes,3,opt,name=sk,proto3" json:"sk,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) Descriptor deprecated

func (*Node) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetIbftId

func (x *Node) GetIbftId() uint64

func (*Node) GetPk

func (x *Node) GetPk() []byte

func (*Node) GetSk

func (x *Node) GetSk() []byte

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect added in v0.0.13

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type RoundState

type RoundState int32
const (
	RoundState_NotStarted  RoundState = 0
	RoundState_PrePrepare  RoundState = 1
	RoundState_Prepare     RoundState = 2
	RoundState_Commit      RoundState = 3 // Commit is when an instance receives a qualified quorum of prepare msgs, then sends a commit msg.
	RoundState_ChangeRound RoundState = 4
	RoundState_Decided     RoundState = 5 // Decided is when an instance receives a qualified quorum of commit msgs
	RoundState_Stopped     RoundState = 6
)

func (RoundState) Descriptor added in v0.0.4

func (RoundState) Descriptor() protoreflect.EnumDescriptor

func (RoundState) Enum added in v0.0.4

func (x RoundState) Enum() *RoundState

func (RoundState) EnumDescriptor deprecated

func (RoundState) EnumDescriptor() ([]byte, []int)

Deprecated: Use RoundState.Descriptor instead.

func (RoundState) Number added in v0.0.4

func (x RoundState) Number() protoreflect.EnumNumber

func (RoundState) String

func (x RoundState) String() string

func (RoundState) Type added in v0.0.4

type SignedMessage

type SignedMessage struct {
	Message   *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Signature []byte   `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	SignerIds []uint64 `protobuf:"varint,3,rep,packed,name=signer_ids,json=signerIds,proto3" json:"signer_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*SignedMessage) Aggregate

func (msg *SignedMessage) Aggregate(other *SignedMessage) error

Aggregate serialize and aggregates signature and signer ID to signed message

func (*SignedMessage) DeepCopy

func (msg *SignedMessage) DeepCopy() (*SignedMessage, error)

DeepCopy checks marshalling of SignedMessage and returns it

func (*SignedMessage) Descriptor deprecated

func (*SignedMessage) Descriptor() ([]byte, []int)

Deprecated: Use SignedMessage.ProtoReflect.Descriptor instead.

func (*SignedMessage) GetMessage

func (x *SignedMessage) GetMessage() *Message

func (*SignedMessage) GetSignature

func (x *SignedMessage) GetSignature() []byte

func (*SignedMessage) GetSignerIds

func (x *SignedMessage) GetSignerIds() []uint64

func (*SignedMessage) ProtoMessage

func (*SignedMessage) ProtoMessage()

func (*SignedMessage) ProtoReflect added in v0.0.4

func (x *SignedMessage) ProtoReflect() protoreflect.Message

func (*SignedMessage) Reset

func (x *SignedMessage) Reset()

func (*SignedMessage) SignersIDString

func (msg *SignedMessage) SignersIDString() string

SignersIDString returns all Signer's Ids as string

func (*SignedMessage) String

func (x *SignedMessage) String() string

func (*SignedMessage) VerifyAggregatedSig

func (msg *SignedMessage) VerifyAggregatedSig(pks []*bls.PublicKey) (bool, error)

VerifyAggregatedSig returns true if the signed msg verifies against the public keys, false if otherwise

func (*SignedMessage) VerifySig

func (msg *SignedMessage) VerifySig(pk *bls.PublicKey) (bool, error)

VerifySig returns true if the justification signed msg verifies against the public key, false if otherwise

type State

type State struct {
	Stage RoundState `protobuf:"varint,1,opt,name=stage,proto3,enum=proto.RoundState" json:"stage,omitempty"`
	// lambda is an instance unique identifier, much like a block hash in a blockchain
	Lambda []byte `protobuf:"bytes,2,opt,name=lambda,proto3" json:"lambda,omitempty"`
	// sequence number is an incremental number for each instance, much like a block number would be in a blockchain
	SeqNumber     uint64         `protobuf:"varint,3,opt,name=seq_number,json=seqNumber,proto3" json:"seq_number,omitempty"`
	InputValue    []byte         `protobuf:"bytes,4,opt,name=input_value,json=inputValue,proto3" json:"input_value,omitempty"`
	Round         uint64         `protobuf:"varint,5,opt,name=round,proto3" json:"round,omitempty"`
	PreparedRound uint64         `protobuf:"varint,6,opt,name=prepared_round,json=preparedRound,proto3" json:"prepared_round,omitempty"`
	PreparedValue []byte         `protobuf:"bytes,7,opt,name=prepared_value,json=preparedValue,proto3" json:"prepared_value,omitempty"`
	DecidedMsg    *SignedMessage `protobuf:"bytes,8,opt,name=decided_msg,json=decidedMsg,proto3" json:"decided_msg,omitempty"`
	// contains filtered or unexported fields
}

func (*State) Descriptor deprecated

func (*State) Descriptor() ([]byte, []int)

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetDecidedMsg added in v0.0.13

func (x *State) GetDecidedMsg() *SignedMessage

func (*State) GetInputValue

func (x *State) GetInputValue() []byte

func (*State) GetLambda

func (x *State) GetLambda() []byte

func (*State) GetPreparedRound

func (x *State) GetPreparedRound() uint64

func (*State) GetPreparedValue

func (x *State) GetPreparedValue() []byte

func (*State) GetRound

func (x *State) GetRound() uint64

func (*State) GetSeqNumber

func (x *State) GetSeqNumber() uint64

func (*State) GetStage

func (x *State) GetStage() RoundState

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect added in v0.0.13

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

Jump to

Keyboard shortcuts

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