diff --git a/integration-tests/actions/seth/actions.go b/integration-tests/actions/seth/actions.go index 55beca25751..bc9c71c3813 100644 --- a/integration-tests/actions/seth/actions.go +++ b/integration-tests/actions/seth/actions.go @@ -131,12 +131,15 @@ func SendFunds(logger zerolog.Logger, client *seth.Client, payload FundsToSendPa } if client.Cfg.Network.EIP1559DynamicFees { + // if any of the dynamic fees are not set, we need to either estimate them or read them from config if payload.GasFeeCap == nil || payload.GasTipCap == nil { + // estimatior or config reading happens here txOptions := client.NewTXOpts() gasFeeCap = txOptions.GasFeeCap gasTipCap = txOptions.GasTipCap } + // override with payload values if they are set if payload.GasFeeCap != nil { gasFeeCap = payload.GasFeeCap } @@ -155,10 +158,10 @@ func SendFunds(logger zerolog.Logger, client *seth.Client, payload FundsToSendPa } } - var signedTx *types.Transaction + var rawTx types.TxData if client.Cfg.Network.EIP1559DynamicFees { - rawTx := &types.DynamicFeeTx{ + rawTx = &types.DynamicFeeTx{ Nonce: nonce, To: &payload.ToAddress, Value: payload.Amount, @@ -166,19 +169,18 @@ func SendFunds(logger zerolog.Logger, client *seth.Client, payload FundsToSendPa GasFeeCap: gasFeeCap, GasTipCap: gasTipCap, } - // in the future we might need to dynamically set the signer to reflect the hard fork for given chain - signedTx, err = types.SignNewTx(payload.PrivateKey, types.NewLondonSigner(big.NewInt(client.ChainID)), rawTx) } else { - rawTx := &types.LegacyTx{ + rawTx = &types.LegacyTx{ Nonce: nonce, To: &payload.ToAddress, Value: payload.Amount, Gas: gasLimit, GasPrice: gasPrice, } - signedTx, err = types.SignNewTx(payload.PrivateKey, types.NewEIP155Signer(big.NewInt(client.ChainID)), rawTx) } + signedTx, err := types.SignNewTx(payload.PrivateKey, types.LatestSignerForChainID(big.NewInt(client.ChainID)), rawTx) + if err != nil { return nil, errors.Wrap(err, "failed to sign tx") } diff --git a/integration-tests/actions/seth/refund.go b/integration-tests/actions/seth/refund.go index c7faec858a7..f898b4dfcd7 100644 --- a/integration-tests/actions/seth/refund.go +++ b/integration-tests/actions/seth/refund.go @@ -274,6 +274,7 @@ func ReturnFunds(log zerolog.Logger, sethClient *seth.Client, chainlinkNodes []c return err } + // if not set, it will be just set to empty string, which is okay as long as gas estimation is disabled txPriority := sethClient.Cfg.Network.GasEstimationTxPriority txTimeout := sethClient.Cfg.Network.TxnTimeout.Duration() @@ -291,19 +292,19 @@ func ReturnFunds(log zerolog.Logger, sethClient *seth.Client, chainlinkNodes []c Priority: txPriority, }) - var totalGasCost *big.Int + var maxTotalGasCost *big.Int if sethClient.Cfg.Network.EIP1559DynamicFees { - totalGasCost = new(big.Int).Mul(big.NewInt(0).SetInt64(sethClient.Cfg.Network.TransferGasFee), estimations.GasFeeCap) + maxTotalGasCost = new(big.Int).Mul(big.NewInt(0).SetInt64(sethClient.Cfg.Network.TransferGasFee), estimations.GasFeeCap) } else { - totalGasCost = new(big.Int).Mul(big.NewInt(0).SetInt64(sethClient.Cfg.Network.TransferGasFee), estimations.GasPrice) + maxTotalGasCost = new(big.Int).Mul(big.NewInt(0).SetInt64(sethClient.Cfg.Network.TransferGasFee), estimations.GasPrice) } - toSend := new(big.Int).Sub(balance, totalGasCost) + toSend := new(big.Int).Sub(balance, maxTotalGasCost) if toSend.Cmp(big.NewInt(0)) <= 0 { log.Warn(). Str("Address", fromAddress.String()). - Str("Estimated total cost", totalGasCost.String()). + Str("Estimated maximum total gas cost", maxTotalGasCost.String()). Str("Balance", balance.String()). Str("To send", toSend.String()). Msg("Not enough balance to cover gas cost. Skipping return.") diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index b2fd308fd9d..9baaefe64bf 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -311,7 +311,10 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { if b.hasSeth { readSethCfg := b.testConfig.GetSethConfig() - sethCfg := utils.MergeSethAndEvmNetworkConfigs(b.l, networkConfig, *readSethCfg) + sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(networkConfig, *readSethCfg) + if err != nil { + return nil, err + } err = utils.ValidateSethNetworkConfig(sethCfg.Network) if err != nil { return nil, err diff --git a/integration-tests/experiments/gas_test.go b/integration-tests/experiments/gas_test.go deleted file mode 100644 index 3f90d7b661d..00000000000 --- a/integration-tests/experiments/gas_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package experiments - -import ( - "testing" - "time" - - "github.com/smartcontractkit/seth" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-testing-framework/networks" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" - tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - "github.com/smartcontractkit/chainlink/integration-tests/utils" -) - -func TestGasExperiment(t *testing.T) { - config, err := tc.GetConfig("Soak", tc.OCR) - require.NoError(t, err, "Error getting config") - - network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] - readSethCfg := config.GetSethConfig() - require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") - - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) - require.NoError(t, err, "Error merging seth and evm network configs") - err = utils.ValidateSethNetworkConfig(sethCfg.Network) - require.NoError(t, err, "Error validating seth network config") - - seth, err := seth.NewClientWithConfig(&sethCfg) - require.NoError(t, err, "Error creating seth client") - - for i := 0; i < 1; i++ { - _, err = contracts.DeployLinkTokenContract(seth) - require.NoError(t, err, "Error deploying LINK contract") - time.Sleep(2 * time.Second) - } -} - -// 0.000000128551002561 -// 0.000000134350145939 diff --git a/integration-tests/soak/ocr_soak_report.csv b/integration-tests/soak/ocr_soak_report.csv deleted file mode 100644 index ff06cfde685..00000000000 --- a/integration-tests/soak/ocr_soak_report.csv +++ /dev/null @@ -1,5 +0,0 @@ -OCRv1 Soak Test Report -Namespace,soak-ocr-v1-polygon-amoy-11bb8,Started At,2024-03-21 12:47:26.92 CET,Test Duration,2m4.945516583s - -Timeline -Time,Message