voluntaryexits

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: GPL-3.0 Imports: 9 Imported by: 35

Documentation

Overview

Package voluntaryexits defines an in-memory pool of received voluntary exit events by the beacon node, handling their lifecycle and performing integrity checks before serving them as objects for validators to include in blocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool is a concrete implementation of PoolManager.

func NewPool

func NewPool() *Pool

NewPool accepts a head fetcher (for reading the validator set) and returns an initialized voluntary exit pool.

func (*Pool) InsertVoluntaryExit

func (p *Pool) InsertVoluntaryExit(ctx context.Context, state *beaconstate.BeaconState, exit *ethpb.SignedVoluntaryExit)

InsertVoluntaryExit into the pool. This method is a no-op if the pending exit already exists, or the validator is already exited.

func (*Pool) MarkIncluded

func (p *Pool) MarkIncluded(exit *ethpb.SignedVoluntaryExit)

MarkIncluded is used when an exit has been included in a beacon block. Every block seen by this node should call this method to include the exit. This will remove the exit from the pending exits slice.

func (*Pool) PendingExits

func (p *Pool) PendingExits(state *beaconstate.BeaconState, slot types.Slot, noLimit bool) []*ethpb.SignedVoluntaryExit

PendingExits returns exits that are ready for inclusion at the given slot. This method will not return more than the block enforced MaxVoluntaryExits.

type PoolManager added in v1.3.2

type PoolManager interface {
	PendingExits(state *beaconstate.BeaconState, slot types.Slot, noLimit bool) []*ethpb.SignedVoluntaryExit
	InsertVoluntaryExit(ctx context.Context, state *beaconstate.BeaconState, exit *ethpb.SignedVoluntaryExit)
	MarkIncluded(exit *ethpb.SignedVoluntaryExit)
}

PoolManager maintains pending and seen voluntary exits. This pool is used by proposers to insert voluntary exits into new blocks.

type PoolMock added in v1.3.2

type PoolMock struct {
	Exits []*eth.SignedVoluntaryExit
}

PoolMock is a fake implementation of PoolManager.

func (*PoolMock) InsertVoluntaryExit added in v1.3.2

func (*PoolMock) InsertVoluntaryExit(_ context.Context, _ *beaconstate.BeaconState, _ *eth.SignedVoluntaryExit)

InsertVoluntaryExit --

func (*PoolMock) MarkIncluded added in v1.3.2

func (*PoolMock) MarkIncluded(_ *eth.SignedVoluntaryExit)

MarkIncluded --

func (*PoolMock) PendingExits added in v1.3.2

func (m *PoolMock) PendingExits(_ *beaconstate.BeaconState, _ types.Slot, _ bool) []*eth.SignedVoluntaryExit

PendingExits --

Jump to

Keyboard shortcuts

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