consensuslayer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: AGPL-3.0-or-later Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachingConsensusLayer

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

CachingConsensusLayer provides rescue-proxy with the consensus layer information needed to enforce fee recipients and caches it for performance.

func NewCachingConsensusLayer

func NewCachingConsensusLayer(bnURL *url.URL, logger *zap.Logger, forceJSON bool) *CachingConsensusLayer

NewConsensusLayer creates a new consensus layer client using the provided url and logger

func (*CachingConsensusLayer) Deinit

func (c *CachingConsensusLayer) Deinit()

Deinit shuts down the consensus layer client

func (*CachingConsensusLayer) GetValidatorInfo

func (c *CachingConsensusLayer) GetValidatorInfo(validatorIndices []string) (map[string]*ValidatorInfo, error)

GetValidatorIfno maps a validator index to a pubkey and withdrawal credential. It caches responses from the beacon client in memory for an arbitrary amount of time to save resources.

func (*CachingConsensusLayer) GetValidators

func (c *CachingConsensusLayer) GetValidators() ([]*apiv1.Validator, error)

GetValidators gets the list of all validators for the finalized state It does no caching- the response is large, so caching should be done downstream, for the data the caller cares about.

func (*CachingConsensusLayer) Init

Init connects to the consensus layer and initializes the cache

type ConsensusLayer

type ConsensusLayer interface {
	GetValidatorInfo([]string) (map[string]*ValidatorInfo, error)
	GetValidators() ([]*apiv1.Validator, error)
}

ConsensusLayer provides an abstraction for the rescue proxy over the consensus layer It's specifically needed to map validator indices to pubkeys prior to EL validation

type ValidatorInfo

type ValidatorInfo struct {
	Pubkey            rptypes.ValidatorPubkey
	WithdrawalAddress common.Address
	Is0x01            bool
}

Jump to

Keyboard shortcuts

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