types

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChainOmniEVM = EVMChain{
		Name:              "omni_evm",
		ID:                1,
		BlockPeriod:       2 * time.Second,
		FinalizationStrat: netconf.StratFinalized,
	}
)

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"
	ContractELAVSDirectory      ContractName = "el_avs_directory"
	ContractELDelegationManager ContractName = "el_delegation_manager"
	ContractELStrategyManager   ContractName = "el_strategy_manager"
	ContractELPodManager        ContractName = "el_pod_manager"
	ContractELWETH              ContractName = "el_weth"
	ContractELWETHStrategy      ContractName = "el_weth_strategy"
	ContractAVSDirectory        ContractName = "el_avs_directory"
	ContractEIP1271SigUtils     ContractName = "el_eip_1271_sig_utils"
)

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
}

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 PublicChainByName

func PublicChainByName(name string) (EVMChain, error)

PublicChainByName returns the public chain definition by name.

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 string `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_goerli, 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"`
}

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

func (Manifest) OmniEVMs

func (m Manifest) OmniEVMs() []string

OmniEVMs returns the names 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
	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.

	// 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) BootNodesStr

func (o OmniEVM) BootNodesStr() string

func (OmniEVM) NodeKeyHex

func (o OmniEVM) NodeKeyHex() string

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      string
	OmniEVMs     []OmniEVM
	AnvilChains  []AnvilChain
	PublicChains []PublicChain
}

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

func (Testnet) AVSChain

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

Jump to

Keyboard shortcuts

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