signer

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

README

Blox Eth Key Manager - Validator Signer

blox.io

Validator Signer has the responsibility to sign the basic 3 operations an eth 2.0 validator needs:

- sign attestation
- sign block proposal
- sign attestation aggregation
- return available public keys
Instantiation
   signer := &signer.SimpleSigner{
   	wallet,
   	slashingProtector
   }

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FarFutureMaxValidEpoch = int64(time.Hour.Hours()) * 6

Functions

func IsValidFarFutureEpoch

func IsValidFarFutureEpoch(network core.Network, epoch uint64) bool

To prevent far into the future signing request, verify a slot is within the current epoch https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/validator.md#protection-best-practices

func IsValidFarFutureSlot

func IsValidFarFutureSlot(network core.Network, slot uint64) bool

Types

type SimpleSigner

type SimpleSigner struct {
	// contains filtered or unexported fields
}

SimpleSigner implements ValidatorSigner interface

func NewSimpleSigner

func NewSimpleSigner(wallet core.Wallet, slashingProtector core.SlashingProtector, network core.Network) *SimpleSigner

NewSimpleSigner is the constructor of SimpleSigner

func (*SimpleSigner) SignAggregateAndProof

func (signer *SimpleSigner) SignAggregateAndProof(agg *eth.AggregateAttestationAndProof, domain []byte, pubKey []byte) ([]byte, error)

func (*SimpleSigner) SignBeaconAttestation

func (signer *SimpleSigner) SignBeaconAttestation(attestation *eth.AttestationData, domain []byte, pubKey []byte) ([]byte, error)

func (*SimpleSigner) SignBeaconBlock

func (signer *SimpleSigner) SignBeaconBlock(block *eth.BeaconBlock, domain []byte, pubKey []byte) ([]byte, error)

func (*SimpleSigner) SignEpoch

func (signer *SimpleSigner) SignEpoch(epoch uint64, domain []byte, pubKey []byte) ([]byte, error)

func (*SimpleSigner) SignSlot

func (signer *SimpleSigner) SignSlot(slot uint64, domain []byte, pubKey []byte) ([]byte, error)

type ValidatorSigner

type ValidatorSigner interface {
	SignBeaconBlock(block *eth.BeaconBlock, domain []byte, pubKey []byte) ([]byte, error)
	SignBeaconAttestation(attestation *eth.AttestationData, domain []byte, pubKey []byte) ([]byte, error)
	SignAggregateAndProof(agg *eth.AggregateAttestationAndProof, domain []byte, pubKey []byte) ([]byte, error)
	SignSlot(slot uint64, domain []byte, pubKey []byte) ([]byte, error)
	SignEpoch(epoch uint64, domain []byte, pubKey []byte) ([]byte, error)
}

ValidatorSigner represents the behavior of the validator signer

Jump to

Keyboard shortcuts

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