Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-791] Migrate OCRv1/v2 tests from EVMClient to Seth #12076

Merged
merged 24 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e901161
use simple bash script to set BASE64 env var
Tofel Feb 13, 2024
10297e6
Merge branch 'tt_878_easier_soak_load_test_run' into tt_791_seth_ocr_…
Tofel Feb 14, 2024
bc27459
added some OCR actions that use Seth, refactored others to use it if …
Tofel Feb 16, 2024
e5ccdbd
move ocr2 smoke tests to seth
Tofel Feb 23, 2024
63f62c5
don't panic, when network is not known to Seth, use defaults instead
Tofel Feb 23, 2024
d486f33
restore some old ocr helper functions
Tofel Feb 23, 2024
e19eb7f
add chain-of-responsibility-based fund returning function
Tofel Feb 23, 2024
85787f0
Merge branch 'develop' into tt_791_seth_ocr_tests
Tofel Feb 26, 2024
707d948
fix some bugs, add Deprecated comments to deprecated functions, add l…
Tofel Feb 26, 2024
da62d82
small streamlines
Tofel Feb 26, 2024
605a4f0
fix lints
Tofel Feb 26, 2024
a07a805
go mod tidy, use latest Seth
Tofel Feb 26, 2024
cb8540c
more go.mod
Tofel Feb 26, 2024
909fc5b
lints + more go.mods
Tofel Feb 26, 2024
dc3c626
use EVMClient by default when building docker test env
Tofel Feb 26, 2024
43d3b52
ignore code duplication in files that will be deleted when we finish …
Tofel Feb 26, 2024
13671b5
fixed forwarder soak test
Tofel Feb 26, 2024
7ec024d
change flow so that OCRv2 soak tests can run with forwarders
Tofel Feb 26, 2024
a47d56e
Merge branch 'develop' into tt_791_seth_ocr_tests
Tofel Feb 27, 2024
c300f44
code review changes
Tofel Feb 27, 2024
b3d99cf
merge 2 interfaces + move OCRv1 smoke tests to Seth
Tofel Feb 27, 2024
991d4fb
add method for funding CL nodes from root private key
Tofel Feb 27, 2024
7002b7e
Merge branch 'develop' into tt_791_seth_ocr_tests
Tofel Feb 28, 2024
cff5d09
Merge branch 'develop' into tt_791_seth_ocr_tests
Tofel Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't panic, when network is not known to Seth, use defaults instead
  • Loading branch information
Tofel committed Feb 23, 2024
commit 63f62c5a55b931f2f4054d255b1ce4b6ae3f41c1
2 changes: 1 addition & 1 deletion integration-tests/chaos/ocr_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestOCRChaos(t *testing.T) {
panic("no network settings for Simulated Geth")
}
network.URLs = testEnvironment.URLs["Simulated Geth"]
utils.MustDecorateSethConfigWithNetwork(&network, sethCfg)
utils.MustDecorateSethConfigWithNetwork(l, &network, sethCfg)
seth, err := seth.NewClientWithConfig(sethCfg)
require.NoError(t, err, "Error creating seth client")

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/docker/test_env/test_env_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) {

if b.hasSeth {
sethCfg := b.testConfig.GetSethConfig()
utils.MustDecorateSethConfigWithNetwork(&networkConfig, sethCfg)
utils.MustDecorateSethConfigWithNetwork(b.l, &networkConfig, sethCfg)
seth, err := seth.NewClientWithConfig(sethCfg)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/ocr/ocr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestOCRLoad(t *testing.T) {

sethCfg := config.GetSethConfig()
require.NotNil(t, sethCfg, "Seth config shouldn't be nil")
utils.MustDecorateSethConfigWithNetwork(evmNetwork, sethCfg)
utils.MustDecorateSethConfigWithNetwork(l, evmNetwork, sethCfg)

seth, err := seth.NewClientWithConfig(sethCfg)
require.NoError(t, err, "Error creating seth client")
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestOCRVolume(t *testing.T) {

sethCfg := config.GetSethConfig()
require.NotNil(t, sethCfg, "Seth config shouldn't be nil")
utils.MustDecorateSethConfigWithNetwork(evmNetwork, sethCfg)
utils.MustDecorateSethConfigWithNetwork(l, evmNetwork, sethCfg)

seth, err := seth.NewClientWithConfig(sethCfg)
require.NoError(t, err, "Error creating seth client")
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/testsetups/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) {
sethCfg := ocrTestConfig.GetSethConfig()
require.NotNil(o.t, sethCfg, "Seth config shouldn't be nil")

utils.MustDecorateSethConfigWithNetwork(&network, sethCfg)
utils.MustDecorateSethConfigWithNetwork(o.log, &network, sethCfg)

seth, err := seth.NewClientWithConfig(sethCfg)
require.NoError(o.t, err, "Error creating seth client")
Expand Down
20 changes: 18 additions & 2 deletions integration-tests/utils/seth_network_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"fmt"

"github.com/rs/zerolog"
"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/seth"
)
Expand All @@ -11,7 +12,7 @@ import (
// already has Network settings, it will return without doing anything. If the network is simulated, it will
// use Geth-specific settings. Otherwise it will use the chain ID to find the correct network settings.
// If no match is found it will return an error.
func MustDecorateSethConfigWithNetwork(evmNetwork *blockchain.EVMNetwork, sethConfig *seth.Config) error {
func MustDecorateSethConfigWithNetwork(l zerolog.Logger, evmNetwork *blockchain.EVMNetwork, sethConfig *seth.Config) error {
if evmNetwork == nil {
panic("evmNetwork must not be nil")
}
Expand Down Expand Up @@ -47,7 +48,22 @@ func MustDecorateSethConfigWithNetwork(evmNetwork *blockchain.EVMNetwork, sethCo
}

if sethNetwork == nil {
return fmt.Errorf("Could not find any Seth network settings for chain ID %d", evmNetwork.ChainID)
//TODO in the future we could run gas estimator here
l.Warn().
Int64("chainID", evmNetwork.ChainID).
Msg("Could not find any Seth network settings for chain ID. Using default network settings")
sethNetwork = &seth.Network{}
sethNetwork.PrivateKeys = evmNetwork.PrivateKeys
sethNetwork.URLs = evmNetwork.URLs
sethNetwork.EIP1559DynamicFees = evmNetwork.SupportsEIP1559
sethNetwork.ChainID = fmt.Sprint(evmNetwork.ChainID)
// Sepolia settings
sethNetwork.GasLimit = 14_000_000
sethNetwork.GasPrice = 1_000_000_000
sethNetwork.GasFeeCap = 25_000_000_000
sethNetwork.GasTipCap = 5_000_000_000
sethNetwork.TransferGasFee = 21_000
sethNetwork.TxnTimeout = seth.MustMakeDuration(evmNetwork.Timeout.Duration)
}

sethConfig.Network = sethNetwork
Expand Down