Versions in this module Expand all Collapse all v0 v0.5.0 Mar 23, 2021 Changes in this version + var ErrCanNotContinue = errors.New("can not continue distributed key generation") + var ErrUnknownRequest = errors.New("unknown request") + var ErrUnknownResponse = errors.New("response isn't in expected form") + var SvcEndpointInSync = "SvcEndpointInSync" + var SvcGetEvents = "SvcGetEvents" + var SvcGetSnapShot = "SvcGetSnapShot" + var SvcGetValidators = "SvcGetValidators" + var SvcWatchEthereum = "SvcWatchEthereum" + func AbortETHDKG(ethdkg *EthDKGState) + func ETHDKGInProgress(ethdkg *EthDKGState, currentBlock uint64) bool + func RetrieveParticipants(eth blockchain.Ethereum, callOpts *bind.CallOpts) (dkg.ParticipantList, int, error) + type Bus interface + Register func(serviceName string, capacity uint16) (<-chan rbus.Request, error) + Request func(serviceName string, timeOut time.Duration, request interface{}) (rbus.Response, error) + StartLoop func() (chan<- bool, error) + StopLoop func() error + func NewBus(rb rbus.Rbus, svcs *Services) (Bus, error) + type Database interface + FindState func() (*State, error) + UpdateState func(state *State) error + func NewDatabase(ctx context.Context, directoryName string, inMemory bool) Database + func NewDatabaseFromExisting(db *badger.DB) Database + type EthDKGPhase int + const Dispute + const GPKJGroupAccusation + const GPKJSubmission + const KeyShareSubmission + const MPKSubmission + const Registration + const ShareDistribution + type EthDKGSchedule struct + CompleteEnd uint64 + CompleteStart uint64 + DisputeEnd uint64 + DisputeStart uint64 + GPKJGroupAccusationEnd uint64 + GPKJGroupAccusationStart uint64 + GPKJSubmissionEnd uint64 + GPKJSubmissionStart uint64 + KeyShareSubmissionEnd uint64 + KeyShareSubmissionStart uint64 + MPKSubmissionEnd uint64 + MPKSubmissionStart uint64 + RegistrationEnd uint64 + RegistrationStart uint64 + ShareDistributionEnd uint64 + ShareDistributionStart uint64 + type EthDKGState struct + Address common.Address + Commitments map[common.Address][][2]*big.Int + CompleteTH tasks.TaskHandler + DisputeTH tasks.TaskHandler + EncryptedShares map[common.Address][]*big.Int + GPKJGroupAccusationTH tasks.TaskHandler + GPKJSubmissionTH tasks.TaskHandler + GroupPrivateKey *big.Int + GroupPublicKey [4]*big.Int + Index int + KeyShareG1CorrectnessProofs map[common.Address][2]*big.Int + KeyShareG1s map[common.Address][2]*big.Int + KeyShareG2s map[common.Address][4]*big.Int + KeyShareSubmissionTH tasks.TaskHandler + MPKSubmissionTH tasks.TaskHandler + MasterPublicKey [4]*big.Int + NumberOfValidators int + Participants dkg.ParticipantList + PrivateCoefficients []*big.Int + RegistrationTH tasks.TaskHandler + Schedule *EthDKGSchedule + SecretValue *big.Int + ShareDistributionTH tasks.TaskHandler + TransportPrivateKey *big.Int + TransportPublicKey [2]*big.Int + ValidatorThreshold int + func NewEthDKGState() *EthDKGState + type Monitor interface + GetStatus func() <-chan string + StartEventLoop func() (chan<- bool, error) + func NewMonitor(db Database, bus Bus, tickInterval time.Duration, timeout time.Duration) (Monitor, error) + type Services struct + func NewServices(eth blockchain.Ethereum, db *db.Database, dph *deposit.Handler, ...) *Services + func (svcs *Services) DoDistributeShares(state *State, block uint64) error + func (svcs *Services) DoGroupAccusationGPKj(state *State, block uint64) error + func (svcs *Services) DoSubmitDispute(state *State, block uint64) error + func (svcs *Services) DoSubmitGPKj(state *State, block uint64) error + func (svcs *Services) DoSubmitKeyShare(state *State, block uint64) error + func (svcs *Services) DoSubmitMasterPublicKey(state *State, block uint64) error + func (svcs *Services) DoSuccessfulCompletion(state *State, block uint64) error + func (svcs *Services) EndpointInSync(ctx context.Context, state *State) error + func (svcs *Services) PersistSnapshot(blockHeader *objs.BlockHeader) error + func (svcs *Services) ProcessDepositReceived(state *State, log types.Log) error + func (svcs *Services) ProcessKeyShareSubmission(state *State, log types.Log) error + func (svcs *Services) ProcessRegistrationOpen(state *State, log types.Log) error + func (svcs *Services) ProcessShareDistribution(state *State, log types.Log) error + func (svcs *Services) ProcessSnapshotTaken(state *State, log types.Log) error + func (svcs *Services) ProcessValidatorMember(state *State, log types.Log) error + func (svcs *Services) ProcessValidatorSet(state *State, log types.Log) error + func (svcs *Services) RegisterEvent(selector string, name string, fn func(*State, types.Log) error) error + func (svcs *Services) SetBN256PrivateKey(pk []byte) error + func (svcs *Services) SetSECP256K1PrivateKey(pk []byte) error + func (svcs *Services) UpdateProgress(state *State) error + func (svcs *Services) WatchEthereum(state *State) error + type Share struct + Commitments [][2]*big.Int + EncryptedShares []*big.Int + Issuer common.Address + type State struct + CommunicationFailures uint32 + EthereumInSync bool + HighestBlockFinalized uint64 + HighestBlockProcessed uint64 + HighestEpochProcessed uint32 + HighestEpochSeen uint32 + InSync bool + LatestDepositProcessed uint32 + LatestDepositSeen uint32 + PeerCount uint32 + ValidatorSets map[uint32]ValidatorSet + Validators map[uint32][]Validator + Version uint8 + func (s *State) Clone() *State + func (s *State) Diff(o *State) string + func (s State) String() string + type Validator struct + Account common.Address + Index uint8 + SharedKey [4]big.Int + type ValidatorSet struct + GroupKey [4]big.Int + NotBeforeMadNetHeight uint32 + ValidatorCount uint8