randao

package
v0.1.1-experimental.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = errors.New("invalid signature")

ErrInvalidSignature is returned when the signature is invalid.

Functions

This section is empty.

Types

type Option

type Option func(*Processor) error

func WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig sets the config.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets the logger.

func WithSigner

func WithSigner(
	signer core.BLSSigner,
) Option

WithSigner sets the signer.

type Processor

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

Processor is the randao processor.

func NewProcessor

func NewProcessor(
	opts ...Option,
) *Processor

NewProcessor creates a new randao processor.

func (*Processor) BuildReveal

func (p *Processor) BuildReveal(
	st state.BeaconState,
) (primitives.BLSSignature, error)

BuildReveal creates a reveal for the proposer. def get_epoch_signature(state: BeaconState, block: BeaconBlock, privkey: int) -> BLSSignature:

domain = get_domain(state, DOMAIN_RANDAO, compute_epoch_at_slot(block.slot))
signing_root = compute_signing_root(
					compute_epoch_at_slot(block.slot),
					domain)

return bls.Sign(privkey, signing_root)

func (*Processor) ProcessRandao

func (p *Processor) ProcessRandao(
	st state.BeaconState,
	blk beacontypes.BeaconBlock,
) error

ProcessRandao processes the randao reveal. process_randao in the Ethereum 2.0 specification.

func (*Processor) ProcessRandaoMixesReset

func (p *Processor) ProcessRandaoMixesReset(st state.BeaconState) error

ProcessRandaoMixesReset resets the randao mixes. process_randao_mixes_reset in the Ethereum 2.0 specification.

Jump to

Keyboard shortcuts

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