From bf39ba41c2cbdc63986330591a03d2841d68f019 Mon Sep 17 00:00:00 2001 From: Dylan Tinianov Date: Mon, 6 Jan 2025 15:05:42 -0500 Subject: [PATCH] Add QueryTimeout to client --- common/client/timeout.go | 5 +++ core/chains/evm/client/evm_client.go | 5 +-- core/chains/evm/client/helpers_test.go | 5 +-- core/chains/evm/client/rpc_client_test.go | 33 ++++++++++--------- core/chains/evm/gas/fee_history_estimator.go | 7 ++-- .../evm/gas/rollups/arbitrum_l1_oracle.go | 7 ++-- .../gas/rollups/custom_calldata_da_oracle.go | 5 ++- core/chains/evm/gas/rollups/op_l1_oracle.go | 5 ++- .../evm/gas/rollups/zkSync_l1_oracle.go | 5 ++- .../evm/gas/suggested_price_estimator.go | 5 ++- 10 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 common/client/timeout.go diff --git a/common/client/timeout.go b/common/client/timeout.go new file mode 100644 index 00000000000..0827b812962 --- /dev/null +++ b/common/client/timeout.go @@ -0,0 +1,5 @@ +package client + +import "time" + +const QueryTimeout = 10 * time.Second diff --git a/core/chains/evm/client/evm_client.go b/core/chains/evm/client/evm_client.go index 9d7ec4cf0e0..bf985bdfa28 100644 --- a/core/chains/evm/client/evm_client.go +++ b/core/chains/evm/client/evm_client.go @@ -8,6 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-framework/multinode" + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" @@ -41,8 +42,8 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg multinode.ChainConfig, client func getRPCTimeouts(chainType chaintype.ChainType) (largePayload, defaultTimeout time.Duration) { if chaintype.ChainHedera == chainType { - return 30 * time.Second, multinode.QueryTimeout + return 30 * time.Second, commonclient.QueryTimeout } - return multinode.QueryTimeout, multinode.QueryTimeout + return commonclient.QueryTimeout, commonclient.QueryTimeout } diff --git a/core/chains/evm/client/helpers_test.go b/core/chains/evm/client/helpers_test.go index 9fb8f08f862..dee78ff4b98 100644 --- a/core/chains/evm/client/helpers_test.go +++ b/core/chains/evm/client/helpers_test.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-framework/multinode" "github.com/smartcontractkit/chainlink-framework/multinode/mocks" + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -150,7 +151,7 @@ func NewChainClientWithTestNode( nodePoolCfg := TestNodePoolConfig{ NodeFinalizedBlockPollInterval: 1 * time.Second, } - rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := NewRPCClient(nodePoolCfg, lggr, parsed, rpcHTTPURL, "eth-primary-rpc-0", id, chainID, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") n := multinode.NewNode[*big.Int, *evmtypes.Head, *RPCClient]( nodeCfg, mocks.ChainConfig{NoNewHeadsThresholdVal: noNewHeadsThreshold}, lggr, parsed, rpcHTTPURL, "eth-primary-node-0", id, chainID, 1, rpc, "EVM") @@ -161,7 +162,7 @@ func NewChainClientWithTestNode( if u.Scheme != "http" && u.Scheme != "https" { return nil, pkgerrors.Errorf("sendonly ethereum rpc url scheme must be http(s): %s", u.String()) } - rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, multinode.Secondary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := NewRPCClient(nodePoolCfg, lggr, nil, &sendonlyRPCURLs[i], fmt.Sprintf("eth-sendonly-rpc-%d", i), id, chainID, multinode.Secondary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") s := multinode.NewSendOnlyNode[*big.Int, *RPCClient]( lggr, u, fmt.Sprintf("eth-sendonly-%d", i), chainID, rpc) sendonlys[i] = s diff --git a/core/chains/evm/client/rpc_client_test.go b/core/chains/evm/client/rpc_client_test.go index c2a916be847..f33ac9f9f8e 100644 --- a/core/chains/evm/client/rpc_client_test.go +++ b/core/chains/evm/client/rpc_client_test.go @@ -24,6 +24,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-framework/multinode" + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils" @@ -87,7 +88,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("WS and HTTP URL cannot be both empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfgHeadPolling, observedLggr, nil, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.Equal(t, errors.New("cannot dial rpc client when both ws and http info are missing"), rpcClient.Dial(ctx)) }) @@ -95,7 +96,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) // set to default values @@ -144,7 +145,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -187,7 +188,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) latest, highestUserObservations := rpc.GetInterceptedChainInfo() @@ -226,7 +227,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) var wg sync.WaitGroup @@ -249,7 +250,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Block's chain ID matched configured", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) ch, sub, err := rpc.SubscribeToHeads(tests.Context(t)) @@ -265,7 +266,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, _, err := rpc.SubscribeToHeads(ctx) @@ -275,7 +276,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Closed rpc client should remove existing SubscribeToHeads subscription with WS", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -287,7 +288,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -299,7 +300,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgHeadPolling, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) @@ -310,7 +311,7 @@ func TestRPCClient_SubscribeToHeads(t *testing.T) { t.Run("Subscription error is properly wrapper", func(t *testing.T) { server := testutils.NewWSServer(t, chainId, serverCallBack) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfgWSSub, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) _, sub, err := rpc.SubscribeToHeads(ctx) @@ -340,7 +341,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { t.Run("Failed SubscribeFilterLogs when WSURL is empty", func(t *testing.T) { // ws is optional when LogBroadcaster is disabled, however SubscribeFilterLogs will return error if ws is missing observedLggr := logger.Test(t) - rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpcClient := client.NewRPCClient(nodePoolCfg, observedLggr, nil, &url.URL{}, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.Nil(t, rpcClient.Dial(ctx)) _, err := rpcClient.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -352,7 +353,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { }) wsURL := server.WSURL() observedLggr, observed := logger.TestObserved(t, zap.DebugLevel) - rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, observedLggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) server.Close() _, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -369,7 +370,7 @@ func TestRPCClient_SubscribeFilterLogs(t *testing.T) { return resp }) wsURL := server.WSURL() - rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") defer rpc.Close() require.NoError(t, rpc.Dial(ctx)) sub, err := rpc.SubscribeFilterLogs(ctx, ethereum.FilterQuery{}, make(chan types.Log)) @@ -423,7 +424,7 @@ func TestRPCClient_LatestFinalizedBlock(t *testing.T) { } server := createRPCServer() - rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, "") + rpc := client.NewRPCClient(nodePoolCfg, lggr, server.URL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, "") require.NoError(t, rpc.Dial(ctx)) defer rpc.Close() server.Head.Store(&evmtypes.Head{Number: 128}) @@ -615,7 +616,7 @@ func TestAstarCustomFinality(t *testing.T) { const expectedFinalizedBlockNumber = int64(4) const expectedFinalizedBlockHash = "0x7441e97acf83f555e0deefef86db636bc8a37eb84747603412884e4df4d22804" - rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, multinode.Primary, multinode.QueryTimeout, multinode.QueryTimeout, chaintype.ChainAstar) + rpcClient := client.NewRPCClient(nodePoolCfg, logger.Test(t), wsURL, nil, "rpc", 1, chainId, multinode.Primary, commonclient.QueryTimeout, commonclient.QueryTimeout, chaintype.ChainAstar) defer rpcClient.Close() err := rpcClient.Dial(tests.Context(t)) require.NoError(t, err) diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go index b5b8e316b1a..906e0356323 100644 --- a/core/chains/evm/gas/fee_history_estimator.go +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -15,8 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -177,7 +176,7 @@ func (f *FeeHistoryEstimator) GetLegacyGas(ctx context.Context, _ []byte, gasLim // RefreshGasPrice will use eth_gasPrice to fetch and cache the latest gas price from the RPC. func (f *FeeHistoryEstimator) RefreshGasPrice() (*assets.Wei, error) { - ctx, cancel := f.stopCh.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := f.stopCh.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() gasPrice, err := f.client.SuggestGasPrice(ctx) @@ -231,7 +230,7 @@ func (f *FeeHistoryEstimator) GetDynamicFee(ctx context.Context, maxPrice *asset // the highest percentile we're willing to pay. A buffer is added on top of the latest baseFee to catch fluctuations in the next // blocks. On Ethereum the increase is baseFee * 1.125 per block, however in some chains that may vary. func (f *FeeHistoryEstimator) RefreshDynamicPrice() error { - ctx, cancel := f.stopCh.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := f.stopCh.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() // RewardPercentile will be used for maxPriorityFeePerGas estimations and connectivityPercentile to set the highest threshold for bumping. diff --git a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go index f2d78f361c0..3180f13e56f 100644 --- a/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go +++ b/core/chains/evm/gas/rollups/arbitrum_l1_oracle.go @@ -15,8 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -155,7 +154,7 @@ func (o *arbitrumL1Oracle) refresh() { } func (o *arbitrumL1Oracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() price, err := o.fetchL1GasPrice(ctx) @@ -221,7 +220,7 @@ func (o *arbitrumL1Oracle) GasPrice(_ context.Context) (l1GasPrice *assets.Wei, // https://github.com/OffchainLabs/nitro/blob/f7645453cfc77bf3e3644ea1ac031eff629df325/contracts/src/precompiles/ArbGasInfo.sol#L69 func (o *arbitrumL1Oracle) GetPricesInArbGas() (perL2Tx uint32, perL1CalldataUnit uint32, err error) { - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() precompile := common.HexToAddress(ArbGasInfoAddress) b, err := o.client.CallContract(ctx, ethereum.CallMsg{ diff --git a/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go b/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go index a556bd32489..943873ea092 100644 --- a/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go +++ b/core/chains/evm/gas/rollups/custom_calldata_da_oracle.go @@ -15,8 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -125,7 +124,7 @@ func (o *customCalldataDAOracle) refresh() { } func (o *customCalldataDAOracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() price, err := o.getCustomCalldataGasPrice(ctx) diff --git a/core/chains/evm/gas/rollups/op_l1_oracle.go b/core/chains/evm/gas/rollups/op_l1_oracle.go index 39e7d9ea9c8..511c58ca13a 100644 --- a/core/chains/evm/gas/rollups/op_l1_oracle.go +++ b/core/chains/evm/gas/rollups/op_l1_oracle.go @@ -17,8 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/chaintype" @@ -233,7 +232,7 @@ func (o *optimismL1Oracle) refresh() { } func (o *optimismL1Oracle) refreshWithError() error { - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() price, err := o.GetDAGasPrice(ctx) diff --git a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go index 98ea2ec9f25..e2bee05a02f 100644 --- a/core/chains/evm/gas/rollups/zkSync_l1_oracle.go +++ b/core/chains/evm/gas/rollups/zkSync_l1_oracle.go @@ -14,8 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -124,7 +123,7 @@ func (o *zkSyncL1Oracle) refresh() (t *time.Timer) { func (o *zkSyncL1Oracle) refreshWithError() (t *time.Timer, err error) { t = time.NewTimer(utils.WithJitter(o.pollPeriod)) - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() price, err := o.CalculateL1GasPrice(ctx) diff --git a/core/chains/evm/gas/suggested_price_estimator.go b/core/chains/evm/gas/suggested_price_estimator.go index d63a69c4976..5a3efbfa55b 100644 --- a/core/chains/evm/gas/suggested_price_estimator.go +++ b/core/chains/evm/gas/suggested_price_estimator.go @@ -13,8 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink-framework/multinode" - + commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -124,7 +123,7 @@ func (o *SuggestedPriceEstimator) run() { func (o *SuggestedPriceEstimator) refreshPrice() { var res hexutil.Big - ctx, cancel := o.chStop.CtxWithTimeout(multinode.QueryTimeout) + ctx, cancel := o.chStop.CtxWithTimeout(commonclient.QueryTimeout) defer cancel() if err := o.client.CallContext(ctx, &res, "eth_gasPrice"); err != nil {