mock_builder

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 30 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DEFAULT_BUILDER_HOST = "0.0.0.0"
	DEFAULT_BUILDER_PORT = 18550
)
View Source
const (
	INVALIDATE_PAYLOAD_STATE_ROOT   = "state_root"
	INVALIDATE_PAYLOAD_PARENT_HASH  = "parent_hash"
	INVALIDATE_PAYLOAD_COINBASE     = "coinbase"
	INVALIDATE_PAYLOAD_BASE_FEE     = "base_fee"
	INVALIDATE_PAYLOAD_UNCLE_HASH   = "uncle_hash"
	INVALIDATE_PAYLOAD_RECEIPT_HASH = "receipt_hash"
	INVALIDATE_PAYLOAD_BEACON_ROOT  = "beaconr_root"
)
View Source
const (
	INVALIDATE_ATTR_REMOVE_WITHDRAWAL          = "remove_withdrawal"
	INVALIDATE_ATTR_EXTRA_WITHDRAWAL           = "extra_withdrawal"
	INVALIDATE_ATTR_WITHDRAWAL_ADDRESS         = "withdrawal_address"
	INVALIDATE_ATTR_WITHDRAWAL_AMOUNT          = "withdrawal_amount"
	INVALIDATE_ATTR_WITHDRAWAL_VALIDATOR_INDEX = "withdrawal_validator_index"
	INVALIDATE_ATTR_WITHDRAWAL_INDEX           = "withdrawal_index"
	INVALIDATE_ATTR_TIMESTAMP                  = "timestamp"
	INVALIDATE_ATTR_PREV_RANDAO                = "prevrandao"
	INVALIDATE_ATTR_RANDOM                     = "random"
	INVALIDATE_ATTR_BEACON_ROOT                = "beacon_root"
)

Variables

View Source
var (
	DOMAIN_APPLICATION_BUILDER = beacon.BLSDomainType{0x00, 0x00, 0x00, 0x01}
	EMPTY_HASH                 = el_common.Hash{}
)

Functions

func KZGCommitmentsToVersionedHashes added in v1.1.0

func KZGCommitmentsToVersionedHashes(version byte, kzgCommitments []hexutil.Bytes) []el_common.Hash

func ModifyExtraData

func ModifyExtraData(p *api.ExecutableData, versionedHashes []el_common.Hash, beaconRoot *el_common.Hash, newExtraData []byte) error

func PayloadAttrInvalidationTypeNames

func PayloadAttrInvalidationTypeNames() []string

func PayloadInvalidationTypeNames

func PayloadInvalidationTypeNames() []string

Types

type DenebMessageSlotEnvelope added in v1.1.0

type DenebMessageSlotEnvelope struct {
	MessageSlotEnvelope MessageSlotEnvelope `json:"signed_blinded_block" yaml:"signed_blinded_block"`
}

type ErrorProducer

type ErrorProducer func(beacon.Slot) error

type GetBuilderBidVersion

type GetBuilderBidVersion func(beacon.Slot) (common.BuilderBid, error)

type MessageSlotEnvelope

type MessageSlotEnvelope struct {
	SlotEnvelope SlotEnvelope `json:"message" yaml:"message"`
}

type MockBuilder

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

func (*MockBuilder) Address

func (m *MockBuilder) Address() string

func (*MockBuilder) Cancel

func (m *MockBuilder) Cancel() error

func (*MockBuilder) DefaultBuilderBidVersionResolver

func (m *MockBuilder) DefaultBuilderBidVersionResolver(
	slot beacon.Slot,
) (builderBid common.BuilderBid, err error)

func (*MockBuilder) GetBuiltPayloads

func (m *MockBuilder) GetBuiltPayloads() map[beacon.Slot]common.BuilderBid

func (*MockBuilder) GetBuiltPayloadsCount

func (m *MockBuilder) GetBuiltPayloadsCount() int

func (*MockBuilder) GetModifiedPayloads

func (m *MockBuilder) GetModifiedPayloads() map[beacon.Slot]common.ExecutionPayload

func (*MockBuilder) GetSignedBeaconBlock added in v1.2.0

func (m *MockBuilder) GetSignedBeaconBlock(slot beacon.Slot) (common.SignedBeaconResponse, bool)

func (*MockBuilder) GetSignedBeaconBlockCount

func (m *MockBuilder) GetSignedBeaconBlockCount() int

func (*MockBuilder) GetSignedBeaconBlocks

func (m *MockBuilder) GetSignedBeaconBlocks() map[beacon.Slot]common.SignedBeaconResponse

func (*MockBuilder) GetValidationErrors added in v1.2.0

func (m *MockBuilder) GetValidationErrors() map[beacon.Slot]error

func (*MockBuilder) GetValidationErrorsCount added in v1.2.0

func (m *MockBuilder) GetValidationErrorsCount() int

func (*MockBuilder) HandleGetExecutionPayloadHeader

