Documentation ¶
Index ¶
- Constants
- func LogGovernanceTransition(msg *ChainTransitionEventData, log *logger.Logger)
- func LogStateTransition(msg *ChainTransitionEventData, reqids []iscp.RequestID, log *logger.Logger)
- func PublishGovernanceTransition(stateOutput *ledgerstate.AliasOutput)
- func PublishRequestsSettled(chainID *iscp.ChainID, stateIndex uint32, reqids []iscp.RequestID)
- func PublishStateTransition(chainID *iscp.ChainID, stateOutput *ledgerstate.AliasOutput, reqIDsLength int)
- type AsynchronousCommonSubsetRunner
- type Chain
- type ChainCore
- type ChainEntry
- type ChainMetrics
- type ChainNodeConnection
- type ChainRequests
- type ChainTransitionEventData
- type Committee
- type CommitteeInfo
- type Consensus
- type ConsensusInfo
- type ConsensusPipeMetrics
- type ConsensusWorkflowStatus
- type Mempool
- type MempoolInfo
- type NodeConnection
- type NodeConnectionHandleInclusionStateFun
- type NodeConnectionHandleOutputFun
- type NodeConnectionHandleTransactionFun
- type NodeConnectionHandleUnspentAliasOutputFun
- type PeerStatus
- type ReadyListRecord
- type RequestProcessingStatus
- type StateManager
- type SyncInfo
- type WAL
Constants ¶
View Source
const ( RequestProcessingStatusUnknown = RequestProcessingStatus(iota) RequestProcessingStatusBacklog RequestProcessingStatusCompleted )
View Source
const ( PeerMsgTypeMissingRequestIDs = iota PeerMsgTypeMissingRequest PeerMsgTypeOffLedgerRequest PeerMsgTypeRequestAck )
View Source
const ( // TimerTickPeriod time tick for consensus and state manager objects TimerTickPeriod = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func LogGovernanceTransition ¶ added in v0.2.0
func LogGovernanceTransition(msg *ChainTransitionEventData, log *logger.Logger)
LogGovernanceTransition
func LogStateTransition ¶ added in v0.2.0
func LogStateTransition(msg *ChainTransitionEventData, reqids []iscp.RequestID, log *logger.Logger)
LogStateTransition also used in testing
func PublishGovernanceTransition ¶ added in v0.2.0
func PublishGovernanceTransition(stateOutput *ledgerstate.AliasOutput)
func PublishRequestsSettled ¶ added in v0.2.0
func PublishStateTransition ¶ added in v0.2.0
func PublishStateTransition(chainID *iscp.ChainID, stateOutput *ledgerstate.AliasOutput, reqIDsLength int)
Types ¶
type AsynchronousCommonSubsetRunner ¶ added in v0.2.0
type Chain ¶
type Chain interface { ChainCore ChainRequests ChainEntry ChainMetrics }
type ChainCore ¶ added in v0.2.0
type ChainCore interface { ID() *iscp.ChainID GetCommitteeInfo() *CommitteeInfo StateCandidateToStateManager(state.VirtualStateAccess, ledgerstate.OutputID) TriggerChainTransition(*ChainTransitionEventData) Processors() *processors.Cache GlobalStateSync() coreutil.ChainStateSync GetStateReader() state.OptimisticStateReader GetChainNodes() []peering.PeerStatusProvider // CommitteeNodes + AccessNodes GetCandidateNodes() []*governance.AccessNodeInfo // All the current candidates. Log() *logger.Logger // Most of these methods are made public for mocking in tests EnqueueDismissChain(reason string) // This one should really be public EnqueueLedgerState(chainOutput *ledgerstate.AliasOutput, timestamp time.Time) EnqueueOffLedgerRequestMsg(msg *messages.OffLedgerRequestMsgIn) EnqueueRequestAckMsg(msg *messages.RequestAckMsgIn) EnqueueMissingRequestIDsMsg(msg *messages.MissingRequestIDsMsgIn) EnqueueMissingRequestMsg(msg *messages.MissingRequestMsg) EnqueueTimerTick(tick int) }
type ChainEntry ¶ added in v0.2.0
type ChainEntry interface { ReceiveTransaction(*ledgerstate.Transaction) ReceiveState(stateOutput *ledgerstate.AliasOutput, timestamp time.Time) Dismiss(reason string) IsDismissed() bool }
ChainEntry interface to access chain from the chain registry side
type ChainMetrics ¶ added in v0.2.3
type ChainMetrics interface { GetNodeConnectionMetrics() nodeconnmetrics.NodeConnectionMessagesMetrics GetConsensusWorkflowStatus() ConsensusWorkflowStatus GetConsensusPipeMetrics() ConsensusPipeMetrics }
type ChainNodeConnection ¶ added in v0.2.3
type ChainNodeConnection interface { AttachToTransactionReceived(NodeConnectionHandleTransactionFun) AttachToInclusionStateReceived(NodeConnectionHandleInclusionStateFun) AttachToOutputReceived(NodeConnectionHandleOutputFun) AttachToUnspentAliasOutputReceived(NodeConnectionHandleUnspentAliasOutputFun) PullState() PullTransactionInclusionState(txid ledgerstate.TransactionID) PullConfirmedOutput(outputID ledgerstate.OutputID) PostTransaction(tx *ledgerstate.Transaction) GetMetrics() nodeconnmetrics.NodeConnectionMessagesMetrics DetachFromTransactionReceived() DetachFromInclusionStateReceived() DetachFromOutputReceived() DetachFromUnspentAliasOutputReceived() Close() }
type ChainRequests ¶ added in v0.2.0
type ChainRequests interface { GetRequestProcessingStatus(id iscp.RequestID) RequestProcessingStatus AttachToRequestProcessed(func(iscp.RequestID)) (attachID *events.Closure) DetachFromRequestProcessed(attachID *events.Closure) }
ChainRequests is an interface to query status of the request
type ChainTransitionEventData ¶ added in v0.2.0
type ChainTransitionEventData struct { VirtualState state.VirtualStateAccess ChainOutput *ledgerstate.AliasOutput OutputTimestamp time.Time }
type Committee ¶ added in v0.2.0
type Committee interface { Address() ledgerstate.Address Size() uint16 Quorum() uint16 OwnPeerIndex() uint16 IsAlivePeer(peerIndex uint16) bool QuorumIsAlive(quorum ...uint16) bool PeerStatus() []*PeerStatus IsReady() bool Close() RunACSConsensus(value []byte, sessionID uint64, stateIndex uint32, callback func(sessionID uint64, acs [][]byte)) GetRandomValidators(upToN int) []*ed25519.PublicKey // TODO: Remove after OffLedgerRequest dissemination is changed. }
Committee is ordered (indexed 0..size-1) list of peers which run the consensus
type CommitteeInfo ¶ added in v0.2.0
type CommitteeInfo struct { Address ledgerstate.Address Size uint16 Quorum uint16 QuorumIsAlive bool PeerStatus []*PeerStatus }
type Consensus ¶ added in v0.2.0
type Consensus interface { EnqueueStateTransitionMsg(state.VirtualStateAccess, *ledgerstate.AliasOutput, time.Time) EnqueueSignedResultMsg(*messages.SignedResultMsgIn) EnqueueSignedResultAckMsg(*messages.SignedResultAckMsgIn) EnqueueInclusionsStateMsg(ledgerstate.TransactionID, ledgerstate.InclusionState) EnqueueAsynchronousCommonSubsetMsg(msg *messages.AsynchronousCommonSubsetMsg) EnqueueVMResultMsg(msg *messages.VMResultMsg) EnqueueTimerMsg(messages.TimerTick) IsReady() bool Close() GetStatusSnapshot() *ConsensusInfo GetWorkflowStatus() ConsensusWorkflowStatus ShouldReceiveMissingRequest(req iscp.Request) bool GetPipeMetrics() ConsensusPipeMetrics }
type ConsensusInfo ¶ added in v0.2.0
type ConsensusInfo struct { StateIndex uint32 Mempool MempoolInfo TimerTick int }
type ConsensusPipeMetrics ¶ added in v0.2.5
type ConsensusWorkflowStatus ¶ added in v0.2.4
type ConsensusWorkflowStatus interface { IsStateReceived() bool IsBatchProposalSent() bool IsConsensusBatchKnown() bool IsVMStarted() bool IsVMResultSigned() bool IsTransactionFinalized() bool IsTransactionPosted() bool IsTransactionSeen() bool IsInProgress() bool GetBatchProposalSentTime() time.Time GetConsensusBatchKnownTime() time.Time GetVMStartedTime() time.Time GetVMResultSignedTime() time.Time GetTransactionFinalizedTime() time.Time GetTransactionPostedTime() time.Time GetTransactionSeenTime() time.Time GetCompletedTime() time.Time GetCurrentStateIndex() uint32 }
type Mempool ¶ added in v0.2.0
type Mempool interface { ReceiveRequests(reqs ...iscp.Request) ReceiveRequest(req iscp.Request) bool RemoveRequests(reqs ...iscp.RequestID) ReadyNow(nowis ...time.Time) []iscp.Request ReadyFromIDs(nowis time.Time, reqIDs ...iscp.RequestID) ([]iscp.Request, []int, bool) HasRequest(id iscp.RequestID) bool GetRequest(id iscp.RequestID) iscp.Request Info() MempoolInfo WaitRequestInPool(reqid iscp.RequestID, timeout ...time.Duration) bool // for testing WaitInBufferEmpty(timeout ...time.Duration) bool // for testing Close() }
type MempoolInfo ¶ added in v0.2.0
type NodeConnection ¶ added in v0.2.0
type NodeConnection interface { Subscribe(addr ledgerstate.Address) Unsubscribe(addr ledgerstate.Address) AttachToTransactionReceived(*ledgerstate.AliasAddress, NodeConnectionHandleTransactionFun) AttachToInclusionStateReceived(*ledgerstate.AliasAddress, NodeConnectionHandleInclusionStateFun) AttachToOutputReceived(*ledgerstate.AliasAddress, NodeConnectionHandleOutputFun) AttachToUnspentAliasOutputReceived(*ledgerstate.AliasAddress, NodeConnectionHandleUnspentAliasOutputFun) PullState(addr *ledgerstate.AliasAddress) PullTransactionInclusionState(addr ledgerstate.Address, txid ledgerstate.TransactionID) PullConfirmedOutput(addr ledgerstate.Address, outputID ledgerstate.OutputID) PostTransaction(tx *ledgerstate.Transaction) GetMetrics() nodeconnmetrics.NodeConnectionMetrics DetachFromTransactionReceived(*ledgerstate.AliasAddress) DetachFromInclusionStateReceived(*ledgerstate.AliasAddress) DetachFromOutputReceived(*ledgerstate.AliasAddress) DetachFromUnspentAliasOutputReceived(*ledgerstate.AliasAddress) Close() }
type NodeConnectionHandleInclusionStateFun ¶ added in v0.2.3
type NodeConnectionHandleInclusionStateFun func(ledgerstate.TransactionID, ledgerstate.InclusionState)
type NodeConnectionHandleOutputFun ¶ added in v0.2.3
type NodeConnectionHandleOutputFun func(ledgerstate.Output)
type NodeConnectionHandleTransactionFun ¶ added in v0.2.3
type NodeConnectionHandleTransactionFun func(*ledgerstate.Transaction)
type NodeConnectionHandleUnspentAliasOutputFun ¶ added in v0.2.3
type NodeConnectionHandleUnspentAliasOutputFun func(*ledgerstate.AliasOutput, time.Time)
type PeerStatus ¶
func (*PeerStatus) String ¶
func (p *PeerStatus) String() string
type ReadyListRecord ¶ added in v0.2.0
type RequestProcessingStatus ¶
type RequestProcessingStatus int
type StateManager ¶
type StateManager interface { Ready() *ready.Ready EnqueueGetBlockMsg(msg *messages.GetBlockMsgIn) EnqueueBlockMsg(msg *messages.BlockMsgIn) EnqueueStateMsg(msg *messages.StateMsg) EnqueueOutputMsg(msg ledgerstate.Output) EnqueueStateCandidateMsg(state.VirtualStateAccess, ledgerstate.OutputID) EnqueueTimerMsg(msg messages.TimerTick) GetStatusSnapshot() *SyncInfo SetChainPeers(peers []*ed25519.PublicKey) Close() }
Directories ¶
Path | Synopsis |
---|---|
Provides implementations for chain.ChainCore methods except the Enqueue*, which are provided in eventproc.go Provides implementations for chain.ChainEntry methods Provides implementations for chain.ChainMetrics methods Provides implementations for chain.ChainRequests methods
|
Provides implementations for chain.ChainCore methods except the Enqueue*, which are provided in eventproc.go Provides implementations for chain.ChainEntry methods Provides implementations for chain.ChainMetrics methods Provides implementations for chain.ChainRequests methods |
commoncoin
Package commoncoin implements a common coin abstraction needed by the HoneyBadgerBFT for synchronization and randomness.
|
Package commoncoin implements a common coin abstraction needed by the HoneyBadgerBFT for synchronization and randomness. |
mempool implements a buffer of requests sent to the ISCP chain, essentially a backlog of requests It contains both on-ledger and off-ledger requests.
|
mempool implements a buffer of requests sent to the ISCP chain, essentially a backlog of requests It contains both on-ledger and off-ledger requests. |
Provides implementations for chain.ChainNodeConnection methods
|
Provides implementations for chain.ChainNodeConnection methods |
statemgr package implements object which is responsible for the smart contract ledger state to be synchronized and validated
|
statemgr package implements object which is responsible for the smart contract ledger state to be synchronized and validated |
Click to show internal directories.
Click to hide internal directories.