From 1598a6b31336515a14fa6dfad6369655a5e5b6af Mon Sep 17 00:00:00 2001 From: Damjan Smickovski <32773226+smickovskid@users.noreply.github.com> Date: Fri, 1 Mar 2024 21:54:46 +0100 Subject: [PATCH] Added Gnosis Chiado to benchmark tests (#11869) * Added Gnosis Chiado to benchmark tests * Added Gnosis Chiado to benchmark tests * Added Gnosis Chiado to benchmark tests * fix * set readOnlyAddress for gnosis * add default network config in benchmark test * clean mode selection * run lint --------- Co-authored-by: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> --- integration-tests/benchmark/keeper_test.go | 13 +++++++++- .../contracts/contract_deployer.go | 25 +++++++++---------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go index 5ca52d26a9e..d6c4c6b2587 100644 --- a/integration-tests/benchmark/keeper_test.go +++ b/integration-tests/benchmark/keeper_test.go @@ -120,6 +120,12 @@ type NetworkConfig struct { funding *big.Float } +var defaultNetworkConfig = NetworkConfig{ + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: time.Duration(0), +} + func TestAutomationBenchmark(t *testing.T) { l := logging.GetTestLogger(t) testType, err := tc.GetConfigurationNameFromEnv() @@ -237,7 +243,7 @@ func getNetworkConfig(networkName string, config *tc.TestConfig) NetworkConfig { var nc NetworkConfig var ok bool if nc, ok = networkConfig[networkName]; !ok { - return NetworkConfig{} + return defaultNetworkConfig } if networkName == "SimulatedGeth" || networkName == "geth" { @@ -302,6 +308,11 @@ var networkConfig = map[string]NetworkConfig{ blockTime: time.Second, deltaStage: 20 * time.Second, }, + "GnosisChiado": { + upkeepSLA: int64(120), + blockTime: 6 * time.Second, + deltaStage: 20 * time.Second, + }, } func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) { diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index 78ec0c18c64..1cf2a6bede2 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "github.com/smartcontractkit/chainlink-testing-framework/networks" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -956,18 +958,13 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( var mode uint8 switch e.client.GetChainID().Int64() { //Arbitrum payment model - //Goerli Arbitrum - case 421613: - mode = uint8(1) - //Sepolia Arbitrum - case 421614: + case networks.ArbitrumMainnet.ChainID, networks.ArbitrumSepolia.ChainID: mode = uint8(1) //Optimism payment model - //Goerli Optimism - case 420: + case networks.OptimismMainnet.ChainID, networks.OptimismSepolia.ChainID: mode = uint8(2) - //Goerli Base - case 84531: + //Base + case networks.BaseMainnet.ChainID, networks.BaseSepolia.ChainID: mode = uint8(2) default: mode = uint8(0) @@ -1227,21 +1224,21 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( var err error chainId := e.client.GetChainID().Int64() - if chainId == 534352 || chainId == 534351 { // Scroll / Scroll Sepolia + if chainId == networks.ScrollMainnet.ChainID || chainId == networks.ScrollSepolia.ChainID { chainModuleAddr, _, _, err = e.client.DeployContract("ScrollModule", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { return scroll_module.DeployScrollModule(auth, backend) }) - } else if chainId == 42161 || chainId == 421614 || chainId == 421613 { // Arbitrum One / Sepolia / Goerli + } else if chainId == networks.ArbitrumMainnet.ChainID || chainId == networks.ArbitrumSepolia.ChainID { chainModuleAddr, _, _, err = e.client.DeployContract("ArbitrumModule", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { return arbitrum_module.DeployArbitrumModule(auth, backend) }) - } else if chainId == 10 || chainId == 11155420 { // Optimism / Optimism Sepolia + } else if chainId == networks.OptimismMainnet.ChainID || chainId == networks.OptimismSepolia.ChainID { chainModuleAddr, _, _, err = e.client.DeployContract("OptimismModule", func( auth *bind.TransactOpts, backend bind.ContractBackend, @@ -1269,8 +1266,10 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( } var allowedReadOnlyAddress common.Address - if chainId == 1101 || chainId == 1442 || chainId == 2442 { + if chainId == networks.PolygonZkEvmMainnet.ChainID || chainId == networks.PolygonZkEvmCardona.ChainID { allowedReadOnlyAddress = common.HexToAddress("0x1111111111111111111111111111111111111111") + } else if chainId == networks.GnosisMainnet.ChainID || chainId == networks.GnosisChiado.ChainID { + allowedReadOnlyAddress = common.HexToAddress("0xfffffffffffffffffffffffffffffffffffffffe") } else { allowedReadOnlyAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") }