Documentation
¶
Overview ¶
Package isaac runs consensus process
Index ¶
- Variables
- func BlockHeightDirectory(height base.Height) string
- func BlockItemDecodeLineItems(f io.Reader, decode func([]byte) (interface{}, error), ...) (count uint64, _ error)
- func BlockItemDecodeLineItemsWithWorker(f io.Reader, num uint64, decode func([]byte) (interface{}, error), ...) (count uint64, _ error)
- func BlockItemFilesPath(root string, height base.Height) string
- func BlockItemReadByBlockItemFileFuncWithRemote(readers *BlockItemReaders, fromRemotes RemotesBlockItemReadFunc) ...
- func BlockItemReadersDecode[T any](itemf BlockItemReadersItemFunc, height base.Height, t base.BlockItemType, ...) (target T, _ bool, _ error)
- func BlockItemReadersDecodeFromReader[T any](itemf BlockItemReadersFromReaderFunc, t base.BlockItemType, r io.Reader, ...) (target T, _ error)
- func BlockItemReadersDecodeItems[T any](itemf BlockItemReadersItemFunc, height base.Height, t base.BlockItemType, ...) (count uint64, l []T, found bool, _ error)
- func BlockItemReadersDecodeItemsFromReader[T any](itemf BlockItemReadersFromReaderFunc, t base.BlockItemType, r io.Reader, ...) (count uint64, l []T, _ error)
- func BlockItemReadersItemFuncWithRemote(readers *BlockItemReaders, fromRemotes RemotesBlockItemReadFunc, ...) func(context.Context) BlockItemReadersItemFunc
- func ConcurrentRequestProposal(ctx context.Context, point base.Point, proposer base.Node, ...) (base.ProposalSignFact, bool, error)
- func ErrCallbackWorkerWithSyncSourcePool(ctx context.Context, pool *SyncSourcePool, picksize int, semsize int64, ...) error
- func FilterCandidates(height base.Height, candidates []base.SuffrageCandidateStateValue) []base.SuffrageCandidateStateValue
- func GetSuffrageFromDatabase(db Database, height base.Height) (base.Suffrage, bool, error)
- func InCandidates(node base.Node, candidates []base.SuffrageCandidateStateValue) bool
- func IsInLocalBlockItemFile(uri url.URL) bool
- func IsNewBallot(last LastPoint, point base.StagePoint, isSuffrageConfirm bool) bool
- func IsNewVoteproof(last LastPoint, vp base.Voteproof) bool
- func IsNewVoteproofbyPoint(last LastPoint, point base.StagePoint, isMajority, isSuffrageConfirm bool) bool
- func IsNodeAddressInLastConsensusNodes(node base.Address, proof base.SuffrageProof, candidatesst base.State) (base.Suffrage, bool, error)
- func IsNodeInLastConsensusNodes(node base.Node, proof base.SuffrageProof, candidatesst base.State) (base.Suffrage, bool, error)
- func IsSuffrageConfirmBallotFact(fact base.Fact) bool
- func IsValidExpelWithSuffrage(height base.Height, expel base.SuffrageExpelOperation, suf base.Suffrage) error
- func IsValidExpelWithSuffrageLifespan(height base.Height, expel base.SuffrageExpelOperation, suf base.Suffrage, ...) error
- func IsValidVoteproofWithSuffrage(vp base.Voteproof, suf base.Suffrage) error
- func JobWorkerWithSyncSourcePool(ctx context.Context, pool *SyncSourcePool, picksize int, semsize int64, ...) error
- func LastCandidatesFromState(height base.Height, getStateFunc base.GetStateFunc) (base.Height, []base.SuffrageCandidateStateValue, error)
- func LoadBlockItemFileBaseHeader(f io.Reader) (_ *bufio.Reader, writer, enc hint.Hint, _ error)
- func LoadBlockItemFileHeader(f io.Reader, v interface{}) (br *bufio.Reader, _ error)
- func LoadBlockItemFilesPath(root string, height base.Height, jsonenc encoder.Encoder) (bfiles base.BlockItemFiles, found bool, _ error)
- func NewCandidatesOfMajoritySuffrageCandidateLimiterRule(ratio float64, getSuffrage func() (uint64, error)) (uint64, error)
- func NewFixedSuffrageCandidateLimiter(rule FixedSuffrageCandidateLimiterRule) base.SuffrageCandidateLimiter
- func NewMajoritySuffrageCandidateLimiter(rule MajoritySuffrageCandidateLimiterRule, getSuffrage func() (uint64, error)) base.SuffrageCandidateLimiter
- func NewNode(pub base.Publickey, addr base.Address) base.BaseNode
- func NewSuffrageFromState(st base.State) (suf base.Suffrage, _ error)
- func NewSuffrageWithExpels(suf base.Suffrage, threshold base.Threshold, ...) (base.Suffrage, error)
- func ReadBlockItemFileHeader(f io.Reader) (br *bufio.Reader, _ []byte, _ error)
- type ACCEPTBallot
- func (bl ACCEPTBallot) BallotSignFact() base.ACCEPTBallotSignFact
- func (bl *ACCEPTBallot) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (bl ACCEPTBallot) Expels() []base.SuffrageExpelOperation
- func (bl ACCEPTBallot) HashBytes() []byte
- func (bl ACCEPTBallot) IsValid(networkID []byte) error
- func (bl ACCEPTBallot) MarshalJSON() ([]byte, error)
- func (bl ACCEPTBallot) Point() base.StagePoint
- func (bl ACCEPTBallot) SignFact() base.BallotSignFact
- func (bl ACCEPTBallot) Voteproof() base.Voteproof
- type ACCEPTBallotFact
- func (fact *ACCEPTBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact ACCEPTBallotFact) ExpelFacts() []util.Hash
- func (fact ACCEPTBallotFact) IsValid([]byte) error
- func (fact ACCEPTBallotFact) MarshalJSON() ([]byte, error)
- func (fact ACCEPTBallotFact) NewBlock() util.Hash
- func (fact ACCEPTBallotFact) Point() base.StagePoint
- func (fact ACCEPTBallotFact) Proposal() util.Hash
- func (fact ACCEPTBallotFact) Stage() base.Stage
- type ACCEPTBallotFactJSONMarshaler
- type ACCEPTBallotFactJSONUnmarshaler
- type ACCEPTBallotSignFact
- func (sf ACCEPTBallotSignFact) BallotFact() base.ACCEPTBallotFact
- func (sf *ACCEPTBallotSignFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (sf ACCEPTBallotSignFact) Fact() base.Fact
- func (sf ACCEPTBallotSignFact) HashBytes() []byte
- func (sf ACCEPTBallotSignFact) IsValid(networkID []byte) error
- func (sf ACCEPTBallotSignFact) MarshalJSON() ([]byte, error)
- func (sf ACCEPTBallotSignFact) Node() base.Address
- func (sf *ACCEPTBallotSignFact) NodeSign(priv base.Privatekey, networkID base.NetworkID, node base.Address) error
- func (sf ACCEPTBallotSignFact) NodeSigns() []base.NodeSign
- func (sf ACCEPTBallotSignFact) Signer() base.Publickey
- func (sf ACCEPTBallotSignFact) Signs() []base.Sign
- type ACCEPTExpelVoteproof
- func (vp *ACCEPTExpelVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp ACCEPTExpelVoteproof) Expels() []base.SuffrageExpelOperation
- func (vp *ACCEPTExpelVoteproof) Finish() baseVoteproof
- func (vp ACCEPTExpelVoteproof) FinishedAt() time.Time
- func (vp ACCEPTExpelVoteproof) HashBytes() []byte
- func (vp ACCEPTExpelVoteproof) ID() string
- func (ACCEPTExpelVoteproof) IsExpelVoteproof() bool
- func (vp ACCEPTExpelVoteproof) IsValid(networkID []byte) error
- func (vp ACCEPTExpelVoteproof) Majority() base.BallotFact
- func (vp ACCEPTExpelVoteproof) MarshalJSON() ([]byte, error)
- func (vp ACCEPTExpelVoteproof) Point() base.StagePoint
- func (vp ACCEPTExpelVoteproof) Result() base.VoteResult
- func (vp *ACCEPTExpelVoteproof) SetExpels(expels []base.SuffrageExpelOperation) *baseExpelVoteproof
- func (vp *ACCEPTExpelVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *ACCEPTExpelVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *ACCEPTExpelVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *ACCEPTExpelVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp ACCEPTExpelVoteproof) SignFacts() []base.BallotSignFact
- func (vp ACCEPTExpelVoteproof) Threshold() base.Threshold
- type ACCEPTStuckVoteproof
- func (vp *ACCEPTStuckVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp *ACCEPTStuckVoteproof) Finish() *ACCEPTStuckVoteproof
- func (vp ACCEPTStuckVoteproof) FinishedAt() time.Time
- func (vp ACCEPTStuckVoteproof) HashBytes() []byte
- func (vp ACCEPTStuckVoteproof) ID() string
- func (ACCEPTStuckVoteproof) IsStuckVoteproof() bool
- func (vp ACCEPTStuckVoteproof) IsValid(networkID []byte) error
- func (vp ACCEPTStuckVoteproof) Majority() base.BallotFact
- func (vp ACCEPTStuckVoteproof) MarshalJSON() ([]byte, error)
- func (vp ACCEPTStuckVoteproof) Point() base.StagePoint
- func (vp ACCEPTStuckVoteproof) Result() base.VoteResult
- func (vp *ACCEPTStuckVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *ACCEPTStuckVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *ACCEPTStuckVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *ACCEPTStuckVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp ACCEPTStuckVoteproof) SignFacts() []base.BallotSignFact
- func (vp ACCEPTStuckVoteproof) Threshold() base.Threshold
- type ACCEPTVoteproof
- func (vp ACCEPTVoteproof) BallotMajority() base.ACCEPTBallotFact
- func (vp ACCEPTVoteproof) BallotSignFacts() []base.ACCEPTBallotSignFact
- func (vp *ACCEPTVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp *ACCEPTVoteproof) Finish() baseVoteproof
- func (vp ACCEPTVoteproof) FinishedAt() time.Time
- func (vp ACCEPTVoteproof) HashBytes() []byte
- func (vp ACCEPTVoteproof) ID() string
- func (vp ACCEPTVoteproof) IsValid(networkID []byte) error
- func (vp ACCEPTVoteproof) Majority() base.BallotFact
- func (vp ACCEPTVoteproof) MarshalJSON() ([]byte, error)
- func (vp ACCEPTVoteproof) Point() base.StagePoint
- func (vp ACCEPTVoteproof) Result() base.VoteResult
- func (vp *ACCEPTVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *ACCEPTVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *ACCEPTVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *ACCEPTVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp ACCEPTVoteproof) SignFacts() []base.BallotSignFact
- func (vp ACCEPTVoteproof) Threshold() base.Threshold
- type BallotPool
- type BaseDatabase
- type BaseProposalSelector
- type BaseProposalSelectorArgs
- type BlockBasedProposerSelector
- type BlockImporter
- type BlockItemFile
- type BlockItemFileBaseItemsHeader
- type BlockItemFileJSONMarshaler
- type BlockItemFiles
- func (f *BlockItemFiles) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (f BlockItemFiles) IsValid([]byte) error
- func (f BlockItemFiles) Item(t base.BlockItemType) (base.BlockItemFile, bool)
- func (f BlockItemFiles) Items() map[base.BlockItemType]base.BlockItemFile
- func (f BlockItemFiles) MarshalJSON() ([]byte, error)
- type BlockItemFilesJSONMarshaler
- type BlockItemFilesJSONUnmarshaler
- type BlockItemFilesMaker
- type BlockItemReader
- type BlockItemReaderCallbackFunc
- type BlockItemReaderFunc
- type BlockItemReaders
- func (rs *BlockItemReaders) Add(writerhint hint.Hint, v NewBlockItemReaderFunc) error
- func (rs *BlockItemReaders) Close()
- func (rs *BlockItemReaders) Item(height base.Height, t base.BlockItemType, callback BlockItemReaderCallbackFunc) (base.BlockItemFile, bool, error)
- func (rs *BlockItemReaders) ItemFile(height base.Height, t base.BlockItemType) (base.BlockItemFile, bool, error)
- func (rs *BlockItemReaders) ItemFiles(height base.Height) (base.BlockItemFiles, bool, error)
- func (rs *BlockItemReaders) ItemFilesReader(height base.Height, f func(io.Reader) error) (bool, error)
- func (rs *BlockItemReaders) ItemFromReader(t base.BlockItemType, r io.Reader, compressFormat string, ...) error
- func (rs *BlockItemReaders) ReadFileFromItemFile(height base.Height, bfile base.BlockItemFile) (*os.File, bool, error)
- func (rs *BlockItemReaders) Reader(height base.Height, t base.BlockItemType, ...) (bool, error)
- func (rs *BlockItemReaders) Root() string
- func (rs *BlockItemReaders) WriteItemFiles(height base.Height, b []byte) (updated bool, _ error)
- type BlockItemReadersArgs
- type BlockItemReadersFromReaderFunc
- type BlockItemReadersItemFunc
- type BlockReader
- type BlockWriteDatabase
- type BlockWriter
- type Database
- type DefaultProposalProcessor
- func (p *DefaultProposalProcessor) Cancel() error
- func (p *DefaultProposalProcessor) Process(ctx context.Context, ivp base.INITVoteproof) (base.Manifest, error)
- func (p *DefaultProposalProcessor) Proposal() base.ProposalSignFact
- func (p *DefaultProposalProcessor) Save(ctx context.Context, avp base.ACCEPTVoteproof) (base.BlockMap, error)
- type DefaultProposalProcessorArgs
- type EmptyOperationsACCEPTBallotFact
- type EmptyProposalINITBallotFact
- func (fact *EmptyProposalINITBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact EmptyProposalINITBallotFact) ExpelFacts() []util.Hash
- func (fact EmptyProposalINITBallotFact) IsValid([]byte) error
- func (fact EmptyProposalINITBallotFact) MarshalJSON() ([]byte, error)
- func (fact EmptyProposalINITBallotFact) Point() base.StagePoint
- func (fact EmptyProposalINITBallotFact) Stage() base.Stage
- type EmptyProposalINITBallotFactJSONMarshaler
- type ExpelBallotFact
- type FixedSuffrageCandidateLimiterRule
- func (l FixedSuffrageCandidateLimiterRule) HashBytes() []byte
- func (l FixedSuffrageCandidateLimiterRule) IsValid([]byte) error
- func (l FixedSuffrageCandidateLimiterRule) Limit() uint64
- func (l FixedSuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
- func (l *FixedSuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
- type FuncProposerSelector
- type GetLastSuffrageCandidateStateRemoteFunc
- type GetLastSuffrageProofFromRemoteFunc
- type GetSuffrageByBlockHeight
- type GetSuffrageProofFromRemoteFunc
- type INITBallot
- func (bl INITBallot) BallotSignFact() base.INITBallotSignFact
- func (bl *INITBallot) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (bl INITBallot) Expels() []base.SuffrageExpelOperation
- func (bl INITBallot) HashBytes() []byte
- func (bl INITBallot) IsValid(networkID []byte) error
- func (bl INITBallot) MarshalJSON() ([]byte, error)
- func (bl INITBallot) Point() base.StagePoint
- func (bl INITBallot) SignFact() base.BallotSignFact
- func (bl INITBallot) Voteproof() base.Voteproof
- type INITBallotFact
- func (fact *INITBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact INITBallotFact) ExpelFacts() []util.Hash
- func (fact INITBallotFact) IsValid([]byte) error
- func (fact INITBallotFact) MarshalJSON() ([]byte, error)
- func (fact INITBallotFact) Point() base.StagePoint
- func (fact INITBallotFact) PreviousBlock() util.Hash
- func (fact INITBallotFact) Proposal() util.Hash
- func (fact INITBallotFact) Stage() base.Stage
- type INITBallotFactJSONMarshaler
- type INITBallotFactJSONUnmarshaler
- type INITBallotSignFact
- func (sf INITBallotSignFact) BallotFact() base.INITBallotFact
- func (sf *INITBallotSignFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (sf INITBallotSignFact) Fact() base.Fact
- func (sf INITBallotSignFact) HashBytes() []byte
- func (sf INITBallotSignFact) IsValid(networkID []byte) error
- func (sf INITBallotSignFact) MarshalJSON() ([]byte, error)
- func (sf INITBallotSignFact) Node() base.Address
- func (sf *INITBallotSignFact) NodeSign(priv base.Privatekey, networkID base.NetworkID, node base.Address) error
- func (sf INITBallotSignFact) NodeSigns() []base.NodeSign
- func (sf INITBallotSignFact) Signer() base.Publickey
- func (sf INITBallotSignFact) Signs() []base.Sign
- type INITExpelVoteproof
- func (vp *INITExpelVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp INITExpelVoteproof) Expels() []base.SuffrageExpelOperation
- func (vp *INITExpelVoteproof) Finish() baseVoteproof
- func (vp INITExpelVoteproof) FinishedAt() time.Time
- func (vp INITExpelVoteproof) HashBytes() []byte
- func (vp INITExpelVoteproof) ID() string
- func (INITExpelVoteproof) IsExpelVoteproof() bool
- func (vp INITExpelVoteproof) IsValid(networkID []byte) error
- func (vp INITExpelVoteproof) Majority() base.BallotFact
- func (vp INITExpelVoteproof) MarshalJSON() ([]byte, error)
- func (vp INITExpelVoteproof) Point() base.StagePoint
- func (vp INITExpelVoteproof) Result() base.VoteResult
- func (vp *INITExpelVoteproof) SetExpels(expels []base.SuffrageExpelOperation) *baseExpelVoteproof
- func (vp *INITExpelVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *INITExpelVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *INITExpelVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *INITExpelVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp INITExpelVoteproof) SignFacts() []base.BallotSignFact
- func (vp INITExpelVoteproof) Threshold() base.Threshold
- type INITStuckVoteproof
- func (vp *INITStuckVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp *INITStuckVoteproof) Finish() *INITStuckVoteproof
- func (vp INITStuckVoteproof) FinishedAt() time.Time
- func (vp INITStuckVoteproof) HashBytes() []byte
- func (vp INITStuckVoteproof) ID() string
- func (INITStuckVoteproof) IsStuckVoteproof() bool
- func (vp INITStuckVoteproof) IsValid(networkID []byte) error
- func (vp INITStuckVoteproof) Majority() base.BallotFact
- func (vp INITStuckVoteproof) MarshalJSON() ([]byte, error)
- func (vp INITStuckVoteproof) Point() base.StagePoint
- func (vp INITStuckVoteproof) Result() base.VoteResult
- func (vp *INITStuckVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *INITStuckVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *INITStuckVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *INITStuckVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp INITStuckVoteproof) SignFacts() []base.BallotSignFact
- func (vp INITStuckVoteproof) Threshold() base.Threshold
- type INITVoteproof
- func (vp INITVoteproof) BallotMajority() base.INITBallotFact
- func (vp INITVoteproof) BallotSignFacts() []base.INITBallotSignFact
- func (vp *INITVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (vp *INITVoteproof) Finish() baseVoteproof
- func (vp INITVoteproof) FinishedAt() time.Time
- func (vp INITVoteproof) HashBytes() []byte
- func (vp INITVoteproof) ID() string
- func (vp INITVoteproof) IsValid(networkID []byte) error
- func (vp INITVoteproof) Majority() base.BallotFact
- func (vp INITVoteproof) MarshalJSON() ([]byte, error)
- func (vp INITVoteproof) Point() base.StagePoint
- func (vp INITVoteproof) Result() base.VoteResult
- func (vp *INITVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
- func (vp *INITVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
- func (vp *INITVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
- func (vp *INITVoteproof) SetThreshold(s base.Threshold) *baseVoteproof
- func (vp INITVoteproof) SignFacts() []base.BallotSignFact
- func (vp INITVoteproof) Threshold() base.Threshold
- type LastConsensusNodesWatcher
- func (u *LastConsensusNodesWatcher) Exists(node base.Node) (base.Suffrage, bool, error)
- func (u *LastConsensusNodesWatcher) GetSuffrage(height base.Height) (base.Suffrage, bool, error)
- func (u *LastConsensusNodesWatcher) Last() (base.SuffrageProof, base.State, error)
- func (u *LastConsensusNodesWatcher) SetWhenUpdated(...)
- type LastPoint
- type LastVoteproofs
- func (l LastVoteproofs) ACCEPT() base.ACCEPTVoteproof
- func (l LastVoteproofs) Cap() base.Voteproof
- func (l LastVoteproofs) INIT() base.INITVoteproof
- func (l LastVoteproofs) IsNew(vp base.Voteproof) bool
- func (l LastVoteproofs) Majority() base.Voteproof
- func (l LastVoteproofs) PreviousBlockForNextRound(vp base.Voteproof) util.Hash
- type LastVoteproofsHandler
- func (l *LastVoteproofsHandler) ForceSetLast(vp base.Voteproof) bool
- func (l *LastVoteproofsHandler) IsNew(vp base.Voteproof) bool
- func (l *LastVoteproofsHandler) Last() LastVoteproofs
- func (l *LastVoteproofsHandler) Set(vp base.Voteproof) bool
- func (l *LastVoteproofsHandler) Voteproofs(point base.StagePoint) (LastVoteproofs, bool)
- type LocalNode
- type MajoritySuffrageCandidateLimiterRule
- func (l MajoritySuffrageCandidateLimiterRule) HashBytes() []byte
- func (l MajoritySuffrageCandidateLimiterRule) IsValid([]byte) error
- func (l MajoritySuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
- func (l MajoritySuffrageCandidateLimiterRule) Max() uint64
- func (l MajoritySuffrageCandidateLimiterRule) Min() uint64
- func (l MajoritySuffrageCandidateLimiterRule) Ratio() float64
- func (l *MajoritySuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
- type Manifest
- func (m Manifest) Hash() util.Hash
- func (m Manifest) Height() base.Height
- func (m Manifest) IsValid([]byte) error
- func (m Manifest) MarshalJSON() ([]byte, error)
- func (m Manifest) OperationsTree() util.Hash
- func (m Manifest) Previous() util.Hash
- func (m Manifest) Proposal() util.Hash
- func (m Manifest) ProposedAt() time.Time
- func (m Manifest) StatesTree() util.Hash
- func (m Manifest) Suffrage() util.Hash
- func (m *Manifest) UnmarshalJSON(b []byte) error
- type ManifestJSONMarshaler
- type ManifestJSONUnmarshaler
- type NetworkClient
- type NetworkPolicy
- func (p *NetworkPolicy) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (p NetworkPolicy) EmptyProposalNoBlock() bool
- func (p NetworkPolicy) HashBytes() []byte
- func (p NetworkPolicy) IsValid([]byte) error
- func (p NetworkPolicy) MarshalJSON() ([]byte, error)
- func (p NetworkPolicy) MaxOperationsInProposal() uint64
- func (p NetworkPolicy) MaxSuffrageSize() uint64
- func (p *NetworkPolicy) SetEmptyProposalNoBlock(i bool) NetworkPolicy
- func (p *NetworkPolicy) SetMaxOperationsInProposal(i uint64) NetworkPolicy
- func (p *NetworkPolicy) SetMaxSuffrageSize(i uint64) NetworkPolicy
- func (p *NetworkPolicy) SetSuffrageCandidateLifespan(i base.Height) NetworkPolicy
- func (p *NetworkPolicy) SetSuffrageCandidateLimiterRule(i base.SuffrageCandidateLimiterRule) NetworkPolicy
- func (p *NetworkPolicy) SetSuffrageExpelLifespan(i base.Height) NetworkPolicy
- func (p NetworkPolicy) SuffrageCandidateLifespan() base.Height
- func (p NetworkPolicy) SuffrageCandidateLimiterRule() base.SuffrageCandidateLimiterRule
- func (p NetworkPolicy) SuffrageExpelLifespan() base.Height
- type NetworkPolicyStateValue
- func (s *NetworkPolicyStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (s NetworkPolicyStateValue) HashBytes() []byte
- func (s NetworkPolicyStateValue) IsValid([]byte) error
- func (s NetworkPolicyStateValue) MarshalJSON() ([]byte, error)
- func (s NetworkPolicyStateValue) Policy() base.NetworkPolicy
- type NetworkPolicyStateValueJSONMarshaler
- type NetworkPolicyStateValueJSONUnmarshaler
- type NewBlockItemReaderFunc
- type NewBlockWriterFunc
- type NewOperationPool
- type NewOperationProcessorFunc
- type NewOperationProcessorInternalFunc
- type NodeConnInfo
- type NodeInConsensusNodesFunc
- type NotProcessedACCEPTBallotFact
- type OperationProcessHandler
- type OperationProcessorGetOperationFunction
- type Params
- func (p *Params) BallotStuckResolveAfter() time.Duration
- func (p *Params) BallotStuckWait() time.Duration
- func (p *Params) IntervalBroadcastBallot() time.Duration
- func (p *Params) IsValid(networkID []byte) error
- func (p *Params) MarshalJSON() ([]byte, error)
- func (p *Params) MaxTryHandoverYBrokerSyncData() uint64
- func (p *Params) MinWaitNextBlockINITBallot() time.Duration
- func (p *Params) NetworkID() base.NetworkID
- func (p *Params) OperationPoolCacheSize() int
- func (p *Params) SetBallotStuckResolveAfter(d time.Duration) error
- func (p *Params) SetBallotStuckWait(d time.Duration) error
- func (p *Params) SetIntervalBroadcastBallot(d time.Duration) error
- func (p *Params) SetMaxTryHandoverYBrokerSyncData(d uint64) error
- func (p *Params) SetMinWaitNextBlockINITBallot(d time.Duration) error
- func (p *Params) SetNetworkID(n base.NetworkID) error
- func (p *Params) SetOperationPoolCacheSize(d int) error
- func (p *Params) SetStateCacheSize(d int) error
- func (p *Params) SetThreshold(t base.Threshold) error
- func (p *Params) SetWaitPreparingINITBallot(d time.Duration) error
- func (p *Params) StateCacheSize() int
- func (p *Params) Threshold() base.Threshold
- func (p *Params) UnmarshalJSON(b []byte) error
- func (p *Params) WaitPreparingINITBallot() time.Duration
- type PermanentDatabase
- type PoolOperationRecordMeta
- type ProcessorProcessFunc
- type ProposalFact
- func (fact *ProposalFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact ProposalFact) IsValid([]byte) error
- func (fact ProposalFact) MarshalJSON() ([]byte, error)
- func (fact ProposalFact) Operations() [][2]util.Hash
- func (fact ProposalFact) Point() base.Point
- func (fact ProposalFact) PreviousBlock() util.Hash
- func (fact ProposalFact) ProposedAt() time.Time
- func (fact ProposalFact) Proposer() base.Address
- type ProposalMaker
- type ProposalPool
- type ProposalProcessor
- type ProposalProcessors
- func (pps *ProposalProcessors) Cancel() error
- func (pps *ProposalProcessors) Process(ctx context.Context, point base.Point, facthash util.Hash, ...) (ProcessorProcessFunc, error)
- func (pps *ProposalProcessors) Processor() ProposalProcessor
- func (pps *ProposalProcessors) Save(ctx context.Context, facthash util.Hash, avp base.ACCEPTVoteproof) (base.BlockMap, error)
- func (pps *ProposalProcessors) SetRetryInterval(i time.Duration) *ProposalProcessors
- func (pps *ProposalProcessors) SetRetryLimit(l int) *ProposalProcessors
- type ProposalSelectFunc
- type ProposalSignFact
- func (sf *ProposalSignFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (sf ProposalSignFact) Fact() base.Fact
- func (sf ProposalSignFact) HashBytes() []byte
- func (sf ProposalSignFact) IsValid(networkID []byte) error
- func (sf ProposalSignFact) MarshalJSON() ([]byte, error)
- func (sf ProposalSignFact) Point() base.Point
- func (sf ProposalSignFact) ProposalFact() base.ProposalFact
- func (sf *ProposalSignFact) Sign(priv base.Privatekey, networkID base.NetworkID) error
- func (sf ProposalSignFact) Signs() []base.Sign
- type ProposerSelectFunc
- type ReasonProcessedOperation
- type RemoteBlockItemReadFunc
- type RemotesBlockItemReadFunc
- type StateCacheSetter
- type Suffrage
- type SuffrageCandidateJSONMarshaler
- type SuffrageCandidateJSONUnmarshaler
- type SuffrageCandidateStateValue
- func (suf SuffrageCandidateStateValue) Deadline() base.Height
- func (suf *SuffrageCandidateStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (suf SuffrageCandidateStateValue) HashBytes() []byte
- func (suf SuffrageCandidateStateValue) IsValid([]byte) error
- func (suf SuffrageCandidateStateValue) MarshalJSON() ([]byte, error)
- func (suf SuffrageCandidateStateValue) Start() base.Height
- type SuffrageCandidatesStateValue
- func (s *SuffrageCandidatesStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (s SuffrageCandidatesStateValue) HashBytes() []byte
- func (s SuffrageCandidatesStateValue) IsValid([]byte) error
- func (s SuffrageCandidatesStateValue) MarshalJSON() ([]byte, error)
- func (s SuffrageCandidatesStateValue) Nodes() []base.SuffrageCandidateStateValue
- type SuffrageConfirmBallotFact
- type SuffrageExpelFact
- func (fact *SuffrageExpelFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact SuffrageExpelFact) ExpelEnd() base.Height
- func (fact SuffrageExpelFact) ExpelStart() base.Height
- func (fact SuffrageExpelFact) IsValid([]byte) error
- func (fact SuffrageExpelFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageExpelFact) Node() base.Address
- func (fact SuffrageExpelFact) Reason() string
- type SuffrageExpelOperation
- type SuffrageExpelPool
- type SuffrageNodeStateValue
- func (s *SuffrageNodeStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (s SuffrageNodeStateValue) HashBytes() []byte
- func (s SuffrageNodeStateValue) Hint() hint.Hint
- func (s SuffrageNodeStateValue) IsValid([]byte) error
- func (s SuffrageNodeStateValue) MarshalJSON() ([]byte, error)
- func (s SuffrageNodeStateValue) Start() base.Height
- type SuffrageNodesStateValue
- func (s *SuffrageNodesStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (s SuffrageNodesStateValue) HashBytes() []byte
- func (s SuffrageNodesStateValue) Height() base.Height
- func (s SuffrageNodesStateValue) IsValid([]byte) error
- func (s SuffrageNodesStateValue) MarshalJSON() ([]byte, error)
- func (s SuffrageNodesStateValue) Nodes() []base.SuffrageNodeStateValue
- func (s SuffrageNodesStateValue) Suffrage() (base.Suffrage, error)
- type SuffrageStateBuilder
- type SuffrageVoteFunc
- type SuffrageVoting
- type SyncSourcePool
- func (p *SyncSourcePool) Actives(f func(NodeConnInfo) bool)
- func (p *SyncSourcePool) AddNonFixed(ncis ...NodeConnInfo) bool
- func (p *SyncSourcePool) IsInFixed(node base.Address) bool
- func (p *SyncSourcePool) IsInNonFixed(node base.Address) bool
- func (p *SyncSourcePool) Len() int
- func (p *SyncSourcePool) NodeConnInfo(node base.Address) []NodeConnInfo
- func (p *SyncSourcePool) NodeExists(node base.Address) bool
- func (p *SyncSourcePool) Pick() (NodeConnInfo, func(error), error)
- func (p *SyncSourcePool) PickMultiple(n int) ([]NodeConnInfo, []func(error), error)
- func (p *SyncSourcePool) RemoveNonFixed(nci NodeConnInfo) bool
- func (p *SyncSourcePool) RemoveNonFixedNode(nodes ...base.Address) bool
- func (p *SyncSourcePool) Retry(ctx context.Context, f func(NodeConnInfo) (bool, error), limit int, ...) error
- func (p *SyncSourcePool) Traverse(f func(NodeConnInfo) bool)
- func (p *SyncSourcePool) UpdateFixed(fixed []NodeConnInfo) bool
- type Syncer
- type TempDatabase
- type TempSyncPool
Constants ¶
This section is empty.
Variables ¶
var ( INITBallotHint = hint.MustNewHint("init-ballot-v0.0.1") ACCEPTBallotHint = hint.MustNewHint("accept-ballot-v0.0.1") )
var ( INITBallotFactHint = hint.MustNewHint("init-ballot-fact-v0.0.1") ACCEPTBallotFactHint = hint.MustNewHint("accept-ballot-fact-v0.0.1") SuffrageConfirmBallotFactHint = hint.MustNewHint("suffrage-confirm-ballot-fact-v0.0.1") EmptyProposalINITBallotFactHint = hint.MustNewHint("empty-proposal-init-ballot-fact-v0.0.1") EmptyOperationsACCEPTBallotFactHint = hint.MustNewHint("empty-operations-accept-ballot-fact-v0.0.1") NotProcessedACCEPTBallotFactHint = hint.MustNewHint("not-processed-accept-ballot-fact-v0.0.1") )
var ( INITBallotSignFactHint = hint.MustNewHint("init-ballot-sign-fact-v0.0.1") ACCEPTBallotSignFactHint = hint.MustNewHint("accept-ballot-sign-fact-v0.0.1") )
var ( ManifestHint = hint.MustNewHint("manifest-v0.0.1") BlockItemFileHint = hint.MustNewHint("block-item-file-v0.0.1") BlockItemFilesHint = hint.MustNewHint("block-item-files-v0.0.1") )
var ( NetworkPolicyHint = hint.MustNewHint("network-policy-v0.0.1") NetworkPolicyStateValueHint = hint.MustNewHint("network-policy-state-value-v0.0.1") DefaultMaxOperationsInProposal uint64 = 333 DefaultMaxSuffrageSize uint64 = 33 // NOTE suffrage candidate can be approved within lifespan height; almost 15 // days(based on 5 second for one block) DefaultSuffrageCandidateLifespan base.Height = 1 << 18 DefaultSuffrageExpelLifespan = base.Height(333) //nolint:mnd //... DefaultEmptyProposalNoBlock = false )
var ( DefaultntervalBroadcastBallot = time.Second * 3 DefaultWaitPreparingINITBallot = time.Second * 5 DefaultWaitStuckInterval = time.Second * 33 DefaultTimeoutRequest = time.Second * 3 DefaultMinWaitNextBlockINITBallot = time.Second * 2 DefaultStateCacheSize = 1 << 12 DefaultOperationPoolCacheSize = 1 << 12 )
var ( ProposalFactHint = hint.MustNewHint("proposal-fact-v0.0.1") ProposalSignFactHint = hint.MustNewHint("proposal-sign-fact-v0.0.1") )
var ( ErrOperationInProcessorNotFound = util.NewIDError("operation processor not found") ErrInvalidOperationInProcessor = util.NewIDError("invalid operation") ErrOperationNotFoundInProcessor = util.NewIDError("operation not found") ErrOperationAlreadyProcessedInProcessor = util.NewIDError("operation already processed") ErrSuspendOperation = util.NewIDError("suspend operation") ErrProcessorAlreadySaved = util.NewIDError("processor already saved") ErrProposalProcessorEmptyOperations = util.NewIDError("empty operations in proposal") )
var ( ErrIgnoreErrorProposalProcessor = util.NewIDError("proposal processor somthing wrong; ignore") ErrNotProposalProcessorProcessed = util.NewIDError("proposal processor not processed") )
ErrIgnoreErrorProposalProcessor ignores error from proposalProcessor, it means not ErrIgnoreErrorProposalProcessor from proposalProcessor will break consensus.
var ( LocalFSBlockItemScheme = "local" BlockDirectoryHeightFormat = "%021s" )
var ( DefaultBlockItemReadersRemoveEmptyAfter = time.Minute * 9 DefaultBlockItemReadersRemoveEmptyInterval = time.Minute * 3 )
var ( FixedSuffrageCandidateLimiterRuleHint = hint.MustNewHint("fixed-suffrage-candidate-limiter-rule-v0.0.1") MajoritySuffrageCandidateLimiterRuleHint = hint.MustNewHint("majority-suffrage-candidate-limiter-rule-v0.0.1") )
var ( SuffrageExpelFactHint = hint.MustNewHint("suffrage-expel-fact-v0.0.1") SuffrageExpelOperationHint = hint.MustNewHint("suffrage-expel-operation-v0.0.1") )
var ( SuffrageNodeStateValueHint = hint.MustNewHint("suffrage-node-state-value-v0.0.1") SuffrageNodesStateValueHint = hint.MustNewHint("suffrage-nodes-state-value-v0.0.1") SuffrageCandidateStateValueHint = hint.MustNewHint("suffrage-candidate-state-value-v0.0.1") SuffrageCandidatesStateValueHint = hint.MustNewHint("suffrage-candidates-state-value-v0.0.1") )
var ( SuffrageStateKey = "suffrage" SuffrageCandidateStateKey = "suffrage_candidate" NetworkPolicyStateKey = "network_policy" )
var ( ErrEmptySyncSources = util.NewIDError("empty sync sources; will retry") ErrRetrySyncSources = util.NewIDError("sync sources problem; will retry") )
var ( INITVoteproofHint = hint.MustNewHint("init-voteproof-v0.0.1") INITExpelVoteproofHint = hint.MustNewHint("init-expel-voteproof-v0.0.1") INITStuckVoteproofHint = hint.MustNewHint("init-stuck-voteproof-v0.0.1") ACCEPTVoteproofHint = hint.MustNewHint("accept-voteproof-v0.0.1") ACCEPTExpelVoteproofHint = hint.MustNewHint("accept-expel-voteproof-v0.0.1") ACCEPTStuckVoteproofHint = hint.MustNewHint("accept-stuck-voteproof-v0.0.1") )
var HTTPInsecureFlag = "https_insecure"
var NodeHint = hint.MustNewHint("node-v0.0.1")
var ParamsHint = hint.MustNewHint("isaac-params-v0.0.1")
Functions ¶
func BlockHeightDirectory ¶
func BlockItemReadByBlockItemFileFuncWithRemote ¶
func BlockItemReadByBlockItemFileFuncWithRemote( readers *BlockItemReaders, fromRemotes RemotesBlockItemReadFunc, ) func( context.Context, base.Height, base.BlockItemType, base.BlockItemFile, BlockItemReaderCallbackFunc, ) (bool, error)
func BlockItemReadersDecode ¶
func BlockItemReadersDecode[T any]( itemf BlockItemReadersItemFunc, height base.Height, t base.BlockItemType, f func(ir BlockItemReader) error, ) (target T, _ bool, _ error)
func BlockItemReadersDecodeFromReader ¶
func BlockItemReadersDecodeFromReader[T any]( itemf BlockItemReadersFromReaderFunc, t base.BlockItemType, r io.Reader, compressFormat string, f func(ir BlockItemReader) error, ) (target T, _ error)
func BlockItemReadersDecodeItems ¶
func BlockItemReadersDecodeItems[T any]( itemf BlockItemReadersItemFunc, height base.Height, t base.BlockItemType, item func(uint64, uint64, T) error, f func(ir BlockItemReader) error, ) (count uint64, l []T, found bool, _ error)
func BlockItemReadersDecodeItemsFromReader ¶
func BlockItemReadersDecodeItemsFromReader[T any]( itemf BlockItemReadersFromReaderFunc, t base.BlockItemType, r io.Reader, compressFormat string, item func(uint64, uint64, T) error, f func(ir BlockItemReader) error, ) (count uint64, l []T, _ error)
func BlockItemReadersItemFuncWithRemote ¶
func BlockItemReadersItemFuncWithRemote( readers *BlockItemReaders, fromRemotes RemotesBlockItemReadFunc, callback func(itemfile base.BlockItemFile, ir BlockItemReader, callback BlockItemReaderCallbackFunc) error, ) func(context.Context) BlockItemReadersItemFunc
func FilterCandidates ¶
func FilterCandidates( height base.Height, candidates []base.SuffrageCandidateStateValue, ) []base.SuffrageCandidateStateValue
func GetSuffrageFromDatabase ¶
func InCandidates ¶
func InCandidates(node base.Node, candidates []base.SuffrageCandidateStateValue) bool
func IsInLocalBlockItemFile ¶
func IsNewBallot ¶
func IsNewBallot(last LastPoint, point base.StagePoint, isSuffrageConfirm bool) bool
func IsNewVoteproofbyPoint ¶
func IsNewVoteproofbyPoint( last LastPoint, point base.StagePoint, isMajority, isSuffrageConfirm bool, ) bool
func IsValidExpelWithSuffrageLifespan ¶
func IsValidExpelWithSuffrageLifespan( height base.Height, expel base.SuffrageExpelOperation, suf base.Suffrage, lifespan base.Height, ) error
IsValidExpelWithSuffrageLifespan checks expel operation itself with suffrage and lifespan.
func LastCandidatesFromState ¶
func LastCandidatesFromState( height base.Height, getStateFunc base.GetStateFunc, ) (base.Height, []base.SuffrageCandidateStateValue, error)
func LoadBlockItemFileHeader ¶
func LoadBlockItemFilesPath ¶
func NewCandidatesOfMajoritySuffrageCandidateLimiterRule ¶
func NewCandidatesOfMajoritySuffrageCandidateLimiterRule( ratio float64, getSuffrage func() (uint64, error), ) (uint64, error)
NewCandidatesOfMajoritySuffrageCandidateLimiterRule find the number of new candidates to prevent the current suffrage majority.
func NewFixedSuffrageCandidateLimiter ¶
func NewFixedSuffrageCandidateLimiter(rule FixedSuffrageCandidateLimiterRule) base.SuffrageCandidateLimiter
func NewMajoritySuffrageCandidateLimiter ¶
func NewMajoritySuffrageCandidateLimiter( rule MajoritySuffrageCandidateLimiterRule, getSuffrage func() (uint64, error), ) base.SuffrageCandidateLimiter
func NewSuffrageWithExpels ¶
Types ¶
type ACCEPTBallot ¶
type ACCEPTBallot struct {
// contains filtered or unexported fields
}
func NewACCEPTBallot ¶
func NewACCEPTBallot( ivp base.INITVoteproof, signfact ACCEPTBallotSignFact, expels []base.SuffrageExpelOperation, ) ACCEPTBallot
func (ACCEPTBallot) BallotSignFact ¶
func (bl ACCEPTBallot) BallotSignFact() base.ACCEPTBallotSignFact
func (*ACCEPTBallot) DecodeJSON ¶
func (ACCEPTBallot) Expels ¶
func (bl ACCEPTBallot) Expels() []base.SuffrageExpelOperation
func (ACCEPTBallot) IsValid ¶
func (bl ACCEPTBallot) IsValid(networkID []byte) error
func (ACCEPTBallot) MarshalJSON ¶
func (ACCEPTBallot) Point ¶
func (bl ACCEPTBallot) Point() base.StagePoint
func (ACCEPTBallot) SignFact ¶
func (bl ACCEPTBallot) SignFact() base.BallotSignFact
type ACCEPTBallotFact ¶
type ACCEPTBallotFact struct {
// contains filtered or unexported fields
}
func NewACCEPTBallotFact ¶
func (*ACCEPTBallotFact) DecodeJSON ¶
func (fact *ACCEPTBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (ACCEPTBallotFact) ExpelFacts ¶
func (ACCEPTBallotFact) IsValid ¶
func (fact ACCEPTBallotFact) IsValid([]byte) error
func (ACCEPTBallotFact) MarshalJSON ¶
func (fact ACCEPTBallotFact) MarshalJSON() ([]byte, error)
func (ACCEPTBallotFact) NewBlock ¶
func (fact ACCEPTBallotFact) NewBlock() util.Hash
func (ACCEPTBallotFact) Point ¶
func (fact ACCEPTBallotFact) Point() base.StagePoint
func (ACCEPTBallotFact) Proposal ¶
func (fact ACCEPTBallotFact) Proposal() util.Hash
type ACCEPTBallotFactJSONUnmarshaler ¶
type ACCEPTBallotFactJSONUnmarshaler struct { Proposal valuehash.HashDecoder `json:"proposal"` NewBlock valuehash.HashDecoder `json:"new_block"` // contains filtered or unexported fields }
type ACCEPTBallotSignFact ¶
type ACCEPTBallotSignFact struct {
// contains filtered or unexported fields
}
func NewACCEPTBallotSignFact ¶
func NewACCEPTBallotSignFact(fact base.ACCEPTBallotFact) ACCEPTBallotSignFact
func (ACCEPTBallotSignFact) BallotFact ¶
func (sf ACCEPTBallotSignFact) BallotFact() base.ACCEPTBallotFact
func (*ACCEPTBallotSignFact) DecodeJSON ¶
func (ACCEPTBallotSignFact) IsValid ¶
func (sf ACCEPTBallotSignFact) IsValid(networkID []byte) error
func (ACCEPTBallotSignFact) MarshalJSON ¶
type ACCEPTExpelVoteproof ¶
type ACCEPTExpelVoteproof struct { ACCEPTVoteproof // contains filtered or unexported fields }
func NewACCEPTExpelVoteproof ¶
func NewACCEPTExpelVoteproof(point base.Point) ACCEPTExpelVoteproof
func (*ACCEPTExpelVoteproof) DecodeJSON ¶
func (vp *ACCEPTExpelVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
func (ACCEPTExpelVoteproof) Expels ¶
func (vp ACCEPTExpelVoteproof) Expels() []base.SuffrageExpelOperation
func (ACCEPTExpelVoteproof) FinishedAt ¶
func (ACCEPTExpelVoteproof) HashBytes ¶
func (vp ACCEPTExpelVoteproof) HashBytes() []byte
func (ACCEPTExpelVoteproof) IsExpelVoteproof ¶
func (ACCEPTExpelVoteproof) IsExpelVoteproof() bool
func (ACCEPTExpelVoteproof) IsValid ¶
func (vp ACCEPTExpelVoteproof) IsValid(networkID []byte) error
func (ACCEPTExpelVoteproof) Majority ¶
func (vp ACCEPTExpelVoteproof) Majority() base.BallotFact
func (ACCEPTExpelVoteproof) MarshalJSON ¶
func (vp ACCEPTExpelVoteproof) MarshalJSON() ([]byte, error)
func (ACCEPTExpelVoteproof) Point ¶
func (vp ACCEPTExpelVoteproof) Point() base.StagePoint
func (ACCEPTExpelVoteproof) Result ¶
func (vp ACCEPTExpelVoteproof) Result() base.VoteResult
func (*ACCEPTExpelVoteproof) SetExpels ¶
func (vp *ACCEPTExpelVoteproof) SetExpels(expels []base.SuffrageExpelOperation) *baseExpelVoteproof
func (*ACCEPTExpelVoteproof) SetMajority ¶
func (vp *ACCEPTExpelVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*ACCEPTExpelVoteproof) SetPoint ¶
func (vp *ACCEPTExpelVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*ACCEPTExpelVoteproof) SetSignFacts ¶
func (vp *ACCEPTExpelVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*ACCEPTExpelVoteproof) SetThreshold ¶
func (ACCEPTExpelVoteproof) SignFacts ¶
func (vp ACCEPTExpelVoteproof) SignFacts() []base.BallotSignFact
type ACCEPTStuckVoteproof ¶
type ACCEPTStuckVoteproof struct { ACCEPTVoteproof // contains filtered or unexported fields }
func NewACCEPTStuckVoteproof ¶
func NewACCEPTStuckVoteproof(point base.Point) ACCEPTStuckVoteproof
func (*ACCEPTStuckVoteproof) DecodeJSON ¶
func (vp *ACCEPTStuckVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
func (*ACCEPTStuckVoteproof) Finish ¶
func (vp *ACCEPTStuckVoteproof) Finish() *ACCEPTStuckVoteproof
func (ACCEPTStuckVoteproof) FinishedAt ¶
func (ACCEPTStuckVoteproof) IsStuckVoteproof ¶
func (ACCEPTStuckVoteproof) IsStuckVoteproof() bool
func (ACCEPTStuckVoteproof) IsValid ¶
func (vp ACCEPTStuckVoteproof) IsValid(networkID []byte) error
func (ACCEPTStuckVoteproof) Majority ¶
func (vp ACCEPTStuckVoteproof) Majority() base.BallotFact
func (ACCEPTStuckVoteproof) MarshalJSON ¶
func (vp ACCEPTStuckVoteproof) MarshalJSON() ([]byte, error)
func (ACCEPTStuckVoteproof) Point ¶
func (vp ACCEPTStuckVoteproof) Point() base.StagePoint
func (ACCEPTStuckVoteproof) Result ¶
func (vp ACCEPTStuckVoteproof) Result() base.VoteResult
func (*ACCEPTStuckVoteproof) SetMajority ¶
func (vp *ACCEPTStuckVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*ACCEPTStuckVoteproof) SetPoint ¶
func (vp *ACCEPTStuckVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*ACCEPTStuckVoteproof) SetSignFacts ¶
func (vp *ACCEPTStuckVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*ACCEPTStuckVoteproof) SetThreshold ¶
func (ACCEPTStuckVoteproof) SignFacts ¶
func (vp ACCEPTStuckVoteproof) SignFacts() []base.BallotSignFact
type ACCEPTVoteproof ¶
type ACCEPTVoteproof struct {
// contains filtered or unexported fields
}
func NewACCEPTVoteproof ¶
func NewACCEPTVoteproof(point base.Point) ACCEPTVoteproof
func (ACCEPTVoteproof) BallotMajority ¶
func (vp ACCEPTVoteproof) BallotMajority() base.ACCEPTBallotFact
func (ACCEPTVoteproof) BallotSignFacts ¶
func (vp ACCEPTVoteproof) BallotSignFacts() []base.ACCEPTBallotSignFact
func (*ACCEPTVoteproof) DecodeJSON ¶
func (ACCEPTVoteproof) FinishedAt ¶
func (ACCEPTVoteproof) IsValid ¶
func (vp ACCEPTVoteproof) IsValid(networkID []byte) error
func (ACCEPTVoteproof) Majority ¶
func (vp ACCEPTVoteproof) Majority() base.BallotFact
func (ACCEPTVoteproof) MarshalJSON ¶
func (ACCEPTVoteproof) Point ¶
func (vp ACCEPTVoteproof) Point() base.StagePoint
func (ACCEPTVoteproof) Result ¶
func (vp ACCEPTVoteproof) Result() base.VoteResult
func (*ACCEPTVoteproof) SetMajority ¶
func (vp *ACCEPTVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*ACCEPTVoteproof) SetPoint ¶
func (vp *ACCEPTVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*ACCEPTVoteproof) SetSignFacts ¶
func (vp *ACCEPTVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*ACCEPTVoteproof) SetThreshold ¶
func (ACCEPTVoteproof) SignFacts ¶
func (vp ACCEPTVoteproof) SignFacts() []base.BallotSignFact
type BallotPool ¶
type BallotPool interface { Ballot(_ base.Point, _ base.Stage, isSuffrageConfirm bool) (base.Ballot, bool, error) SetBallot(base.Ballot) (bool, error) }
BallotPool stores latest ballots of local
type BaseDatabase ¶
type BaseProposalSelector ¶
type BaseProposalSelector struct {
// contains filtered or unexported fields
}
func NewBaseProposalSelector ¶
func NewBaseProposalSelector( local base.LocalNode, args *BaseProposalSelectorArgs, ) *BaseProposalSelector
type BaseProposalSelectorArgs ¶
type BaseProposalSelectorArgs struct { Pool ProposalPool ProposerSelectFunc ProposerSelectFunc Maker *ProposalMaker GetNodesFunc func(base.Height) ([]base.Node, bool, error) RequestFunc func(context.Context, base.Point, base.Node, util.Hash) (base.ProposalSignFact, bool, error) TimeoutRequest func() time.Duration RequestProposalInterval time.Duration MinProposerWait time.Duration }
func NewBaseProposalSelectorArgs ¶
func NewBaseProposalSelectorArgs() *BaseProposalSelectorArgs
type BlockBasedProposerSelector ¶
type BlockBasedProposerSelector struct{}
func NewBlockBasedProposerSelector ¶
func NewBlockBasedProposerSelector() BlockBasedProposerSelector
type BlockImporter ¶
type BlockItemFile ¶
type BlockItemFile struct { hint.BaseHinter // contains filtered or unexported fields }
func NewBlockItemFile ¶
func NewBlockItemFile(uri url.URL, compressFormat string) BlockItemFile
func NewFileBlockItemFile ¶
func NewFileBlockItemFile(f, compressFormat string) BlockItemFile
func NewLocalFSBlockItemFile ¶
func NewLocalFSBlockItemFile(f, compressFormat string) BlockItemFile
func (BlockItemFile) CompressFormat ¶
func (f BlockItemFile) CompressFormat() string
func (BlockItemFile) IsValid ¶
func (f BlockItemFile) IsValid([]byte) error
func (BlockItemFile) MarshalJSON ¶
func (f BlockItemFile) MarshalJSON() ([]byte, error)
func (BlockItemFile) URI ¶
func (f BlockItemFile) URI() url.URL
func (*BlockItemFile) UnmarshalJSON ¶
func (f *BlockItemFile) UnmarshalJSON(b []byte) error
type BlockItemFileJSONMarshaler ¶
type BlockItemFileJSONMarshaler struct { URI string `json:"uri,omitempty"` CompressFormat string `json:"compress_format,omitempty"` hint.BaseHinter }
type BlockItemFiles ¶
type BlockItemFiles struct { hint.BaseHinter // contains filtered or unexported fields }
func NewBlockItemFiles ¶
func NewBlockItemFiles(items map[base.BlockItemType]base.BlockItemFile) BlockItemFiles
func (*BlockItemFiles) DecodeJSON ¶
func (f *BlockItemFiles) DecodeJSON(b []byte, enc encoder.Encoder) error
func (BlockItemFiles) IsValid ¶
func (f BlockItemFiles) IsValid([]byte) error
func (BlockItemFiles) Item ¶
func (f BlockItemFiles) Item(t base.BlockItemType) (base.BlockItemFile, bool)
func (BlockItemFiles) Items ¶
func (f BlockItemFiles) Items() map[base.BlockItemType]base.BlockItemFile
func (BlockItemFiles) MarshalJSON ¶
func (f BlockItemFiles) MarshalJSON() ([]byte, error)
type BlockItemFilesJSONMarshaler ¶
type BlockItemFilesJSONMarshaler struct { Items map[base.BlockItemType]base.BlockItemFile `json:"items"` hint.BaseHinter }
type BlockItemFilesJSONUnmarshaler ¶
type BlockItemFilesJSONUnmarshaler struct { Items map[base.BlockItemType]json.RawMessage `json:"items"` hint.BaseHinter }
type BlockItemFilesMaker ¶
type BlockItemFilesMaker struct {
// contains filtered or unexported fields
}
func NewBlockItemFilesMaker ¶
func NewBlockItemFilesMaker(jsonenc encoder.Encoder) *BlockItemFilesMaker
func (*BlockItemFilesMaker) Bytes ¶
func (f *BlockItemFilesMaker) Bytes() ([]byte, error)
func (*BlockItemFilesMaker) Files ¶
func (f *BlockItemFilesMaker) Files() BlockItemFiles
func (*BlockItemFilesMaker) Save ¶
func (f *BlockItemFilesMaker) Save(s string) error
func (*BlockItemFilesMaker) SetItem ¶
func (f *BlockItemFilesMaker) SetItem(t base.BlockItemType, i base.BlockItemFile) (bool, error)
type BlockItemReader ¶
type BlockItemReaderCallbackFunc ¶
type BlockItemReaderCallbackFunc func(BlockItemReader) error
type BlockItemReaderFunc ¶
type BlockItemReaderFunc func( base.Height, base.BlockItemType, BlockItemReaderCallbackFunc, ) (bool, error)
type BlockItemReaders ¶
type BlockItemReaders struct { *hint.CompatibleSet[NewBlockItemReaderFunc] *util.ContextDaemon *logging.Logging // contains filtered or unexported fields }
func NewBlockItemReaders ¶
func NewBlockItemReaders( root string, encs *encoder.Encoders, args *BlockItemReadersArgs, ) *BlockItemReaders
func (*BlockItemReaders) Add ¶
func (rs *BlockItemReaders) Add(writerhint hint.Hint, v NewBlockItemReaderFunc) error
func (*BlockItemReaders) Close ¶
func (rs *BlockItemReaders) Close()
func (*BlockItemReaders) Item ¶
func (rs *BlockItemReaders) Item( height base.Height, t base.BlockItemType, callback BlockItemReaderCallbackFunc, ) (base.BlockItemFile, bool, error)
func (*BlockItemReaders) ItemFile ¶
func (rs *BlockItemReaders) ItemFile(height base.Height, t base.BlockItemType) (base.BlockItemFile, bool, error)
func (*BlockItemReaders) ItemFiles ¶
func (rs *BlockItemReaders) ItemFiles(height base.Height) (base.BlockItemFiles, bool, error)
func (*BlockItemReaders) ItemFilesReader ¶
func (*BlockItemReaders) ItemFromReader ¶
func (rs *BlockItemReaders) ItemFromReader( t base.BlockItemType, r io.Reader, compressFormat string, callback BlockItemReaderCallbackFunc, ) error
func (*BlockItemReaders) ReadFileFromItemFile ¶
func (rs *BlockItemReaders) ReadFileFromItemFile(height base.Height, bfile base.BlockItemFile) (*os.File, bool, error)
func (*BlockItemReaders) Root ¶
func (rs *BlockItemReaders) Root() string
func (*BlockItemReaders) WriteItemFiles ¶
type BlockItemReadersArgs ¶
type BlockItemReadersArgs struct { DecompressReaderFunc util.DecompressReaderFunc LoadEmptyHeightsFunc func() ([]base.Height, error) AddEmptyHeightFunc func(base.Height) error CancelAddedEmptyHeightFunc func(base.Height) error RemoveEmptyAfter func() time.Duration RemoveEmptyInterval func() time.Duration WhenBlockItemFilesUpdated func(prev base.BlockItemFiles, updated base.BlockItemFiles) WhenEmptyHeightDirectoryRemoved func(base.Height) }
func NewBlockItemReadersArgs ¶
func NewBlockItemReadersArgs() *BlockItemReadersArgs
type BlockItemReadersFromReaderFunc ¶
type BlockItemReadersFromReaderFunc func( _ base.BlockItemType, _ io.Reader, compressFormat string, _ BlockItemReaderCallbackFunc, ) error
type BlockItemReadersItemFunc ¶
type BlockItemReadersItemFunc func( base.Height, base.BlockItemType, BlockItemReaderCallbackFunc, ) (base.BlockItemFile, bool, error)
type BlockReader ¶
type BlockReader interface { BlockMap() (base.BlockMap, bool, error) BlockItemFiles() (base.BlockItemFiles, bool, error) Reader(base.BlockItemType) (io.ReadCloser, bool, error) ChecksumReader(base.BlockItemType) (util.ChecksumReader, bool, error) Item(base.BlockItemType) (interface{}, bool, error) Items(func(base.BlockMapItem, interface{}, bool, error) bool) error }
type BlockWriteDatabase ¶
type BlockWriteDatabase interface { Close() error Cancel() error BlockMap() (base.BlockMap, error) SetBlockMap(base.BlockMap) error SetStates(sts []base.State) error SetOperations(ops []util.Hash) error // NOTE operation hash, not operation fact hash SetSuffrageProof(base.SuffrageProof) error SuffrageState() base.State NetworkPolicy() base.NetworkPolicy Write() error TempDatabase() (TempDatabase, error) }
type BlockWriter ¶
type BlockWriter interface { SetOperationsSize(uint64) SetProcessResult( _ context.Context, index uint64, ophash, facthash util.Hash, instate bool, errorreason base.OperationProcessReasonError, ) error SetStates(_ context.Context, index uint64, values []base.StateMergeValue, operation base.Operation) error Manifest(_ context.Context, previous base.Manifest) (base.Manifest, error) SetINITVoteproof(context.Context, base.INITVoteproof) error SetACCEPTVoteproof(context.Context, base.ACCEPTVoteproof) error Save(context.Context) (base.BlockMap, error) Cancel() error }
type Database ¶
type Database interface { util.Daemon Close() error BlockMap(height base.Height) (base.BlockMap, bool, error) BlockMapBytes(base.Height) (string, []byte, []byte, bool, error) LastBlockMap() (base.BlockMap, bool, error) LastBlockMapBytes() (string, []byte, []byte, bool, error) LastSuffrageProof() (base.SuffrageProof, bool, error) LastSuffrageProofBytes() (string, []byte, []byte, bool, base.Height, error) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error) SuffrageProofBytes(suffrageHeight base.Height) (string, []byte, []byte, bool, error) SuffrageProofByBlockHeight(blockheight base.Height) (base.SuffrageProof, bool, error) LastNetworkPolicy() base.NetworkPolicy State(key string) (base.State, bool, error) StateBytes(key string) (string, []byte, []byte, bool, error) // NOTE ExistsInStateOperation has only operation facts, which is in state ExistsInStateOperation(operationFactHash util.Hash) (bool, error) // NOTE ExistsKnownOperation has the known operation hashes ExistsKnownOperation(operationHash util.Hash) (bool, error) NewBlockWriteDatabase(height base.Height) (BlockWriteDatabase, error) MergeBlockWriteDatabase(BlockWriteDatabase) error MergeAllPermanent() error RemoveBlocks(base.Height) (bool, error) }
Database serves some of block items like blockmap, states and operations from TempDatabases and PermanentDatabase. It has several TempDatabases and one PermanentDatabase.
type DefaultProposalProcessor ¶
func NewDefaultProposalProcessor ¶
func NewDefaultProposalProcessor( proposal base.ProposalSignFact, previous base.Manifest, args *DefaultProposalProcessorArgs, ) (*DefaultProposalProcessor, error)
func (*DefaultProposalProcessor) Cancel ¶
func (p *DefaultProposalProcessor) Cancel() error
func (*DefaultProposalProcessor) Process ¶
func (p *DefaultProposalProcessor) Process(ctx context.Context, ivp base.INITVoteproof) (base.Manifest, error)
func (*DefaultProposalProcessor) Proposal ¶
func (p *DefaultProposalProcessor) Proposal() base.ProposalSignFact
func (*DefaultProposalProcessor) Save ¶
func (p *DefaultProposalProcessor) Save(ctx context.Context, avp base.ACCEPTVoteproof) (base.BlockMap, error)
type DefaultProposalProcessorArgs ¶
type DefaultProposalProcessorArgs struct { NewWriterFunc NewBlockWriterFunc GetStateFunc base.GetStateFunc GetOperationFunc OperationProcessorGetOperationFunction NewOperationProcessorFunc NewOperationProcessorFunc EmptyProposalNoBlockFunc func() bool MaxWorkerSize int64 }
func NewDefaultProposalProcessorArgs ¶
func NewDefaultProposalProcessorArgs() *DefaultProposalProcessorArgs
type EmptyOperationsACCEPTBallotFact ¶
type EmptyOperationsACCEPTBallotFact struct {
ACCEPTBallotFact
}
func NewEmptyOperationsACCEPTBallotFact ¶
func NewEmptyOperationsACCEPTBallotFact( point base.Point, proposal util.Hash, ) EmptyOperationsACCEPTBallotFact
func (EmptyOperationsACCEPTBallotFact) ExpelFacts ¶
func (EmptyOperationsACCEPTBallotFact) Point ¶
func (fact EmptyOperationsACCEPTBallotFact) Point() base.StagePoint
type EmptyProposalINITBallotFact ¶
type EmptyProposalINITBallotFact struct { INITBallotFact // contains filtered or unexported fields }
func NewEmptyProposalINITBallotFact ¶
func NewEmptyProposalINITBallotFact( point base.Point, previousBlock, proposal util.Hash, ) EmptyProposalINITBallotFact
func (*EmptyProposalINITBallotFact) DecodeJSON ¶
func (fact *EmptyProposalINITBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (EmptyProposalINITBallotFact) ExpelFacts ¶
func (EmptyProposalINITBallotFact) IsValid ¶
func (fact EmptyProposalINITBallotFact) IsValid([]byte) error
func (EmptyProposalINITBallotFact) MarshalJSON ¶
func (fact EmptyProposalINITBallotFact) MarshalJSON() ([]byte, error)
func (EmptyProposalINITBallotFact) Point ¶
func (fact EmptyProposalINITBallotFact) Point() base.StagePoint
type EmptyProposalINITBallotFactJSONMarshaler ¶
type EmptyProposalINITBallotFactJSONMarshaler struct { R string `json:"r"` INITBallotFactJSONMarshaler }
type ExpelBallotFact ¶
type FixedSuffrageCandidateLimiterRule ¶
type FixedSuffrageCandidateLimiterRule struct { hint.BaseHinter // contains filtered or unexported fields }
func NewFixedSuffrageCandidateLimiterRule ¶
func NewFixedSuffrageCandidateLimiterRule(limit uint64) FixedSuffrageCandidateLimiterRule
func (FixedSuffrageCandidateLimiterRule) HashBytes ¶
func (l FixedSuffrageCandidateLimiterRule) HashBytes() []byte
func (FixedSuffrageCandidateLimiterRule) IsValid ¶
func (l FixedSuffrageCandidateLimiterRule) IsValid([]byte) error
func (FixedSuffrageCandidateLimiterRule) Limit ¶
func (l FixedSuffrageCandidateLimiterRule) Limit() uint64
func (FixedSuffrageCandidateLimiterRule) MarshalJSON ¶
func (l FixedSuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
func (*FixedSuffrageCandidateLimiterRule) UnmarshalJSON ¶
func (l *FixedSuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
type FuncProposerSelector ¶
type FuncProposerSelector struct {
// contains filtered or unexported fields
}
type INITBallot ¶
type INITBallot struct {
// contains filtered or unexported fields
}
func NewINITBallot ¶
func NewINITBallot( vp base.Voteproof, signfact INITBallotSignFact, expels []base.SuffrageExpelOperation, ) INITBallot
func (INITBallot) BallotSignFact ¶
func (bl INITBallot) BallotSignFact() base.INITBallotSignFact
func (*INITBallot) DecodeJSON ¶
func (INITBallot) Expels ¶
func (bl INITBallot) Expels() []base.SuffrageExpelOperation
func (INITBallot) IsValid ¶
func (bl INITBallot) IsValid(networkID []byte) error
func (INITBallot) MarshalJSON ¶
func (INITBallot) Point ¶
func (bl INITBallot) Point() base.StagePoint
func (INITBallot) SignFact ¶
func (bl INITBallot) SignFact() base.BallotSignFact
type INITBallotFact ¶
type INITBallotFact struct {
// contains filtered or unexported fields
}
func NewINITBallotFact ¶
func (*INITBallotFact) DecodeJSON ¶
func (fact *INITBallotFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (INITBallotFact) ExpelFacts ¶
func (INITBallotFact) IsValid ¶
func (fact INITBallotFact) IsValid([]byte) error
func (INITBallotFact) MarshalJSON ¶
func (fact INITBallotFact) MarshalJSON() ([]byte, error)
func (INITBallotFact) Point ¶
func (fact INITBallotFact) Point() base.StagePoint
func (INITBallotFact) PreviousBlock ¶
func (fact INITBallotFact) PreviousBlock() util.Hash
func (INITBallotFact) Proposal ¶
func (fact INITBallotFact) Proposal() util.Hash
type INITBallotFactJSONUnmarshaler ¶
type INITBallotFactJSONUnmarshaler struct { PreviousBlock valuehash.HashDecoder `json:"previous_block"` Proposal valuehash.HashDecoder `json:"proposal"` // contains filtered or unexported fields }
type INITBallotSignFact ¶
type INITBallotSignFact struct {
// contains filtered or unexported fields
}
func NewINITBallotSignFact ¶
func NewINITBallotSignFact(fact base.INITBallotFact) INITBallotSignFact
func (INITBallotSignFact) BallotFact ¶
func (sf INITBallotSignFact) BallotFact() base.INITBallotFact
func (*INITBallotSignFact) DecodeJSON ¶
func (INITBallotSignFact) IsValid ¶
func (sf INITBallotSignFact) IsValid(networkID []byte) error
func (INITBallotSignFact) MarshalJSON ¶
type INITExpelVoteproof ¶
type INITExpelVoteproof struct { INITVoteproof // contains filtered or unexported fields }
func NewINITExpelVoteproof ¶
func NewINITExpelVoteproof(point base.Point) INITExpelVoteproof
func (*INITExpelVoteproof) DecodeJSON ¶
func (vp *INITExpelVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
func (INITExpelVoteproof) Expels ¶
func (vp INITExpelVoteproof) Expels() []base.SuffrageExpelOperation
func (INITExpelVoteproof) FinishedAt ¶
func (INITExpelVoteproof) HashBytes ¶
func (vp INITExpelVoteproof) HashBytes() []byte
func (INITExpelVoteproof) IsExpelVoteproof ¶
func (INITExpelVoteproof) IsExpelVoteproof() bool
func (INITExpelVoteproof) IsValid ¶
func (vp INITExpelVoteproof) IsValid(networkID []byte) error
func (INITExpelVoteproof) Majority ¶
func (vp INITExpelVoteproof) Majority() base.BallotFact
func (INITExpelVoteproof) MarshalJSON ¶
func (vp INITExpelVoteproof) MarshalJSON() ([]byte, error)
func (INITExpelVoteproof) Point ¶
func (vp INITExpelVoteproof) Point() base.StagePoint
func (INITExpelVoteproof) Result ¶
func (vp INITExpelVoteproof) Result() base.VoteResult
func (*INITExpelVoteproof) SetExpels ¶
func (vp *INITExpelVoteproof) SetExpels(expels []base.SuffrageExpelOperation) *baseExpelVoteproof
func (*INITExpelVoteproof) SetMajority ¶
func (vp *INITExpelVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*INITExpelVoteproof) SetPoint ¶
func (vp *INITExpelVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*INITExpelVoteproof) SetSignFacts ¶
func (vp *INITExpelVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*INITExpelVoteproof) SetThreshold ¶
func (INITExpelVoteproof) SignFacts ¶
func (vp INITExpelVoteproof) SignFacts() []base.BallotSignFact
type INITStuckVoteproof ¶
type INITStuckVoteproof struct { INITVoteproof // contains filtered or unexported fields }
func NewINITStuckVoteproof ¶
func NewINITStuckVoteproof(point base.Point) INITStuckVoteproof
func (*INITStuckVoteproof) DecodeJSON ¶
func (vp *INITStuckVoteproof) DecodeJSON(b []byte, enc encoder.Encoder) error
func (*INITStuckVoteproof) Finish ¶
func (vp *INITStuckVoteproof) Finish() *INITStuckVoteproof
func (INITStuckVoteproof) FinishedAt ¶
func (INITStuckVoteproof) IsStuckVoteproof ¶
func (INITStuckVoteproof) IsStuckVoteproof() bool
func (INITStuckVoteproof) IsValid ¶
func (vp INITStuckVoteproof) IsValid(networkID []byte) error
func (INITStuckVoteproof) Majority ¶
func (vp INITStuckVoteproof) Majority() base.BallotFact
func (INITStuckVoteproof) MarshalJSON ¶
func (vp INITStuckVoteproof) MarshalJSON() ([]byte, error)
func (INITStuckVoteproof) Point ¶
func (vp INITStuckVoteproof) Point() base.StagePoint
func (INITStuckVoteproof) Result ¶
func (vp INITStuckVoteproof) Result() base.VoteResult
func (*INITStuckVoteproof) SetMajority ¶
func (vp *INITStuckVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*INITStuckVoteproof) SetPoint ¶
func (vp *INITStuckVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*INITStuckVoteproof) SetSignFacts ¶
func (vp *INITStuckVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*INITStuckVoteproof) SetThreshold ¶
func (INITStuckVoteproof) SignFacts ¶
func (vp INITStuckVoteproof) SignFacts() []base.BallotSignFact
type INITVoteproof ¶
type INITVoteproof struct {
// contains filtered or unexported fields
}
func NewINITVoteproof ¶
func NewINITVoteproof(point base.Point) INITVoteproof
func (INITVoteproof) BallotMajority ¶
func (vp INITVoteproof) BallotMajority() base.INITBallotFact
func (INITVoteproof) BallotSignFacts ¶
func (vp INITVoteproof) BallotSignFacts() []base.INITBallotSignFact
func (*INITVoteproof) DecodeJSON ¶
func (INITVoteproof) FinishedAt ¶
func (INITVoteproof) IsValid ¶
func (vp INITVoteproof) IsValid(networkID []byte) error
func (INITVoteproof) Majority ¶
func (vp INITVoteproof) Majority() base.BallotFact
func (INITVoteproof) MarshalJSON ¶
func (INITVoteproof) Point ¶
func (vp INITVoteproof) Point() base.StagePoint
func (INITVoteproof) Result ¶
func (vp INITVoteproof) Result() base.VoteResult
func (*INITVoteproof) SetMajority ¶
func (vp *INITVoteproof) SetMajority(fact base.BallotFact) *baseVoteproof
func (*INITVoteproof) SetPoint ¶
func (vp *INITVoteproof) SetPoint(p base.StagePoint) *baseVoteproof
func (*INITVoteproof) SetSignFacts ¶
func (vp *INITVoteproof) SetSignFacts(sfs []base.BallotSignFact) *baseVoteproof
func (*INITVoteproof) SetThreshold ¶
func (INITVoteproof) SignFacts ¶
func (vp INITVoteproof) SignFacts() []base.BallotSignFact
type LastConsensusNodesWatcher ¶
type LastConsensusNodesWatcher struct { *util.ContextDaemon *logging.Logging // contains filtered or unexported fields }
func NewLastConsensusNodesWatcher ¶
func NewLastConsensusNodesWatcher( getFromLocal func() (base.Height, base.SuffrageProof, base.State, bool, error), getFromRemote func(context.Context, base.State) (base.Height, []base.SuffrageProof, base.State, error), whenUpdatedf func(context.Context, base.SuffrageProof, base.SuffrageProof, base.State), checkInterval time.Duration, ) (*LastConsensusNodesWatcher, error)
func (*LastConsensusNodesWatcher) GetSuffrage ¶
func (*LastConsensusNodesWatcher) Last ¶
func (u *LastConsensusNodesWatcher) Last() (base.SuffrageProof, base.State, error)
func (*LastConsensusNodesWatcher) SetWhenUpdated ¶
func (u *LastConsensusNodesWatcher) SetWhenUpdated( whenUpdated func(context.Context, base.SuffrageProof, base.SuffrageProof, base.State), )
type LastPoint ¶
type LastPoint struct { base.StagePoint // contains filtered or unexported fields }
func NewLastPoint ¶
func NewLastPoint( point base.StagePoint, isMajority, isSuffrageConfirm bool, ) (LastPoint, error)
func (LastPoint) Before ¶
func (l LastPoint) Before( point base.StagePoint, isSuffrageConfirm bool, ) bool
func (LastPoint) IsMajority ¶
func (LastPoint) IsSuffrageConfirm ¶
type LastVoteproofs ¶
type LastVoteproofs struct {
// contains filtered or unexported fields
}
func (LastVoteproofs) ACCEPT ¶
func (l LastVoteproofs) ACCEPT() base.ACCEPTVoteproof
func (LastVoteproofs) Cap ¶
func (l LastVoteproofs) Cap() base.Voteproof
func (LastVoteproofs) INIT ¶
func (l LastVoteproofs) INIT() base.INITVoteproof
func (LastVoteproofs) Majority ¶
func (l LastVoteproofs) Majority() base.Voteproof
func (LastVoteproofs) PreviousBlockForNextRound ¶
func (l LastVoteproofs) PreviousBlockForNextRound(vp base.Voteproof) util.Hash
PreviousBlockForNextRound finds the previous block hash from last majority voteproof.
-------------------------------------- | m | v | | heights | -------------------------------------- | init | init | X | | | accept | init | O | m == v - 1 | | init | accept | O | m == v | | accept | accept | O | m == v - 1 | --------------------------------------
* 'm' is last majority voteproof * 'v' is draw voteproof, new incoming voteproof for next round
type LastVoteproofsHandler ¶
type LastVoteproofsHandler struct {
// contains filtered or unexported fields
}
func NewLastVoteproofsHandler ¶
func NewLastVoteproofsHandler() *LastVoteproofsHandler
func (*LastVoteproofsHandler) ForceSetLast ¶
func (l *LastVoteproofsHandler) ForceSetLast(vp base.Voteproof) bool
func (*LastVoteproofsHandler) Last ¶
func (l *LastVoteproofsHandler) Last() LastVoteproofs
func (*LastVoteproofsHandler) Voteproofs ¶
func (l *LastVoteproofsHandler) Voteproofs(point base.StagePoint) (LastVoteproofs, bool)
type LocalNode ¶
type LocalNode struct {
base.BaseLocalNode
}
func NewLocalNode ¶
func NewLocalNode(priv base.Privatekey, addr base.Address) LocalNode
type MajoritySuffrageCandidateLimiterRule ¶
type MajoritySuffrageCandidateLimiterRule struct { hint.BaseHinter // contains filtered or unexported fields }
func NewMajoritySuffrageCandidateLimiterRule ¶
func NewMajoritySuffrageCandidateLimiterRule(ratio float64, minv, maxv uint64) MajoritySuffrageCandidateLimiterRule
func (MajoritySuffrageCandidateLimiterRule) HashBytes ¶
func (l MajoritySuffrageCandidateLimiterRule) HashBytes() []byte
func (MajoritySuffrageCandidateLimiterRule) IsValid ¶
func (l MajoritySuffrageCandidateLimiterRule) IsValid([]byte) error
func (MajoritySuffrageCandidateLimiterRule) MarshalJSON ¶
func (l MajoritySuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
func (MajoritySuffrageCandidateLimiterRule) Max ¶
func (l MajoritySuffrageCandidateLimiterRule) Max() uint64
func (MajoritySuffrageCandidateLimiterRule) Min ¶
func (l MajoritySuffrageCandidateLimiterRule) Min() uint64
func (MajoritySuffrageCandidateLimiterRule) Ratio ¶
func (l MajoritySuffrageCandidateLimiterRule) Ratio() float64
func (*MajoritySuffrageCandidateLimiterRule) UnmarshalJSON ¶
func (l *MajoritySuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
type Manifest ¶
type Manifest struct { hint.BaseHinter // contains filtered or unexported fields }
func NewManifest ¶
func (Manifest) MarshalJSON ¶
func (Manifest) OperationsTree ¶
func (Manifest) ProposedAt ¶
func (Manifest) StatesTree ¶
func (*Manifest) UnmarshalJSON ¶
type ManifestJSONMarshaler ¶
type ManifestJSONMarshaler struct { ProposedAt time.Time `json:"proposed_at"` StatesTree util.Hash `json:"states_tree"` Hash util.Hash `json:"hash"` Previous util.Hash `json:"previous"` Proposal util.Hash `json:"proposal"` OperationsTree util.Hash `json:"operations_tree"` Suffrage util.Hash `json:"suffrage"` hint.BaseHinter Height base.Height `json:"height"` }
type ManifestJSONUnmarshaler ¶
type ManifestJSONUnmarshaler struct { ProposedAt localtime.Time `json:"proposed_at"` Hash valuehash.HashDecoder `json:"hash"` Previous valuehash.HashDecoder `json:"previous"` Proposal valuehash.HashDecoder `json:"proposal"` OperationsTree valuehash.HashDecoder `json:"operations_tree"` StatesTree valuehash.HashDecoder `json:"states_tree"` Suffrage valuehash.HashDecoder `json:"suffrage"` Height base.HeightDecoder `json:"height"` }
type NetworkClient ¶
type NetworkClient interface { // revive:disable:line-length-limit Operation(_ context.Context, _ quicstream.ConnInfo, operationhash util.Hash) (base.Operation, bool, error) SendOperation(context.Context, quicstream.ConnInfo, base.Operation) (bool, error) RequestProposal(_ context.Context, connInfo quicstream.ConnInfo, point base.Point, proposer base.Address, previousBlock util.Hash) (base.ProposalSignFact, bool, error) Proposal(_ context.Context, connInfo quicstream.ConnInfo, facthash util.Hash) (base.ProposalSignFact, bool, error) LastSuffrageProof(_ context.Context, connInfo quicstream.ConnInfo, state util.Hash) (lastheight base.Height, _ base.SuffrageProof, updated bool, _ error) SuffrageProof(_ context.Context, connInfo quicstream.ConnInfo, suffrageheight base.Height) (_ base.SuffrageProof, found bool, _ error) LastBlockMap(_ context.Context, _ quicstream.ConnInfo, manifest util.Hash) (_ base.BlockMap, updated bool, _ error) BlockMap(context.Context, quicstream.ConnInfo, base.Height) (_ base.BlockMap, updated bool, _ error) BlockItem(context.Context, quicstream.ConnInfo, base.Height, base.BlockItemType, func(_ io.Reader, uri url.URL, compressFormat string) error) (bool, error) BlockItemFiles(context.Context, quicstream.ConnInfo, base.Height, base.Privatekey, base.NetworkID, func(_ io.Reader) error) (found bool, _ error) NodeChallenge(_ context.Context, _ quicstream.ConnInfo, _ base.NetworkID, _ base.Address, _ base.Publickey, input []byte, me base.LocalNode) (base.Signature, error) SuffrageNodeConnInfo(context.Context, quicstream.ConnInfo) ([]NodeConnInfo, error) SyncSourceConnInfo(context.Context, quicstream.ConnInfo) ([]NodeConnInfo, error) State(_ context.Context, _ quicstream.ConnInfo, key string, _ util.Hash) (base.State, bool, error) ExistsInStateOperation(_ context.Context, _ quicstream.ConnInfo, facthash util.Hash) (bool, error) }
type NetworkPolicy ¶
type NetworkPolicy struct { hint.BaseHinter // contains filtered or unexported fields }
func DefaultNetworkPolicy ¶
func DefaultNetworkPolicy() NetworkPolicy
func (*NetworkPolicy) DecodeJSON ¶
func (p *NetworkPolicy) DecodeJSON(b []byte, enc encoder.Encoder) error
func (NetworkPolicy) EmptyProposalNoBlock ¶
func (p NetworkPolicy) EmptyProposalNoBlock() bool
func (NetworkPolicy) HashBytes ¶
func (p NetworkPolicy) HashBytes() []byte
func (NetworkPolicy) IsValid ¶
func (p NetworkPolicy) IsValid([]byte) error
func (NetworkPolicy) MarshalJSON ¶
func (p NetworkPolicy) MarshalJSON() ([]byte, error)
func (NetworkPolicy) MaxOperationsInProposal ¶
func (p NetworkPolicy) MaxOperationsInProposal() uint64
func (NetworkPolicy) MaxSuffrageSize ¶
func (p NetworkPolicy) MaxSuffrageSize() uint64
func (*NetworkPolicy) SetEmptyProposalNoBlock ¶
func (p *NetworkPolicy) SetEmptyProposalNoBlock(i bool) NetworkPolicy
func (*NetworkPolicy) SetMaxOperationsInProposal ¶
func (p *NetworkPolicy) SetMaxOperationsInProposal(i uint64) NetworkPolicy
func (*NetworkPolicy) SetMaxSuffrageSize ¶
func (p *NetworkPolicy) SetMaxSuffrageSize(i uint64) NetworkPolicy
func (*NetworkPolicy) SetSuffrageCandidateLifespan ¶
func (p *NetworkPolicy) SetSuffrageCandidateLifespan(i base.Height) NetworkPolicy
func (*NetworkPolicy) SetSuffrageCandidateLimiterRule ¶
func (p *NetworkPolicy) SetSuffrageCandidateLimiterRule(i base.SuffrageCandidateLimiterRule) NetworkPolicy
func (*NetworkPolicy) SetSuffrageExpelLifespan ¶
func (p *NetworkPolicy) SetSuffrageExpelLifespan(i base.Height) NetworkPolicy
func (NetworkPolicy) SuffrageCandidateLifespan ¶
func (p NetworkPolicy) SuffrageCandidateLifespan() base.Height
func (NetworkPolicy) SuffrageCandidateLimiterRule ¶
func (p NetworkPolicy) SuffrageCandidateLimiterRule() base.SuffrageCandidateLimiterRule
func (NetworkPolicy) SuffrageExpelLifespan ¶
func (p NetworkPolicy) SuffrageExpelLifespan() base.Height
type NetworkPolicyStateValue ¶
type NetworkPolicyStateValue struct { hint.BaseHinter // contains filtered or unexported fields }
func NewNetworkPolicyStateValue ¶
func NewNetworkPolicyStateValue(policy base.NetworkPolicy) NetworkPolicyStateValue
func (*NetworkPolicyStateValue) DecodeJSON ¶
func (s *NetworkPolicyStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (NetworkPolicyStateValue) HashBytes ¶
func (s NetworkPolicyStateValue) HashBytes() []byte
func (NetworkPolicyStateValue) IsValid ¶
func (s NetworkPolicyStateValue) IsValid([]byte) error
func (NetworkPolicyStateValue) MarshalJSON ¶
func (s NetworkPolicyStateValue) MarshalJSON() ([]byte, error)
func (NetworkPolicyStateValue) Policy ¶
func (s NetworkPolicyStateValue) Policy() base.NetworkPolicy
type NetworkPolicyStateValueJSONMarshaler ¶
type NetworkPolicyStateValueJSONMarshaler struct { Policy base.NetworkPolicy `json:"policy"` hint.BaseHinter }
type NetworkPolicyStateValueJSONUnmarshaler ¶
type NetworkPolicyStateValueJSONUnmarshaler struct {
Policy json.RawMessage `json:"policy"`
}
type NewBlockItemReaderFunc ¶
type NewBlockItemReaderFunc func( base.BlockItemType, encoder.Encoder, *util.CompressedReader, ) (BlockItemReader, error)
type NewBlockWriterFunc ¶
type NewBlockWriterFunc func(base.ProposalSignFact, base.GetStateFunc) (BlockWriter, error)
type NewOperationPool ¶
type NewOperationPool interface { Operation(_ context.Context, operationhash util.Hash) (base.Operation, bool, error) OperationBytes(_ context.Context, operationhash util.Hash) (string, []byte, []byte, bool, error) OperationHashes( _ context.Context, _ base.Height, limit uint64, filter func(PoolOperationRecordMeta) (ok bool, err error), ) ([][2]util.Hash, error) SetOperation(context.Context, base.Operation) (bool, error) }
type NewOperationProcessorFunc ¶
type NewOperationProcessorFunc func(base.Height, hint.Hint, base.GetStateFunc) (base.OperationProcessor, error)
type NewOperationProcessorInternalFunc ¶
type NewOperationProcessorInternalFunc func(base.Height, base.GetStateFunc) (base.OperationProcessor, error)
type NodeConnInfo ¶
type NotProcessedACCEPTBallotFact ¶
type NotProcessedACCEPTBallotFact struct {
ACCEPTBallotFact
}
func NewNotProcessedACCEPTBallotFact ¶
func NewNotProcessedACCEPTBallotFact( point base.Point, proposal util.Hash, ) NotProcessedACCEPTBallotFact
func (NotProcessedACCEPTBallotFact) ExpelFacts ¶
func (NotProcessedACCEPTBallotFact) Point ¶
func (fact NotProcessedACCEPTBallotFact) Point() base.StagePoint
type OperationProcessHandler ¶
type OperationProcessorGetOperationFunction ¶
type OperationProcessorGetOperationFunction func(_ context.Context, operationhash, fact util.Hash) ( base.Operation, error)
OperationProcessorGetOperationFunction works, - if operation is invalid, getOperation should return nil, ErrInvalidOperationInProcessor; it will be not processed and it's fact hash will be stored. - if operation not found in remote, getOperation should return nil, ErrOperationNotFoundInProcessor; it will be ignored. - if operation is known, return nil, ErrOperationAlreadyProcessedInProcessor; it will be ignored. - if operation fact not match with fact in proposal, return ErrNotProposalProcessorProcessed; it will stop processing proposal and makes wrong ACCEPT ballot for next round.
type Params ¶
type Params struct { *util.BaseParams hint.BaseHinter // contains filtered or unexported fields }
func DefaultParams ¶
func (*Params) BallotStuckResolveAfter ¶
func (*Params) BallotStuckWait ¶
func (*Params) IntervalBroadcastBallot ¶
func (*Params) MarshalJSON ¶
func (*Params) MaxTryHandoverYBrokerSyncData ¶
func (*Params) MinWaitNextBlockINITBallot ¶
MinWaitNextBlockINITBallot is used for waiting until the proposer creates new block for new proposal; Too short MinWaitNextBlockINITBallot may cause empty proposal.
func (*Params) OperationPoolCacheSize ¶
func (*Params) SetBallotStuckResolveAfter ¶
func (*Params) SetIntervalBroadcastBallot ¶
func (*Params) SetMaxTryHandoverYBrokerSyncData ¶
func (*Params) SetMinWaitNextBlockINITBallot ¶
func (*Params) SetOperationPoolCacheSize ¶
func (*Params) SetStateCacheSize ¶
func (*Params) SetWaitPreparingINITBallot ¶
func (*Params) StateCacheSize ¶
func (*Params) UnmarshalJSON ¶
func (*Params) WaitPreparingINITBallot ¶
type PermanentDatabase ¶
type PermanentDatabase interface { BaseDatabase Close() error Clean() error LastBlockMap() (base.BlockMap, bool, error) LastBlockMapBytes() (string, []byte, []byte, bool, error) LastSuffrageProof() (base.SuffrageProof, bool, error) LastSuffrageProofBytes() (string, []byte, []byte, bool, error) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error) SuffrageProofBytes(suffrageHeight base.Height) (string, []byte, []byte, bool, error) SuffrageProofByBlockHeight(blockheight base.Height) (base.SuffrageProof, bool, error) BlockMap(base.Height) (base.BlockMap, bool, error) BlockMapBytes(base.Height) (string, []byte, []byte, bool, error) LastNetworkPolicy() base.NetworkPolicy MergeTempDatabase(context.Context, TempDatabase) error }
PermanentDatabase stores some of block items permanently.
type PoolOperationRecordMeta ¶
type ProposalFact ¶
func NewProposalFact ¶
func (*ProposalFact) DecodeJSON ¶
func (fact *ProposalFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (ProposalFact) IsValid ¶
func (fact ProposalFact) IsValid([]byte) error
func (ProposalFact) MarshalJSON ¶
func (fact ProposalFact) MarshalJSON() ([]byte, error)
func (ProposalFact) Operations ¶
func (fact ProposalFact) Operations() [][2]util.Hash
func (ProposalFact) Point ¶
func (fact ProposalFact) Point() base.Point
func (ProposalFact) PreviousBlock ¶
func (fact ProposalFact) PreviousBlock() util.Hash
func (ProposalFact) ProposedAt ¶
func (fact ProposalFact) ProposedAt() time.Time
func (ProposalFact) Proposer ¶
func (fact ProposalFact) Proposer() base.Address
type ProposalMaker ¶
func NewProposalMaker ¶
func (*ProposalMaker) Make ¶
func (p *ProposalMaker) Make( ctx context.Context, point base.Point, previousBlock util.Hash, ) (base.ProposalSignFact, error)
func (*ProposalMaker) PreferEmpty ¶
func (p *ProposalMaker) PreferEmpty( ctx context.Context, point base.Point, previousBlock util.Hash, ) (base.ProposalSignFact, error)
type ProposalPool ¶
type ProposalProcessor ¶
type ProposalProcessors ¶
func NewProposalProcessors ¶
func NewProposalProcessors( makenew func(base.ProposalSignFact, base.Manifest) (ProposalProcessor, error), getproposal func(context.Context, base.Point, util.Hash) (base.ProposalSignFact, error), ) *ProposalProcessors
func (*ProposalProcessors) Cancel ¶
func (pps *ProposalProcessors) Cancel() error
func (*ProposalProcessors) Process ¶
func (pps *ProposalProcessors) Process( ctx context.Context, point base.Point, facthash util.Hash, previous base.Manifest, ivp base.INITVoteproof, ) (ProcessorProcessFunc, error)
func (*ProposalProcessors) Processor ¶
func (pps *ProposalProcessors) Processor() ProposalProcessor
func (*ProposalProcessors) Save ¶
func (pps *ProposalProcessors) Save( ctx context.Context, facthash util.Hash, avp base.ACCEPTVoteproof, ) (base.BlockMap, error)
func (*ProposalProcessors) SetRetryInterval ¶
func (pps *ProposalProcessors) SetRetryInterval(i time.Duration) *ProposalProcessors
func (*ProposalProcessors) SetRetryLimit ¶
func (pps *ProposalProcessors) SetRetryLimit(l int) *ProposalProcessors
type ProposalSelectFunc ¶
type ProposalSignFact ¶
type ProposalSignFact struct { hint.BaseHinter // contains filtered or unexported fields }
func NewProposalSignFact ¶
func NewProposalSignFact(fact ProposalFact) ProposalSignFact
func (*ProposalSignFact) DecodeJSON ¶
func (sf *ProposalSignFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (ProposalSignFact) Fact ¶
func (sf ProposalSignFact) Fact() base.Fact
func (ProposalSignFact) HashBytes ¶
func (sf ProposalSignFact) HashBytes() []byte
func (ProposalSignFact) IsValid ¶
func (sf ProposalSignFact) IsValid(networkID []byte) error
func (ProposalSignFact) MarshalJSON ¶
func (sf ProposalSignFact) MarshalJSON() ([]byte, error)
func (ProposalSignFact) Point ¶
func (sf ProposalSignFact) Point() base.Point
func (ProposalSignFact) ProposalFact ¶
func (sf ProposalSignFact) ProposalFact() base.ProposalFact
func (*ProposalSignFact) Sign ¶
func (sf *ProposalSignFact) Sign(priv base.Privatekey, networkID base.NetworkID) error
func (ProposalSignFact) Signs ¶
func (sf ProposalSignFact) Signs() []base.Sign
type ProposerSelectFunc ¶
type ProposerSelectFunc func(context.Context, base.Point, []base.Node, util.Hash) (base.Node, error)
ProposerSelectFunc selects proposer between suffrage nodes. If failed to request proposal from remotes, local will be proposer.
type ReasonProcessedOperation ¶
func NewReasonProcessedOperation ¶
func NewReasonProcessedOperation( op, facthash util.Hash, reason base.OperationProcessReasonError, ) ReasonProcessedOperation
func (ReasonProcessedOperation) FactHash ¶
func (op ReasonProcessedOperation) FactHash() util.Hash
func (ReasonProcessedOperation) OperationHash ¶
func (op ReasonProcessedOperation) OperationHash() util.Hash
func (ReasonProcessedOperation) Reason ¶
func (op ReasonProcessedOperation) Reason() base.OperationProcessReasonError
type RemoteBlockItemReadFunc ¶
func HTTPBlockItemReadFunc ¶
func HTTPBlockItemReadFunc() RemoteBlockItemReadFunc
HTTPBlockItemReadFunc reads block item thru http, https. If there is `#https_insecure` fragment in url, connection has `InsecureSkipVerify` in tls.
type RemotesBlockItemReadFunc ¶
type RemotesBlockItemReadFunc func( _ context.Context, uri url.URL, compressFormat string, callback func(_ io.Reader, compressFormat string) error, ) (known, found bool, _ error)
func NewDefaultRemotesBlockItemReadFunc ¶
func NewDefaultRemotesBlockItemReadFunc() RemotesBlockItemReadFunc
type StateCacheSetter ¶
type Suffrage ¶
type Suffrage struct {
// contains filtered or unexported fields
}
func (Suffrage) ExistsPublickey ¶
func (Suffrage) MarshalJSON ¶
type SuffrageCandidateJSONUnmarshaler ¶
type SuffrageCandidateJSONUnmarshaler struct { Node json.RawMessage `json:"node"` Start base.HeightDecoder `json:"start"` Deadline base.HeightDecoder `json:"deadline"` }
type SuffrageCandidateStateValue ¶
type SuffrageCandidateStateValue struct { base.Node hint.BaseHinter // contains filtered or unexported fields }
func NewSuffrageCandidateStateValue ¶
func NewSuffrageCandidateStateValue(node base.Node, start, deadline base.Height) SuffrageCandidateStateValue
func (SuffrageCandidateStateValue) Deadline ¶
func (suf SuffrageCandidateStateValue) Deadline() base.Height
func (*SuffrageCandidateStateValue) DecodeJSON ¶
func (suf *SuffrageCandidateStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageCandidateStateValue) HashBytes ¶
func (suf SuffrageCandidateStateValue) HashBytes() []byte
func (SuffrageCandidateStateValue) IsValid ¶
func (suf SuffrageCandidateStateValue) IsValid([]byte) error
func (SuffrageCandidateStateValue) MarshalJSON ¶
func (suf SuffrageCandidateStateValue) MarshalJSON() ([]byte, error)
func (SuffrageCandidateStateValue) Start ¶
func (suf SuffrageCandidateStateValue) Start() base.Height
type SuffrageCandidatesStateValue ¶
type SuffrageCandidatesStateValue struct { hint.BaseHinter // contains filtered or unexported fields }
func NewSuffrageCandidatesStateValue ¶
func NewSuffrageCandidatesStateValue(nodes []base.SuffrageCandidateStateValue) SuffrageCandidatesStateValue
func (*SuffrageCandidatesStateValue) DecodeJSON ¶
func (s *SuffrageCandidatesStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageCandidatesStateValue) HashBytes ¶
func (s SuffrageCandidatesStateValue) HashBytes() []byte
func (SuffrageCandidatesStateValue) IsValid ¶
func (s SuffrageCandidatesStateValue) IsValid([]byte) error
func (SuffrageCandidatesStateValue) MarshalJSON ¶
func (s SuffrageCandidatesStateValue) MarshalJSON() ([]byte, error)
func (SuffrageCandidatesStateValue) Nodes ¶
func (s SuffrageCandidatesStateValue) Nodes() []base.SuffrageCandidateStateValue
type SuffrageConfirmBallotFact ¶
type SuffrageConfirmBallotFact struct {
INITBallotFact
}
func (SuffrageConfirmBallotFact) ExpelFacts ¶
func (SuffrageConfirmBallotFact) IsValid ¶
func (fact SuffrageConfirmBallotFact) IsValid([]byte) error
func (SuffrageConfirmBallotFact) Point ¶
func (fact SuffrageConfirmBallotFact) Point() base.StagePoint
type SuffrageExpelFact ¶
func NewSuffrageExpelFact ¶
func (*SuffrageExpelFact) DecodeJSON ¶
func (fact *SuffrageExpelFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageExpelFact) ExpelEnd ¶
func (fact SuffrageExpelFact) ExpelEnd() base.Height
func (SuffrageExpelFact) ExpelStart ¶
func (fact SuffrageExpelFact) ExpelStart() base.Height
func (SuffrageExpelFact) IsValid ¶
func (fact SuffrageExpelFact) IsValid([]byte) error
func (SuffrageExpelFact) MarshalJSON ¶
func (fact SuffrageExpelFact) MarshalJSON() ([]byte, error)
func (SuffrageExpelFact) Node ¶
func (fact SuffrageExpelFact) Node() base.Address
func (SuffrageExpelFact) Reason ¶
func (fact SuffrageExpelFact) Reason() string
type SuffrageExpelOperation ¶
type SuffrageExpelOperation struct {
base.BaseNodeOperation
}
func NewSuffrageExpelOperation ¶
func NewSuffrageExpelOperation(fact SuffrageExpelFact) SuffrageExpelOperation
func (SuffrageExpelOperation) ExpelFact ¶
func (op SuffrageExpelOperation) ExpelFact() base.SuffrageExpelFact
func (SuffrageExpelOperation) IsValid ¶
func (op SuffrageExpelOperation) IsValid(networkID []byte) error
func (SuffrageExpelOperation) NodeSigns ¶
func (op SuffrageExpelOperation) NodeSigns() []base.NodeSign
type SuffrageExpelPool ¶
type SuffrageExpelPool interface { SuffrageExpelOperation(base.Height, base.Address) (base.SuffrageExpelOperation, bool, error) SetSuffrageExpelOperation(base.SuffrageExpelOperation) error TraverseSuffrageExpelOperations( context.Context, base.Height, SuffrageVoteFunc, ) error RemoveSuffrageExpelOperationsByFact([]base.SuffrageExpelFact) error RemoveSuffrageExpelOperationsByHeight(base.Height) error }
type SuffrageNodeStateValue ¶
type SuffrageNodeStateValue struct { base.Node hint.BaseHinter // contains filtered or unexported fields }
func NewSuffrageNodeStateValue ¶
func NewSuffrageNodeStateValue(node base.Node, start base.Height) SuffrageNodeStateValue
func (*SuffrageNodeStateValue) DecodeJSON ¶
func (s *SuffrageNodeStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageNodeStateValue) HashBytes ¶
func (s SuffrageNodeStateValue) HashBytes() []byte
func (SuffrageNodeStateValue) Hint ¶
func (s SuffrageNodeStateValue) Hint() hint.Hint
func (SuffrageNodeStateValue) IsValid ¶
func (s SuffrageNodeStateValue) IsValid([]byte) error
func (SuffrageNodeStateValue) MarshalJSON ¶
func (s SuffrageNodeStateValue) MarshalJSON() ([]byte, error)
func (SuffrageNodeStateValue) Start ¶
func (s SuffrageNodeStateValue) Start() base.Height
type SuffrageNodesStateValue ¶
type SuffrageNodesStateValue struct { hint.BaseHinter // contains filtered or unexported fields }
func NewSuffrageNodesStateValue ¶
func NewSuffrageNodesStateValue( suffrageheight base.Height, nodes []base.SuffrageNodeStateValue, ) SuffrageNodesStateValue
func (*SuffrageNodesStateValue) DecodeJSON ¶
func (s *SuffrageNodesStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageNodesStateValue) HashBytes ¶
func (s SuffrageNodesStateValue) HashBytes() []byte
func (SuffrageNodesStateValue) Height ¶
func (s SuffrageNodesStateValue) Height() base.Height
func (SuffrageNodesStateValue) IsValid ¶
func (s SuffrageNodesStateValue) IsValid([]byte) error
func (SuffrageNodesStateValue) MarshalJSON ¶
func (s SuffrageNodesStateValue) MarshalJSON() ([]byte, error)
func (SuffrageNodesStateValue) Nodes ¶
func (s SuffrageNodesStateValue) Nodes() []base.SuffrageNodeStateValue
type SuffrageStateBuilder ¶
type SuffrageStateBuilder struct {
// contains filtered or unexported fields
}
SuffrageStateBuilder tries to sync suffrage states from remote nodes. It will rebuild the entire suffrage states history. SuffrageProof from getSuffrageProof should be valid(IsValid()).
func NewSuffrageStateBuilder ¶
func NewSuffrageStateBuilder( networkID base.NetworkID, lastSuffrageProof GetLastSuffrageProofFromRemoteFunc, getSuffrageProof GetSuffrageProofFromRemoteFunc, lastSuffrageCandidateState GetLastSuffrageCandidateStateRemoteFunc, ) *SuffrageStateBuilder
type SuffrageVoteFunc ¶
type SuffrageVoteFunc func(base.SuffrageExpelOperation) (bool, error)
type SuffrageVoting ¶
type SuffrageVoting struct {
// contains filtered or unexported fields
}
func NewSuffrageVoting ¶
func NewSuffrageVoting( local base.Address, db SuffrageExpelPool, existsInState func(util.Hash) (bool, error), votedCallback func(base.SuffrageExpelOperation) error, ) *SuffrageVoting
func (*SuffrageVoting) Find ¶
func (s *SuffrageVoting) Find( ctx context.Context, height base.Height, suf base.Suffrage, ) ([]base.SuffrageExpelOperation, error)
func (*SuffrageVoting) Vote ¶
func (s *SuffrageVoting) Vote(op base.SuffrageExpelOperation) (bool, error)
type SyncSourcePool ¶
type SyncSourcePool struct {
// contains filtered or unexported fields
}
func NewSyncSourcePool ¶
func NewSyncSourcePool(fixed []NodeConnInfo) *SyncSourcePool
func (*SyncSourcePool) Actives ¶
func (p *SyncSourcePool) Actives(f func(NodeConnInfo) bool)
func (*SyncSourcePool) AddNonFixed ¶
func (p *SyncSourcePool) AddNonFixed(ncis ...NodeConnInfo) bool
func (*SyncSourcePool) IsInNonFixed ¶
func (p *SyncSourcePool) IsInNonFixed(node base.Address) bool
func (*SyncSourcePool) Len ¶
func (p *SyncSourcePool) Len() int
func (*SyncSourcePool) NodeConnInfo ¶
func (p *SyncSourcePool) NodeConnInfo(node base.Address) []NodeConnInfo
func (*SyncSourcePool) NodeExists ¶
func (p *SyncSourcePool) NodeExists(node base.Address) bool
func (*SyncSourcePool) Pick ¶
func (p *SyncSourcePool) Pick() (NodeConnInfo, func(error), error)
func (*SyncSourcePool) PickMultiple ¶
func (p *SyncSourcePool) PickMultiple(n int) ([]NodeConnInfo, []func(error), error)
func (*SyncSourcePool) RemoveNonFixed ¶
func (p *SyncSourcePool) RemoveNonFixed(nci NodeConnInfo) bool
func (*SyncSourcePool) RemoveNonFixedNode ¶
func (p *SyncSourcePool) RemoveNonFixedNode(nodes ...base.Address) bool
func (*SyncSourcePool) Retry ¶
func (p *SyncSourcePool) Retry( ctx context.Context, f func(NodeConnInfo) (bool, error), limit int, interval time.Duration, ) error
func (*SyncSourcePool) Traverse ¶
func (p *SyncSourcePool) Traverse(f func(NodeConnInfo) bool)
func (*SyncSourcePool) UpdateFixed ¶
func (p *SyncSourcePool) UpdateFixed(fixed []NodeConnInfo) bool
type TempDatabase ¶
type TempDatabase interface { BaseDatabase Height() base.Height Close() error Remove() error Merge() error LastBlockMap() (base.BlockMap, bool, error) BlockMapBytes() (string, []byte, []byte, error) SuffrageHeight() base.Height SuffrageProof() (base.SuffrageProof, bool, error) LastSuffrageProofBytes() (string, []byte, []byte, bool, error) NetworkPolicy() base.NetworkPolicy }
TempDatabase is the temporary database; it contains only blockmap and others of one block for storing some of block items fast.
Source Files
¶
- ballot.go
- ballot_fact.go
- ballot_fact_json.go
- ballot_json.go
- ballot_sign.go
- ballot_sign_json.go
- block.go
- block_json.go
- block_writer.go
- database.go
- doc.go
- last_consensus_nodes_watcher.go
- last_voteproofs.go
- lastpoint.go
- network.go
- network_policy.go
- network_policy_json.go
- node.go
- operation.go
- params.go
- proposal.go
- proposal_json.go
- proposal_maker.go
- proposal_processor.go
- proposal_processors.go
- proposal_selector.go
- proposer_selector.go
- readers.go
- suffrage.go
- suffrage_builder.go
- suffrage_json.go
- suffrage_limiter.go
- suffrage_limiter_json.go
- suffrage_operation.go
- suffrage_operation_json.go
- suffrage_state.go
- suffrage_voting.go
- syncer.go
- voteproof.go
- voteproof_isvalid.go
- voteproof_json.go
Directories
¶
Path | Synopsis |
---|---|
Package isaacblock handles data of block.
|
Package isaacblock handles data of block. |
Package isaacdatabase handles data for isaac
|
Package isaacdatabase handles data for isaac |
Package isaacnetwork provides network.
|
Package isaacnetwork provides network. |
Package isaacoperation provides the base operations.
|
Package isaacoperation provides the base operations. |
Package isaacstates handles node states
|
Package isaacstates handles node states |