Documentation
¶
Overview ¶
Package types includes important structs used by end to end tests, such as a configuration type, an evaluator type, and more.
Index ¶
- func GenesisFork() int
- func InitForkCfg(start, end int, c *params.BeaconChainConfig) *params.BeaconChainConfig
- type BeaconNodeSet
- type ComponentRunner
- type DepositBalancer
- type DepositBatch
- type E2EConfig
- type E2EConfigOpt
- func WithBuilder() E2EConfigOpt
- func WithCheckpointSync() E2EConfigOpt
- func WithEpochs(e uint64) E2EConfigOpt
- func WithExitEpoch(e primitives.Epoch) E2EConfigOpt
- func WithLargeBlobs() E2EConfigOpt
- func WithRemoteSigner() E2EConfigOpt
- func WithRemoteSignerAndPersistentKeysFile() E2EConfigOpt
- func WithSSZOnly() E2EConfigOpt
- func WithStateDiff() E2EConfigOpt
- func WithValidatorCrossClient() E2EConfigOpt
- func WithValidatorRESTApi() E2EConfigOpt
- type EmptyComponent
- type EngineProxy
- type EvaluationContext
- type Evaluator
- type MultipleComponentRunners
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenesisFork ¶
func GenesisFork() int
func InitForkCfg ¶
func InitForkCfg(start, end int, c *params.BeaconChainConfig) *params.BeaconChainConfig
Types ¶
type BeaconNodeSet ¶
type BeaconNodeSet interface {
ComponentRunner
// SetENR provides the relevant bootnode's enr to the beacon nodes.
SetENR(enr string)
}
BeaconNodeSet defines an interface for an object that fulfills the duties of a group of beacon nodes.
type ComponentRunner ¶
type ComponentRunner interface {
// Start starts a component.
Start(ctx context.Context) error
// Started checks whether an underlying component is started and ready to be queried.
Started() <-chan struct{}
// Pause pauses a component.
Pause() error
// Resume resumes a component.
Resume() error
// Stop stops a component.
Stop() error
// UnderlyingProcess is the underlying process, once started.
UnderlyingProcess() *os.Process
}
ComponentRunner defines an interface via which E2E component's configuration, execution and termination is managed.
type DepositBalancer ¶
type DepositBalancer interface {
Balances(DepositBatch) map[[48]byte]uint64
}
DepositBalancer represents a type that can sum, by validator, all deposits made in E2E prior to the function call.
type DepositBatch ¶
type DepositBatch int
DepositBatch represents a group of deposits that are sent together during an e2e run.
const ( // GenesisDepositBatch deposits are sent to populate the initial set of validators for genesis. GenesisDepositBatch DepositBatch // PostGenesisDepositBatch deposits are sent to test that deposits appear in blocks as expected // and validators become active. PostGenesisDepositBatch // PostElectraDepositBatch deposits are sent to test that deposits sent after electra has been transitioned // work as expected. PostElectraDepositBatch )
type E2EConfig ¶
type E2EConfig struct {
TestCheckpointSync bool
TestSync bool
TestFeature bool
UsePrysmShValidator bool
UsePprof bool
UseWeb3RemoteSigner bool
UsePersistentKeyFile bool
TestDeposits bool
UseFixedPeerIDs bool
UseValidatorCrossClient bool
UseBeaconRestApi bool
UseBuilder bool
UseLargeBlobs bool // Use large blob transactions (6 blobs per tx) for BPO testing
EpochsToRun uint64
ExitEpoch primitives.Epoch // Custom epoch for voluntary exit submission (0 means use default)
Seed int64
TracingSinkEndpoint string
Evaluators []Evaluator
EvalInterceptor func(*EvaluationContext, uint64, []*grpc.ClientConn) bool
BeaconFlags []string
ValidatorFlags []string
PeerIDs []string
ExtraEpochs uint64
}
E2EConfig defines the struct for all configurations needed for E2E testing.
type E2EConfigOpt ¶
type E2EConfigOpt func(*E2EConfig)
func WithBuilder ¶
func WithBuilder() E2EConfigOpt
func WithCheckpointSync ¶
func WithCheckpointSync() E2EConfigOpt
func WithEpochs ¶
func WithEpochs(e uint64) E2EConfigOpt
func WithExitEpoch ¶ added in v7.1.3
func WithExitEpoch(e primitives.Epoch) E2EConfigOpt
WithExitEpoch sets a custom epoch for voluntary exit submission. This affects ProposeVoluntaryExit, ValidatorsHaveExited, SubmitWithdrawal, and ValidatorsHaveWithdrawn evaluators.
func WithLargeBlobs ¶ added in v7.1.3
func WithLargeBlobs() E2EConfigOpt
WithLargeBlobs configures the transaction generator to use large blob transactions (6 blobs per tx) for testing BPO limits. Without this option, small blob transactions (1 blob per tx) are used by default.
func WithRemoteSigner ¶
func WithRemoteSigner() E2EConfigOpt
func WithRemoteSignerAndPersistentKeysFile ¶
func WithRemoteSignerAndPersistentKeysFile() E2EConfigOpt
func WithSSZOnly ¶
func WithSSZOnly() E2EConfigOpt
func WithStateDiff ¶ added in v7.1.3
func WithStateDiff() E2EConfigOpt
func WithValidatorCrossClient ¶
func WithValidatorCrossClient() E2EConfigOpt
func WithValidatorRESTApi ¶
func WithValidatorRESTApi() E2EConfigOpt
type EmptyComponent ¶
EmptyComponent satisfies the component interface. It can be embedded in other types in order to turn them into components.
func (*EmptyComponent) Pause ¶
func (*EmptyComponent) Pause() error
func (*EmptyComponent) Resume ¶
func (*EmptyComponent) Resume() error
func (*EmptyComponent) Started ¶
func (c *EmptyComponent) Started() <-chan struct{}
func (*EmptyComponent) Stop ¶
func (*EmptyComponent) Stop() error
type EngineProxy ¶
type EngineProxy interface {
ComponentRunner
// AddRequestInterceptor adds in a json-rpc request interceptor.
AddRequestInterceptor(rpcMethodName string, responseGen func() any, trigger func() bool)
// RemoveRequestInterceptor removes the request interceptor for the provided method.
RemoveRequestInterceptor(rpcMethodName string)
// ReleaseBackedUpRequests releases backed up http requests.
ReleaseBackedUpRequests(rpcMethodName string)
}
type EvaluationContext ¶
type EvaluationContext struct {
DepositBalancer
// ExitedVals maps validator pubkey to the epoch when their exit was submitted.
// The actual exit takes effect at: submission_epoch + 1 + MaxSeedLookahead
ExitedVals map[[48]byte]primitives.Epoch
SeenVotes map[primitives.Slot][]byte
ExpectedEth1DataVote []byte
// Eth1DataMismatchCount tracks how many eth1data vote mismatches have been seen
// in the current voting period. Some tolerance is allowed for timing differences.
Eth1DataMismatchCount int
}
EvaluationContext allows for additional data to be provided to evaluators that need extra state.
func NewEvaluationContext ¶
func NewEvaluationContext(d DepositBalancer) *EvaluationContext
NewEvaluationContext handles initializing internal datastructures (like maps) provided by the EvaluationContext.
type Evaluator ¶
type Evaluator struct {
Name string
Policy func(currentEpoch primitives.Epoch) bool
// Evaluation accepts one or many/all conns, depending on what is needed by the set of evaluators.
Evaluation func(ec *EvaluationContext, conn ...*grpc.ClientConn) error
}
Evaluator defines the structure of the evaluators used to conduct the current beacon state during the E2E.
type MultipleComponentRunners ¶
type MultipleComponentRunners interface {
ComponentRunner
// ComponentAtIndex returns the component at index
ComponentAtIndex(i int) (ComponentRunner, error)
// PauseAtIndex pauses the grouped component element at the desired index.
PauseAtIndex(i int) error
// ResumeAtIndex resumes the grouped component element at the desired index.
ResumeAtIndex(i int) error
// StopAtIndex stops the grouped component element at the desired index.
StopAtIndex(i int) error
}