probedb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	Slot            uint32
	Committee       uint16
	AggregationBits []byte
}

Attestation holds information about an attestation.

type AttestationsSetter

type AttestationsSetter interface {
	// SetAttestations sets multiple attestations.
	SetAttestations(ctx context.Context, attestations []*Attestation) error

	// SetAttestation sets an attestation.
	SetAttestation(ctx context.Context, attestation *Attestation) error
}

AttestationsSetter defines functions to create and update attestations.

type BlockDelaysProvider

type BlockDelaysProvider interface {
	// BlockDelays obtains the block delays for a range of slots.
	BlockDelays(ctx context.Context, filter *DelayFilter) ([]*DelayValue, error)
}

BlockDelaysProvider defines functions to obtain block delays.

type BlockDelaysSetter

type BlockDelaysSetter interface {
	// SetBlockDelay sets a block delay.
	SetBlockDelay(ctx context.Context, delay *Delay) error
}

BlockDelaysSetter defines functions to create and update block delays.

type Delay

type Delay struct {
	IPAddr  net.IP
	Source  string
	Method  string
	Slot    uint32
	DelayMS uint32
}

Delay holds information about a delay.

type DelayFilter

type DelayFilter struct {
	// IPAddr is the IP address from which to fetch delays.
	// If empty then there is no IP address filter.
	IPAddr string

	// Source is the beacon node source from which to fetch delays.
	// If empty then there is no source filter.
	Source string

	// Method is the collection method from which to fetch delays.
	// If empty then there is no method filter.
	Method string

	// From is the slot of the earliest delay to fetch.
	// If nil then there is no earliest slot.
	From *phase0.Slot

	// To is the slot of the latest delay to fetch.
	// If nil then there is no latest slot.
	To *phase0.Slot

	// Order is either OrderEarliest, in which case the earliest results
	// that match the filter are returned, or OrderLatest, in which case the
	// latest results that match the filter are returned.
	// The default is OrderEarliest.
	Order Order

	// Selection is the selection of the delay(s).
	// The default is SelectionMinimum.
	Selection Selection
}

DelayFilter defines a filter for fetching delays. Filter elements are ANDed together. Results are always returned in ascending slot/method/IP address/source order.

type DelayValue

type DelayValue struct {
	Slot    uint32
	DelayMS uint32
}

DelayValue holds a single delay value.

type HeadDelaysProvider

type HeadDelaysProvider interface {
	// HeadDelays obtains the minimum head delays for a range of slots.
	HeadDelays(ctx context.Context, filter *DelayFilter) ([]*DelayValue, error)
}

HeadDelaysProvider defines functions to obtain head delays.

type HeadDelaysSetter

type HeadDelaysSetter interface {
	// SetHeadDelay sets a head delay.
	SetHeadDelay(ctx context.Context, delay *Delay) error
}

HeadDelaysSetter defines functions to create and update head delays.

type Order

type Order uint8

Order is the order in which results should be fetched (N.B. fetched, not returned).

const (
	// OrderEarliest fetches earliest transactions first.
	OrderEarliest Order = iota
	// OrderLatest fetches latest transactions first.
	OrderLatest
)

type Selection

type Selection uint8

Selection is the selection criterion when multiple delays are present.

const (
	// SelectionMinimum fetches the minimum delay.
	SelectionMinimum Selection = iota
	// SelectionMaximum fetches the maximum delay.
	SelectionMaximum
	// SelectionMedian fetches the median delay.
	SelectionMedian
)

type Service

type Service interface {
	// BeginTx begins a transaction.
	BeginTx(ctx context.Context) (context.Context, context.CancelFunc, error)

	// CommitTx commits a transaction.
	CommitTx(ctx context.Context) error

	// SetMetadata sets a metadata key to a JSON value.
	SetMetadata(ctx context.Context, key string, value []byte) error

	// Metadata obtains the JSON value from a metadata key.
	Metadata(ctx context.Context, key string) ([]byte, error)
}

Service defines a minimal probe database service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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