agent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: GPL-3.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeaconBlockDirectory added in v0.1.0

func BeaconBlockDirectory(
	network string,
	slot phase0.Slot,
) string

func BeaconStateDirectory added in v0.1.0

func BeaconStateDirectory(
	network string,
	slot phase0.Slot,
) string

func CreateBeaconBadBlobFileName added in v0.0.16

func CreateBeaconBadBlobFileName(
	node string,
	network string,
	slot phase0.Slot,
	blockRoot string,
	index uint64,
) string

func CreateBeaconBadBlockFileName added in v0.0.16

func CreateBeaconBadBlockFileName(
	node string,
	network string,
	slot phase0.Slot,
	blockRoot string,
) string

func CreateExecutionBadBlockFileName

func CreateExecutionBadBlockFileName(
	node string,
	network string,
	blockHash string,
) string

func ExecutionBlockTraceDirectory added in v0.1.0

func ExecutionBlockTraceDirectory(
	network string,
	blockNumber uint64,
) string

func ExecutionBlockTraceIdentity added in v0.1.0

func ExecutionBlockTraceIdentity(blockHash, dedupKey string) string

ExecutionBlockTraceIdentity names a trace inside its directory. A trace is only reproducible from the client that produced it and the parameters it was asked for, all of which its dedup key carries and its block hash does not. Both belong in the location: two dedup keys that happen to produce identical bytes must still land on two objects, because collecting either one would otherwise empty the other's rows.

func ExecutionPayloadEnvelopeDirectory added in v0.1.0

func ExecutionPayloadEnvelopeDirectory(
	network string,
	slot phase0.Slot,
) string

func New

func New(ctx context.Context, log logrus.FieldLogger, config *Config) (*agent, error)

Types

type BeaconBadBlobRequest added in v0.0.16

type BeaconBadBlobRequest struct {
	Path string
	// contains filtered or unexported fields
}

type BeaconBadBlockRequest added in v0.0.16

type BeaconBadBlockRequest struct {
	Path string
	// contains filtered or unexported fields
}

type BeaconBlockRequest added in v0.0.16

type BeaconBlockRequest struct {
	Slot phase0.Slot
	// contains filtered or unexported fields
}

type BeaconStateRequest

type BeaconStateRequest struct {
	Slot phase0.Slot
	// contains filtered or unexported fields
}

type Config

type Config struct {
	LoggingLevel string  `yaml:"logging" default:"info"`
	MetricsAddr  string  `yaml:"metricsAddr" default:":9090"`
	PProfAddr    *string `yaml:"pprofAddr"`

	// ShutdownTimeoutSeconds bounds how long we wait for in-flight fetches and
	// uploads to finish after a shutdown signal. Anything still running when it
	// expires is abandoned; the store-then-index write order makes that safe.
	// Keep it strictly below the orchestrator's termination grace period, or the
	// process is killed mid-drain and the wait achieves nothing.
	ShutdownTimeoutSeconds int `yaml:"shutdownTimeoutSeconds" default:"10"`

	// FetchTimeouts bounds one fetch attempt per artifact kind. States are the
	// largest artifact by far, so their value decides whether a distant agent
	// can capture them at all.
	FetchTimeouts FetchTimeouts `yaml:"fetchTimeouts"`

	// The name of the agent
	Name string `yaml:"name"`

	// Ethereum configuration
	Ethereum ethereum.Config `yaml:"ethereum"`

	// Indexer configuration
	Indexer *indexer.Config `yaml:"indexer"`

	// Store configuration
	Store *store.Config `yaml:"store"`
}

func (*Config) ShutdownTimeout added in v0.1.0

func (c *Config) ShutdownTimeout() time.Duration

ShutdownTimeout is how long the agent waits for its queue workers after its context is cancelled, before abandoning whatever is still running.

func (*Config) Validate

func (c *Config) Validate() error

type ExecutionBadBlockRequest added in v0.0.16

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

type ExecutionBlockTraceRequest

type ExecutionBlockTraceRequest struct {
	BlockID string
	// contains filtered or unexported fields
}

ExecutionBlockTraceRequest identifies the beacon block whose execution payload should be traced. It carries no execution block hash or number: resolving those can block on a builder revealing a payload, so it happens on the queue worker rather than in the beacon event callback that queues it.

type ExecutionPayloadEnvelopeRequest added in v0.1.0

type ExecutionPayloadEnvelopeRequest struct {
	Slot phase0.Slot
	// contains filtered or unexported fields
}

type FetchTimeouts added in v0.1.0

type FetchTimeouts struct {
	BeaconStateSeconds              int `yaml:"beaconStateSeconds" default:"30"`
	BeaconBlockSeconds              int `yaml:"beaconBlockSeconds" default:"30"`
	ExecutionPayloadEnvelopeSeconds int `yaml:"executionPayloadEnvelopeSeconds" default:"60"`
	ExecutionBlockTraceSeconds      int `yaml:"executionBlockTraceSeconds" default:"60"`
	ExecutionBadBlockSeconds        int `yaml:"executionBadBlockSeconds" default:"60"`
}

