Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeRoundHash(nodeId crypto.Hash, number uint64, snapshots []*common.Snapshot) (uint64, uint64, crypto.Hash)
- func LoadRoundGraph(store storage.Store, networkId, idForNetwork crypto.Hash) (map[crypto.Hash]*CacheRound, map[crypto.Hash]*FinalRound, error)
- func TestMockDiff(at time.Duration)
- func TestMockReset()
- type CNode
- type CacheRound
- type Chain
- func (chain *Chain) AddSnapshot(final *FinalRound, cache *CacheRound, s *common.Snapshot) error
- func (chain *Chain) AppendCosiAction(m *CosiAction) error
- func (chain *Chain) AppendFinalSnapshot(peerId crypto.Hash, s *common.Snapshot) error
- func (chain *Chain) AppendSelfEmpty(s *common.Snapshot) error
- func (chain *Chain) ConsensusKeys(round, timestamp uint64) []*crypto.Key
- func (chain *Chain) ConsumeFinalActions()
- func (chain *Chain) IsPledging() bool
- func (chain *Chain) QueuePollSnapshots()
- func (chain *Chain) StateCopy() (*CacheRound, *FinalRound)
- func (chain *Chain) StepForward()
- func (chain *Chain) Teardown()
- type ChainRound
- type ChainState
- type CosiAction
- type CosiAggregator
- type CosiChainData
- type CosiVerifier
- type FinalRound
- type Genesis
- type Node
- func (node *Node) Authenticate(msg []byte) (crypto.Hash, string, error)
- func (node *Node) BuildAuthenticationMessage() []byte
- func (node *Node) BuildChain(chainId crypto.Hash) *Chain
- func (node *Node) BuildGraph() []*network.SyncPoint
- func (node *Node) CachePutTransaction(peerId crypto.Hash, tx *common.VersionedTransaction) error
- func (node *Node) CacheVerify(snap crypto.Hash, sig crypto.Signature, pub crypto.Key) bool
- func (node *Node) CacheVerifyCosi(snap crypto.Hash, sig *crypto.CosiSignature, publics []*crypto.Key, ...) bool
- func (node *Node) CheckBroadcastedToPeers() bool
- func (node *Node) CheckCatchUpWithPeers() bool
- func (node *Node) ConsensusReady(cn *CNode, timestamp uint64) bool
- func (node *Node) ConsensusThreshold(timestamp uint64) int
- func (node *Node) CosiAggregateSelfCommitments(peerId crypto.Hash, snap crypto.Hash, commitment *crypto.Key, wantTx bool) error
- func (node *Node) CosiAggregateSelfResponses(peerId crypto.Hash, snap crypto.Hash, response *[32]byte) error
- func (node *Node) CosiQueueExternalAnnouncement(peerId crypto.Hash, s *common.Snapshot, commitment *crypto.Key) error
- func (node *Node) CosiQueueExternalChallenge(peerId crypto.Hash, snap crypto.Hash, cosi *crypto.CosiSignature, ...) error
- func (node *Node) ElectionLoop()
- func (node *Node) GetAcceptedOrPledgingNode(id crypto.Hash) *CNode
- func (node *Node) GetCacheStore() *fastcache.Cache
- func (node *Node) GetOrCreateChain(id crypto.Hash) *Chain
- func (node *Node) Import(configDir string, source storage.Store) error
- func (node *Node) ListenNeighbors() error
- func (node *Node) LoadAllChains(store storage.Store, networkId crypto.Hash) error
- func (node *Node) LoadCacheToQueue() error
- func (node *Node) LoadConsensusNodes() error
- func (node *Node) LoadGenesis(configDir string) error
- func (node *Node) LoadNodeConfig()
- func (node *Node) Loop() error
- func (node *Node) MintLoop()
- func (node *Node) NetworkId() crypto.Hash
- func (node *Node) NodesListWithoutState(threshold uint64, acceptedOnly bool) []*CNode
- func (node *Node) PingNeighborsFromConfig() error
- func (node *Node) PledgingNode(timestamp uint64) *CNode
- func (node *Node) PoolInfo() (uint64, uint64)
- func (node *Node) PoolSize() (common.Integer, error)
- func (node *Node) QueueTransaction(tx *common.VersionedTransaction) (string, error)
- func (node *Node) ReadAllNodesWithoutState() []crypto.Hash
- func (node *Node) ReadSnapshotsForNodeRound(nodeIdWithNetwork crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (node *Node) ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (node *Node) SPS() float64
- func (node *Node) SendTransactionToPeer(peerId, hash crypto.Hash) error
- func (node *Node) Teardown()
- func (node *Node) TopoWrite(s *common.Snapshot) *common.SnapshotWithTopologicalOrder
- func (node *Node) TopologicalOrder() uint64
- func (node *Node) UpdateNeighbors(neighbors []string) error
- func (node *Node) UpdateSyncPoint(peerId crypto.Hash, points []*network.SyncPoint)
- func (node *Node) Uptime() time.Duration
- func (node *Node) VerifyAndQueueAppendSnapshotFinalization(peerId crypto.Hash, s *common.Snapshot) error
- type PeerSnapshot
- type TopologicalSequence
Constants ¶
View Source
const ( FinalPoolSlotsLimit = config.SnapshotSyncRoundThreshold * 8 FinalPoolRoundSizeLimit = 1024 CachePoolSnapshotsLimit = 8192 )
View Source
const ( CosiActionSelfEmpty = iota CosiActionSelfCommitment CosiActionSelfResponse CosiActionExternalAnnouncement CosiActionExternalChallenge CosiActionFinalization )
View Source
const ( GraphOperationClassAtomic = 0x00 GraphOperationClassNormalLedger = 0x01 MainnetNodeRemovalConsensusForkTimestamp = 1590000000000000000 )
View Source
const ( MainnetMintPeriodForkBatch = 72 MainnetMintPeriodForkTimeBegin = 6 MainnetMintPeriodForkTimeEnd = 18 )
View Source
const (
MainnetAcceptPeriodForkSnapshotHash = "b8855c19a38999f283d9be6daa45147aef47cc6d35007673f62390c2e137e4e1"
)
View Source
const (
MinimumNodeCount = 7
)
Variables ¶
Functions ¶
func ComputeRoundHash ¶ added in v0.2.10
func LoadRoundGraph ¶
func TestMockDiff ¶ added in v0.6.2
func TestMockReset ¶ added in v0.8.3
func TestMockReset()
Types ¶
type CacheRound ¶
type CacheRound struct { NodeId crypto.Hash Number uint64 Timestamp uint64 References *common.RoundLink Snapshots []*common.Snapshot `msgpack:"-"` }
func (*CacheRound) Copy ¶
func (c *CacheRound) Copy() *CacheRound
func (*CacheRound) Gap ¶
func (c *CacheRound) Gap() (uint64, uint64)
func (*CacheRound) ValidateSnapshot ¶
func (c *CacheRound) ValidateSnapshot(s *common.Snapshot) error
type Chain ¶ added in v0.9.0
type Chain struct { sync.RWMutex ChainId crypto.Hash ConsensusInfo *CNode State *ChainState CosiAggregators map[crypto.Hash]*CosiAggregator CosiVerifiers map[crypto.Hash]*CosiVerifier CachePool *util.RingBuffer FinalPool [FinalPoolSlotsLimit]*ChainRound FinalIndex int FinalCount int // contains filtered or unexported fields }
func (*Chain) AddSnapshot ¶ added in v0.9.1
func (chain *Chain) AddSnapshot(final *FinalRound, cache *CacheRound, s *common.Snapshot) error
func (*Chain) AppendCosiAction ¶ added in v0.9.0
func (chain *Chain) AppendCosiAction(m *CosiAction) error
func (*Chain) AppendFinalSnapshot ¶ added in v0.9.0
func (*Chain) AppendSelfEmpty ¶ added in v0.9.0
func (*Chain) ConsensusKeys ¶ added in v0.9.1
func (*Chain) ConsumeFinalActions ¶ added in v0.9.0
func (chain *Chain) ConsumeFinalActions()
func (*Chain) IsPledging ¶ added in v0.9.1
func (*Chain) QueuePollSnapshots ¶ added in v0.9.0
func (chain *Chain) QueuePollSnapshots()
func (*Chain) StateCopy ¶ added in v0.9.1
func (chain *Chain) StateCopy() (*CacheRound, *FinalRound)
func (*Chain) StepForward ¶ added in v0.9.0
func (chain *Chain) StepForward()
type ChainRound ¶ added in v0.9.0
type ChainRound struct { Number uint64 Size int Timestamp uint64 Snapshots [FinalPoolRoundSizeLimit]*PeerSnapshot // contains filtered or unexported fields }
type ChainState ¶ added in v0.9.0
type ChainState struct { sync.RWMutex CacheRound *CacheRound FinalRound *FinalRound RoundHistory []*FinalRound RoundLinks map[crypto.Hash]uint64 }
type CosiAction ¶ added in v0.5.0
type CosiAggregator ¶ added in v0.5.0
type CosiChainData ¶ added in v0.9.1
type CosiChainData struct { PN *CNode CN *CNode TX *common.VersionedTransaction F bool }
type CosiVerifier ¶ added in v0.5.0
type FinalRound ¶
type FinalRound struct { NodeId crypto.Hash Number uint64 Start uint64 End uint64 Hash crypto.Hash }
func (*FinalRound) Copy ¶
func (f *FinalRound) Copy() *FinalRound
type Genesis ¶
type Genesis struct { Epoch int64 `json:"epoch"` Nodes []struct { Signer common.Address `json:"signer"` Payee common.Address `json:"payee"` Balance common.Integer `json:"balance"` } `json:"nodes"` Domains []struct { Signer common.Address `json:"signer"` Balance common.Integer `json:"balance"` } `json:"domains"` }
type Node ¶
type Node struct { IdForNetwork crypto.Hash Signer common.Address Listener string Peer *network.Peer TopoCounter *TopologicalSequence SyncPoints *syncMap GraphTimestamp uint64 Epoch uint64 // contains filtered or unexported fields }
func (*Node) BuildAuthenticationMessage ¶
func (*Node) BuildGraph ¶
func (*Node) CachePutTransaction ¶
func (*Node) CacheVerify ¶
func (*Node) CacheVerifyCosi ¶ added in v0.5.0
func (*Node) CheckBroadcastedToPeers ¶ added in v0.2.12
func (*Node) CheckCatchUpWithPeers ¶ added in v0.2.12
func (*Node) ConsensusReady ¶ added in v0.9.1
An accepted node can sign transactions only when it satisfies either: 1. It is a genesis node. 2. It has been accepted more than 12 hours.
func (*Node) ConsensusThreshold ¶ added in v0.5.0
func (*Node) CosiAggregateSelfCommitments ¶ added in v0.5.0
func (*Node) CosiAggregateSelfResponses ¶ added in v0.5.0
func (*Node) CosiQueueExternalAnnouncement ¶ added in v0.5.0
func (*Node) CosiQueueExternalChallenge ¶ added in v0.5.0
func (node *Node) CosiQueueExternalChallenge(peerId crypto.Hash, snap crypto.Hash, cosi *crypto.CosiSignature, ver *common.VersionedTransaction) error
func (*Node) ElectionLoop ¶ added in v0.3.5
func (node *Node) ElectionLoop()
func (*Node) GetAcceptedOrPledgingNode ¶ added in v0.9.1
func (*Node) GetCacheStore ¶ added in v0.2.18
func (*Node) GetOrCreateChain ¶ added in v0.9.0
func (*Node) ListenNeighbors ¶
func (*Node) LoadAllChains ¶ added in v0.9.0
func (*Node) LoadCacheToQueue ¶
func (*Node) LoadConsensusNodes ¶
func (*Node) LoadGenesis ¶
func (*Node) LoadNodeConfig ¶ added in v0.2.15
func (node *Node) LoadNodeConfig()
func (*Node) NodesListWithoutState ¶ added in v0.9.1
func (*Node) PingNeighborsFromConfig ¶ added in v0.7.25
func (*Node) PledgingNode ¶ added in v0.9.1
func (*Node) QueueTransaction ¶ added in v0.1.2
func (node *Node) QueueTransaction(tx *common.VersionedTransaction) (string, error)
func (*Node) ReadAllNodesWithoutState ¶ added in v0.9.1
func (*Node) ReadSnapshotsForNodeRound ¶
func (*Node) ReadSnapshotsSinceTopology ¶
func (node *Node) ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
func (*Node) SendTransactionToPeer ¶
func (*Node) TopoWrite ¶ added in v0.9.0
func (node *Node) TopoWrite(s *common.Snapshot) *common.SnapshotWithTopologicalOrder
func (*Node) TopologicalOrder ¶ added in v0.1.2
func (*Node) UpdateNeighbors ¶ added in v0.8.3
func (*Node) UpdateSyncPoint ¶
type PeerSnapshot ¶ added in v0.9.0
type TopologicalSequence ¶
func (*TopologicalSequence) TopoStats ¶ added in v0.9.0
func (topo *TopologicalSequence) TopoStats()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.