consensus

package
v0.0.0-...-4619e39 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthConsensus        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConsensus          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConsensus = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ConsensusType_name = map[int32]string{
	0: "SOLO",
	1: "TBFT",
	2: "MAXBFT",
	3: "RAFT",
	4: "DPOS",
}
View Source
var ConsensusType_value = map[string]int32{
	"SOLO":   0,
	"TBFT":   1,
	"MAXBFT": 2,
	"RAFT":   3,
	"DPOS":   4,
}
View Source
var VerifyResult_Code_name = map[int32]string{
	0: "SUCCESS",
	1: "FAIL",
}
View Source
var VerifyResult_Code_value = map[string]int32{
	"SUCCESS": 0,
	"FAIL":    1,
}

Functions

This section is empty.

Types

type BlockHeaderConsensusArgs

type BlockHeaderConsensusArgs struct {
	ConsensusType int64           `protobuf:"varint,1,opt,name=consensus_type,json=consensusType,proto3" json:"consensus_type,omitempty"`
	Round         uint64          `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	Level         uint64          `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"`
	Consensus     *common.TxRWSet `protobuf:"bytes,4,opt,name=consensus,proto3" json:"consensus,omitempty"`
}

func (*BlockHeaderConsensusArgs) Descriptor

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

func (*BlockHeaderConsensusArgs) GetConsensus

func (m *BlockHeaderConsensusArgs) GetConsensus() *common.TxRWSet

func (*BlockHeaderConsensusArgs) GetConsensusType

func (m *BlockHeaderConsensusArgs) GetConsensusType() int64

func (*BlockHeaderConsensusArgs) GetLevel

func (m *BlockHeaderConsensusArgs) GetLevel() uint64

func (*BlockHeaderConsensusArgs) GetRound

func (m *BlockHeaderConsensusArgs) GetRound() uint64

func (*BlockHeaderConsensusArgs) Marshal

func (m *BlockHeaderConsensusArgs) Marshal() (dAtA []byte, err error)

func (*BlockHeaderConsensusArgs) MarshalTo

func (m *BlockHeaderConsensusArgs) MarshalTo(dAtA []byte) (int, error)

func (*BlockHeaderConsensusArgs) MarshalToSizedBuffer

func (m *BlockHeaderConsensusArgs) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BlockHeaderConsensusArgs) ProtoMessage

func (*BlockHeaderConsensusArgs) ProtoMessage()

func (*BlockHeaderConsensusArgs) Reset

func (m *BlockHeaderConsensusArgs) Reset()

func (*BlockHeaderConsensusArgs) Size

func (m *BlockHeaderConsensusArgs) Size() (n int)

func (*BlockHeaderConsensusArgs) String

func (m *BlockHeaderConsensusArgs) String() string

func (*BlockHeaderConsensusArgs) Unmarshal

func (m *BlockHeaderConsensusArgs) Unmarshal(dAtA []byte) error

func (*BlockHeaderConsensusArgs) XXX_DiscardUnknown

func (m *BlockHeaderConsensusArgs) XXX_DiscardUnknown()

func (*BlockHeaderConsensusArgs) XXX_Marshal

func (m *BlockHeaderConsensusArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockHeaderConsensusArgs) XXX_Merge

func (m *BlockHeaderConsensusArgs) XXX_Merge(src proto.Message)

func (*BlockHeaderConsensusArgs) XXX_Size

func (m *BlockHeaderConsensusArgs) XXX_Size() int

func (*BlockHeaderConsensusArgs) XXX_Unmarshal

func (m *BlockHeaderConsensusArgs) XXX_Unmarshal(b []byte) error

type ConsensusType

type ConsensusType int32
const (
	ConsensusType_SOLO   ConsensusType = 0
	ConsensusType_TBFT   ConsensusType = 1
	ConsensusType_MAXBFT ConsensusType = 2
	ConsensusType_RAFT   ConsensusType = 3
	ConsensusType_DPOS   ConsensusType = 4
)

func (ConsensusType) EnumDescriptor

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

func (ConsensusType) String

func (x ConsensusType) String() string

type GovernanceContract

type GovernanceContract struct {
	// epoch id,通过epoch switch增加
	EpochId uint64 `protobuf:"varint,1,opt,name=epoch_id,json=epochId,proto3" json:"epoch_id,omitempty"`
	// 共识类型
	Type ConsensusType `protobuf:"varint,2,opt,name=type,proto3,enum=consensus.ConsensusType" json:"type,omitempty"`
	// 当前要分配的索引
	CurMaxIndex       int64 `protobuf:"varint,3,opt,name=cur_max_index,json=curMaxIndex,proto3" json:"cur_max_index,omitempty"`
	SkipTimeoutCommit bool  `protobuf:"varint,4,opt,name=skip_timeout_commit,json=skipTimeoutCommit,proto3" json:"skip_timeout_commit,omitempty"`
	// config序列,检查配置是否改变
	ConfigSequence uint64 `protobuf:"varint,5,opt,name=config_sequence,json=configSequence,proto3" json:"config_sequence,omitempty"`
	// 参与共识的节点数
	N uint64 `protobuf:"varint,6,opt,name=n,proto3" json:"n,omitempty"`
	// 需要存活的最小共识节点数
	MinQuorumForQc uint64 `protobuf:"varint,7,opt,name=min_quorum_for_qc,json=minQuorumForQc,proto3" json:"min_quorum_for_qc,omitempty"`
	CachedLen      uint64 `protobuf:"varint,8,opt,name=cached_len,json=cachedLen,proto3" json:"cached_len,omitempty"`
	// 切换验证器的下一个高度
	NextSwitchHeight uint64 `protobuf:"varint,9,opt,name=next_switch_height,json=nextSwitchHeight,proto3" json:"next_switch_height,omitempty"`
	// 切换验证器的缓冲区高度
	TransitBlock uint64 `protobuf:"varint,10,opt,name=transit_block,json=transitBlock,proto3" json:"transit_block,omitempty"`
	// 切换验证器的周期
	BlockNumPerEpoch uint64 `protobuf:"varint,11,opt,name=block_num_per_epoch,json=blockNumPerEpoch,proto3" json:"block_num_per_epoch,omitempty"`
	// 参与验证者的最大数量
	ValidatorNum uint64 `protobuf:"varint,12,opt,name=validator_num,json=validatorNum,proto3" json:"validator_num,omitempty"`
	// 每个验证者可以连续出块的轮次
	NodeProposeRound uint64 `protobuf:"varint,13,opt,name=node_propose_round,json=nodeProposeRound,proto3" json:"node_propose_round,omitempty"`
	// 当前维护的节点
	Members []*GovernanceMember `protobuf:"bytes,14,rep,name=members,proto3" json:"members,omitempty"`
	// 目前参与验证者
	Validators []*GovernanceMember `protobuf:"bytes,15,rep,name=validators,proto3" json:"validators,omitempty"`
	// 下一个参与验证者
	NextValidators []*GovernanceMember `protobuf:"bytes,16,rep,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"`
	// 最后一个epoch需要存活的最小共识节点数
	LastMinQuorumForQc uint64 `protobuf:"varint,17,opt,name=last_min_quorum_for_qc,json=lastMinQuorumForQc,proto3" json:"last_min_quorum_for_qc,omitempty"`
	// viewChange 的基本超时
	MaxbftRoundTimeoutMill uint64 `` /* 133-byte string literal not displayed */
	// viewChange 的增量超时
	MaxbftRoundTimeoutIntervalMill uint64 `` /* 159-byte string literal not displayed */
	// 最后一个时期参与验证者
	LastValidators []*GovernanceMember `protobuf:"bytes,20,rep,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"`
}

func (*GovernanceContract) Descriptor

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

func (*GovernanceContract) GetBlockNumPerEpoch

func (m *GovernanceContract) GetBlockNumPerEpoch() uint64

func (*GovernanceContract) GetCachedLen

func (m *GovernanceContract) GetCachedLen() uint64

func (*GovernanceContract) GetConfigSequence

func (m *GovernanceContract) GetConfigSequence() uint64

func (*GovernanceContract) GetCurMaxIndex

func (m *GovernanceContract) GetCurMaxIndex() int64

func (*GovernanceContract) GetEpochId

func (m *GovernanceContract) GetEpochId() uint64

func (*GovernanceContract) GetLastMinQuorumForQc

func (m *GovernanceContract) GetLastMinQuorumForQc() uint64

func (*GovernanceContract) GetLastValidators

func (m *GovernanceContract) GetLastValidators() []*GovernanceMember

func (*GovernanceContract) GetMaxbftRoundTimeoutIntervalMill

func (m *GovernanceContract) GetMaxbftRoundTimeoutIntervalMill() uint64

func (*GovernanceContract) GetMaxbftRoundTimeoutMill

func (m *GovernanceContract) GetMaxbftRoundTimeoutMill() uint64

func (*GovernanceContract) GetMembers

func (m *GovernanceContract) GetMembers() []*GovernanceMember

func (*GovernanceContract) GetMinQuorumForQc

func (m *GovernanceContract) GetMinQuorumForQc() uint64

func (*GovernanceContract) GetN

func (m *GovernanceContract) GetN() uint64

func (*GovernanceContract) GetNextSwitchHeight

func (m *GovernanceContract) GetNextSwitchHeight() uint64

func (*GovernanceContract) GetNextValidators

func (m *GovernanceContract) GetNextValidators() []*GovernanceMember

func (*GovernanceContract) GetNodeProposeRound

func (m *GovernanceContract) GetNodeProposeRound() uint64

func (*GovernanceContract) GetSkipTimeoutCommit

func (m *GovernanceContract) GetSkipTimeoutCommit() bool

func (*GovernanceContract) GetTransitBlock

func (m *GovernanceContract) GetTransitBlock() uint64

func (*GovernanceContract) GetType

func (m *GovernanceContract) GetType() ConsensusType

func (*GovernanceContract) GetValidatorNum

func (m *GovernanceContract) GetValidatorNum() uint64

func (*GovernanceContract) GetValidators

func (m *GovernanceContract) GetValidators() []*GovernanceMember

func (*GovernanceContract) Marshal

func (m *GovernanceContract) Marshal() (dAtA []byte, err error)

func (*GovernanceContract) MarshalTo

func (m *GovernanceContract) MarshalTo(dAtA []byte) (int, error)

func (*GovernanceContract) MarshalToSizedBuffer

func (m *GovernanceContract) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GovernanceContract) ProtoMessage

func (*GovernanceContract) ProtoMessage()

func (*GovernanceContract) Reset

func (m *GovernanceContract) Reset()

func (*GovernanceContract) Size

func (m *GovernanceContract) Size() (n int)

func (*GovernanceContract) String

func (m *GovernanceContract) String() string

func (*GovernanceContract) Unmarshal

func (m *GovernanceContract) Unmarshal(dAtA []byte) error

func (*GovernanceContract) XXX_DiscardUnknown

func (m *GovernanceContract) XXX_DiscardUnknown()

func (*GovernanceContract) XXX_Marshal

func (m *GovernanceContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GovernanceContract) XXX_Merge

func (m *GovernanceContract) XXX_Merge(src proto.Message)

func (*GovernanceContract) XXX_Size

func (m *GovernanceContract) XXX_Size() int

func (*GovernanceContract) XXX_Unmarshal

func (m *GovernanceContract) XXX_Unmarshal(b []byte) error

type GovernanceMember

type GovernanceMember struct {
	NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	Index  int64  `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
}

func (*GovernanceMember) Descriptor

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

func (*GovernanceMember) GetIndex

func (m *GovernanceMember) GetIndex() int64

func (*GovernanceMember) GetNodeId

func (m *GovernanceMember) GetNodeId() string

func (*GovernanceMember) Marshal

func (m *GovernanceMember) Marshal() (dAtA []byte, err error)

func (*GovernanceMember) MarshalTo

func (m *GovernanceMember) MarshalTo(dAtA []byte) (int, error)

func (*GovernanceMember) MarshalToSizedBuffer

func (m *GovernanceMember) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GovernanceMember) ProtoMessage

func (*GovernanceMember) ProtoMessage()

func (*GovernanceMember) Reset

func (m *GovernanceMember) Reset()

func (*GovernanceMember) Size

func (m *GovernanceMember) Size() (n int)

func (*GovernanceMember) String

func (m *GovernanceMember) String() string

func (*GovernanceMember) Unmarshal

func (m *GovernanceMember) Unmarshal(dAtA []byte) error

func (*GovernanceMember) XXX_DiscardUnknown

func (m *GovernanceMember) XXX_DiscardUnknown()

func (*GovernanceMember) XXX_Marshal

func (m *GovernanceMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GovernanceMember) XXX_Merge

func (m *GovernanceMember) XXX_Merge(src proto.Message)

func (*GovernanceMember) XXX_Size

func (m *GovernanceMember) XXX_Size() int

func (*GovernanceMember) XXX_Unmarshal

func (m *GovernanceMember) XXX_Unmarshal(b []byte) error

type ProposalBlock

type ProposalBlock struct {
	Block    *common.Block              `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
	TxsRwSet map[string]*common.TxRWSet `` /* 175-byte string literal not displayed */
}

