Skip to content

Commit

Permalink
Add QueryTimeout to client
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov committed Jan 6, 2025
1 parent fbdbcb7 commit bf39ba4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 40 deletions.
5 changes: 5 additions & 0 deletions common/client/timeout.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package client

import "time"

const QueryTimeout = 10 * time.Second
5 changes: 3 additions & 2 deletions core/chains/evm/client/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
5 changes: 3 additions & 2 deletions core/chains/evm/client/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand Down
33 changes: 17 additions & 16 deletions core/chains/evm/client/rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -87,15 +88,15 @@ 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))
})

t.Run("Updates chain info on new blocks", 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))
// set to default values
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand All @@ -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)
Expand All @@ -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))

Expand All @@ -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))

Expand All @@ -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))

Expand All @@ -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)
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions core/chains/evm/gas/fee_history_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions core/chains/evm/gas/rollups/arbitrum_l1_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down
5 changes: 2 additions & 3 deletions core/chains/evm/gas/rollups/custom_calldata_da_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions core/chains/evm/gas/rollups/op_l1_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions core/chains/evm/gas/rollups/zkSync_l1_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions core/chains/evm/gas/suggested_price_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bf39ba4

Please sign in to comment.