diff --git a/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go index 788b93e8361..00498ecb66a 100644 --- a/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go +++ b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go @@ -394,7 +394,6 @@ func TestCCIPReader_Nonces(t *testing.T) { s.sb.Commit() for sourceChain, addrs := range nonces { - var addrQuery []string for addr := range addrs { addrQuery = append(addrQuery, addr.String()) diff --git a/core/capabilities/targets/write_target.go b/core/capabilities/targets/write_target.go index 83c39e34578..c77dc06199e 100644 --- a/core/capabilities/targets/write_target.go +++ b/core/capabilities/targets/write_target.go @@ -274,12 +274,11 @@ func (cap *WriteTarget) Execute(ctx context.Context, rawRequest capabilities.Cap value := big.NewInt(0) if err := cap.cw.SubmitTransaction(ctx, "forwarder", "report", req, txID.String(), cap.forwarderAddress, &meta, value); err != nil { - if commontypes.ErrSettingTransactionGasLimitNotSupported.Is(err) { - meta.GasLimit = nil - if err := cap.cw.SubmitTransaction(ctx, "forwarder", "report", req, txID.String(), cap.forwarderAddress, &meta, value); err != nil { - return capabilities.CapabilityResponse{}, fmt.Errorf("failed to submit transaction: %w", err) - } - } else { + if !commontypes.ErrSettingTransactionGasLimitNotSupported.Is(err) { + return capabilities.CapabilityResponse{}, fmt.Errorf("failed to submit transaction: %w", err) + } + meta.GasLimit = nil + if err := cap.cw.SubmitTransaction(ctx, "forwarder", "report", req, txID.String(), cap.forwarderAddress, &meta, value); err != nil { return capabilities.CapabilityResponse{}, fmt.Errorf("failed to submit transaction: %w", err) } } diff --git a/core/chains/evm/gas/fee_history_estimator.go b/core/chains/evm/gas/fee_history_estimator.go index ba3192be100..53af03ac7a8 100644 --- a/core/chains/evm/gas/fee_history_estimator.go +++ b/core/chains/evm/gas/fee_history_estimator.go @@ -252,7 +252,7 @@ func (f *FeeHistoryEstimator) RefreshDynamicPrice() error { maxPriorityFeePerGas := assets.NewWeiI(0) priorityFeeThresholdWei := assets.NewWeiI(0) if f.config.BlockHistorySize > 0 { - var nonZeroRewardsLen int64 = 0 + var nonZeroRewardsLen int64 priorityFee := big.NewInt(0) priorityFeeThreshold := big.NewInt(0) for _, reward := range feeHistory.Reward { @@ -263,7 +263,7 @@ func (f *FeeHistoryEstimator) RefreshDynamicPrice() error { // We'll calculate the average of non-zero priority fees if reward[0].Cmp(big.NewInt(0)) > 0 { priorityFee = priorityFee.Add(priorityFee, reward[0]) - nonZeroRewardsLen += 1 + nonZeroRewardsLen++ } // We take the max value for the bumping threshold if reward[1].Cmp(big.NewInt(0)) > 0 { diff --git a/core/services/llo/evm/report_codec_premium_legacy_test.go b/core/services/llo/evm/report_codec_premium_legacy_test.go index 2b864af5550..dab2a8cf3fd 100644 --- a/core/services/llo/evm/report_codec_premium_legacy_test.go +++ b/core/services/llo/evm/report_codec_premium_legacy_test.go @@ -18,8 +18,6 @@ import ( "github.com/smartcontractkit/chainlink-data-streams/llo" ) -const ethMainnetChainSelector uint64 = 5009297550715157269 - func newValidPremiumLegacyReport() llo.Report { return llo.Report{ ConfigDigest: types.ConfigDigest{1, 2, 3}, diff --git a/core/services/ocr2/plugins/llo/helpers_test.go b/core/services/ocr2/plugins/llo/helpers_test.go index 4097294ba0e..b3a0294fef4 100644 --- a/core/services/ocr2/plugins/llo/helpers_test.go +++ b/core/services/ocr2/plugins/llo/helpers_test.go @@ -330,49 +330,6 @@ transmitterID = "%x" )) } -func addOCRJobs( - t *testing.T, - streams []Stream, - serverPubKey ed25519.PublicKey, - serverURL string, - configuratorAddress common.Address, - bootstrapPeerID string, - bootstrapNodePort int, - nodes []Node, - configStoreAddress common.Address, - clientPubKeys []ed25519.PublicKey, - pluginConfig, - relayType, - relayConfig string) (streamJobIDs []int32) { - - // Add OCR jobs - one per feed on each node - for i, node := range nodes { - for j, strm := range streams { - bmBridge := createBridge(t, fmt.Sprintf("benchmarkprice-%d-%d", strm.id, j), i, strm.baseBenchmarkPrice, node.App.BridgeORM()) - jobID := addSingleDecimalStreamJob( - t, - node, - strm.id, - bmBridge, - ) - streamJobIDs = append(streamJobIDs, jobID) - } - addLLOJob( - t, - node, - configuratorAddress, - bootstrapPeerID, - bootstrapNodePort, - clientPubKeys[i], - "feed-1", - pluginConfig, - relayType, - relayConfig, - ) - } - return streamJobIDs -} - func createBridge(t *testing.T, name string, i int, p decimal.Decimal, borm bridges.ORM) (bridgeName string) { ctx := testutils.Context(t) bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { @@ -397,22 +354,6 @@ func createBridge(t *testing.T, name string, i int, p decimal.Decimal, borm brid return bridgeName } -func createErroringBridge(t *testing.T, name string, i int, borm bridges.ORM) (bridgeName string) { - ctx := testutils.Context(t) - bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - res.WriteHeader(http.StatusInternalServerError) - })) - t.Cleanup(bridge.Close) - u, _ := url.Parse(bridge.URL) - bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) - require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ - Name: bridges.BridgeName(bridgeName), - URL: models.WebURL(*u), - })) - - return bridgeName -} - func addOCRJobsEVMPremiumLegacy( t *testing.T, streams []Stream, diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index f5c2869442a..50d580fe258 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -88,14 +88,11 @@ type Stream struct { baseBenchmarkPrice decimal.Decimal baseBid decimal.Decimal baseAsk decimal.Decimal - strmType string } const ( - btcStreamID = 51 ethStreamID = 52 linkStreamID = 53 - dogeStreamID = 54 quoteStreamID1 = 55 quoteStreamID2 = 56 ) @@ -103,12 +100,7 @@ const ( var ( quoteStreamFeedID1 = common.HexToHash(`0x0003111111111111111111111111111111111111111111111111111111111111`) quoteStreamFeedID2 = common.HexToHash(`0x0003222222222222222222222222222222222222222222222222222222222222`) - - btcStream = Stream{ - id: 51, - baseBenchmarkPrice: decimal.NewFromFloat32(56_114.41), - } - ethStream = Stream{ + ethStream = Stream{ id: 52, baseBenchmarkPrice: decimal.NewFromFloat32(2_976.39), } @@ -116,10 +108,6 @@ var ( id: 53, baseBenchmarkPrice: decimal.NewFromFloat32(13.25), } - dogeStream = Stream{ - id: 54, - baseBenchmarkPrice: decimal.NewFromFloat32(0.10960935), - } quoteStream1 = Stream{ id: 55, baseBenchmarkPrice: decimal.NewFromFloat32(1000.1212), @@ -146,8 +134,6 @@ func generateConfig(t *testing.T, oracles []confighelper.OracleIdentityExtra) ( reportingPluginConfig, err := rawReportingPluginConfig.Encode() require.NoError(t, err) - offchainConfig = []byte{} - signers, transmitters, f, onchainConfig, offchainConfigVersion, offchainConfig, err = ocr3confighelper.ContractSetConfigArgsForTests( 2*time.Second, // DeltaProgress 20*time.Second, // DeltaResend diff --git a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go index 6067887681c..ec918e2375d 100644 --- a/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go +++ b/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go @@ -2,7 +2,6 @@ package llo_test import ( "bytes" - "context" "encoding/json" "errors" "fmt" @@ -13,7 +12,6 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/stretchr/testify/assert" @@ -368,17 +366,3 @@ func Test_ChannelDefinitionCache_Integration(t *testing.T) { assert.Equal(t, uint32(5), pd.Version) }) } - -type mockLogPoller struct { - logpoller.LogPoller - LatestBlockFn func(ctx context.Context) (int64, error) - LogsWithSigsFn func(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) -} - -func (p *mockLogPoller) LogsWithSigs(ctx context.Context, start, end int64, eventSigs []common.Hash, address common.Address) ([]logpoller.Log, error) { - return p.LogsWithSigsFn(ctx, start, end, eventSigs, address) -} -func (p *mockLogPoller) LatestBlock(ctx context.Context) (logpoller.LogPollerBlock, error) { - block, err := p.LatestBlockFn(ctx) - return logpoller.LogPollerBlock{BlockNumber: block}, err -} diff --git a/core/services/relay/evm/write_target.go b/core/services/relay/evm/write_target.go index 8c71030f8a7..03b1130f8ed 100644 --- a/core/services/relay/evm/write_target.go +++ b/core/services/relay/evm/write_target.go @@ -6,9 +6,9 @@ import ( "fmt" chainselectors "github.com/smartcontractkit/chain-selectors" - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/logger" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/targets" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm"