types

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicRPCByName

func PublicRPCByName(name string) string

PublicRPCByName returns the public chain RPC address by name.

Types

type AnvilChain

type AnvilChain struct {
	Chain       EVMChain // For netconf
	InternalIP  net.IP   // For docker container IP
	ProxyPort   uint32   // For binding
	InternalRPC string   // For JSON-RPC queries from halo/relayer
	ExternalRPC string   // For JSON-RPC queries from e2e app.
	LoadState   string   // File path to load anvil state from
}

AnvilChain represents an anvil chain instance in a omni network.

type ContractName

type ContractName string
const (
	ContractPortal   ContractName = "portal"
	ContractOmniAVS  ContractName = "omni_avs"
	ContractPingPong ContractName = "ping_pong"
)

type DeployInfo

type DeployInfo struct {
	Address common.Address
	Height  uint64
}

DeployInfo contains the address and deploy height of a deployed contract.

type DeployInfos

type DeployInfos map[uint64]map[ContractName]DeployInfo

DeployInfos contains the addresses of deployed xdapps and contracts by chainID.

Note that ContractPortal is duplicated both here and in netconf.Chain. That is because netconf is used by halo and relayer and other production apps.

This DeployInfos is similar to netconf, but it is only used by e2e deployment and tests. As soon as any production app needs to use any of these addresses, they should be moved to netconf.

func LoadDeployInfos

func LoadDeployInfos(file string) (DeployInfos, error)

func (DeployInfos) Addr

func (i DeployInfos) Addr(chainID uint64, contract ContractName) (common.Address, bool)

func (DeployInfos) Save

func (i DeployInfos) Save(file string) error

func (DeployInfos) Set

func (i DeployInfos) Set(chainID uint64, contract ContractName, addr common.Address, height uint64)

type EVMChain

type EVMChain struct {
	Name               string // Chain Nam.
	ID                 uint64 // Chain ID
	IsPublic           bool
	IsAVSTarget        bool
	BlockPeriod        time.Duration
	FinalizationStrat  netconf.FinalizationStrat
	AVSContractAddress common.Address
}

EVMChain represents a EVM chain in a omni network.

func AnvilChainsByNames

func AnvilChainsByNames(names []string) []EVMChain

AnvilChainsByNames returns the Anvil evm chain definitions by names.

func OmniEVMByNetwork

func OmniEVMByNetwork(network netconf.ID) EVMChain

OmniEVMByNetwork returns the Omni evm chain definition by netconf network.

func PublicChainByName

func PublicChainByName(name string) (EVMChain, error)

PublicChainByName returns the public chain definition by name.

type GcMode added in v0.1.2

type GcMode string

GcMode represents the garbage collection mode for geth. Either "full" or "archive".

const (
	GcModeFull    GcMode = "full"    // default mode for geth
	GcModeArchive GcMode = "archive" // archival mode for geth
)

type GethConfig added in v0.1.2

type GethConfig struct {
	// BootstrapNodes are used to establish connectivity
	// with the rest of the network.
	BootstrapNodes string

	// Static nodes are used as pre-configured connections which are always
	// maintained and re-connected on disconnects.
	StaticNodes string
}

GethConfig represents part of the geth configuration that can't be initialized through the command line args.

type InfraProvider

type InfraProvider interface {
	infra.Provider

	Upgrade(ctx context.Context) error

	// Clean deletes all containers, networks, and data on disk.
	Clean(ctx context.Context) error
}

type InfrastructureData

type InfrastructureData struct {
	e2e.InfrastructureData

	// VMs maps the VM name to its instance data.
	// Note this differs from e2e.InfrastructureData.Instances, which maps the service names to its instance data.
	VMs map[string]e2e.InstanceData
}

InfrastructureData wraps e2e.InfrastructureData with additional omni-specific fields.

type Manifest

type Manifest struct {
	e2e.Manifest

	Network netconf.ID `toml:"network"`

	// AnvilChains defines the anvil chains to deploy; chain_a, chain_b, etc.
	AnvilChains []string `toml:"anvil_chains"`

	// PublicChains defines the public chains to connect to; arb_sepolia, etc.
	PublicChains []string `toml:"public_chains"`

	// AVSTarget identifies the chain to deploy the AVS contracts to.
	// It must be one of the anvil or public chains.
	AVSTarget string `toml:"avs_target"`

	// MultiOmniEVMs defines whether to deploy one or multiple Omni EVMs.
	MultiOmniEVMs bool `toml:"multi_omni_evms"`

	// SlowTests defines whether to run slow tests (e.g. tests/eigen_tests.go)
	SlowTests bool `toml:"slow_tests"`

	// OnlyMonitor indicates that the monitor is the only thing that we deploy in this network.
	OnlyMonitor bool `toml:"only_monitor"`

	// PingPongN defines the number of ping pong messages to send. Defaults 3 if 0.
	PingPongN uint64 `toml:"pingpong_n"`
}

Manifest wraps e2e.Manifest with additional omni-specific fields.

func (Manifest) OmniEVMs

func (m Manifest) OmniEVMs() map[string]GcMode

OmniEVMs returns the map names and GcMode of Omni EVMs to deploy. If only a single Omni EVM is to be deployed, the name is "omni_evm". Otherwise, the names are "<node>_evm".

type OmniEVM

type OmniEVM struct {
	Chain           EVMChain // For netconf (all instances must have the same chain)
	InstanceName    string   // For docker container name
	InternalIP      net.IP   // For docker container IP
	ExternalIP      net.IP   // For setting up NAT on geth bootnode
	ProxyPort       uint32   // For binding
	InternalRPC     string   // For JSON-RPC queries from halo/relayer
	InternalAuthRPC string   // For engine API queries from halo
	ExternalRPC     string   // For JSON-RPC queries from e2e app.
	GcMode          GcMode   // Geth config for archive or full mode

	// P2P networking
	NodeKey   *ecdsa.PrivateKey // Private key
	Enode     *enode.Node       // Public key
	BootNodes []*enode.Node     // Peer public keys
}

OmniEVM represents a omni evm instance in a omni network. Similar to e2e.Node for halo instances.

func (OmniEVM) BootNodesStrArr added in v0.1.2

func (o OmniEVM) BootNodesStrArr() string

BootNodesStrArr returns a string array of bootnodes for use in geth's config for bootnodes.

func (OmniEVM) NodeKeyHex

func (o OmniEVM) NodeKeyHex() string

NodeKeyHex returns the hex-encoded node key. Used for geth's config.

type PublicChain

type PublicChain struct {
	Chain      EVMChain // For netconf
	RPCAddress string   // For JSON-RPC queries from halo/relayer/e2e app.
}

PublicChain represents a public chain in a omni network.

type Testnet

type Testnet struct {
	*e2e.Testnet
	Network      netconf.ID
	OmniEVMs     []OmniEVM
	AnvilChains  []AnvilChain
	PublicChains []PublicChain
	OnlyMonitor  bool
}

Testnet wraps e2e.Testnet with additional omni-specific fields.

func (Testnet) AVSChain added in v0.1.2

func (t Testnet) AVSChain() (EVMChain, error)

func (Testnet) FirstOmniValidatorEVM added in v0.1.2

func (t Testnet) FirstOmniValidatorEVM() (OmniEVM, error)

FirstOmniValidatorEVM returns the first validator's evm.

func (Testnet) HasOmniEVM

func (t Testnet) HasOmniEVM() bool

Jump to

Keyboard shortcuts

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