execution

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockNotFound = errors.New("execution block not found")

ErrBlockNotFound is returned when the execution node does not know about the requested block, e.g. a gloas payload that has not been revealed yet.

Functions

This section is empty.

Types

type BadBlock

type BadBlock struct {
	// The hash of the block
	Hash string `json:"hash"`
	// Block is the actual bad block
	Block json.RawMessage `json:"block"`
	// RLP is the RLP encoded block
	RLP string `json:"rlp"`
}

func (*BadBlock) ParseBlockHeader

func (b *BadBlock) ParseBlockHeader() (*types.Header, error)

type BadBlockFilter added in v0.1.0

type BadBlockFilter func(ctx context.Context, hash string) bool

BadBlockFilter decides from the hash alone whether a bad block is worth decoding. It runs before the block's body is materialised, which is where the saving is: a node repeats every bad block it has ever seen on every poll, and nearly all of them are already indexed.

type BadBlockHandler added in v0.1.0

type BadBlockHandler func(ctx context.Context, block *BadBlock) error

BadBlockHandler receives one decoded bad block at a time. The block is only valid for the duration of the call. Returning an error stops the stream.

type Config

type Config struct {
	// The address of the Execution node to connect to
	NodeAddress         string `yaml:"nodeAddress"`
	TraceDisableMemory  *bool  `yaml:"traceDisableMemory" default:"false"`
	TraceDisableStack   *bool  `yaml:"traceDisableStack" default:"true"`
	TraceDisableStorage *bool  `yaml:"traceDisableStorage" default:"false"`
}

func (*Config) GetTraceDisableMemory added in v0.0.12

func (c *Config) GetTraceDisableMemory() bool

func (*Config) GetTraceDisableStack added in v0.0.12

func (c *Config) GetTraceDisableStack() bool

func (*Config) GetTraceDisableStorage added in v0.0.12

func (c *Config) GetTraceDisableStorage() bool

func (*Config) Validate

func (c *Config) Validate() error

type Node

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

func NewNode

func NewNode(log logrus.FieldLogger, conf *Config) *Node

func (*Node) BlockNumber added in v0.1.0

func (n *Node) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the execution node's current head block number.

func (*Node) ForEachBadBlock added in v0.1.0

func (n *Node) ForEachBadBlock(ctx context.Context, stall time.Duration, want BadBlockFilter, handle BadBlockHandler) error

ForEachBadBlock streams debug_getBadBlocks and hands the blocks that pass want to handle, one at a time, while the response is still arriving. Memory is bounded by one bad block rather than by the node's whole list.

A stream that legitimately runs for minutes cannot live under a whole-request deadline, so instead the call is abandoned once no bytes have arrived for stall, headers included.

func (*Node) GetBlockNumberByHash added in v0.1.0

func (n *Node) GetBlockNumberByHash(ctx context.Context, hash string) (uint64, error)

GetBlockNumberByHash resolves an execution block number from its hash. Returns ErrBlockNotFound if the node does not (yet) have the block.

func (*Node) GetRawDebugBlockTrace

func (n *Node) GetRawDebugBlockTrace(ctx context.Context, hash, client string) (*[]byte, error)

func (*Node) Metadata

func (n *Node) Metadata() *services.MetadataService

func (*Node) OnReady

func (n *Node) OnReady(_ context.Context, callback func(ctx context.Context) error)

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

func (*Node) Stop

func (n *Node) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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