Documentation
¶
Index ¶
- Constants
- Variables
- func DecodePackedBytesV1(blob kzg4844.Blob) ([]byte, error)
- func EncodePackedBytesV1(payload []byte) (kzg4844.Blob, error)
- func LoadState(path, destination string) error
- func SignBlobTransaction(request BlobTransactionRequest, key *ecdsa.PrivateKey) (*types.Transaction, error)
- type Account
- type AccountChanges
- type AccountsConfig
- type AuthorizationRequest
- type BeaconBlockRequest
- type BeaconConfig
- type BeaconDataColumnSidecarsRequest
- type BeaconDataEnvelope
- type BeaconErrorMessage
- type BeaconEventsRequest
- type BeaconExecutionPayloadEnvelopeRequest
- type BeaconResponse
- type BeaconValidatorBalancesRequest
- type BeaconValidatorsRequest
- type BeaconVersionedResponse
- type BlobTransactionRequest
- type BlockSafety
- type ChainConfig
- type Config
- type ControlChanges
- type Endpoints
- type Event
- type EventsConfig
- type ExecutionConsolidationRequest
- type ExecutionDepositRequest
- type ExecutionWithdrawalRequest
- type FinalityStatus
- type ForkConfig
- type IPCConfig
- type ImportAccountResult
- type ListenerConfig
- type LogConfig
- type MiningConfig
- type Node
- func (n *Node) Accounts() []common.Address
- func (n *Node) AddConsolidationRequest(ctx context.Context, request ExecutionConsolidationRequest) error
- func (n *Node) AddDepositRequest(ctx context.Context, request ExecutionDepositRequest) error
- func (n *Node) AddWithdrawal(ctx context.Context, request WithdrawalRequest) error
- func (n *Node) AddWithdrawalRequest(ctx context.Context, request ExecutionWithdrawalRequest) error
- func (n *Node) ApplyControl(ctx context.Context, changes ControlChanges) (common.Hash, error)
- func (n *Node) Automine() bool
- func (n *Node) BlockSafety(hash common.Hash) (BlockSafety, error)
- func (n *Node) Checkpoint(ctx context.Context, name string) error
- func (n *Node) Close() error
- func (n *Node) ControlChanges(hash common.Hash) (ControlChanges, bool)
- func (n *Node) CreateBranch(ctx context.Context, name string, blockNumber uint64) error
- func (n *Node) DropAllTransactions(ctx context.Context) error
- func (n *Node) DropTransaction(ctx context.Context, hash common.Hash) (bool, error)
- func (n *Node) DumpState(path string) error
- func (n *Node) Endpoints() Endpoints
- func (n *Node) EventsSince(revision Revision) ([]Event, error)
- func (n *Node) FinalityStatus() FinalityStatus
- func (n *Node) ImportAccount(ctx context.Context, privateKey *ecdsa.PrivateKey, balance *big.Int) (ImportAccountResult, error)
- func (n *Node) IntervalMining() time.Duration
- func (n *Node) Mine(ctx context.Context, count uint64, empty bool) ([]common.Hash, error)
- func (n *Node) MineBranch(ctx context.Context, name string, count uint64) ([]common.Hash, error)
- func (n *Node) MissSlots(ctx context.Context, count uint64) ([]uint64, error)
- func (n *Node) PauseFinality(ctx context.Context) error
- func (n *Node) RPCClient() *rpc.Client
- func (n *Node) RemoveAccount(ctx context.Context, address common.Address) (bool, error)
- func (n *Node) RemovePoolTransactions(ctx context.Context, address common.Address) error
- func (n *Node) Restore(ctx context.Context, name string) error
- func (n *Node) ResumeFinality(ctx context.Context) error
- func (n *Node) Revert(ctx context.Context, id uint64) (bool, error)
- func (n *Node) Revision() Revision
- func (n *Node) SafetyStatus() SafetyStatus
- func (n *Node) SendTransaction(ctx context.Context, tx *types.Transaction) (common.Hash, error)
- func (n *Node) SetAutomine(ctx context.Context, enabled bool) error
- func (n *Node) SetFeeRecipient(ctx context.Context, address common.Address) error
- func (n *Node) SetIntervalMining(ctx context.Context, interval time.Duration) error
- func (n *Node) SignAuthorization(authority common.Address, request AuthorizationRequest) (types.SetCodeAuthorization, error)
- func (n *Node) Snapshot(ctx context.Context) (uint64, error)
- func (n *Node) Start() error
- func (n *Node) SwitchBranch(ctx context.Context, name string) error
- func (n *Node) VerifyControlBlock(ctx context.Context, hash common.Hash) (bool, error)
- func (n *Node) VerifyControlRecord(ctx context.Context, hash common.Hash) (bool, error)
- func (n *Node) Wait(ctx context.Context) error
- type Option
- type ResourceLimits
- type Revision
- type SafetyStatus
- type StateManifest
- type StorageConfig
- type TLSConfig
- type WithdrawalRequest
Constants ¶
const ( PackedBytesV1HeaderSize = 48 PackedBytesV1Capacity = 4096*31 - PackedBytesV1HeaderSize )
const ( DefaultMnemonic = "test test test test test test test test test test test junk" DefaultChainID = uint64(1337) )
const StateArchiveFormat = "ethertest-state-v3"
const Version = "0.1.0-alpha.1"
Variables ¶
var ( ErrDepositRequestQueueFull = errors.New("deposit execution request queue already has 8192 entries") ErrWithdrawalRequestQueueFull = errors.New("withdrawal execution request queue already has 16 entries") ErrConsolidationRequestQueueFull = errors.New("consolidation execution request queue already has 2 entries") ErrExecutionRequestIDOverflow = errors.New("execution request ID overflow") )
var ( ErrWithdrawalAmountZero = errors.New("withdrawal amount must be greater than zero") ErrWithdrawalQueueFull = errors.New("next block already has 16 withdrawals") ErrWithdrawalIndexOverflow = errors.New("withdrawal index overflow") )
var ErrEventGap = errors.New("requested revision is no longer available")
var ErrNodeStopped = errors.New("ethertest node is stopped")
var ErrResourceLimit = errors.New("resource limit exceeded")
ErrResourceLimit is returned when a request exceeds a configured local-node work or response bound.
Functions ¶
func EncodePackedBytesV1 ¶
EncodePackedBytesV1 encodes one payload into one canonical EIP-4844 blob. Byte zero in every field element remains zero, so every element is canonical.
func SignBlobTransaction ¶
func SignBlobTransaction(request BlobTransactionRequest, key *ecdsa.PrivateKey) (*types.Transaction, error)
SignBlobTransaction builds an Osaka sidecar with real KZG commitment and 128 cell proofs, then signs the EIP-4844 transaction.
Types ¶
type Account ¶
type Account struct {
Address common.Address
PrivateKey *ecdsa.PrivateKey
Path string
}
type AccountChanges ¶
type AccountsConfig ¶
type AuthorizationRequest ¶
AuthorizationRequest is the exact EIP-7702 tuple to sign. Address is the delegation target, including the zero address used to clear a delegation. Callers are responsible for selecting the nonce; signing does not read or mutate execution state.
type BeaconBlockRequest ¶
type BeaconBlockRequest struct {
BlockID string `path:"block_id"`
}
BeaconBlockRequest is generated from the locked path and query parameters.
type BeaconConfig ¶
type BeaconConfig struct {
Enabled bool `toml:"enabled"`
}
type BeaconDataColumnSidecarsRequest ¶
type BeaconDataColumnSidecarsRequest struct {
BlockID string `path:"block_id"`
Indices []string `query:"indices"`
}
BeaconDataColumnSidecarsRequest is generated from the locked path and query parameters.
type BeaconDataEnvelope ¶
type BeaconDataEnvelope[T any] struct { Data T `json:"data"` }
BeaconDataEnvelope is generated from components.schemas.DataEnvelope.
type BeaconErrorMessage ¶
type BeaconErrorMessage struct {
Code int `json:"code"`
Message string `json:"message"`
Stacktraces []string `json:"stacktraces,omitempty"`
}
BeaconErrorMessage is generated from components.schemas.ErrorMessage.
type BeaconEventsRequest ¶
type BeaconEventsRequest struct {
Topics []string `query:"topics"`
}
BeaconEventsRequest is generated from the locked path and query parameters.
type BeaconExecutionPayloadEnvelopeRequest ¶
type BeaconExecutionPayloadEnvelopeRequest struct {
BlockID string `path:"block_id"`
}
BeaconExecutionPayloadEnvelopeRequest is generated from the locked path and query parameters.
type BeaconResponse ¶
type BeaconResponse[T any] struct { ExecutionOptimistic bool `json:"execution_optimistic"` Finalized bool `json:"finalized"` Data T `json:"data"` EthertestTainted bool `json:"ethertest_tainted,omitempty"` }
BeaconResponse is generated from components.schemas.Response.
type BeaconValidatorBalancesRequest ¶
type BeaconValidatorBalancesRequest struct {
StateID string `path:"state_id"`
IDs []string `query:"id"`
}
BeaconValidatorBalancesRequest is generated from the locked path and query parameters.
type BeaconValidatorsRequest ¶
type BeaconValidatorsRequest struct {
StateID string `path:"state_id"`
IDs []string `query:"id"`
Statuses []string `query:"status"`
}
BeaconValidatorsRequest is generated from the locked path and query parameters.
type BeaconVersionedResponse ¶
type BeaconVersionedResponse[T any] struct { Version string `json:"version"` ExecutionOptimistic bool `json:"execution_optimistic"` Finalized bool `json:"finalized"` Data T `json:"data"` EthertestTainted bool `json:"ethertest_tainted,omitempty"` }
BeaconVersionedResponse is generated from components.schemas.VersionedResponse.
type BlobTransactionRequest ¶
type BlockSafety ¶
type BlockSafety struct {
BlockHash common.Hash `json:"block_hash"`
Tainted bool `json:"tainted"`
FirstUnsafeBlock *common.Hash `json:"first_unsafe_block,omitempty"`
Reasons []string `json:"reasons,omitempty"`
}
BlockSafety describes whether a block belongs to Ethereum-replayable history or to an unsafe fixture lineage.
type ChainConfig ¶
type ChainConfig struct {
ChainID uint64 `toml:"chain_id"`
NetworkID uint64 `toml:"network_id"`
GenesisFile string `toml:"genesis"`
GenesisTime int64 `toml:"genesis_time"`
SlotDuration time.Duration `toml:"slot_duration"`
SlotsPerEpoch uint64 `toml:"slots_per_epoch"`
Validators uint64 `toml:"validators"`
GasLimit uint64 `toml:"gas_limit"`
Forks ForkConfig `toml:"forks"`
}
type Config ¶
type Config struct {
Chain ChainConfig `toml:"chain"`
Accounts AccountsConfig `toml:"accounts"`
Mining MiningConfig `toml:"mining"`
HTTP ListenerConfig `toml:"http"`
IPC IPCConfig `toml:"ipc"`
Beacon BeaconConfig `toml:"beacon"`
Storage StorageConfig `toml:"storage"`
Events EventsConfig `toml:"events"`
Limits ResourceLimits `toml:"limits"`
Log LogConfig `toml:"log"`
DumpState string `toml:"dump_state"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func LoadConfig ¶
func ReadConfig ¶
ReadConfig applies defaults, a strict TOML file, then ETHERTEST_* variables. It intentionally leaves validation to the caller so CLI overrides can resolve a conflict introduced by an earlier layer.
func ResolveConfig ¶
ResolveConfig loads and validates an explicitly configured execution genesis and returns the effective chain fields. network_id = 0 remains an inheritance marker until a Node has selected either a fresh or persisted genesis.
func (Config) EffectiveNetworkID ¶
EffectiveNetworkID resolves network_id = 0 to the effective execution chain ID. Nodes store the resolved non-zero value after genesis initialization.
func (Config) IPCEndpoint ¶
IPCEndpoint resolves the configured socket or named-pipe endpoint. A simple name follows geth semantics: it is placed in persistent storage when one is configured, otherwise in the system temporary directory.
type ControlChanges ¶
type ControlChanges map[common.Address]AccountChanges
type Event ¶
type Event struct {
Revision Revision `json:"revision"`
Type string `json:"type"`
Slot uint64 `json:"slot"`
BlockHash common.Hash `json:"block_hash,omitempty"`
BlockNumber uint64 `json:"block_number,omitempty"`
Removed bool `json:"removed,omitempty"`
OldHead common.Hash `json:"old_head,omitempty"`
NewHead common.Hash `json:"new_head,omitempty"`
Depth uint64 `json:"depth,omitempty"`
}
type EventsConfig ¶
type EventsConfig struct {
Capacity uint64 `toml:"capacity"`
}
type ExecutionConsolidationRequest ¶
type ExecutionConsolidationRequest struct {
SourceAddress common.Address
SourcePubkey [48]byte
TargetPubkey [48]byte
}
ExecutionConsolidationRequest is an EIP-7251 consolidation request queued for an Electra execution_requests container.
type ExecutionDepositRequest ¶
type ExecutionDepositRequest struct {
Pubkey [48]byte
WithdrawalCredentials [32]byte
Amount uint64
Signature [96]byte
Index uint64
}
ExecutionDepositRequest is an EIP-6110 deposit request queued for an Electra execution_requests container. It is a synthetic control object and does not run a BeaconState deposit transition.
type ExecutionWithdrawalRequest ¶
type ExecutionWithdrawalRequest struct {
SourceAddress common.Address
ValidatorPubkey [48]byte
Amount uint64
}
ExecutionWithdrawalRequest is an EIP-7002 withdrawal request queued for an Electra execution_requests container. Amount is denominated in Gwei; zero retains the protocol's full-exit meaning.
type FinalityStatus ¶
type FinalityStatus struct {
Paused bool `json:"paused"`
CurrentSlot uint64 `json:"current_slot"`
FinalitySlot uint64 `json:"finality_slot"`
SafeSlot uint64 `json:"safe_slot"`
SafeBlockHash common.Hash `json:"safe_block_hash"`
SafeBlockNumber uint64 `json:"safe_block_number"`
FinalizedSlot uint64 `json:"finalized_slot"`
FinalizedBlockHash common.Hash `json:"finalized_block_hash"`
FinalizedBlockNumber uint64 `json:"finalized_block_number"`
ConsensusMode string `json:"consensus_mode"`
}
FinalityStatus describes ethertest's current synthetic finality projection. FinalitySlot is the observer slot from which the one/two-epoch lags are calculated. It equals CurrentSlot unless finality is paused.
type ForkConfig ¶
type ImportAccountResult ¶
type ImportAccountResult struct {
Address common.Address `json:"address"`
ControlBlockHash *common.Hash `json:"controlBlockHash"`
}
ImportAccountResult describes both the new signer and the optional unsafe control block created to set its initial balance.
type ListenerConfig ¶
type MiningConfig ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) AddConsolidationRequest ¶
func (n *Node) AddConsolidationRequest(ctx context.Context, request ExecutionConsolidationRequest) error
AddConsolidationRequest persistently queues an EIP-7251-shaped synthetic request for the next canonical Prague-or-later block with remaining capacity.
func (*Node) AddDepositRequest ¶
func (n *Node) AddDepositRequest(ctx context.Context, request ExecutionDepositRequest) error
AddDepositRequest persistently queues an EIP-6110-shaped synthetic request for the next canonical Prague-or-later block with remaining deposit capacity.
func (*Node) AddWithdrawal ¶
func (n *Node) AddWithdrawal(ctx context.Context, request WithdrawalRequest) error
AddWithdrawal queues a withdrawal for the next canonical block. It updates the pending candidate without triggering block production.
func (*Node) AddWithdrawalRequest ¶
func (n *Node) AddWithdrawalRequest(ctx context.Context, request ExecutionWithdrawalRequest) error
AddWithdrawalRequest persistently queues an EIP-7002-shaped synthetic request for the next canonical Prague-or-later block with remaining capacity.
func (*Node) ApplyControl ¶
func (*Node) BlockSafety ¶
func (n *Node) BlockSafety(hash common.Hash) (BlockSafety, error)
func (*Node) ControlChanges ¶
func (n *Node) ControlChanges(hash common.Hash) (ControlChanges, bool)
func (*Node) CreateBranch ¶
func (*Node) DropAllTransactions ¶
DropAllTransactions clears the pending pool, retaining canonical blob data.
func (*Node) DropTransaction ¶
DropTransaction removes only a currently pooled transaction.
func (*Node) FinalityStatus ¶
func (n *Node) FinalityStatus() FinalityStatus
FinalityStatus returns the active synthetic safe/finalized projection.
func (*Node) ImportAccount ¶
func (n *Node) ImportAccount(ctx context.Context, privateKey *ecdsa.PrivateKey, balance *big.Int) (ImportAccountResult, error)
ImportAccount adds a runtime-only signing key. When balance is non-nil, its absolute value is applied through the normal unsafe control-block path.
func (*Node) IntervalMining ¶
IntervalMining returns the active runtime interval, or zero when disabled.
func (*Node) MineBranch ¶
func (*Node) PauseFinality ¶
PauseFinality freezes synthetic safe/finalized resolution at the current slot while block production and missed-slot processing continue.
func (*Node) RemoveAccount ¶
RemoveAccount removes only a runtime-imported signer. It does not modify the corresponding execution account state.
func (*Node) RemovePoolTransactions ¶
RemovePoolTransactions removes all pending transactions of an account.
func (*Node) ResumeFinality ¶
ResumeFinality resumes slot-derived finality and immediately catches the projection up to the current slot.
func (*Node) SafetyStatus ¶
func (n *Node) SafetyStatus() SafetyStatus
func (*Node) SendTransaction ¶
func (*Node) SetAutomine ¶
SetAutomine changes runtime mining without changing the slot timeline. Already executable transactions are mined before enabling automine. If a later block fails, earlier committed blocks remain, as with Mine.
func (*Node) SetFeeRecipient ¶
SetFeeRecipient changes the runtime beneficiary and the pending candidate.
func (*Node) SetIntervalMining ¶
SetIntervalMining selects runtime interval mining, including empty blocks. Zero selects manual mode. Block timestamps still advance by slot duration.
func (*Node) SignAuthorization ¶
func (n *Node) SignAuthorization(authority common.Address, request AuthorizationRequest) (types.SetCodeAuthorization, error)
SignAuthorization signs an EIP-7702 authorization with a configured or runtime-imported account. ChainID must be the node chain ID or zero, the replayable cross-chain value allowed by EIP-7702.
func (*Node) Start ¶
Start starts the single-writer controller. Network listeners are started by Serve; embedded users may use the in-process methods without opening ports.
func (*Node) VerifyControlBlock ¶
VerifyControlBlock is retained as a deprecated compatibility wrapper. Deprecated: use VerifyControlRecord.
func (*Node) VerifyControlRecord ¶
VerifyControlRecord verifies ethertest's unsafe fixture record. It does not assert that the block is valid under the Ethereum state transition.
type Option ¶
type Option func(*nodeOptions)
func WithLogger ¶
WithLogger configures structured runtime logging. New is silent when this option is omitted, allowing an embedded node to follow its host's policy.
type ResourceLimits ¶
type ResourceLimits struct {
MaxRequestBytes int64 `toml:"max_request_bytes"`
MaxBatchItems int `toml:"max_batch_items"`
MaxResponseBytes int64 `toml:"max_response_bytes"`
MaxControlOperations uint64 `toml:"max_control_operations"`
MaxLogBlocks uint64 `toml:"max_log_blocks"`
MaxLogResults int `toml:"max_log_results"`
RPCGasCap uint64 `toml:"rpc_gas_cap"`
TraceTimeout time.Duration `toml:"trace_timeout"`
MaxFilters int `toml:"max_filters"`
MaxSubscriptions int `toml:"max_subscriptions"`
FilterTimeout time.Duration `toml:"filter_timeout"`
}
type SafetyStatus ¶
type SafetyStatus struct {
SessionTainted bool `json:"session_tainted"`
HeadTainted bool `json:"head_tainted"`
FirstUnsafeBlock *common.Hash `json:"first_unsafe_block,omitempty"`
Reasons []string `json:"reasons,omitempty"`
TimelineComplete bool `json:"timeline_complete"`
ConsensusMode string `json:"consensus_mode"`
}
SafetyStatus describes the safety of both the active head and the database session. Session taint is permanent because archives retain non-canonical history even after the active head returns to a clean branch.
type StateManifest ¶
type StateManifest struct {
Format string `json:"format"`
Version string `json:"version"`
CreatedAt string `json:"created_at"`
ChainID uint64 `json:"chain_id"`
GenesisHash string `json:"genesis_hash"`
HeadHash string `json:"head_hash"`
HeadNumber uint64 `json:"head_number"`
Revision uint64 `json:"revision"`
DatabaseSHA256 string `json:"database_sha256"`
Secrets bool `json:"secrets"`
Tainted bool `json:"tainted"`
HeadTainted bool `json:"head_tainted"`
TaintReasons []string `json:"taint_reasons,omitempty"`
TimelineComplete bool `json:"timeline_complete"`
ConsensusMode string `json:"consensus_mode"`
}
func InspectState ¶
func InspectState(path string) (StateManifest, error)
type StorageConfig ¶
type WithdrawalRequest ¶
WithdrawalRequest describes a withdrawal to include in the next canonical block. Amount is denominated in Gwei. The globally monotonic withdrawal index is assigned by the node when it builds the pending candidate.
Source Files
¶
- accounts.go
- archive.go
- beacon.go
- beacon_contract_generated.go
- blob.go
- blob_store.go
- branch.go
- candidate_state.go
- chain.go
- commit.go
- config.go
- consensus.go
- control.go
- events.go
- execution_requests.go
- finality.go
- genesis.go
- gloas.go
- gloas_types.go
- http_limits.go
- ipc_listener_unix.go
- ipc_transport.go
- logging.go
- metadata.go
- node.go
- pending_events.go
- projection.go
- resource_limits.go
- rpc_anvil.go
- rpc_bal.go
- rpc_block_overrides.go
- rpc_calls.go
- rpc_compat.go
- rpc_control.go
- rpc_debug.go
- rpc_eth.go
- rpc_execution_requests.go
- rpc_fee_config.go
- rpc_filters.go
- rpc_finality.go
- rpc_legacy_aliases.go
- rpc_queries.go
- rpc_server.go
- rpc_simulate.go
- rpc_subscriptions.go
- rpc_transactions.go
- rpc_txpool.go
- rpc_types.go
- rpc_wallet.go
- rpc_withdrawal.go
- runtime_control.go
- staged_directory.go
- state_metadata.go
- version.go
- wallet.go
- websocket_transport.go
- withdrawal.go