func (*ProposalBlock) Descriptor

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

func (*ProposalBlock) GetBlock

func (m *ProposalBlock) GetBlock() *common.Block

func (*ProposalBlock) GetTxsRwSet

func (m *ProposalBlock) GetTxsRwSet() map[string]*common.TxRWSet

func (*ProposalBlock) Marshal

func (m *ProposalBlock) Marshal() (dAtA []byte, err error)

func (*ProposalBlock) MarshalTo

func (m *ProposalBlock) MarshalTo(dAtA []byte) (int, error)

func (*ProposalBlock) MarshalToSizedBuffer

func (m *ProposalBlock) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProposalBlock) ProtoMessage

func (*ProposalBlock) ProtoMessage()

func (*ProposalBlock) Reset

func (m *ProposalBlock) Reset()

func (*ProposalBlock) Size

func (m *ProposalBlock) Size() (n int)

func (*ProposalBlock) String

func (m *ProposalBlock) String() string

func (*ProposalBlock) Unmarshal

func (m *ProposalBlock) Unmarshal(dAtA []byte) error

func (*ProposalBlock) XXX_DiscardUnknown

func (m *ProposalBlock) XXX_DiscardUnknown()

func (*ProposalBlock) XXX_Marshal

func (m *ProposalBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProposalBlock) XXX_Merge

func (m *ProposalBlock) XXX_Merge(src proto.Message)

func (*ProposalBlock) XXX_Size

func (m *ProposalBlock) XXX_Size() int

func (*ProposalBlock) XXX_Unmarshal

func (m *ProposalBlock) XXX_Unmarshal(b []byte) error

type VerifyResult

type VerifyResult struct {
	VerifiedBlock *common.Block              `protobuf:"bytes,1,opt,name=verified_block,json=verifiedBlock,proto3" json:"verified_block,omitempty"`
	Code          VerifyResult_Code          `protobuf:"varint,2,opt,name=code,proto3,enum=consensus.VerifyResult_Code" json:"code,omitempty"`
	Message       string                     `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	TxsRwSet      map[string]*common.TxRWSet `` /* 175-byte string literal not displayed */
}

func (*VerifyResult) Descriptor

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

func (*VerifyResult) GetCode

func (m *VerifyResult) GetCode() VerifyResult_Code

func (*VerifyResult) GetMessage

func (m *VerifyResult) GetMessage() string

func (*VerifyResult) GetTxsRwSet

func (m *VerifyResult) GetTxsRwSet() map[string]*common.TxRWSet

func (*VerifyResult) GetVerifiedBlock

func (m *VerifyResult) GetVerifiedBlock() *common.Block

func (*VerifyResult) Marshal

func (m *VerifyResult) Marshal() (dAtA []byte, err error)

func (*VerifyResult) MarshalTo

func (m *VerifyResult) MarshalTo(dAtA []byte) (int, error)

func (*VerifyResult) MarshalToSizedBuffer

func (m *VerifyResult) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VerifyResult) ProtoMessage

func (*VerifyResult) ProtoMessage()

func (*VerifyResult) Reset

func (m *VerifyResult) Reset()

func (*VerifyResult) Size

func (m *VerifyResult) Size() (n int)

func (*VerifyResult) String

func (m *VerifyResult) String() string

func (*VerifyResult) Unmarshal

func (m *VerifyResult) Unmarshal(dAtA []byte) error

func (*VerifyResult) XXX_DiscardUnknown

func (m *VerifyResult) XXX_DiscardUnknown()

func (*VerifyResult) XXX_Marshal

func (m *VerifyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VerifyResult) XXX_Merge

func (m *VerifyResult) XXX_Merge(src proto.Message)

func (*VerifyResult) XXX_Size

func (m *VerifyResult) XXX_Size() int

func (*VerifyResult) XXX_Unmarshal

func (m *VerifyResult) XXX_Unmarshal(b []byte) error

type VerifyResult_Code

type VerifyResult_Code int32
const (
	VerifyResult_SUCCESS VerifyResult_Code = 0
	VerifyResult_FAIL    VerifyResult_Code = 1
)

func (VerifyResult_Code) EnumDescriptor

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

func (VerifyResult_Code) String

func (x VerifyResult_Code) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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