mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
5d65ace970
* checkpoint changes * Update beacon-chain/rpc/validator/status.go Co-authored-by: Potuz <potuz@potuz.net> * Update beacon-chain/rpc/validator/status.go Co-authored-by: Potuz <potuz@potuz.net> * add in client side tests * add ordering * add all new test cases * gate feature * handle edge case * add one more test case * fatal error * zahoor's review * Update validator/client/validator.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Update validator/client/validator.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * doppelganger not doppleganger * preston's review * add in comment * change comment * Fix e2e to only run new flags on the current version * Fix bug where zero byte public keys were always sent in the request when attestation history existed. Still some tests to fix due to another bug in attester protection AttestationHistoryForPubKey. * go mod tidy, gazelle * Increase test size * fix timeout, change size back to small Co-authored-by: Potuz <potuz@potuz.net> Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
55 lines
2.1 KiB
Go
55 lines
2.1 KiB
Go
package iface
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"time"
|
|
|
|
types "github.com/prysmaticlabs/eth2-types"
|
|
"github.com/prysmaticlabs/prysm/validator/keymanager"
|
|
)
|
|
|
|
// ErrConnectionIssue represents a connection problem.
|
|
var ErrConnectionIssue = errors.New("could not connect")
|
|
|
|
// ValidatorRole defines the validator role.
|
|
type ValidatorRole int8
|
|
|
|
const (
|
|
// RoleUnknown means that the role of the validator cannot be determined.
|
|
RoleUnknown ValidatorRole = iota
|
|
// RoleAttester means that the validator should submit an attestation.
|
|
RoleAttester
|
|
// RoleProposer means that the validator should propose a block.
|
|
RoleProposer
|
|
// RoleAggregator means that the validator should submit an aggregation and proof.
|
|
RoleAggregator
|
|
)
|
|
|
|
// Validator interface defines the primary methods of a validator client.
|
|
type Validator interface {
|
|
Done()
|
|
WaitForChainStart(ctx context.Context) error
|
|
WaitForSync(ctx context.Context) error
|
|
WaitForActivation(ctx context.Context, accountsChangedChan chan [][48]byte) error
|
|
SlasherReady(ctx context.Context) error
|
|
CanonicalHeadSlot(ctx context.Context) (types.Slot, error)
|
|
NextSlot() <-chan types.Slot
|
|
SlotDeadline(slot types.Slot) time.Time
|
|
LogValidatorGainsAndLosses(ctx context.Context, slot types.Slot) error
|
|
UpdateDuties(ctx context.Context, slot types.Slot) error
|
|
RolesAt(ctx context.Context, slot types.Slot) (map[[48]byte][]ValidatorRole, error) // validator pubKey -> roles
|
|
SubmitAttestation(ctx context.Context, slot types.Slot, pubKey [48]byte)
|
|
ProposeBlock(ctx context.Context, slot types.Slot, pubKey [48]byte)
|
|
SubmitAggregateAndProof(ctx context.Context, slot types.Slot, pubKey [48]byte)
|
|
LogAttestationsSubmitted()
|
|
LogNextDutyTimeLeft(slot types.Slot) error
|
|
UpdateDomainDataCaches(ctx context.Context, slot types.Slot)
|
|
WaitForWalletInitialization(ctx context.Context) error
|
|
AllValidatorsAreExited(ctx context.Context) (bool, error)
|
|
GetKeymanager() keymanager.IKeymanager
|
|
ReceiveBlocks(ctx context.Context, connectionErrorChannel chan<- error)
|
|
HandleKeyReload(ctx context.Context, newKeys [][48]byte) (bool, error)
|
|
CheckDoppelGanger(ctx context.Context) error
|
|
}
|