func (m *MockBuilder) HandleGetExecutionPayloadHeader(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockDisableErrorOnHeaderRequest

func (m *MockBuilder) HandleMockDisableErrorOnHeaderRequest(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockDisableErrorOnPayloadReveal

func (m *MockBuilder) HandleMockDisableErrorOnPayloadReveal(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockDisableInvalidatePayload

func (m *MockBuilder) HandleMockDisableInvalidatePayload(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockDisableInvalidatePayloadAttributes

func (m *MockBuilder) HandleMockDisableInvalidatePayloadAttributes(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockEnableErrorOnHeaderRequest

func (m *MockBuilder) HandleMockEnableErrorOnHeaderRequest(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockEnableErrorOnPayloadReveal

func (m *MockBuilder) HandleMockEnableErrorOnPayloadReveal(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockEnableInvalidatePayload

func (m *MockBuilder) HandleMockEnableInvalidatePayload(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleMockEnableInvalidatePayloadAttributes

func (m *MockBuilder) HandleMockEnableInvalidatePayloadAttributes(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleStatus

func (m *MockBuilder) HandleStatus(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleSubmitBlindedBlock

func (m *MockBuilder) HandleSubmitBlindedBlock(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleValidationErrors added in v1.2.0

func (m *MockBuilder) HandleValidationErrors(
	w http.ResponseWriter, req *http.Request,
)

func (*MockBuilder) HandleValidators

func (m *MockBuilder) HandleValidators(
	w http.ResponseWriter,
	req *http.Request,
)

func (*MockBuilder) SlotToTimestamp

func (m *MockBuilder) SlotToTimestamp(slot beacon.Slot) uint64

func (*MockBuilder) Start

func (m *MockBuilder) Start(ctx context.Context) error

Start a proxy server.

type Option

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

func WithBeaconGenesisTime

func WithBeaconGenesisTime(t beacon.Timestamp) Option

func WithErrorOnHeaderRequest

func WithErrorOnHeaderRequest(e ErrorProducer) Option

func WithErrorOnHeaderRequestAtEpoch

func WithErrorOnHeaderRequestAtEpoch(epoch beacon.Epoch) Option

func WithErrorOnHeaderRequestAtSlot

func WithErrorOnHeaderRequestAtSlot(slot beacon.Slot) Option

func WithErrorOnPayloadReveal

func WithErrorOnPayloadReveal(e ErrorProducer) Option

func WithErrorOnPayloadRevealAtEpoch

func WithErrorOnPayloadRevealAtEpoch(epoch beacon.Epoch) Option

func WithErrorOnPayloadRevealAtSlot

func WithErrorOnPayloadRevealAtSlot(slot beacon.Slot) Option

func WithExternalIP

func WithExternalIP(ip net.IP) Option

func WithExtraDataWatermark

func WithExtraDataWatermark(wm string) Option

func WithGetPayloadDelay added in v1.1.0

func WithGetPayloadDelay(ms int) Option

func WithHost

func WithHost(host string) Option

func WithID

func WithID(id int) Option

func WithInvalidBuilderBidVersionAtEpoch

func WithInvalidBuilderBidVersionAtEpoch(
	activationEpoch beacon.Epoch,
) Option

func WithInvalidBuilderBidVersionAtSlot

func WithInvalidBuilderBidVersionAtSlot(
	activationSlot beacon.Slot,
) Option

func WithLogLevel added in v1.1.0

func WithLogLevel(logLevel string) Option

func WithPayloadAttributesInvalidatorAtEpoch

func WithPayloadAttributesInvalidatorAtEpoch(
	epoch beacon.Epoch,
	invType PayloadAttributesInvalidation,
) Option

func WithPayloadAttributesInvalidatorAtSlot

func WithPayloadAttributesInvalidatorAtSlot(
	slot beacon.Slot,
	invType PayloadAttributesInvalidation,
) Option

func WithPayloadAttributesModifier

func WithPayloadAttributesModifier(pam PayloadAttributesModifier) Option

func WithPayloadInvalidatorAtEpoch

func WithPayloadInvalidatorAtEpoch(
	epoch beacon.Epoch,
	invType PayloadInvalidation,
) Option

func WithPayloadInvalidatorAtSlot

func WithPayloadInvalidatorAtSlot(
	slot beacon.Slot,
	invType PayloadInvalidation,
) Option

func WithPayloadModifier

func WithPayloadModifier(pm PayloadModifier) Option

func WithPayloadWeiValueBump

func WithPayloadWeiValueBump(bump *big.Int) Option

func WithPayloadWeiValueMultiplier

func WithPayloadWeiValueMultiplier(mult *big.Int) Option

func WithPort

func WithPort(port int) Option

func WithSpec

func WithSpec(spec *beacon.Spec) Option

func (Option) MarshalText

func (o Option) MarshalText() ([]byte, error)

type PayloadAttributesInvalidation

type PayloadAttributesInvalidation string

type PayloadAttributesModifier

type PayloadAttributesModifier func(*api.PayloadAttributes, beacon.Slot) (bool, error)

type PayloadHeaderRequestVarsParser

type PayloadHeaderRequestVarsParser map[string]string

func (PayloadHeaderRequestVarsParser) ParentHash

func (vars PayloadHeaderRequestVarsParser) ParentHash() (el_common.Hash, error)

func (PayloadHeaderRequestVarsParser) PubKey

func (vars PayloadHeaderRequestVarsParser) PubKey() (pubkey beacon.BLSPubkey, err error)

func (PayloadHeaderRequestVarsParser) Slot

func (vars PayloadHeaderRequestVarsParser) Slot() (slot beacon.Slot, err error)

type PayloadInvalidation

type PayloadInvalidation string

type PayloadModifier

type PayloadModifier func(basePayload *api.ExecutableData, versionedHashes []el_common.Hash, blobBundle *api.BlobsBundleV1, beaconRoot *el_common.Hash, currentSlot beacon.Slot) (bool, error)

type PayloadWeiBidModifier

type PayloadWeiBidModifier func(*big.Int) (*big.Int, error)

type SlotEnvelope

type SlotEnvelope struct {
	Slot beacon.Slot `json:"slot" yaml:"slot"`
}

Jump to

Keyboard shortcuts

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