dkg

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionTask

type CompletionTask struct {
	*tasks.BaseTask
	// variables that are unique only for this task
	StartBlockHash common.Hash `json:"startBlockHash"`
}

CompletionTask contains required state for safely complete ETHDKG.

func NewCompletionTask

func NewCompletionTask(start, end uint64) *CompletionTask

NewCompletionTask creates a background task that attempts to call Complete on ethdkg.

func (*CompletionTask) Execute

Execute executes the task business logic.

func (*CompletionTask) Prepare

func (t *CompletionTask) Prepare(ctx context.Context) *tasks.TaskErr

Prepare prepares for work to be done in the CompletionTask.

func (*CompletionTask) ShouldExecute

func (t *CompletionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type DisputeGPKjTask

type DisputeGPKjTask struct {
	*tasks.BaseTask
	// additional fields that are not part of the default task
	Address common.Address
}

DisputeGPKjTask contains required state for performing a group accusation.

func NewDisputeGPKjTask

func NewDisputeGPKjTask(start, end uint64, address common.Address) *DisputeGPKjTask

NewDisputeGPKjTask creates a background task that attempts perform a group accusation if necessary.

func (*DisputeGPKjTask) Execute

Execute executes the task business logic.

func (*DisputeGPKjTask) Prepare

func (t *DisputeGPKjTask) Prepare(ctx context.Context) *tasks.TaskErr

Prepare prepares for work to be done in the DisputeGPKjTask. Here, we determine if anyone submitted an invalid gpkj.

func (*DisputeGPKjTask) ShouldExecute

func (t *DisputeGPKjTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type DisputeMissingGPKjTask

type DisputeMissingGPKjTask struct {
	*tasks.BaseTask
}

DisputeMissingGPKjTask stores the data required to dispute shares.

func NewDisputeMissingGPKjTask

func NewDisputeMissingGPKjTask(start, end uint64) *DisputeMissingGPKjTask

NewDisputeMissingGPKjTask creates a new task.

func (*DisputeMissingGPKjTask) Execute

Execute executes the task business logic.

func (*DisputeMissingGPKjTask) Prepare

Prepare prepares for work to be done in the DisputeMissingGPKjTask.

func (*DisputeMissingGPKjTask) ShouldExecute

func (t *DisputeMissingGPKjTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type DisputeMissingKeySharesTask

type DisputeMissingKeySharesTask struct {
	*tasks.BaseTask
}

DisputeMissingKeySharesTask stores the data required to dispute shares.

func NewDisputeMissingKeySharesTask

func NewDisputeMissingKeySharesTask(start, end uint64) *DisputeMissingKeySharesTask

NewDisputeMissingKeySharesTask creates a new task.

func (*DisputeMissingKeySharesTask) Execute

Execute executes the task business logic.

func (*DisputeMissingKeySharesTask) Prepare

Prepare prepares for work to be done in the DisputeMissingKeySharesTask.

func (*DisputeMissingKeySharesTask) ShouldExecute

func (t *DisputeMissingKeySharesTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type DisputeMissingRegistrationTask

type DisputeMissingRegistrationTask struct {
	*tasks.BaseTask
}

DisputeMissingRegistrationTask contains required state for accusing missing registrations.

func NewDisputeMissingRegistrationTask

func NewDisputeMissingRegistrationTask(start, end uint64) *DisputeMissingRegistrationTask

NewDisputeMissingRegistrationTask creates a background task to accuse missing registrations during ETHDKG.

func (*DisputeMissingRegistrationTask) Execute

Execute executes the task business logic.

func (*DisputeMissingRegistrationTask) Prepare

Prepare prepares for work to be done in the DisputeMissingRegistrationTask.

func (*DisputeMissingRegistrationTask) ShouldExecute

func (t *DisputeMissingRegistrationTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type DisputeMissingShareDistributionTask

type DisputeMissingShareDistributionTask struct {
	*tasks.BaseTask
}

DisputeMissingShareDistributionTask stores the data required to dispute shares.

func NewDisputeMissingShareDistributionTask

func NewDisputeMissingShareDistributionTask(start, end uint64) *DisputeMissingShareDistributionTask

NewDisputeMissingShareDistributionTask creates a new task.

func (*DisputeMissingShareDistributionTask) Execute

Execute executes the task business logic.

func (*DisputeMissingShareDistributionTask) Prepare

Prepare prepares for work to be done in the DisputeMissingShareDistributionTask.

func (*DisputeMissingShareDistributionTask) ShouldExecute

ShouldExecute checks if it makes sense to execute the task.

type DisputeShareDistributionTask

type DisputeShareDistributionTask struct {
	*tasks.BaseTask
	// additional fields that are not part of the default task
	Address common.Address
}

DisputeShareDistributionTask stores the data required to dispute shares.

func NewDisputeShareDistributionTask

func NewDisputeShareDistributionTask(start, end uint64, address common.Address) *DisputeShareDistributionTask

NewDisputeShareDistributionTask creates a new task.

func (*DisputeShareDistributionTask) Execute

Execute executes the task business logic.

func (*DisputeShareDistributionTask) Prepare

Prepare prepares for work to be done in the DisputeShareDistributionTask. It determines if the shares previously distributed are valid. If any are invalid, disputes will be issued.

func (*DisputeShareDistributionTask) ShouldExecute

func (t *DisputeShareDistributionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type GPKjSubmissionTask

type GPKjSubmissionTask struct {
	*tasks.BaseTask
	// contains filtered or unexported fields
}

GPKjSubmissionTask contains required state for gpk submission.

func NewGPKjSubmissionTask

func NewGPKjSubmissionTask(start, end uint64, adminHandler monInterfaces.AdminHandler) *GPKjSubmissionTask

NewGPKjSubmissionTask creates a background task that attempts to submit the gpkj in ETHDKG.

func (*GPKjSubmissionTask) Execute

Execute executes the task business logic.

func (*GPKjSubmissionTask) Prepare

func (t *GPKjSubmissionTask) Prepare(ctx context.Context) *tasks.TaskErr

Prepare prepares for work to be done in the GPKjSubmissionTask.

func (*GPKjSubmissionTask) SetAdminHandler

func (t *GPKjSubmissionTask) SetAdminHandler(adminHandler monInterfaces.AdminHandler)

SetAdminHandler sets the task adminHandler.

func (*GPKjSubmissionTask) ShouldExecute

func (t *GPKjSubmissionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type KeyShareSubmissionTask

type KeyShareSubmissionTask struct {
	*tasks.BaseTask
}

KeyShareSubmissionTask is the task for submitting KeyShare information.

func NewKeyShareSubmissionTask

func NewKeyShareSubmissionTask(start, end uint64) *KeyShareSubmissionTask

NewKeyShareSubmissionTask creates a new task.

func (*KeyShareSubmissionTask) Execute

Execute executes the task business logic.

func (*KeyShareSubmissionTask) Prepare

Prepare prepares for work to be done in the KeyShareSubmissionTask. Here, the G1 key share, G1 proof, and G2 key share are constructed and stored for submission.

func (*KeyShareSubmissionTask) ShouldExecute

func (t *KeyShareSubmissionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type MPKSubmissionTask

type MPKSubmissionTask struct {
	*tasks.BaseTask
	// variables that are unique only for this task
	StartBlockHash common.Hash `json:"startBlockHash"`
}

MPKSubmissionTask stores the data required to submit the mpk.

func NewMPKSubmissionTask

func NewMPKSubmissionTask(start, end uint64) *MPKSubmissionTask

NewMPKSubmissionTask creates a new task.

func (*MPKSubmissionTask) Execute

Execute executes the task business logic.

func (*MPKSubmissionTask) Prepare

func (t *MPKSubmissionTask) Prepare(ctx context.Context) *tasks.TaskErr

Prepare prepares for work to be done in the MPKSubmissionTask Here we load all key shares and construct the master public key to submit in DoWork.

func (*MPKSubmissionTask) ShouldExecute

func (t *MPKSubmissionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type RegisterTask

type RegisterTask struct {
	*tasks.BaseTask
}

RegisterTask contains required state for safely performing a registration.

func NewRegisterTask

func NewRegisterTask(start, end uint64) *RegisterTask

NewRegisterTask creates a background task that attempts to register with ETHDKG.

func (*RegisterTask) Execute

func (t *RegisterTask) Execute(ctx context.Context) (*types.Transaction, *tasks.TaskErr)

Execute executes the task business logic.

func (*RegisterTask) Prepare

func (t *RegisterTask) Prepare(ctx context.Context) *tasks.TaskErr

Prepare prepares for work to be done in the RegisterTask We construct our TransportPrivateKey and TransportPublicKey which will be used in the ShareDistribution phase for secure communication. These keys are *not* used otherwise. Also get the list of existing validators from the pool to assert accusation in later phases.

func (*RegisterTask) ShouldExecute

func (t *RegisterTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldExecute checks if it makes sense to execute the task.

type ShareDistributionTask

type ShareDistributionTask struct {
	*tasks.BaseTask
}

ShareDistributionTask stores the state required safely distribute shares.

func NewShareDistributionTask

func NewShareDistributionTask(start, end uint64) *ShareDistributionTask

NewShareDistributionTask creates a new task.

func (*ShareDistributionTask) Execute

Execute executes the task business logic.

func (*ShareDistributionTask) Prepare

Prepare prepares for work to be done in the ShareDistributionTask. We construct our commitments and encrypted shares before submitting them to the associated smart contract.

func (*ShareDistributionTask) ShouldExecute

func (t *ShareDistributionTask) ShouldExecute(ctx context.Context) (bool, *tasks.TaskErr)

ShouldRetry checks if it makes sense to try again.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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