Documentation
¶
Index ¶
- Variables
- func AddressEqual(a []string, b []string) bool
- func CleanProduceMap(isProduce map[int64]bool, period int64)
- func InitQCTree(startHeight int64, ledger cctx.LedgerRely, log logs.Logger) *chainedBft.QCPendingTree
- func NewContractErrResponse(status int, msg string) *contract.Response
- func NewContractOKResponse(json []byte) *contract.Response
- func NewSignToOld(new []*bftPb.QuorumCertSign) []*lpb.SignInfo
- func NewToOldQC(new *chainedBft.QuorumCert) (*lpb.QuorumCert, error)
- func OldQCToNew(storage []byte) (*chainedBft.QuorumCert, error)
- func OldSignToNew(storage []byte) []*bftPb.QuorumCertSign
- type ConsensusStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyValidors = errors.New("Current validators is empty.") NotValidContract = errors.New("Cannot get valid res with contract.") EmptyJustify = errors.New("Justify is empty.") InvalidJustify = errors.New("Justify structure is invalid.") MaxMapSize = 1000 StatusOK = 200 StatusBadRequest = 400 StatusErr = 500 )
Functions ¶
func AddressEqual ¶
AddressEqual 判断两个validators地址是否相等
func CleanProduceMap ¶
func InitQCTree ¶
func InitQCTree(startHeight int64, ledger cctx.LedgerRely, log logs.Logger) *chainedBft.QCPendingTree
initQCTree 创建了smr需要的QC树存储,该Tree存储了目前待commit的QC信息
func NewContractErrResponse ¶
func NewContractOKResponse ¶
func NewSignToOld ¶
func NewSignToOld(new []*bftPb.QuorumCertSign) []*lpb.SignInfo
NewSignToOld 新的签名结构转化为老的签名结构
func NewToOldQC ¶
func NewToOldQC(new *chainedBft.QuorumCert) (*lpb.QuorumCert, error)
NewToOldQC 为新的QC pb结构转化为老pb结构
func OldQCToNew ¶
func OldQCToNew(storage []byte) (*chainedBft.QuorumCert, error)
OldQCToNew 为老的QC pb结构转化为新的QC结构
func OldSignToNew ¶
func OldSignToNew(storage []byte) []*bftPb.QuorumCertSign
OldSignToNew 老的签名结构转化为新的签名结构
Types ¶
type ConsensusStorage ¶
type ConsensusStorage struct { Justify *lpb.QuorumCert `json:"justify,omitempty"` CurTerm int64 `json:"curTerm,omitempty"` CurBlockNum int64 `json:"curBlockNum,omitempty"` // TargetBits 是一个trick实现 // 1. 在bcs层作为一个复用字段,记录ChainedBFT发生回滚时,当前的TipHeight,此处用int32代替int64,理论上可能造成错误 TargetBits int32 `json:"targetBits,omitempty"` }
/////////////////// lpb兼容逻辑 ///////////////////// 历史共识存储字段
func ParseOldQCStorage ¶
func ParseOldQCStorage(storage []byte) (*ConsensusStorage, error)
ParseOldQCStorage 将有Justify结构的老共识结构解析出来
Click to show internal directories.
Click to hide internal directories.