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 ChainEvents
- type ChainRequests
- type ChainTransitionEventData
- type Committee
- type CommitteeInfo
- type Consensus
- type ConsensusInfo
- type Mempool
- type MempoolInfo
- type NodeConnection
- type PeerStatus
- type ReadyListRecord
- type RequestProcessingStatus
- type StateManager
- type SyncInfo
Constants ¶
View Source
const ( RequestProcessingStatusUnknown = RequestProcessingStatus(iota) RequestProcessingStatusBacklog RequestProcessingStatusCompleted )
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
}
type ChainCore ¶ added in v0.2.0
type ChainCore interface {
ID() *iscp.ChainID
GetCommitteeInfo() *CommitteeInfo
ReceiveMessage(interface{})
Events() ChainEvents
Processors() *processors.Cache
GlobalStateSync() coreutil.ChainStateSync
GetStateReader() state.OptimisticStateReader
Log() *logger.Logger
}
type ChainEntry ¶ added in v0.2.0
type ChainEntry interface {
ReceiveTransaction(*ledgerstate.Transaction)
ReceiveInclusionState(ledgerstate.TransactionID, ledgerstate.InclusionState)
ReceiveState(stateOutput *ledgerstate.AliasOutput, timestamp time.Time)
ReceiveOutput(output ledgerstate.Output)
ReceiveOffLedgerRequest(req *request.OffLedger, senderNetID string)
Dismiss(reason string)
IsDismissed() bool
}
ChainEntry interface to access chain from the chain registry side
type ChainEvents ¶ added in v0.2.0
type ChainRequests ¶ added in v0.2.0
type ChainRequests interface {
GetRequestProcessingStatus(id iscp.RequestID) RequestProcessingStatus
EventRequestProcessed() *events.Event
}
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
SendMsg(targetPeerIndex uint16, msgType byte, msgData []byte) error
SendMsgToPeers(msgType byte, msgData []byte, ts int64, except ...uint16)
IsAlivePeer(peerIndex uint16) bool
QuorumIsAlive(quorum ...uint16) bool
PeerStatus() []*PeerStatus
Attach(chain ChainCore)
IsReady() bool
Close()
RunACSConsensus(value []byte, sessionID uint64, stateIndex uint32, callback func(sessionID uint64, acs [][]byte))
GetOtherValidatorsPeerIDs() []string
GetRandomValidators(upToN int) []string
}
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 {
EventStateTransitionMsg(*messages.StateTransitionMsg)
EventSignedResultMsg(*messages.SignedResultMsg)
EventSignedResultAckMsg(*messages.SignedResultAckMsg)
EventInclusionsStateMsg(*messages.InclusionStateMsg)
EventAsynchronousCommonSubsetMsg(msg *messages.AsynchronousCommonSubsetMsg)
EventVMResultMsg(msg *messages.VMResultMsg)
EventTimerMsg(messages.TimerTick)
IsReady() bool
Close()
GetStatusSnapshot() *ConsensusInfo
ShouldReceiveMissingRequest(req iscp.Request) bool
}
type ConsensusInfo ¶ added in v0.2.0
type ConsensusInfo struct {
StateIndex uint32
Mempool MempoolInfo
TimerTick int
}
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 {
PullBacklog(addr *ledgerstate.AliasAddress)
PullState(addr *ledgerstate.AliasAddress)
PullConfirmedTransaction(addr ledgerstate.Address, txid ledgerstate.TransactionID)
PullTransactionInclusionState(addr ledgerstate.Address, txid ledgerstate.TransactionID)
PullConfirmedOutput(addr ledgerstate.Address, outputID ledgerstate.OutputID)
PostTransaction(tx *ledgerstate.Transaction)
}
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
EventGetBlockMsg(msg *messages.GetBlockMsg)
EventBlockMsg(msg *messages.BlockMsg)
EventStateMsg(msg *messages.StateMsg)
EventOutputMsg(msg ledgerstate.Output)
EventStateCandidateMsg(msg *messages.StateCandidateMsg)
EventTimerMsg(msg messages.TimerTick)
GetStatusSnapshot() *SyncInfo
Close()
}
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |
|
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.