Documentation ¶
Index ¶
- func TagForCommittee(kind scheduler.CommitteeKind) string
- type AccessPolicy
- type CommitteeInfo
- type EpochSnapshot
- func (e *EpochSnapshot) GetEpochHeight() int64
- func (e *EpochSnapshot) GetEpochNumber() beacon.EpochTime
- func (e *EpochSnapshot) GetExecutorCommittee() *CommitteeInfo
- func (e *EpochSnapshot) GetRuntime() *registry.Runtime
- func (e *EpochSnapshot) IsExecutorBackupWorker() bool
- func (e *EpochSnapshot) IsExecutorMember() bool
- func (e *EpochSnapshot) IsExecutorWorker() bool
- func (e *EpochSnapshot) IsTransactionScheduler(round uint64) bool
- func (e *EpochSnapshot) IsValid() bool
- func (e *EpochSnapshot) Node(ctx context.Context, id signature.PublicKey) (*node.Node, error)
- func (e *EpochSnapshot) Nodes() nodes.NodeDescriptorLookup
- func (e *EpochSnapshot) VerifyTxnSchedulerSigner(id signature.PublicKey, round uint64) error
- type Group
- type KeyManagerClientWrapper
- type Node
- func (n *Node) AddHooks(hooks NodeHooks)
- func (n *Node) Cleanup()
- func (n *Node) GetMinRepublishInterval() time.Duration
- func (n *Node) GetRuntime() runtimeRegistry.Runtime
- func (n *Node) GetStatus(ctx context.Context) (*api.Status, error)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) NewRuntimeHostHandler() protocol.Handler
- func (n *Node) NewRuntimeHostNotifier(ctx context.Context, host host.Runtime) protocol.Notifier
- func (n *Node) PublishTx(ctx context.Context, tx []byte) error
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
- type NodeHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TagForCommittee ¶ added in v0.2012.0
func TagForCommittee(kind scheduler.CommitteeKind) string
TagForCommittee returns node lookup tag for scheduler committee kind.
Types ¶
type AccessPolicy ¶
AccessPolicy defines a list of actions that are allowed by the policy.
func (AccessPolicy) AddPublicKeyPolicy ¶
func (ap AccessPolicy) AddPublicKeyPolicy(policy *accessctl.Policy, pubKey signature.PublicKey)
AddPublicKeyPolicy augments the given policy by allowing actions in the current AccessPolicy to given TLS public key.
func (AccessPolicy) AddRulesForNodeRoles ¶
func (ap AccessPolicy) AddRulesForNodeRoles( policy *accessctl.Policy, nodes []*node.Node, roles node.RolesMask, )
AddRulesForNodeRoles augments the given policy by allowing actions in the current AccessPolicy for the nodes that have the given roles mask.
func (AccessPolicy) AddRulesForNodes ¶ added in v0.2200.0
func (ap AccessPolicy) AddRulesForNodes(policy *accessctl.Policy, nodes []*node.Node)
AddRulesForNodes augments the given policy by allowing actions in the current AccessPolicy for the specified list of nodes.
type CommitteeInfo ¶
type CommitteeInfo struct { Indices []int Roles []scheduler.Role Committee *scheduler.Committee PublicKeys map[signature.PublicKey]bool Peers map[signature.PublicKey]bool }
CommitteeInfo contains information about a committee of nodes.
type EpochSnapshot ¶
type EpochSnapshot struct {
// contains filtered or unexported fields
}
EpochSnapshot is an immutable snapshot of epoch state.
func (*EpochSnapshot) GetEpochHeight ¶ added in v0.2200.0
func (e *EpochSnapshot) GetEpochHeight() int64
GetEpochHeight returns the consensus height corresponding to the epoch transition.
func (*EpochSnapshot) GetEpochNumber ¶
func (e *EpochSnapshot) GetEpochNumber() beacon.EpochTime
GetEpochNumber returns the sequential number of the epoch.
func (*EpochSnapshot) GetExecutorCommittee ¶ added in v0.2010.0
func (e *EpochSnapshot) GetExecutorCommittee() *CommitteeInfo
GetExecutorCommittee returns the current executor committee.
func (*EpochSnapshot) GetRuntime ¶
func (e *EpochSnapshot) GetRuntime() *registry.Runtime
GetRuntime returns the current runtime descriptor.
func (*EpochSnapshot) IsExecutorBackupWorker ¶
func (e *EpochSnapshot) IsExecutorBackupWorker() bool
IsExecutorBackupWorker checks if the current node is a backup worker of the executor committee in the current epoch.
func (*EpochSnapshot) IsExecutorMember ¶
func (e *EpochSnapshot) IsExecutorMember() bool
IsExecutorMember checks if the current node is a member of the executor committee in the current epoch.
func (*EpochSnapshot) IsExecutorWorker ¶
func (e *EpochSnapshot) IsExecutorWorker() bool
IsExecutorWorker checks if the current node is a worker of the executor committee in the current epoch.
func (*EpochSnapshot) IsTransactionScheduler ¶ added in v0.2010.0
func (e *EpochSnapshot) IsTransactionScheduler(round uint64) bool
IsTransactionScheduler checks if the current node is a a transaction scheduler at the specific runtime round.
func (*EpochSnapshot) IsValid ¶ added in v0.2200.0
func (e *EpochSnapshot) IsValid() bool
IsValid checks whether the given epoch snapshot is valid (represents an actual epoch).
func (*EpochSnapshot) Nodes ¶
func (e *EpochSnapshot) Nodes() nodes.NodeDescriptorLookup
Nodes returns a node descriptor lookup interface.
func (*EpochSnapshot) VerifyTxnSchedulerSigner ¶ added in v0.2100.0
func (e *EpochSnapshot) VerifyTxnSchedulerSigner(id signature.PublicKey, round uint64) error
VerifyTxnSchedulerSigner verifies that the given signature comes from the transaction scheduler at provided round.
type Group ¶
Group encapsulates communication with a group of nodes in the runtime committees.
func NewGroup ¶
func NewGroup( ctx context.Context, identity *identity.Identity, runtime runtimeRegistry.Runtime, consensus consensus.Backend, ) (*Group, error)
NewGroup creates a new group.
func (*Group) EpochTransition ¶
EpochTransition processes an epoch transition that just happened.
func (*Group) GetEpochSnapshot ¶
func (g *Group) GetEpochSnapshot() *EpochSnapshot
GetEpochSnapshot returns a snapshot of the currently active epoch.
func (*Group) RoundTransition ¶
func (g *Group) RoundTransition()
RoundTransition processes a round transition that just happened.
type KeyManagerClientWrapper ¶ added in v0.2201.5
type KeyManagerClientWrapper struct {
// contains filtered or unexported fields
}
KeyManagerClientWrapper is a wrapper for the key manager P2P client that handles deferred initialization after the key manager runtime ID is known.
func (*KeyManagerClientWrapper) CallEnclave ¶ added in v0.2201.5
Implements runtimeKeymanager.Client.
func (*KeyManagerClientWrapper) Initialized ¶ added in v0.2201.5
func (km *KeyManagerClientWrapper) Initialized() <-chan struct{}
Initialized returns a channel that gets closed when the client is initialized.
type Node ¶
type Node struct { *runtimeRegistry.RuntimeHostNode Runtime runtimeRegistry.Runtime HostNode control.ControlledNode Identity *identity.Identity KeyManager keymanager.Backend KeyManagerClient *KeyManagerClientWrapper Consensus consensus.Backend Group *Group P2P *p2p.P2P TxPool txpool.TransactionPool // Mutable and shared between nodes' workers. // Guarded by .CrossNode. CrossNode sync.Mutex CurrentBlock *block.Block CurrentBlockHeight int64 CurrentConsensusBlock *consensus.LightBlock CurrentDescriptor *registry.Runtime CurrentEpoch beacon.EpochTime Height int64 // contains filtered or unexported fields }
Node is a committee node.
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Node) GetMinRepublishInterval ¶ added in v0.2200.0
GetMinRepublishInterval returns the minimum republish interval that needs to be respected by the caller when publishing the same message. If Publish is called for the same message more quickly, the message may be dropped and not published.
func (*Node) GetRuntime ¶
func (n *Node) GetRuntime() runtimeRegistry.Runtime
Implements RuntimeHostHandlerFactory.
func (*Node) Initialized ¶
func (n *Node) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the node is initialized and ready to service requests.
func (*Node) NewRuntimeHostHandler ¶
Implements RuntimeHostHandlerFactory.
func (*Node) NewRuntimeHostNotifier ¶ added in v0.2103.0
Implements RuntimeHostHandlerFactory.
type NodeHooks ¶
type NodeHooks interface { // HandlePeerTx handles a transaction received from a (non-local) peer. HandlePeerTx(ctx context.Context, tx []byte) error // Guarded by CrossNode. HandleEpochTransitionLocked(*EpochSnapshot) // Guarded by CrossNode. HandleNewBlockEarlyLocked(*block.Block) // Guarded by CrossNode. HandleNewBlockLocked(*block.Block) // Guarded by CrossNode. HandleNewEventLocked(*roothash.Event) HandleRuntimeHostEvent(*host.Event) // Initialized returns a channel that will be closed when the worker is initialized and ready // to service requests. Initialized() <-chan struct{} }
NodeHooks defines a worker's duties at common events. These are called from the runtime's common node's worker.