mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
417bb45398
* v2 refactor * fix up imports * builds * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge branch 'master' into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * imports keymanager v1 * Update validator/keymanager/v1/remote.go * Update validator/client/polling/propose.go * Update validator/keymanager/v1/wallet.go * fmt * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * Merge refs/heads/master into accounts-revamp-p1 * fix conf * fix build * gaz
40 lines
1.7 KiB
Go
40 lines
1.7 KiB
Go
package v1
|
|
|
|
import (
|
|
"errors"
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/shared/bls"
|
|
)
|
|
|
|
// ErrNoSuchKey is returned whenever a request is made for a key of which a key manager is unaware.
|
|
var ErrNoSuchKey = errors.New("no such key")
|
|
|
|
// ErrCannotSign is returned whenever a signing attempt fails.
|
|
var ErrCannotSign = errors.New("cannot sign")
|
|
|
|
// ErrDenied is returned whenever a signing attempt is denied.
|
|
var ErrDenied = errors.New("signing attempt denied")
|
|
|
|
// KeyManager controls access to private keys by the validator.
|
|
type KeyManager interface {
|
|
// FetchValidatingKeys fetches the list of public keys that should be used to validate with.
|
|
FetchValidatingKeys() ([][48]byte, error)
|
|
// Sign signs a message for the validator to broadcast.
|
|
// Note that the domain should already be part of the root, but it is passed along for security purposes.
|
|
Sign(pubKey [48]byte, root [32]byte) (bls.Signature, error)
|
|
}
|
|
|
|
// ProtectingKeyManager provides access to a keymanager that protects its clients from slashing events.
|
|
type ProtectingKeyManager interface {
|
|
// SignGeneric signs a generic root.
|
|
// Note that the domain should already be part of the root, but it is provided for authorisation purposes.
|
|
SignGeneric(pubKey [48]byte, root [32]byte, domain [32]byte) (bls.Signature, error)
|
|
|
|
// SignProposal signs a block proposal for the validator to broadcast.
|
|
SignProposal(pubKey [48]byte, domain [32]byte, data *ethpb.BeaconBlockHeader) (bls.Signature, error)
|
|
|
|
// SignAttestation signs an attestation for the validator to broadcast.
|
|
SignAttestation(pubKey [48]byte, domain [32]byte, data *ethpb.AttestationData) (bls.Signature, error)
|
|
}
|