Documentation ¶
Overview ¶
Package event contains data structures that are attached to events in the relay. Though many of these events are triggered on-chain, that is not an inherent requirement of structures in this package.
Index ¶
Constants ¶
const ( // DKGSeedCachePeriod is the time period the cache maintains // the DKG seed corresponding to a DKG instance. DKGSeedCachePeriod = 7 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DKGResultSubmission ¶
type DKGResultSubmission struct { MemberIndex uint32 GroupPublicKey []byte Misbehaved []uint8 BlockNumber uint64 }
DKGResultSubmission represents a DKG result submission event. It is emitted after a submitted DKG result is positively validated on the chain. It contains the index of the member who submitted the result and a final public key of the group. TODO: Adjust to the v2 RandomBeacon contract and rename to DKGResultSubmitted.
type DKGStarted ¶
DKGStarted represents a DKG start event.
type Deduplicator ¶
type Deduplicator struct {
// contains filtered or unexported fields
}
Deduplicator decides whether the given event should be handled by the client or not.
Event subscription may emit the same event two or more times. The same event can be emitted right after it's been emitted for the first time. The same event can also be emitted a long time after it's been emitted for the first time. It is deduplicator's responsibility to decide whether the given event is a duplicate and should be ignored or if it is not a duplicate and should be handled.
Those events are supported: - DKG started - relay entry requested
func NewDeduplicator ¶
func NewDeduplicator(chain chain) *Deduplicator
NewDeduplicator constructs a new Deduplicator instance.
func (*Deduplicator) NotifyDKGStarted ¶
func (d *Deduplicator) NotifyDKGStarted( newDKGSeed *big.Int, ) bool
NotifyDKGStarted notifies the client wants to start the distributed key generation upon receiving an event. It returns boolean indicating whether the client should proceed with the execution or ignore the event as a duplicate.
func (*Deduplicator) NotifyRelayEntryStarted ¶
func (d *Deduplicator) NotifyRelayEntryStarted( newRequestStartBlock uint64, newRequestPreviousEntry string, ) (bool, error)
NotifyRelayEntryStarted notifies the client wants to start relay entry generation upon receiving an event. It returns boolean indicating whether the client should proceed with the execution or ignore the event as a duplicate.
type GroupRegistration ¶
GroupRegistration represents an event of registering a new group with the given public key. TODO: Adjust to the v2 RandomBeacon contract and rename to GroupRegistered.
type RelayEntryRequested ¶
RelayEntryRequested represents a request for an entry in the threshold relay. TODO: Adjust to the v2 RandomBeacon contract.
type RelayEntrySubmitted ¶
type RelayEntrySubmitted struct {
BlockNumber uint64
}
RelayEntrySubmitted indicates that valid relay entry has been submitted to the chain for the currently processed relay request. This event is intended to be used by operators for tracking entry generation and submission progress. TODO: Adjust to the v2 RandomBeacon contract.