params

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type L1PrefundWallets

type L1PrefundWallets struct {
	HOC    wallet.Wallet
	POC    wallet.Wallet
	Faucet wallet.Wallet
}

type L1TenData added in v0.24.0

type L1TenData struct {
	// TenStartBlock is the L1 block hash where the Ten network activity begins (e.g. mgmt contract deployment)
	TenStartBlock common.Hash
	// MgmtContractAddr defines the management contract address
	MgmtContractAddress common.Address
	// ObxErc20Address - the address of the "TEN" ERC20
	ObxErc20Address common.Address
	// EthErc20Address - the address of the "ETH" ERC20
	EthErc20Address common.Address
	// MessageBusAddr - the address of the L1 message bus.
	MessageBusAddr common.Address
}

type SimParams

type SimParams struct {
	NumberOfNodes int

	// A critical parameter of the simulation. The value should be as low as possible, as long as the test is still meaningful
	AvgBlockDuration  time.Duration
	AvgNetworkLatency time.Duration // artificial latency injected between sending and receiving messages on the mock network

	SimulationTime time.Duration // how long the simulations should run for

	L1EfficiencyThreshold float64

	// MgmtContractLib allows parsing MgmtContract txs to and from the eth txs
	MgmtContractLib mgmtcontractlib.MgmtContractLib
	// ERC20ContractLib allows parsing ERC20Contract txs to and from the eth txs
	ERC20ContractLib erc20contractlib.ERC20ContractLib

	L1TenData *L1TenData

	// Contains all the wallets required by the simulation
	Wallets *SimWallets

	StartPort int  // The port from which to start allocating ports. Must be unique across all simulations.
	IsInMem   bool // Denotes that the sim does not have a full RPC layer.

	ReceiptTimeout time.Duration // How long to wait for transactions to be confirmed.

	StoppingDelay              time.Duration // How long to wait between injection and verification
	NodeWithInboundP2PDisabled int
	WithPrefunding             bool
}

SimParams are the parameters for setting up the simulation.

type SimToken

type SimToken struct {
	Name testcommon.ERC20

	L1Owner           wallet.Wallet
	L1ContractAddress *common.Address

	L2Owner           wallet.Wallet
	L2ContractAddress *common.Address
}

SimToken - mapping between the ERC20s on Ethereum and Obscuro. This holds both the contract addresses and the keys of the contract owners, because it needs to sign transactions and deploy contracts. Note: For now the l2 values are taken from the "bridge" inside the Obscuro core.

type SimWallets

type SimWallets struct {
	MCOwnerWallet wallet.Wallet   // owner of the management contract deployed on Ethereum
	NodeWallets   []wallet.Wallet // the keys used by the obscuro nodes to submit rollups to Eth

	SimEthWallets []wallet.Wallet // the wallets of the simulated users on the Ethereum side
	SimObsWallets []wallet.Wallet // and their equivalents on the obscuro side (with a different chainId)

	GasBridgeWallet     wallet.Wallet
	GasWithdrawalWallet wallet.Wallet

	L2FaucetWallet wallet.Wallet // the wallet of the L2 faucet
	L2FeesWallet   wallet.Wallet
	Tokens         map[testcommon.ERC20]*SimToken // The supported tokens

	PrefundedEthWallets L1PrefundWallets
}

func NewSimWallets

func NewSimWallets(nrSimWallets int, nNodes int, ethereumChainID int64, obscuroChainID int64) *SimWallets

func (*SimWallets) AllEthWallets

func (w *SimWallets) AllEthWallets() []wallet.Wallet

func (*SimWallets) AllObsWallets

func (w *SimWallets) AllObsWallets() []wallet.Wallet

Jump to

Keyboard shortcuts

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