Versions in this module Expand all Collapse all v1 v1.4.2 Oct 4, 2021 v1.4.1 Oct 4, 2021 Changes in this version + const Celo64 + const Celo65 + const Celo66 + const ConsensusMsg + const DelegateSignMsg + const EnodeCertificateMsg + const FwdMsg + const MinEpochSize + const MsgCommit + const MsgPrepare + const MsgPreprepare + const MsgRoundChange + const ProtocolName + const QueryEnodeMsg + const ValEnodesShareMsg + const ValidatorHandshakeMsg + const VersionCertificatesMsg + var DefaultConfig = &Config + var ErrInvalidEnodeCertMsgMapOldVersion = errors.New("invalid enode certificate message map because of old version") + var ErrInvalidSigner = errors.New("signed by incorrect validator") + var ErrStartedAnnounce = errors.New("started announce") + var ErrStartedEngine = errors.New("started engine") + var ErrStartedProxiedValidatorEngine = errors.New("started proxied validator engine") + var ErrStartedVPHThread = errors.New("started validator peer handler thread") + var ErrStoppedAnnounce = errors.New("stopped announce") + var ErrStoppedEngine = errors.New("stopped engine") + var ErrStoppedProxiedValidatorEngine = errors.New("stopped proxied validator engine") + var ErrStoppedVPHThread = errors.New("stopped validator peer handler thread") + var ErrUnauthorizedAddress = errors.New("not an elected validator") + var ErrValidatorNotProxied = errors.New("validator not proxied") + var ProtocolLengths = map[uint]uint64 + var ProtocolVersions = []uint + func ApplyParamsChainConfigToConfig(chainConfig *params.ChainConfig, config *Config) error + func CheckValidatorSignature(valSet ValidatorSet, data []byte, sig []byte) (common.Address, error) + func CompareValidatorPublicKeySlices(valSet1 []blscrypto.SerializedPublicKey, ...) bool + func CompareValidatorSlices(valSet1 []common.Address, valSet2 []common.Address) bool + func ConvertPublicKeysToStringSlice(publicKeys []blscrypto.SerializedPublicKey) []string + func GetEpochFirstBlockGivenBlockNumber(blockNumber uint64, epochSize uint64) (uint64, error) + func GetEpochFirstBlockNumber(epochNumber uint64, epochSize uint64) (uint64, error) + func GetEpochLastBlockNumber(epochNumber uint64, epochSize uint64) uint64 + func GetEpochNumber(number uint64, epochSize uint64) uint64 + func GetNodeID(enodeURL string) (*enode.ID, error) + func GetNumberWithinEpoch(number uint64, epochSize uint64) uint64 + func GetSignatureAddress(data []byte, sig []byte) (common.Address, error) + func IsFirstBlockOfEpoch(number uint64, epochSize uint64) bool + func IsGossipedMsg(msgCode uint64) bool + func IsIstanbulMsg(msg p2p.Msg) bool + func IsLastBlockOfEpoch(number uint64, epochSize uint64) bool + func MapMessagesToSenders(messages []Message) []common.Address + func MapValidatorsToAddresses(validators []Validator) []common.Address + func MapValidatorsToPublicKeys(validators []Validator) []blscrypto.SerializedPublicKey + func MustGetEpochFirstBlockGivenBlockNumber(blockNumber uint64, epochSize uint64) uint64 + func RLPHash(v interface{}) (h common.Hash) + func RandomnessCommitmentDBLocation(commitment common.Hash) []byte + func SeparateValidatorDataIntoIstanbulExtra(validators []ValidatorData) ([]common.Address, []blscrypto.SerializedPublicKey) + type AddressEntry struct + Address common.Address + HighestKnownVersion uint + LastQueryTimestamp *time.Time + Node *enode.Node + NumQueryAttemptsForHKVersion uint + PublicKey *ecdsa.PublicKey + Version uint + func (ae *AddressEntry) DecodeRLP(s *rlp.Stream) error + func (ae *AddressEntry) EncodeRLP(w io.Writer) error + func (ae *AddressEntry) GetAddress() common.Address + func (ae *AddressEntry) GetNode() *enode.Node + func (ae *AddressEntry) GetVersion() uint + func (ae *AddressEntry) String() string + type AddressEntryRLP struct + Address common.Address + CompressedPublicKey []byte + EnodeURL string + HighestKnownVersion uint + LastQueryTimestamp []byte + NumQueryAttemptsForHKVersion uint + Version uint + type BLSSignerFn func(accounts.Account, []byte, []byte, bool, bool) (blscrypto.SerializedSignature, error) + type CommittedSubject struct + CommittedSeal []byte + EpochValidatorSetSeal []byte + Subject *Subject + type Config struct + AnnounceAdditionalValidatorsToGossip int64 + AnnounceAggressiveQueryEnodeGossipOnEnablement bool + AnnounceQueryEnodeGossipPeriod uint64 + BlockPeriod uint64 + DefaultLookbackWindow uint64 + Epoch uint64 + LoadTestCSVFile string + MaxResendRoundChangeTimeout uint64 + MinResendRoundChangeTimeout uint64 + ProposerPolicy ProposerPolicy + Proxied bool + ProxiedValidatorAddress common.Address + Proxy bool + ProxyConfigs []*ProxyConfig + Replica bool + ReplicaStateDBPath string + RequestTimeout uint64 + RoundStateDBPath string + TimeoutBackoffFactor uint64 + Validator bool + ValidatorEnodeDBPath string + VersionCertificateDBPath string + type DecryptFn func(accounts.Account, []byte, []byte, []byte) ([]byte, error) + type EncryptedEnodeURL struct + DestAddress common.Address + EncryptedEnodeURL []byte + func (ee *EncryptedEnodeURL) DecodeRLP(s *rlp.Stream) error + func (ee *EncryptedEnodeURL) EncodeRLP(w io.Writer) error + func (ee *EncryptedEnodeURL) String() string + type EnodeCertMsg struct + DestAddresses []common.Address + Msg *Message + type EnodeCertificate struct + EnodeURL string + Version uint + func (ec *EnodeCertificate) DecodeRLP(s *rlp.Stream) error + func (ec *EnodeCertificate) EncodeRLP(w io.Writer) error + type FinalCommittedEvent struct + type ForwardMessage struct + Code uint64 + DestAddresses []common.Address + Msg []byte + type HashSignerFn func(accounts.Account, []byte) ([]byte, error) + type Message struct + Address common.Address + Code uint64 + Msg []byte + Signature []byte + func NewCommitMessage(commit *CommittedSubject, sender common.Address) *Message + func NewEnodeCeritifcateMessage(enodeCertificate *EnodeCertificate, sender common.Address) *Message + func NewForwardMessage(fowardMessage *ForwardMessage, sender common.Address) *Message + func NewPrepareMessage(subject *Subject, sender common.Address) *Message + func NewPreprepareMessage(prePrepare *Preprepare, sender common.Address) *Message + func NewQueryEnodeMessage(queryEnode *QueryEnodeData, sender common.Address) *Message + func NewRoundChangeMessage(roundChange *RoundChange, sender common.Address) *Message + func NewValEnodesShareMessage(valEnodeShareData *ValEnodesShareData, sender common.Address) *Message + func NewVersionCeritifcatesMessage(versionCertificates []*VersionCertificate, sender common.Address) *Message + func (m *Message) Commit() *CommittedSubject + func (m *Message) Copy() *Message + func (m *Message) DecodeRLP(stream *rlp.Stream) error + func (m *Message) EnodeCertificate() *EnodeCertificate + func (m *Message) ForwardMessage() *ForwardMessage + func (m *Message) FromPayload(b []byte, validateFn func([]byte, []byte) (common.Address, error)) error + func (m *Message) Payload() ([]byte, error) + func (m *Message) PayloadNoSig() ([]byte, error) + func (m *Message) Prepare() *Subject + func (m *Message) Preprepare() *Preprepare + func (m *Message) QueryEnodeMsg() *QueryEnodeData + func (m *Message) RoundChange() *RoundChange + func (m *Message) Sign(signingFn func(data []byte) ([]byte, error)) error + func (m *Message) String() string + func (m *Message) ValEnodesShareData() *ValEnodesShareData + func (m *Message) VersionCertificates() []*VersionCertificate + type MessageEvent struct + Payload []byte + type MessageWithPeerIDEvent struct + Payload []byte + PeerID enode.ID + type PreparedCertificate struct + PrepareOrCommitMessages []Message + Proposal Proposal + func EmptyPreparedCertificate() PreparedCertificate + func (pc *PreparedCertificate) AsData() *PreparedCertificateData + func (pc *PreparedCertificate) DecodeRLP(s *rlp.Stream) error + func (pc *PreparedCertificate) EncodeRLP(w io.Writer) error + func (pc *PreparedCertificate) IsEmpty() bool + func (pc *PreparedCertificate) Summary() *PreparedCertificateSummary + type PreparedCertificateData struct + PrepareOrCommitMessages []Message + Proposal *types.Block + type PreparedCertificateSummary struct + CommitSenders []common.Address + PrepareSenders []common.Address + ProposalHash common.Hash + type Preprepare struct + Proposal Proposal + RoundChangeCertificate RoundChangeCertificate + View *View + func (pp *Preprepare) AsData() *PreprepareData + func (pp *Preprepare) DecodeRLP(s *rlp.Stream) error + func (pp *Preprepare) EncodeRLP(w io.Writer) error + func (pp *Preprepare) HasRoundChangeCertificate() bool + func (pp *Preprepare) Summary() *PreprepareSummary + type PreprepareData struct + Proposal *types.Block + RoundChangeCertificate RoundChangeCertificate + View *View + type PreprepareSummary struct + ProposalHash common.Hash + RoundChangeCertificateSenders []common.Address + View *View + type Proposal interface + DecodeRLP func(s *rlp.Stream) error + EncodeRLP func(w io.Writer) error + Hash func() common.Hash + Header func() *types.Header + Number func() *big.Int + ParentHash func() common.Hash + type ProposerPolicy uint64 + const RoundRobin + const ShuffledRoundRobin + const Sticky + type ProposerSelector func(validatorSet ValidatorSet, lastBlockProposer common.Address, ...) Validator + type ProxyConfig struct + ExternalNode *enode.Node + InternalNode *enode.Node + type QueryEnodeData struct + EncryptedEnodeURLs []*EncryptedEnodeURL + Timestamp uint + Version uint + func (qed *QueryEnodeData) DecodeRLP(s *rlp.Stream) error + func (qed *QueryEnodeData) EncodeRLP(w io.Writer) error + func (qed *QueryEnodeData) String() string + type Request struct + Proposal Proposal + func (b *Request) DecodeRLP(s *rlp.Stream) error + func (b *Request) EncodeRLP(w io.Writer) error + type RequestEvent struct + Proposal Proposal + type RoundChange struct + PreparedCertificate PreparedCertificate + View *View + func (b *RoundChange) DecodeRLP(s *rlp.Stream) error + func (b *RoundChange) EncodeRLP(w io.Writer) error + func (b *RoundChange) HasPreparedCertificate() bool + type RoundChangeCertificate struct + RoundChangeMessages []Message + func (b *RoundChangeCertificate) IsEmpty() bool + type SharedValidatorEnode struct + Address common.Address + EnodeURL string + Version uint + func (sve *SharedValidatorEnode) String() string + type SignerFn func(accounts.Account, string, []byte) ([]byte, error) + type Subject struct + Digest common.Hash + View *View + func (s *Subject) String() string + type ValEnodesShareData struct + ValEnodes []SharedValidatorEnode + func (sd *ValEnodesShareData) DecodeRLP(s *rlp.Stream) error + func (sd *ValEnodesShareData) EncodeRLP(w io.Writer) error + func (sd *ValEnodesShareData) String() string + type Validator interface + Address func() common.Address + AsData func() *ValidatorData + AsDataWithBLSKeyCache func() *ValidatorDataWithBLSKeyCache + BLSPublicKey func() blscrypto.SerializedPublicKey + BLSPublicKeyUncompressed func() []byte + CacheUncompressedBLSKey func() + Copy func() Validator + Serialize func() ([]byte, error) + type ValidatorData struct + Address common.Address + BLSPublicKey blscrypto.SerializedPublicKey + func CombineIstanbulExtraToValidatorData(addrs []common.Address, blsPublicKeys []blscrypto.SerializedPublicKey) ([]ValidatorData, error) + func ValidatorSetDiff(oldValSet []ValidatorData, newValSet []ValidatorData) ([]ValidatorData, *big.Int) + type ValidatorDataWithBLSKeyCache struct + Address common.Address + BLSPublicKey blscrypto.SerializedPublicKey + UncompressedBLSPublicKey []byte + type ValidatorSet interface + AddValidators func(validators []ValidatorData) bool + CacheUncompressedBLSKey func() + ContainsByAddress func(add common.Address) bool + Copy func() ValidatorSet + F func() int + GetByAddress func(addr common.Address) (int, Validator) + GetByIndex func(i uint64) Validator + GetIndex func(addr common.Address) int + GetRandomness func() common.Hash + HasBLSKeyCache func() bool + List func() []Validator + MinQuorumSize func() int + RemoveValidators func(removedValidators *big.Int) bool + Serialize func() ([]byte, error) + SetRandomness func(seed common.Hash) + Size func() int + type ValidatorSetData struct + Randomness common.Hash + Validators []ValidatorData + type ValidatorSetDataWithBLSKeyCache struct + Randomness common.Hash + Validators []ValidatorDataWithBLSKeyCache + type ValidatorsDataByAddress []ValidatorData + func (a ValidatorsDataByAddress) Len() int + func (a ValidatorsDataByAddress) Less(i, j int) bool + func (a ValidatorsDataByAddress) Swap(i, j int) + type VersionCertificate struct + Signature []byte + Version uint + func NewVersionCertificate(version uint, signingFn func([]byte) ([]byte, error)) (*VersionCertificate, error) + func NewVersionCertificateFromFields(version uint, signature []byte, address common.Address, key *ecdsa.PublicKey) *VersionCertificate + func (vc *VersionCertificate) Address() common.Address + func (vc *VersionCertificate) DecodeRLP(s *rlp.Stream) error + func (vc *VersionCertificate) PublicKey() *ecdsa.PublicKey + func (vc *VersionCertificate) String() string + type View struct + Round *big.Int + Sequence *big.Int + func (v *View) Cmp(y *View) int + func (v *View) String() string