Skip to content

Commit

Permalink
use latest Seth (#12784)
Browse files Browse the repository at this point in the history
* use latest Seth

* use latest Seth

* update field names

* update field names

* adjust gitignore

* gomodtidy
  • Loading branch information
Tofel authored Apr 17, 2024
1 parent 6a0b4a9 commit f50f2dd
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ override*.toml

# Pythin venv
.venv/

ocr_soak_report.csv
4 changes: 1 addition & 3 deletions integration-tests/actions/seth/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ func SendFunds(logger zerolog.Logger, client *seth.Client, payload FundsToSendPa
if payload.GasTipCap != nil {
gasTipCap = payload.GasTipCap
}
}

if !client.Cfg.Network.EIP1559DynamicFees {
} else {
if payload.GasPrice == nil {
txOptions := client.NewTXOpts((seth.WithGasLimit(gasLimit)))
gasPrice = txOptions.GasPrice
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/actions/seth/refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func ReturnFunds(log zerolog.Logger, sethClient *seth.Client, chainlinkNodes []c
}

// 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
txPriority := sethClient.Cfg.Network.GasPriceEstimationTxPriority
txTimeout := sethClient.Cfg.Network.TxnTimeout.Duration()

if sethClient.Cfg.IsExperimentEnabled(seth.Experiment_SlowFundsReturn) {
Expand All @@ -291,7 +291,7 @@ func ReturnFunds(log zerolog.Logger, sethClient *seth.Client, chainlinkNodes []c
}

estimations := sethClient.CalculateGasEstimations(seth.GasEstimationRequest{
GasEstimationEnabled: sethClient.Cfg.Network.GasEstimationEnabled,
GasEstimationEnabled: sethClient.Cfg.Network.GasPriceEstimationEnabled,
FallbackGasPrice: sethClient.Cfg.Network.GasPrice,
FallbackGasFeeCap: sethClient.Cfg.Network.GasFeeCap,
FallbackGasTipCap: sethClient.Cfg.Network.GasTipCap,
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/experiments/gas_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package experiments

import (
"math/big"
"testing"
"time"

Expand All @@ -9,6 +10,7 @@ import (

"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/networks"
actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth"
"github.com/smartcontractkit/chainlink/integration-tests/contracts"
tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig"
"github.com/smartcontractkit/chainlink/integration-tests/utils"
Expand All @@ -31,6 +33,13 @@ func TestGasExperiment(t *testing.T) {
seth, err := seth.NewClientWithConfig(&sethCfg)
require.NoError(t, err, "Error creating seth client")

_, err = actions_seth.SendFunds(l, seth, actions_seth.FundsToSendPayload{
ToAddress: seth.Addresses[0],
Amount: big.NewInt(10_000_000),
PrivateKey: seth.PrivateKeys[0],
})
require.NoError(t, err, "Error sending funds")

for i := 0; i < 1; i++ {
_, err = contracts.DeployLinkTokenContract(l, seth)
require.NoError(t, err, "Error deploying LINK contract")
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052
github.com/smartcontractkit/seth v0.1.3
github.com/smartcontractkit/seth v0.1.5
github.com/smartcontractkit/wasp v0.4.5
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1543,8 +1543,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJ
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0=
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052 h1:1WFjrrVrWoQ9UpVMh7Mx4jDpzhmo1h8hFUKd9awIhIU=
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052/go.mod h1:SJEZCHgMCAzzBvo9vMV2DQ9onfEcIJCYSViyP4JI6c4=
github.com/smartcontractkit/seth v0.1.3 h1:pQc+SJeONWg73lQOiY5ZmBbvvVqEVBmTM9PiJOr+n4s=
github.com/smartcontractkit/seth v0.1.3/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero=
github.com/smartcontractkit/seth v0.1.5 h1:tobdA3uzRHubN/ytE6bSq1dtvmaXjKdaHEGW5Re9I1U=
github.com/smartcontractkit/seth v0.1.5/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero=
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE=
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg=
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c
github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052
github.com/smartcontractkit/seth v0.1.3
github.com/smartcontractkit/seth v0.1.5
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1
github.com/smartcontractkit/wasp v0.4.6
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJ
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0=
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052 h1:1WFjrrVrWoQ9UpVMh7Mx4jDpzhmo1h8hFUKd9awIhIU=
github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052/go.mod h1:SJEZCHgMCAzzBvo9vMV2DQ9onfEcIJCYSViyP4JI6c4=
github.com/smartcontractkit/seth v0.1.3 h1:pQc+SJeONWg73lQOiY5ZmBbvvVqEVBmTM9PiJOr+n4s=
github.com/smartcontractkit/seth v0.1.3/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero=
github.com/smartcontractkit/seth v0.1.5 h1:tobdA3uzRHubN/ytE6bSq1dtvmaXjKdaHEGW5Re9I1U=
github.com/smartcontractkit/seth v0.1.5/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero=
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE=
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg=
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ=
Expand Down
34 changes: 17 additions & 17 deletions integration-tests/testconfig/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ transfer_gas_fee = 21_000
# gas limit should be explicitly set only if you are connecting to a node that's incapable of estimating gas limit itself (should only happen for very old versions)
# gas_limit = 8_000_000

# manual settings, used when gas_estimation_enabled is false or when it fails
# manual settings, used when gas_price_estimation_enabled is false or when it fails
# legacy transactions
gas_price = 1_000_000_000

Expand All @@ -77,11 +77,11 @@ eip_1559_dynamic_fees = true

# automated gas estimation for live networks
# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks)
# gas_estimation_enabled = true
# gas_price_estimation_enabled = true
# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values)
# gas_estimation_blocks = 100
# gas_price_estimation_blocks = 100
# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x)
# gas_estimation_tx_priority = "standard"
# gas_price_estimation_tx_priority = "standard"

# URLs
# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S)
Expand All @@ -94,7 +94,7 @@ eip_1559_dynamic_fees = true
# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid
transfer_gas_fee = 21_000

# manual settings, used when gas_estimation_enabled is false or when it fails
# manual settings, used when gas_price_estimation_enabled is false or when it fails
# legacy transactions
gas_price = 30_000_000_000

Expand All @@ -110,11 +110,11 @@ eip_1559_dynamic_fees = false

# automated gas estimation for live networks
# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks)
# gas_estimation_enabled = true
# gas_price_estimation_enabled = true
# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values)
# gas_estimation_blocks = 100
# gas_price_estimation_blocks = 100
# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x)
# gas_estimation_tx_priority = "standard"
# gas_price_estimation_tx_priority = "standard"

# URLs
# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S)
Expand All @@ -127,7 +127,7 @@ eip_1559_dynamic_fees = false
# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid
transfer_gas_fee = 21_000

# manual settings, used when gas_estimation_enabled is false or when it fails
# manual settings, used when gas_price_estimation_enabled is false or when it fails
# legacy transactions
gas_price = 50_000_000_000

Expand All @@ -143,11 +143,11 @@ eip_1559_dynamic_fees = true

# automated gas estimation for live networks
# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks)
# gas_estimation_enabled = true
# gas_price_estimation_enabled = true
# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values)
# gas_estimation_blocks = 100
# gas_price_estimation_blocks = 100
# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x)
# gas_estimation_tx_priority = "standard"
# gas_price_estimation_tx_priority = "standard"

# URLs
# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S)
Expand All @@ -160,7 +160,7 @@ eip_1559_dynamic_fees = true
# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid
transfer_gas_fee = 21_000

# manual settings, used when gas_estimation_enabled is false or when it fails
# manual settings, used when gas_price_estimation_enabled is false or when it fails
# legacy transactions
gas_price = 1_800_000_000

Expand All @@ -176,11 +176,11 @@ eip_1559_dynamic_fees = false

# automated gas estimation for live networks
# if set to true we will dynamically estimate gas for every transaction (based on suggested values, priority and congestion rate for last X blocks)
# gas_estimation_enabled = true
# gas_price_estimation_enabled = true
# number of blocks to use for congestion rate estimation (it will determine buffer added on top of suggested values)
# gas_estimation_blocks = 100
# gas_price_estimation_blocks = 100
# transaction priority, which determines adjustment factor multiplier applied to suggested values (fast - 1.2x, standard - 1x, slow - 0.8x)
# gas_estimation_tx_priority = "standard"
# gas_price_estimation_tx_priority = "standard"

# URLs
# if set they will overwrite URLs from EVMNetwork that Seth uses, can be either WS(S) or HTTP(S)
Expand All @@ -193,7 +193,7 @@ eip_1559_dynamic_fees = false
# we use hardcoded value in order to be estimate how much funds are available for sending or returning after tx costs have been paid
transfer_gas_fee = 21_000

# manual settings, used when gas_estimation_enabled is false or when it fails
# manual settings, used when gas_price_estimation_enabled is false or when it fails
# legacy transactions
gas_price = 50_000_000

Expand Down

0 comments on commit f50f2dd

Please sign in to comment.