From 7df27d38a34cb54e4bfdf5b8529eda3c6a959d4e Mon Sep 17 00:00:00 2001 From: corver Date: Wed, 4 Sep 2024 17:01:59 +0200 Subject: [PATCH] chore(e2e): fix staging gas (#1813) Fund `EOAs` on staging. This ensures that gasstation can be funded by them. Precent gasstation deploy on omega/mainnet at this point. issue: none --- e2e/app/gaspump.go | 11 +++++++---- halo/genutil/evm/evm.go | 8 +++++--- halo/genutil/evm/testdata/TestMakeEVMGenesis.golden | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/e2e/app/gaspump.go b/e2e/app/gaspump.go index 7e2b9931f..181953b9b 100644 --- a/e2e/app/gaspump.go +++ b/e2e/app/gaspump.go @@ -12,6 +12,7 @@ import ( "github.com/omni-network/omni/lib/contracts/gasstation" "github.com/omni-network/omni/lib/errors" "github.com/omni-network/omni/lib/log" + "github.com/omni-network/omni/lib/netconf" "github.com/omni-network/omni/lib/txmgr" "github.com/ethereum/go-ethereum/common" @@ -19,7 +20,7 @@ import ( "github.com/ethereum/go-ethereum/params" ) -// deployGasApp deploys OmniGasPump and OmniGasStation contracts. +// DeployGasApp deploys OmniGasPump and OmniGasStation contracts. func DeployGasApp(ctx context.Context, def Definition) error { if err := deployGasPumps(ctx, def); err != nil { return errors.Wrap(err, "deploy gas pumps") @@ -106,6 +107,10 @@ func deployGasStation(ctx context.Context, def Definition) error { // TODO: handle funding / monitoring properly. // consider joining with e2e/app/eoa, or introduce something similar for contracts. func fundGasStation(ctx context.Context, def Definition) error { + if def.Testnet.Network != netconf.Devnet && def.Testnet.Network != netconf.Staging { + return errors.New("funding of gas station only supported on devnet and staging (fixme)") + } + network := networkFromDef(def) omniEVM, ok := network.OmniEVMChain() if !ok { @@ -118,9 +123,7 @@ func fundGasStation(ctx context.Context, def Definition) error { } funder := eoa.Funder() - - // use dev account for ephemeral networks - if network.ID.IsEphemeral() { + if network.ID == netconf.Devnet { // use dev account for devnet funder = anvil.DevAccount8() } diff --git a/halo/genutil/evm/evm.go b/halo/genutil/evm/evm.go index 67f1c91f3..f0270e73f 100644 --- a/halo/genutil/evm/evm.go +++ b/halo/genutil/evm/evm.go @@ -112,9 +112,11 @@ func ephemeralPrefundAlloc() types.GenesisAlloc { anvil.DevAccount8(): {Balance: eth1m}, anvil.DevAccount9(): {Balance: eth1m}, - // Relayer and Monitor EOAs - eoa.MustAddress(netconf.Staging, eoa.RoleMonitor): {Balance: eth1m}, - eoa.MustAddress(netconf.Staging, eoa.RoleRelayer): {Balance: eth1m}, + // Staging EOAs + eoa.MustAddress(netconf.Staging, eoa.RoleMonitor): {Balance: eth1m}, + eoa.MustAddress(netconf.Staging, eoa.RoleRelayer): {Balance: eth1m}, + eoa.MustAddress(netconf.Staging, eoa.RoleDeployer): {Balance: eth1m}, + eoa.Funder(): {Balance: eth1m}, // team ops accounts common.HexToAddress("0xfE921e06Ed0a22c035b4aCFF0A5D3a434A330c96"): {Balance: eth1m}, // dev relayer (local) diff --git a/halo/genutil/evm/testdata/TestMakeEVMGenesis.golden b/halo/genutil/evm/testdata/TestMakeEVMGenesis.golden index a2ddf4084..ee6cc8f9c 100644 --- a/halo/genutil/evm/testdata/TestMakeEVMGenesis.golden +++ b/halo/genutil/evm/testdata/TestMakeEVMGenesis.golden @@ -32246,6 +32246,9 @@ "balance": "0x0", "nonce": "0x1" }, + "f63316aa39fec9d2109ab0d9c7b1ee3a6f60aea4": { + "balance": "0xd3c21bcecceda1000000" + }, "f649b4df492115c2be2817e8344219c572618a69": { "code": "0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639623609d14610093578063ad3cb1cc146100a6578063f2fde38b146100e4575b600080fd5b34801561005b57600080fd5b50610064610104565b005b34801561007257600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b6100646100a1366004610272565b610118565b3480156100b257600080fd5b506100d7604051806040016040528060058152602001640352e302e360dc1b81525081565b60405161008a919061038e565b3480156100f057600080fd5b506100646100ff3660046103a8565b610187565b61010c6101ca565b61011660006101f7565b565b6101206101ca565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061015090869086906004016103c5565b6000604051808303818588803b15801561016957600080fd5b505af115801561017d573d6000803e3d6000fd5b5050505050505050565b61018f6101ca565b6001600160a01b0381166101be57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6101c7816101f7565b50565b6000546001600160a01b031633146101165760405163118cdaa760e01b81523360048201526024016101b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101c757600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561028757600080fd5b833561029281610247565b925060208401356102a281610247565b9150604084013567ffffffffffffffff808211156102bf57600080fd5b818601915086601f8301126102d357600080fd5b8135818111156102e5576102e561025c565b604051601f8201601f19908116603f0116810190838211818310171561030d5761030d61025c565b8160405282815289602084870101111561032657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561036e57602081850181015186830182015201610352565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006103a16020830184610348565b9392505050565b6000602082840312156103ba57600080fd5b81356103a181610247565b6001600160a01b03831681526040602082018190526000906103e990830184610348565b94935050505056fea26469706673582212204e6c3564458e40536cebf1d675d2ad7af11c5352eae442784c5e053dcf005af164736f6c63430008180033", "storage": {