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 ¶
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 ¶
func (s *Store) Get(pubkey phase0.BLSPubKey) *apiv1.SignedValidatorRegistration
Get returns the registration for the given pubkey, or nil.
func (*Store) List ¶
func (s *Store) List() []*apiv1.SignedValidatorRegistration
List returns a copy of all stored validator registrations (unordered).
func (*Store) Put ¶
func (s *Store) Put(reg *apiv1.SignedValidatorRegistration)
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.