FetchTimeouts bounds a single fetch attempt per artifact kind. The defaults suit an agent deployed near its node, where even a state transfer is sub-second. A WAN link needs minutes for states: a 73 MB devnet state at 2 MB/s is already past the default before it finishes. Keep values under the artifact's availability window (~6 minutes for states on the tightest clients) or the fetch outlives the data it is fetching.

func (FetchTimeouts) BeaconBlock added in v0.1.0

func (f FetchTimeouts) BeaconBlock() time.Duration

func (FetchTimeouts) BeaconState added in v0.1.0

func (f FetchTimeouts) BeaconState() time.Duration

func (FetchTimeouts) ExecutionBadBlock added in v0.1.0

func (f FetchTimeouts) ExecutionBadBlock() time.Duration

func (FetchTimeouts) ExecutionBlockTrace added in v0.1.0

func (f FetchTimeouts) ExecutionBlockTrace() time.Duration

func (FetchTimeouts) ExecutionPayloadEnvelope added in v0.1.0

func (f FetchTimeouts) ExecutionPayloadEnvelope() time.Duration

type Metrics

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

func GetMetricsInstance added in v0.0.17

func GetMetricsInstance(namespace string) *Metrics

func (*Metrics) AddFetchedBytes added in v0.1.0

func (m *Metrics) AddFetchedBytes(queue Queue, agentName string, bytes int64)

AddFetchedBytes records raw bytes read from a node, whether or not they were stored.

func (*Metrics) AddStoredBytes added in v0.1.0

func (m *Metrics) AddStoredBytes(queue Queue, agentName string, bytes int64)

AddStoredBytes records compressed bytes handed to the store. A payload that was hashed against one somebody else had already stored contributes nothing, which is the whole point of measuring it separately.

func (*Metrics) IncrementArtifactUnsupported added in v0.1.0

func (m *Metrics) IncrementArtifactUnsupported(queue Queue, agentName string)

func (*Metrics) IncrementBlobCreated added in v0.1.0

func (m *Metrics) IncrementBlobCreated(queue Queue, agentName string)

func (*Metrics) IncrementBlobReused added in v0.1.0

func (m *Metrics) IncrementBlobReused(queue Queue, agentName string)

func (*Metrics) IncrementFlightAbandoned added in v0.1.0

func (m *Metrics) IncrementFlightAbandoned(queue Queue, agentName string)

IncrementFlightAbandoned records a caller that stopped waiting on another node's upload. A rising count means the fleet is collapsing less work than it could, which is a symptom of slow nodes rather than of this agent.

func (*Metrics) IncrementItemDropped added in v0.1.0

func (m *Metrics) IncrementItemDropped(queue Queue, agentName, reason string)

func (*Metrics) IncrementItemExported added in v0.0.11

func (m *Metrics) IncrementItemExported(queue Queue, agentName string)

func (*Metrics) IncrementItemSkipped added in v0.0.30

func (m *Metrics) IncrementItemSkipped(queue Queue, agentName string)

func (*Metrics) IncrementLengthUnverified added in v0.1.0

func (m *Metrics) IncrementLengthUnverified(queue Queue, agentName string)

IncrementLengthUnverified records a payload the completeness gate could not be applied to, which HTTP/2, chunked encoding and transparent decompression all produce.

func (*Metrics) IncrementPayloadMismatch added in v0.1.0

func (m *Metrics) IncrementPayloadMismatch(queue Queue, agentName string)

func (*Metrics) IncrementPayloadVerified added in v0.1.0

func (m *Metrics) IncrementPayloadVerified(queue Queue, agentName string)

func (*Metrics) IncrementTransferIncomplete added in v0.1.0

func (m *Metrics) IncrementTransferIncomplete(queue Queue, agentName string)

func (*Metrics) ObserveQueueItemProcessingTime

func (m *Metrics) ObserveQueueItemProcessingTime(queue Queue, duration time.Duration, agentName string)

func (*Metrics) ObserveQueueWaitTime added in v0.1.0

func (m *Metrics) ObserveQueueWaitTime(queue Queue, duration time.Duration, agentName string)

func (*Metrics) ServeMetrics added in v0.0.17

func (m *Metrics) ServeMetrics(ctx context.Context, addr string)

func (*Metrics) SetQueueSize

func (m *Metrics) SetQueueSize(queue Queue, count int, agentName string)

type Queue

type Queue string
var (
	BeaconStateQueue              Queue = "beacon_state"
	BeaconBlockQueue              Queue = "beacon_block"
	ExecutionPayloadEnvelopeQueue Queue = "execution_payload_envelope"
	BeaconBadBlockQueue           Queue = "beacon_bad_block"
	BeaconBadBlobQueue            Queue = "beacon_bad_blob"
	ExecutionBlockTraceQueue      Queue = "execution_block_trace"
	ExecutionBadBlockQueue        Queue = "execution_bad_block"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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