Documentation ¶
Index ¶
- Variables
- func ComputeETHSigningRoot(obj ssz.HashRoot, domain phase0.Domain) (phase0.Root, error)
- func IsValidFarFutureEpoch(network core.Network, epoch phase0.Epoch) bool
- func IsValidFarFutureSlot(network core.Network, slot phase0.Slot) bool
- type SSZBytes
- type SSZUint64
- type SimpleSigner
- func (signer *SimpleSigner) SignAggregateAndProof(agg *phase0.AggregateAndProof, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignBLSToExecutionChange(blsToExecutionChange *capella.BLSToExecutionChange, domain phase0.Domain, ...) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignBeaconAttestation(attestation *phase0.AttestationData, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignBeaconBlock(b *spec.VersionedBeaconBlock, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignBlindedBeaconBlock(b *api.VersionedBlindedBeaconBlock, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignBlock(block ssz.HashRoot, slot phase0.Slot, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignEpoch(epoch phase0.Epoch, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignRegistration(registration *api.VersionedValidatorRegistration, domain phase0.Domain, ...) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignSlot(slot phase0.Slot, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignSyncCommittee(msgBlockRoot []byte, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignSyncCommitteeContributionAndProof(contribAndProof *altair.ContributionAndProof, domain phase0.Domain, ...) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignSyncCommitteeSelectionData(data *altair.SyncAggregatorSelectionData, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- func (signer *SimpleSigner) SignVoluntaryExit(voluntaryExit *phase0.VoluntaryExit, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
- type ValidatorSigner
Constants ¶
This section is empty.
Variables ¶
var FarFutureMaxValidEpoch = int64(time.Minute.Seconds() * 20)
FarFutureMaxValidEpoch is the max epoch of far future signing
Functions ¶
func ComputeETHSigningRoot ¶
ComputeETHSigningRoot returns computed root for eth signing
func IsValidFarFutureEpoch ¶
IsValidFarFutureEpoch prevents 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
Types ¶
type SSZBytes ¶
type SSZBytes []byte
SSZBytes --
func (SSZBytes) HashTreeRootWith ¶
func (b SSZBytes) HashTreeRootWith(hh ssz.HashWalker) error
HashTreeRootWith --
type SSZUint64 ¶
type SSZUint64 uint64
SSZUint64 --
func (SSZUint64) HashTreeRootWith ¶
func (s SSZUint64) HashTreeRootWith(hh ssz.HashWalker) error
HashTreeRootWith --
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 *phase0.AggregateAndProof, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignAggregateAndProof signs aggregate and proof
func (*SimpleSigner) SignBLSToExecutionChange ¶
func (signer *SimpleSigner) SignBLSToExecutionChange(blsToExecutionChange *capella.BLSToExecutionChange, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignBLSToExecutionChange signs the given BLSToExecutionChange. OFFLINE operation
func (*SimpleSigner) SignBeaconAttestation ¶
func (signer *SimpleSigner) SignBeaconAttestation(attestation *phase0.AttestationData, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignBeaconAttestation signs beacon attestation data
func (*SimpleSigner) SignBeaconBlock ¶
func (signer *SimpleSigner) SignBeaconBlock(b *spec.VersionedBeaconBlock, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignBeaconBlock signs the given beacon block
func (*SimpleSigner) SignBlindedBeaconBlock ¶
func (signer *SimpleSigner) SignBlindedBeaconBlock(b *api.VersionedBlindedBeaconBlock, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignBlindedBeaconBlock signs the given beacon block
func (*SimpleSigner) SignBlock ¶
func (signer *SimpleSigner) SignBlock(block ssz.HashRoot, slot phase0.Slot, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignBlock signs the given beacon block
func (*SimpleSigner) SignEpoch ¶
func (signer *SimpleSigner) SignEpoch(epoch phase0.Epoch, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignEpoch signs the given epoch
func (*SimpleSigner) SignRegistration ¶
func (signer *SimpleSigner) SignRegistration(registration *api.VersionedValidatorRegistration, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignRegistration signs the given ValidatorRegistration.
func (*SimpleSigner) SignSlot ¶
func (signer *SimpleSigner) SignSlot(slot phase0.Slot, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignSlot signes the given slot
func (*SimpleSigner) SignSyncCommittee ¶
func (signer *SimpleSigner) SignSyncCommittee(msgBlockRoot []byte, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignSyncCommittee sign sync committee
func (*SimpleSigner) SignSyncCommitteeContributionAndProof ¶
func (signer *SimpleSigner) SignSyncCommitteeContributionAndProof(contribAndProof *altair.ContributionAndProof, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignSyncCommitteeContributionAndProof sign sync committee
func (*SimpleSigner) SignSyncCommitteeSelectionData ¶
func (signer *SimpleSigner) SignSyncCommitteeSelectionData(data *altair.SyncAggregatorSelectionData, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignSyncCommitteeSelectionData sign sync committee slection data
func (*SimpleSigner) SignVoluntaryExit ¶
func (signer *SimpleSigner) SignVoluntaryExit(voluntaryExit *phase0.VoluntaryExit, domain phase0.Domain, pubKey []byte) ([]byte, []byte, error)
SignVoluntaryExit signs the given VoluntaryExit.
type ValidatorSigner ¶
type ValidatorSigner interface { SignBeaconBlock(block *spec.VersionedBeaconBlock, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignBlindedBeaconBlock(block *api.VersionedBlindedBeaconBlock, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignBeaconAttestation(attestation *phase0.AttestationData, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignAggregateAndProof(agg *phase0.AggregateAndProof, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignSlot(slot phase0.Slot, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignEpoch(epoch phase0.Epoch, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignSyncCommittee(msgBlockRoot []byte, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignSyncCommitteeSelectionData(data *altair.SyncAggregatorSelectionData, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignSyncCommitteeContributionAndProof(contribAndProof *altair.ContributionAndProof, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignRegistration(registration *api.VersionedValidatorRegistration, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignVoluntaryExit(voluntaryExit *phase0.VoluntaryExit, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) SignBLSToExecutionChange(blsToExecutionChange *capella.BLSToExecutionChange, domain phase0.Domain, pubKey []byte) (sig []byte, root []byte, err error) }
ValidatorSigner represents the behavior of the validator signer