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 state.ReadOnlyBeaconState, 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 state.ReadOnlyBeaconState, 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 ¶
type PoolManager interface { PendingExits(state state.ReadOnlyBeaconState, slot types.Slot, noLimit bool) []*ethpb.SignedVoluntaryExit InsertVoluntaryExit(ctx context.Context, state state.ReadOnlyBeaconState, 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.