relay

package
v1.1.0-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {

	// Staker is an on-chain identity that this node is using to prove its
	// stake in the system.
	Staker chain.Staker
	// contains filtered or unexported fields
}

Node represents the current state of a relay node.

func NewNode

func NewNode(
	staker chain.Staker,
	netProvider net.Provider,
	blockCounter chain.BlockCounter,
	chainConfig *config.Chain,
	groupRegistry *registry.Groups,
) Node

NewNode returns an empty Node with no group, zero group count, and a nil last seen entry, tied to the given net.Provider.

func (*Node) ForwardSignatureShares

func (n *Node) ForwardSignatureShares(groupPublicKeyBytes []byte)

ForwardSignatureShares enables the ability to forward signature shares messages to other nodes even if this node is not a part of the group which signs the relay entry.

func (*Node) GenerateRelayEntry

func (n *Node) GenerateRelayEntry(
	previousEntry []byte,
	relayChain relayChain.Interface,
	signing chain.Signing,
	groupPublicKey []byte,
	startBlockHeight uint64,
)

GenerateRelayEntry is triggered for a new relay request and checks if this client is one of the group members selected to create a new relay entry. If it is, this client enters the threshold signature creation process and, upon successfully completing it, submits the signature as a new relay entry. Note that this function returns immediately after determining whether the node is or is not a member of the requested group, and signature creation and submission is performed in a background goroutine.

func (*Node) IsInGroup

func (n *Node) IsInGroup(groupPublicKey []byte) bool

IsInGroup checks if this node is a member of the group which was selected to join a group which undergoes the process of generating a threshold relay entry.

func (*Node) JoinGroupIfEligible

func (n *Node) JoinGroupIfEligible(
	relayChain relaychain.Interface,
	signing chain.Signing,
	groupSelectionResult *groupselection.Result,
	newEntry *big.Int,
)

JoinGroupIfEligible takes a threshold relay entry value and undergoes the process of joining a group if this node's virtual stakers prove eligible for the group generated by that entry. This is an interactive on-chain process, and JoinGroupIfEligible can block for an extended period of time while it completes the on-chain operation.

Indirectly, the completion of the process is signaled by the formation of an on-chain group containing at least one of this node's virtual stakers.

func (*Node) MonitorRelayEntry

func (n *Node) MonitorRelayEntry(
	relayChain relayChain.Interface,
	relayRequestBlockNumber uint64,
	chainConfig *config.Chain,
)

MonitorRelayEntry is listetning to the chain for a new relay entry. When a processing group which is supposed to deliver a relay entry does not fulfill its work, then this Node notifies the chain about it. In the case of delivering a relay entry by a processing group, this Node does nothing.

func (*Node) ResumeSigningIfEligible added in v1.1.2

func (n *Node) ResumeSigningIfEligible(
	relayChain relayChain.Interface,
	signing chain.Signing,
)

ResumeSigningIfEligible enables a client to rejoin the ongoing signing process after it was crashed or restarted and if it belongs to the signing group.

Directories

Path Synopsis
dkg
gen
Package event contains data structures that are attached to events in the relay.
Package event contains data structures that are attached to events in the relay.
Package gjkr contains code that implements Distributed Key Generation protocol described in [GJKR 99].
Package gjkr contains code that implements Distributed Key Generation protocol described in [GJKR 99].
gen
Package groupselection implements the random beacon group selection protocol - an interactive, ticket-based method of selecting a candidate group from the set of all stakers given a pseudorandom seed value.
Package groupselection implements the random beacon group selection protocol - an interactive, ticket-based method of selecting a candidate group from the set of all stakers given a pseudorandom seed value.
gen
thresholdsignature
gen/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL