validators

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package validators provides types and storage for Builder API validator registrations.

Package validators provides types and storage for Builder API validator registrations.

This file embeds the builder-specs example for use in tests.

Index

Constants

This section is empty.

Variables

View Source
var BuilderSpecsExampleJSON []byte

BuilderSpecsExampleJSON is the official example from https://github.com/ethereum/builder-specs/blob/main/examples/bellatrix/signed_validator_registrations.json (request body is the array, not the {"value": [...]} wrapper).

Functions

func VerifyRegistration

func VerifyRegistration(reg *apiv1.SignedValidatorRegistration) bool

VerifyRegistration verifies the BLS signature of a validator registration using DOMAIN_APPLICATION_BUILDER with zero parameters (for tests). For chain-specific verification (e.g. mev-boost registrations), use VerifyRegistrationWithDomain.

func VerifyRegistrationWithDomain

func VerifyRegistrationWithDomain(reg *apiv1.SignedValidatorRegistration, genesisForkVersion, forkVersion phase0.Version, genesisValidatorsRoot phase0.Root) bool

VerifyRegistrationWithDomain verifies the BLS signature of a validator registration using DOMAIN_APPLICATION_BUILDER. Tries (0,0), (genesisForkVersion, 0) from the beacon (mev-boost-relay style), then (forkVersion, genesisValidatorsRoot). Genesis fork version is taken from the beacon so local devnets with their own fork versions work.

Types

type Store

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

Store holds validator registrations by pubkey (in-memory), optionally write-through persisted to a state-db so they survive restarts.

func NewStore

func NewStore() *Store

NewStore creates a new in-memory validator registration store.

func (*Store) Get

Get returns the registration for the given pubkey, or nil.

func (*Store) Len

func (s *Store) Len() int

Len returns the number of stored registrations.

func (*Store) List

List returns a copy of all stored validator registrations (unordered).

func (*Store) Put

Put stores a signed validator registration by its message pubkey. Replaces any existing registration for the same pubkey, and write-through persists it when a state-db is attached.

func (*Store) SetStateDB

func (s *Store) SetStateDB(stateDB *db.Database, log logrus.FieldLogger)

SetStateDB attaches an optional state-db for write-through persistence and loads any previously-persisted registrations into memory.

Jump to

Keyboard shortcuts

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