lookup

package
v4.0.3-hotfix Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: GPL-3.0 Imports: 17 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconDbBlocker

type BeaconDbBlocker struct {
	BeaconDB         db.ReadOnlyDatabase
	ChainInfoFetcher blockchain.ChainInfoFetcher
}

BeaconDbBlocker is an implementation of Blocker. It retrieves blocks from the beacon chain database.

func (*BeaconDbBlocker) Block

Block returns the beacon block for a given identifier. The identifier can be one of:

  • "head" (canonical head in node's view)
  • "genesis"
  • "finalized"
  • "justified"
  • <slot>
  • <hex encoded block root with '0x' prefix>

type BeaconDbStater

type BeaconDbStater struct {
	BeaconDB           db.ReadOnlyDatabase
	ChainInfoFetcher   blockchain.ChainInfoFetcher
	GenesisTimeFetcher blockchain.TimeFetcher
	StateGenService    stategen.StateManager
	ReplayerBuilder    stategen.ReplayerBuilder
}

BeaconDbStater is an implementation of Stater. It retrieves states from the beacon chain database.

func (*BeaconDbStater) State

func (p *BeaconDbStater) State(ctx context.Context, stateId []byte) (state.BeaconState, error)

State returns the BeaconState for a given identifier. The identifier can be one of:

  • "head" (canonical head in node's view)
  • "genesis"
  • "finalized"
  • "justified"
  • <slot>
  • <hex encoded state root with '0x' prefix>

func (*BeaconDbStater) StateBySlot

func (p *BeaconDbStater) StateBySlot(ctx context.Context, target primitives.Slot) (state.BeaconState, error)

StateBySlot returns the post-state for the requested slot. To generate the state, it uses the most recent canonical state prior to the target slot, and all canonical blocks between the found state's slot and the target slot. process_blocks is applied for all canonical blocks, and process_slots is called for any skipped slots, or slots following the most recent canonical block up to and including the target slot.

func (*BeaconDbStater) StateRoot

func (p *BeaconDbStater) StateRoot(ctx context.Context, stateId []byte) (root []byte, err error)

StateRoot returns a beacon state root for a given identifier. The identifier can be one of:

  • "head" (canonical head in node's view)
  • "genesis"
  • "finalized"
  • "justified"
  • <slot>
  • <hex encoded state root with '0x' prefix>

type BlockIdParseError

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

BlockIdParseError represents an error scenario where a block ID could not be parsed.

func NewBlockIdParseError

func NewBlockIdParseError(reason error) BlockIdParseError

NewBlockIdParseError creates a new error instance.

func (BlockIdParseError) Error

func (e BlockIdParseError) Error() string

Error returns the underlying error message.

type Blocker

type Blocker interface {
	Block(ctx context.Context, id []byte) (interfaces.ReadOnlySignedBeaconBlock, error)
}

Blocker is responsible for retrieving blocks.

type StateIdParseError

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

StateIdParseError represents an error scenario where a state ID could not be parsed.

func NewStateIdParseError

func NewStateIdParseError(reason error) StateIdParseError

NewStateIdParseError creates a new error instance.

func (*StateIdParseError) Error

func (e *StateIdParseError) Error() string

Error returns the underlying error message.

type StateNotFoundError

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

StateNotFoundError represents an error scenario where a state could not be found.

func NewStateNotFoundError

func NewStateNotFoundError(stateRootsSize int) StateNotFoundError

NewStateNotFoundError creates a new error instance.

func NewStateRootNotFoundError

func NewStateRootNotFoundError(stateRootsSize int) StateNotFoundError

NewStateRootNotFoundError creates a new error instance.

func (*StateNotFoundError) Error

func (e *StateNotFoundError) Error() string

Error returns the underlying error message.

type StateRootNotFoundError

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

StateRootNotFoundError represents an error scenario where a state root could not be found.

func (*StateRootNotFoundError) Error

func (e *StateRootNotFoundError) Error() string

Error returns the underlying error message.

type Stater

type Stater interface {
	State(ctx context.Context, id []byte) (state.BeaconState, error)
	StateRoot(ctx context.Context, id []byte) ([]byte, error)
	StateBySlot(ctx context.Context, slot primitives.Slot) (state.BeaconState, error)
}

Stater is responsible for retrieving states.

Jump to

Keyboard shortcuts

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