Documentation
¶
Overview ¶
Package components defines utilities to spin up actual beacon node and validator processes as needed by end to end tests.
Index ¶
- Constants
- func FeeRecipientFromPubkey(key string) string
- func SendTransaction(client *rpc.Client, key *dilithium.Dilithium, f *filler.Filler, ...) error
- func WaitForBlocks(web3 *zondclient.Client, blocksToWait uint64) error
- type BeaconNode
- type BeaconNodeSet
- func (s *BeaconNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
- func (s *BeaconNodeSet) Pause() error
- func (s *BeaconNodeSet) PauseAtIndex(i int) error
- func (s *BeaconNodeSet) Resume() error
- func (s *BeaconNodeSet) ResumeAtIndex(i int) error
- func (s *BeaconNodeSet) SetENR(enr string)
- func (s *BeaconNodeSet) Start(ctx context.Context) error
- func (s *BeaconNodeSet) Started() <-chan struct{}
- func (s *BeaconNodeSet) Stop() error
- func (s *BeaconNodeSet) StopAtIndex(i int) error
- type BootNode
- type Builder
- type BuilderSet
- func (s *BuilderSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
- func (s *BuilderSet) Pause() error
- func (s *BuilderSet) PauseAtIndex(i int) error
- func (s *BuilderSet) Resume() error
- func (s *BuilderSet) ResumeAtIndex(i int) error
- func (s *BuilderSet) Start(ctx context.Context) error
- func (s *BuilderSet) Started() <-chan struct{}
- func (s *BuilderSet) Stop() error
- func (s *BuilderSet) StopAtIndex(i int) error
- type DepositHistory
- type Depositor
- func (d *Depositor) History() *DepositHistory
- func (d *Depositor) SendAndMine(ctx context.Context, offset, nvals int, batch types.DepositBatch, partial bool) error
- func (d *Depositor) SendDeposit(dep *zond.Deposit, txo *bind.TransactOpts, batch types.DepositBatch) error
- func (d *Depositor) UnderlyingProcess() *os.Process
- type ExecutionNode
- type ExecutionNodeSet
- func (s *ExecutionNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
- func (s *ExecutionNodeSet) Pause() error
- func (s *ExecutionNodeSet) PauseAtIndex(i int) error
- func (s *ExecutionNodeSet) Resume() error
- func (s *ExecutionNodeSet) ResumeAtIndex(i int) error
- func (s *ExecutionNodeSet) Start(ctx context.Context) error
- func (s *ExecutionNodeSet) Started() <-chan struct{}
- func (s *ExecutionNodeSet) Stop() error
- func (s *ExecutionNodeSet) StopAtIndex(i int) error
- type Proxy
- func (node *Proxy) AddRequestInterceptor(rpcMethodName string, responseGen func() interface{}, trigger func() bool)
- func (node *Proxy) Pause() error
- func (node *Proxy) ReleaseBackedUpRequests(rpcMethodName string)
- func (node *Proxy) RemoveRequestInterceptor(rpcMethodName string)
- func (node *Proxy) Resume() error
- func (node *Proxy) Start(ctx context.Context) error
- func (node *Proxy) Started() <-chan struct{}
- func (node *Proxy) Stop() error
- type ProxySet
- func (s *ProxySet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
- func (s *ProxySet) Pause() error
- func (s *ProxySet) PauseAtIndex(i int) error
- func (s *ProxySet) Resume() error
- func (s *ProxySet) ResumeAtIndex(i int) error
- func (s *ProxySet) Start(ctx context.Context) error
- func (s *ProxySet) Started() <-chan struct{}
- func (s *ProxySet) Stop() error
- func (s *ProxySet) StopAtIndex(i int) error
- type SentDeposit
- type TracingSink
- type TransactionGenerator
- type ValidatorNode
- type ValidatorNodeSet
- func (s *ValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
- func (s *ValidatorNodeSet) Pause() error
- func (s *ValidatorNodeSet) PauseAtIndex(i int) error
- func (s *ValidatorNodeSet) Resume() error
- func (s *ValidatorNodeSet) ResumeAtIndex(i int) error
- func (s *ValidatorNodeSet) Start(ctx context.Context) error
- func (s *ValidatorNodeSet) Started() <-chan struct{}
- func (s *ValidatorNodeSet) Stop() error
- func (s *ValidatorNodeSet) StopAtIndex(i int) error
Constants ¶
const DefaultFeeRecipientAddress = "Z099FB65722e7b2455043bfebF6177f1D2E9738d9"
const KeystorePassword = ""
const NetworkId = 1337
NetworkId is the ID of the Zond chain.
Variables ¶
This section is empty.
Functions ¶
func FeeRecipientFromPubkey ¶
FeeRecipientFromPubkey slices, from the beginning of the hex-encoded pubkey string, the 1 character Z preamble plus enough hex chars to fill out the fee_recipient byte value.
func SendTransaction ¶
func WaitForBlocks ¶
func WaitForBlocks(web3 *zondclient.Client, blocksToWait uint64) error
WaitForBlocks waits for a certain amount of blocks to be included before returning.
Types ¶
type BeaconNode ¶
type BeaconNode struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
BeaconNode represents beacon node.
func NewBeaconNode ¶
func NewBeaconNode(config *e2etypes.E2EConfig, index int, enr string) *BeaconNode
NewBeaconNode creates and returns a beacon node.
func (*BeaconNode) Pause ¶
func (node *BeaconNode) Pause() error
Pause pauses the component and its underlying process.
func (*BeaconNode) Resume ¶
func (node *BeaconNode) Resume() error
Resume resumes the component and its underlying process.
func (*BeaconNode) Start ¶
func (node *BeaconNode) Start(ctx context.Context) error
Start starts a fresh beacon node, connecting to all passed in beacon nodes.
func (*BeaconNode) Started ¶
func (node *BeaconNode) Started() <-chan struct{}
Started checks whether beacon node is started and ready to be queried.
func (*BeaconNode) Stop ¶
func (node *BeaconNode) Stop() error
Stop stops the component and its underlying process.
func (*BeaconNode) UnderlyingProcess ¶
func (node *BeaconNode) UnderlyingProcess() *os.Process
type BeaconNodeSet ¶
type BeaconNodeSet struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
BeaconNodeSet represents set of beacon nodes.
func NewBeaconNodes ¶
func NewBeaconNodes(config *e2etypes.E2EConfig) *BeaconNodeSet
NewBeaconNodes creates and returns a set of beacon nodes.
func (*BeaconNodeSet) ComponentAtIndex ¶
func (s *BeaconNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
ComponentAtIndex returns the component at the provided index.
func (*BeaconNodeSet) Pause ¶
func (s *BeaconNodeSet) Pause() error
Pause pauses the component and its underlying process.
func (*BeaconNodeSet) PauseAtIndex ¶
func (s *BeaconNodeSet) PauseAtIndex(i int) error
PauseAtIndex pauses the component and its underlying process at the desired index.
func (*BeaconNodeSet) Resume ¶
func (s *BeaconNodeSet) Resume() error
Resume resumes the component and its underlying process.
func (*BeaconNodeSet) ResumeAtIndex ¶
func (s *BeaconNodeSet) ResumeAtIndex(i int) error
ResumeAtIndex resumes the component and its underlying process at the desired index.
func (*BeaconNodeSet) SetENR ¶
func (s *BeaconNodeSet) SetENR(enr string)
SetENR assigns ENR to the set of beacon nodes.
func (*BeaconNodeSet) Start ¶
func (s *BeaconNodeSet) Start(ctx context.Context) error
Start starts all the beacon nodes in set.
func (*BeaconNodeSet) Started ¶
func (s *BeaconNodeSet) Started() <-chan struct{}
Started checks whether beacon node set is started and all nodes are ready to be queried.
func (*BeaconNodeSet) Stop ¶
func (s *BeaconNodeSet) Stop() error
Stop stops the component and its underlying process.
func (*BeaconNodeSet) StopAtIndex ¶
func (s *BeaconNodeSet) StopAtIndex(i int) error
StopAtIndex stops the component and its underlying process at the desired index.
type BootNode ¶
type BootNode struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
BootNode represents boot node.
type Builder ¶
type Builder struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
Builder represents a block builder.
type BuilderSet ¶
type BuilderSet struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
BuilderSet represents a set of builders for the validators running via a relay.
func NewBuilderSet ¶
func NewBuilderSet() *BuilderSet
NewBuilderSet creates and returns a set of builders.
func (*BuilderSet) ComponentAtIndex ¶
func (s *BuilderSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
ComponentAtIndex returns the component at the provided index.
func (*BuilderSet) Pause ¶
func (s *BuilderSet) Pause() error
Pause pauses the component and its underlying process.
func (*BuilderSet) PauseAtIndex ¶
func (s *BuilderSet) PauseAtIndex(i int) error
PauseAtIndex pauses the component and its underlying process at the desired index.
func (*BuilderSet) Resume ¶
func (s *BuilderSet) Resume() error
Resume resumes the component and its underlying process.
func (*BuilderSet) ResumeAtIndex ¶
func (s *BuilderSet) ResumeAtIndex(i int) error
ResumeAtIndex resumes the component and its underlying process at the desired index.
func (*BuilderSet) Start ¶
func (s *BuilderSet) Start(ctx context.Context) error
Start starts all the builders in set.
func (*BuilderSet) Started ¶
func (s *BuilderSet) Started() <-chan struct{}
Started checks whether builder set is started and all builders are ready to be queried.
func (*BuilderSet) Stop ¶
func (s *BuilderSet) Stop() error
Stop stops the component and its underlying process.
func (*BuilderSet) StopAtIndex ¶
func (s *BuilderSet) StopAtIndex(i int) error
StopAtIndex stops the component and its underlying process at the desired index.
type DepositHistory ¶
DepositHistory is a type used by Depositor to keep track of batches of deposit for test assertion purposes.
func (*DepositHistory) Balances ¶
func (h *DepositHistory) Balances(batch types.DepositBatch) map[[field_params.DilithiumPubkeyLength]byte]uint64
Balances sums, by validator, all deposit amounts that were sent as part of the given batch. This can be used in e2e evaluators to check that the results of deposit transactions are visible on chain.
type Depositor ¶
type Depositor struct {
// The EmptyComponent type is embedded in the Depositor so that it satisfies the ComponentRunner interface.
// This allows other components or e2e set up code to block until its Start method has been called.
types.EmptyComponent
Key *keystore.Key
Client *zondclient.Client
ChainID *big.Int
NetworkId *big.Int
// contains filtered or unexported fields
}
func (*Depositor) History ¶
func (d *Depositor) History() *DepositHistory
History exposes the DepositHistory value for a Depositor.
func (*Depositor) SendAndMine ¶
func (d *Depositor) SendAndMine(ctx context.Context, offset, nvals int, batch types.DepositBatch, partial bool) error
SendAndMine uses the deterministic validator generator to generate deposits for `nvals` (number of validators). To control which validators should receive deposits, so that we can generate deposits at different stages of e2e, the `offset` parameter skips the first N validators in the deterministic list. In order to test the requirement that our deposit follower is able to handle multiple partial deposits, the `partial` flag specifies that half of the deposits should be broken up into 2 transactions. Once the set of deposits has been generated, it submits a transaction for each deposit (using 2 transactions for partial deposits) and then uses WaitForBlocks (which spams the miner node with transactions to and from its own address) to advance the chain until it has moved forward ETH1_FOLLOW_DISTANCE blocks.
func (*Depositor) SendDeposit ¶
func (d *Depositor) SendDeposit(dep *zond.Deposit, txo *bind.TransactOpts, batch types.DepositBatch) error
SendDeposit sends a single deposit. A record of this deposit will be tracked for the life of the Depositor, allowing evaluators to use the deposit history to make assertions about those deposits.
func (*Depositor) UnderlyingProcess ¶
type ExecutionNode ¶
type ExecutionNode struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
Node represents a zond node.
func NewExecutionNode ¶
func NewExecutionNode(index int) *ExecutionNode
NewExecutionNode creates and returns an execution node.
func (*ExecutionNode) Pause ¶
func (node *ExecutionNode) Pause() error
Pause pauses the component and its underlying process.
func (*ExecutionNode) Resume ¶
func (node *ExecutionNode) Resume() error
Resume resumes the component and its underlying process.
func (*ExecutionNode) Start ¶
func (node *ExecutionNode) Start(ctx context.Context) error
Start runs a non-mining zond node. To connect to a miner and start working properly, this node should be a part of a NodeSet.
func (*ExecutionNode) Started ¶
func (node *ExecutionNode) Started() <-chan struct{}
Started checks whether zond node is started and ready to be queried.
func (*ExecutionNode) Stop ¶
func (node *ExecutionNode) Stop() error
Stop kills the component and its underlying process.
func (*ExecutionNode) UnderlyingProcess ¶
func (node *ExecutionNode) UnderlyingProcess() *os.Process
type ExecutionNodeSet ¶
type ExecutionNodeSet struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
ExecutionNodeSet represents a set of execution nodes, none of which is a mining node.
func NewExecutionNodeSet ¶
func NewExecutionNodeSet() *ExecutionNodeSet
NewNodeSet creates and returns a set of zond nodes.
func (*ExecutionNodeSet) ComponentAtIndex ¶
func (s *ExecutionNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
ComponentAtIndex returns the component at the provided index.
func (*ExecutionNodeSet) Pause ¶
func (s *ExecutionNodeSet) Pause() error
Pause pauses the component and its underlying process.
func (*ExecutionNodeSet) PauseAtIndex ¶
func (s *ExecutionNodeSet) PauseAtIndex(i int) error
PauseAtIndex pauses the component and its underlying process at the desired index.
func (*ExecutionNodeSet) Resume ¶
func (s *ExecutionNodeSet) Resume() error
Resume resumes the component and its underlying process.
func (*ExecutionNodeSet) ResumeAtIndex ¶
func (s *ExecutionNodeSet) ResumeAtIndex(i int) error
ResumeAtIndex resumes the component and its underlying process at the desired index.
func (*ExecutionNodeSet) Start ¶
func (s *ExecutionNodeSet) Start(ctx context.Context) error
Start starts all the execution nodes in set.
func (*ExecutionNodeSet) Started ¶
func (s *ExecutionNodeSet) Started() <-chan struct{}
Started checks whether execution node set is started and all nodes are ready to be queried.
func (*ExecutionNodeSet) Stop ¶
func (s *ExecutionNodeSet) Stop() error
Stop stops the component and its underlying process.
func (*ExecutionNodeSet) StopAtIndex ¶
func (s *ExecutionNodeSet) StopAtIndex(i int) error
StopAtIndex stops the component and its underlying process at the desired index.
type Proxy ¶
type Proxy struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
Proxy represents an engine-api proxy.
func (*Proxy) AddRequestInterceptor ¶
func (node *Proxy) AddRequestInterceptor(rpcMethodName string, responseGen func() interface{}, trigger func() bool)
AddRequestInterceptor adds in a json-rpc request interceptor.
func (*Proxy) ReleaseBackedUpRequests ¶
ReleaseBackedUpRequests releases backed up http requests which were previously ignored due to our interceptors.
func (*Proxy) RemoveRequestInterceptor ¶
RemoveRequestInterceptor removes the request interceptor for the provided method.
type ProxySet ¶
type ProxySet struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
ProxySet represents a set of proxies for the engine-api.
func NewProxySet ¶
func NewProxySet() *ProxySet
NewProxySet creates and returns a set of engine-api proxies.
func (*ProxySet) ComponentAtIndex ¶
func (s *ProxySet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
ComponentAtIndex returns the component at the provided index.
func (*ProxySet) PauseAtIndex ¶
PauseAtIndex pauses the component and its underlying process at the desired index.
func (*ProxySet) ResumeAtIndex ¶
ResumeAtIndex resumes the component and its underlying process at the desired index.
func (*ProxySet) Started ¶
func (s *ProxySet) Started() <-chan struct{}
Started checks whether proxy set is started and all proxies are ready to be queried.
func (*ProxySet) StopAtIndex ¶
StopAtIndex stops the component and its underlying process at the desired index.
type SentDeposit ¶
type SentDeposit struct {
// contains filtered or unexported fields
}
SentDeposit is the record of an individual deposit which has been successfully submitted as a transaction.
type TracingSink ¶
type TracingSink struct {
// contains filtered or unexported fields
}
TracingSink to capture HTTP requests from opentracing pushes. This is meant to capture all opentracing spans from Qrysm during an end-to-end test. Spans are normally sent to a jaeger (https://www.jaegertracing.io/docs/1.25/getting-started/) endpoint, but here we instead replace that with our own http request sink. The request sink receives any requests, raw marshals them and base64-encodes them, then writes them newline-delimited into a file.
The output file from this component can then be used by tools/replay-http in the Qrysm repository to replay requests to a jaeger collector endpoint. This can then be used to visualize the spans themselves in the jaeger UI.
func NewTracingSink ¶
func NewTracingSink(endpoint string) *TracingSink
NewTracingSink initializes the tracing sink component.
func (*TracingSink) Pause ¶
func (ts *TracingSink) Pause() error
Pause pauses the component and its underlying process.
func (*TracingSink) Resume ¶
func (ts *TracingSink) Resume() error
Resume resumes the component and its underlying process.
func (*TracingSink) Start ¶
func (ts *TracingSink) Start(ctx context.Context) error
Start the tracing sink.
func (*TracingSink) Started ¶
func (ts *TracingSink) Started() <-chan struct{}
Started checks whether a tracing sink is started and ready to be queried.
func (*TracingSink) Stop ¶
func (ts *TracingSink) Stop() error
Stop stops the component and its underlying process.
func (*TracingSink) UnderlyingProcess ¶
func (ts *TracingSink) UnderlyingProcess() *os.Process
type TransactionGenerator ¶
type TransactionGenerator struct {
// contains filtered or unexported fields
}
func NewTransactionGenerator ¶
func NewTransactionGenerator(keystore string, seed int64) *TransactionGenerator
func (*TransactionGenerator) Pause ¶
func (t *TransactionGenerator) Pause() error
Pause pauses the component and its underlying process.
func (*TransactionGenerator) Resume ¶
func (t *TransactionGenerator) Resume() error
Resume resumes the component and its underlying process.
func (*TransactionGenerator) Start ¶
func (t *TransactionGenerator) Start(ctx context.Context) error
func (*TransactionGenerator) Started ¶
func (s *TransactionGenerator) Started() <-chan struct{}
Started checks whether beacon node set is started and all nodes are ready to be queried.
func (*TransactionGenerator) Stop ¶
func (t *TransactionGenerator) Stop() error
Stop stops the component and its underlying process.
type ValidatorNode ¶
type ValidatorNode struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
ValidatorNode represents a validator node.
func NewValidatorNode ¶
func NewValidatorNode(config *e2etypes.E2EConfig, validatorNum, index, offset int) *ValidatorNode
NewValidatorNode creates and returns a validator node.
func (*ValidatorNode) Pause ¶
func (v *ValidatorNode) Pause() error
Pause pauses the component and its underlying process.
func (*ValidatorNode) Resume ¶
func (v *ValidatorNode) Resume() error
Resume resumes the component and its underlying process.
func (*ValidatorNode) Start ¶
func (v *ValidatorNode) Start(ctx context.Context) error
Start starts a validator client.
func (*ValidatorNode) Started ¶
func (v *ValidatorNode) Started() <-chan struct{}
Started checks whether validator node is started and ready to be queried.
func (*ValidatorNode) Stop ¶
func (v *ValidatorNode) Stop() error
Stop stops the component and its underlying process.
func (*ValidatorNode) UnderlyingProcess ¶
func (v *ValidatorNode) UnderlyingProcess() *os.Process
type ValidatorNodeSet ¶
type ValidatorNodeSet struct {
e2etypes.ComponentRunner
// contains filtered or unexported fields
}
ValidatorNodeSet represents set of validator nodes.
func NewValidatorNodeSet ¶
func NewValidatorNodeSet(config *e2etypes.E2EConfig) *ValidatorNodeSet
NewValidatorNodeSet creates and returns a set of validator nodes.
func (*ValidatorNodeSet) ComponentAtIndex ¶
func (s *ValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)
ComponentAtIndex returns the component at the provided index.
func (*ValidatorNodeSet) Pause ¶
func (s *ValidatorNodeSet) Pause() error
Pause pauses the component and its underlying process.
func (*ValidatorNodeSet) PauseAtIndex ¶
func (s *ValidatorNodeSet) PauseAtIndex(i int) error
PauseAtIndex pauses the component and its underlying process at the desired index.
func (*ValidatorNodeSet) Resume ¶
func (s *ValidatorNodeSet) Resume() error
Resume resumes the component and its underlying process.
func (*ValidatorNodeSet) ResumeAtIndex ¶
func (s *ValidatorNodeSet) ResumeAtIndex(i int) error
ResumeAtIndex resumes the component and its underlying process at the desired index.
func (*ValidatorNodeSet) Start ¶
func (s *ValidatorNodeSet) Start(ctx context.Context) error
Start starts the configured amount of validators, also sending and mining their deposits.
func (*ValidatorNodeSet) Started ¶
func (s *ValidatorNodeSet) Started() <-chan struct{}
Started checks whether validator node set is started and all nodes are ready to be queried.
func (*ValidatorNodeSet) Stop ¶
func (s *ValidatorNodeSet) Stop() error
Stop stops the component and its underlying process.
func (*ValidatorNodeSet) StopAtIndex ¶
func (s *ValidatorNodeSet) StopAtIndex(i int) error
StopAtIndex stops the component and its underlying process at the desired index.