diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go index 243b6c61706..b3813299573 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go @@ -7,6 +7,9 @@ import ( "math/big" "strings" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/pricegetter" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/rpclib" @@ -18,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" @@ -31,7 +33,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory.go b/core/services/ocr2/plugins/ccip/ccipexec/factory.go index 39fec901bee..50ff4323d6e 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/tokendata" @@ -75,13 +75,7 @@ func (rf *ExecutionReportingPluginFactory) HealthReport() map[string]error { } func NewExecutionReportingPluginFactoryV2(ctx context.Context, lggr logger.Logger, sourceTokenAddress string, srcChainID int64, dstChainID int64, srcProvider commontypes.CCIPExecProvider, dstProvider commontypes.CCIPExecProvider) (*ExecutionReportingPluginFactory, error) { - // TODO: common logger is a subset of core logger. - // what's the golden path for passing a logger through from the plugin to the LOOP reporting plugin factory? - if lggr == nil { - lggr, _ = logger.NewLogger() - } - - // TODO: NewOffRampReader doesn't need addr param when provided in job spec + // NewOffRampReader doesn't need addr param when provided in job spec offRampReader, err := dstProvider.NewOffRampReader(ctx, "") if err != nil { return nil, fmt.Errorf("create offRampReader: %w", err) @@ -145,8 +139,7 @@ func NewExecutionReportingPluginFactoryV2(ctx context.Context, lggr logger.Logge cache.NewChainHealthcheck( // Adding more details to Logger to make healthcheck logs more informative // It's safe because healthcheck logs only in case of unhealthy state - lggr.With( - "onramp", offRampConfig.OnRamp, + logger.With(lggr, "onramp", offRampConfig.OnRamp, "commitStore", offRampConfig.CommitStore, ), onRampReader, @@ -167,7 +160,7 @@ func NewExecutionReportingPluginFactoryV2(ctx context.Context, lggr logger.Logge return &ExecutionReportingPluginFactory{ config: ExecutionPluginStaticConfig{ - lggr: lggr, + lggr: logger.Sugared(lggr), onRampReader: onRampReader, commitStoreReader: commitStoreReader, offRampReader: offRampReader, diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go index 7bbb9be0c69..fc3723e26b7 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ccipdataprovidermocks "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/mocks" @@ -54,7 +54,7 @@ func TestNewReportingPluginRetriesUntilSuccess(t *testing.T) { priceRegistryProvider.On("NewPriceRegistryReader", mock.Anything, mock.Anything).Return(nil, nil).Once() execConfig.priceRegistryProvider = priceRegistryProvider - execConfig.lggr, _ = logger.NewLogger() + execConfig.lggr = logger.TestSugared(t) factory := NewExecutionReportingPluginFactory(execConfig) reportingConfig := types.ReportingPluginConfig{} diff --git a/core/services/ocr2/plugins/ccip/ccipexec/inflight.go b/core/services/ocr2/plugins/ccip/ccipexec/inflight.go index c76bfdf7780..fd6fb86cff5 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/inflight.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/inflight.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) // InflightInternalExecutionReport serves the same purpose as InflightCommitReport diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go index c2c1c54693a..538ff38ea9f 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2.go @@ -16,9 +16,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcommon" @@ -50,7 +50,7 @@ var ( ) type ExecutionPluginStaticConfig struct { - lggr logger.Logger + lggr logger.SugaredLogger onRampReader ccipdata.OnRampReader offRampReader ccipdata.OffRampReader commitStoreReader ccipdata.CommitStoreReader @@ -68,7 +68,7 @@ type ExecutionPluginStaticConfig struct { type ExecutionReportingPlugin struct { // Misc F int - lggr logger.Logger + lggr logger.SugaredLogger offchainConfig cciptypes.ExecOffchainConfig tokenDataWorker tokendata.Worker metricsCollector ccip.PluginMetricsCollector @@ -98,7 +98,7 @@ func (r *ExecutionReportingPlugin) Query(context.Context, types.ReportTimestamp) return types.Query{}, nil } -func (r *ExecutionReportingPlugin) Observation(ctx context.Context, timestamp types.ReportTimestamp, query types.Query) (types.Observation, error) { +func (r *ExecutionReportingPlugin) Observation(ctx context.Context, _ types.ReportTimestamp, _ types.Query) (types.Observation, error) { lggr := r.lggr.Named("ExecutionObservation") if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { return nil, err @@ -139,7 +139,7 @@ func (r *ExecutionReportingPlugin) Observation(ctx context.Context, timestamp ty return ccip.NewExecutionObservation(executableObservations).Marshal() } -func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context, lggr logger.Logger, inflight []InflightInternalExecutionReport) ([]ccip.ObservedMessage, error) { +func (r *ExecutionReportingPlugin) getExecutableObservations(ctx context.Context, lggr logger.SugaredLogger, inflight []InflightInternalExecutionReport) ([]ccip.ObservedMessage, error) { unexpiredReports, err := r.getUnexpiredCommitReports(ctx, r.commitStoreReader, lggr) if err != nil { return nil, err @@ -257,7 +257,7 @@ func (r *ExecutionReportingPlugin) getExecutedSeqNrsInRange(ctx context.Context, // profitability of execution. func (r *ExecutionReportingPlugin) buildBatch( ctx context.Context, - lggr logger.Logger, + lggr logger.SugaredLogger, report commitReportWithSendRequests, inflightAggregateValue *big.Int, aggregateTokenLimit *big.Int, @@ -624,7 +624,7 @@ func (r *ExecutionReportingPlugin) buildReport(ctx context.Context, lggr logger. return encodedReport, nil } -func (r *ExecutionReportingPlugin) Report(ctx context.Context, timestamp types.ReportTimestamp, query types.Query, observations []types.AttributedObservation) (bool, types.Report, error) { +func (r *ExecutionReportingPlugin) Report(ctx context.Context, _ types.ReportTimestamp, _ types.Query, observations []types.AttributedObservation) (bool, types.Report, error) { lggr := r.lggr.Named("ExecutionReport") if healthy, err := r.chainHealthcheck.IsHealthy(ctx); err != nil { return false, nil, err @@ -714,7 +714,7 @@ func calculateObservedMessagesConsensus(observations []ccip.ExecutionObservation return finalSequenceNumbers, nil } -func (r *ExecutionReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Context, timestamp types.ReportTimestamp, report types.Report) (bool, error) { +func (r *ExecutionReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Context, _ types.ReportTimestamp, report types.Report) (bool, error) { lggr := r.lggr.Named("ShouldAcceptFinalizedReport") execReport, err := r.offRampReader.DecodeExecutionReport(ctx, report) if err != nil { @@ -748,7 +748,7 @@ func (r *ExecutionReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Conte return true, nil } -func (r *ExecutionReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, timestamp types.ReportTimestamp, report types.Report) (bool, error) { +func (r *ExecutionReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, _ types.ReportTimestamp, report types.Report) (bool, error) { lggr := r.lggr.Named("ShouldTransmitAcceptedReport") execReport, err := r.offRampReader.DecodeExecutionReport(ctx, report) if err != nil { diff --git a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go index 35b7d6b0764..5394914e0ab 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/ocr2_test.go @@ -23,6 +23,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" lpMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" @@ -137,7 +138,7 @@ func TestExecutionReportingPlugin_Observation(t *testing.T) { p := &ExecutionReportingPlugin{} p.inflightReports = newInflightExecReportsContainer(time.Minute) p.inflightReports.reports = tc.inflightReports - p.lggr = logger.TestLogger(t) + p.lggr = commonlogger.TestSugared(t) p.tokenDataWorker = tokendata.NewBackgroundWorker( make(map[cciptypes.Address]tokendata.Reader), 10, 5*time.Second, time.Hour) p.metricsCollector = ccip.NoopMetricsCollector @@ -264,7 +265,7 @@ func TestExecutionReportingPlugin_Report(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { p := ExecutionReportingPlugin{} - p.lggr = logger.TestLogger(t) + p.lggr = commonlogger.TestSugared(t) p.F = tc.f p.commitStoreReader = ccipdatamocks.NewCommitStoreReader(t) @@ -319,7 +320,7 @@ func TestExecutionReportingPlugin_ShouldAcceptFinalizedReport(t *testing.T) { plugin := ExecutionReportingPlugin{ offRampReader: mockOffRampReader, - lggr: logger.TestLogger(t), + lggr: commonlogger.TestSugared(t), inflightReports: newInflightExecReportsContainer(1 * time.Hour), chainHealthcheck: chainHealthcheck, metricsCollector: ccip.NoopMetricsCollector, @@ -371,7 +372,7 @@ func TestExecutionReportingPlugin_ShouldTransmitAcceptedReport(t *testing.T) { plugin := ExecutionReportingPlugin{ commitStoreReader: mockCommitStoreReader, offRampReader: mockOffRampReader, - lggr: logger.TestLogger(t), + lggr: commonlogger.TestSugared(t), inflightReports: newInflightExecReportsContainer(1 * time.Hour), chainHealthcheck: chainHealthcheck, } @@ -405,7 +406,7 @@ func TestExecutionReportingPlugin_buildReport(t *testing.T) { // ensure that buildReport should cap the built report to fit in MaxExecutionReportLength p := &ExecutionReportingPlugin{} - p.lggr = logger.TestLogger(t) + p.lggr = commonlogger.TestSugared(t) commitStore := ccipdatamocks.NewCommitStoreReader(t) commitStore.On("VerifyExecutionReport", mock.Anything, mock.Anything, mock.Anything).Return(true, nil) @@ -460,7 +461,7 @@ func TestExecutionReportingPlugin_buildReport(t *testing.T) { func TestExecutionReportingPlugin_buildBatch(t *testing.T) { offRamp, _ := testhelpers.NewFakeOffRamp(t) - lggr := logger.TestLogger(t) + lggr := commonlogger.TestSugared(t) sender1 := ccipcalc.HexToAddress("0xa") destNative := ccipcalc.HexToAddress("0xb") @@ -823,7 +824,7 @@ func TestExecutionReportingPlugin_buildBatch(t *testing.T) { BatchGasLimit: 500_000, RelativeBoostPerWaitHour: 1, }, - lggr: logger.TestLogger(t), + lggr: commonlogger.TestSugared(t), gasPriceEstimator: gasPriceEstimator, } @@ -929,7 +930,7 @@ func TestExecutionReportingPlugin_getReportsWithSendRequests(t *testing.T) { } ctx := testutils.Context(t) - lggr := logger.TestLogger(t) + lggr := commonlogger.TestSugared(t) for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { p := &ExecutionReportingPlugin{} @@ -1826,7 +1827,7 @@ func encodeExecutionReport(t *testing.T, report cciptypes.ExecReport) []byte { // Verify the price registry update mechanism in case of configuration change on the source onRamp. func TestExecutionReportingPlugin_ensurePriceRegistrySynchronization(t *testing.T) { p := &ExecutionReportingPlugin{} - p.lggr = logger.TestLogger(t) + p.lggr = commonlogger.TestSugared(t) p.sourcePriceRegistryLock = sync.RWMutex{} sourcePriceRegistryAddress1 := cciptypes.Address(utils.RandomAddress().String()) diff --git a/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go b/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go index b77571a94cb..08c4eaaedba 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/chain_health.go @@ -9,9 +9,9 @@ import ( "github.com/pkg/errors" "golang.org/x/sync/errgroup" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) @@ -53,7 +53,7 @@ type chainHealthcheck struct { globalStatusExpiration time.Duration rmnStatusRefreshInterval time.Duration - lggr logger.Logger + lggr logger.SugaredLogger onRamp ccipdata.OnRampReader commitStore ccipdata.CommitStoreReader @@ -84,7 +84,7 @@ func NewChainHealthcheck(lggr logger.Logger, onRamp ccipdata.OnRampReader, commi globalStatusExpiration: defaultGlobalStatusExpirationDuration, rmnStatusRefreshInterval: defaultRMNStateRefreshInterval, - lggr: lggr, + lggr: logger.Sugared(lggr), onRamp: onRamp, commitStore: commitStore, @@ -106,7 +106,7 @@ func newChainHealthcheckWithCustomEviction(lggr logger.Logger, onRamp ccipdata.O globalStatusExpiration: globalStatusDuration, rmnStatusRefreshInterval: rmnStatusRefreshInterval, - lggr: lggr, + lggr: logger.Sugared(lggr), onRamp: onRamp, commitStore: commitStore, @@ -129,7 +129,7 @@ func (c *chainHealthcheck) IsHealthy(ctx context.Context) (bool, error) { // If cached value is properly casted to bool and not healthy it means the sticky flag is raised // and should be returned immediately if !ok { - c.lggr.Criticalw("Failed to cast cached value to sticky healthcheck", "value", cachedValue) + logger.Sugared(c.lggr).Criticalw("Failed to cast cached value to sticky healthcheck", "value", cachedValue) } else if ok && !healthy { return false, nil } diff --git a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go index ae5fe8fcde0..960867cf473 100644 --- a/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go +++ b/core/services/ocr2/plugins/ccip/internal/cache/commit_roots.go @@ -8,7 +8,7 @@ import ( "github.com/patrickmn/go-cache" orderedmap "github.com/wk8/go-ordered-map/v2" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) const ( diff --git a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go index 8ba57e77ed2..869e73b752d 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipcalc/calc.go @@ -4,7 +4,7 @@ import ( "math/big" "sort" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // ContiguousReqs checks if seqNrs contains all numbers from min to max. diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go index 30e4a415129..6c79e489c07 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader/token_pool_batch_reader.go @@ -10,10 +10,11 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" type_and_version "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/type_and_version_interface_wrapper" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go index 6697a78e199..e12b4d76f9f 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/ccipdataprovider/provider.go @@ -3,10 +3,12 @@ package ccipdataprovider import ( "context" + "github.com/smartcontractkit/chainlink/v2/core/logger" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/factory" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/observability" ) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go index e82584ac7cc..4efee119cff 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/onramp.go @@ -4,7 +4,6 @@ import ( "github.com/pkg/errors" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go index f1fa7c4e81a..f232e1ccf89 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/factory/price_registry.go @@ -28,7 +28,7 @@ func ClosePriceRegistryReader(ctx context.Context, lggr logger.Logger, versionFi return err } -func initOrClosePriceRegistryReader(ctx context.Context, lggr logger.Logger, versionFinder VersionFinder, priceRegistryAddress cciptypes.Address, lp logpoller.LogPoller, cl client.Client, closeReader bool) (ccipdata.PriceRegistryReader, error) { +func initOrClosePriceRegistryReader(_ context.Context, lggr logger.Logger, versionFinder VersionFinder, priceRegistryAddress cciptypes.Address, lp logpoller.LogPoller, cl client.Client, closeReader bool) (ccipdata.PriceRegistryReader, error) { registerFilters := !closeReader priceRegistryEvmAddr, err := ccipcalc.GenericAddrToEvm(priceRegistryAddress) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go index a9a07f0879b..b7f501ada05 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/reader.go @@ -6,10 +6,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" ) const ( diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go index d2104f985b9..6080657a1e3 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/price_registry.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" @@ -20,7 +21,6 @@ import ( evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_0_0" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go index a21781e84c6..8728333316c 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go @@ -14,6 +14,7 @@ import ( "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" @@ -22,7 +23,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store_1_2_0" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go index 9aac30e6123..91d94b278db 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/price_registry.go @@ -7,11 +7,11 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/price_registry_1_2_0" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0" diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go index 3bb582f3a21..a70a05a6684 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/commit_store.go @@ -6,12 +6,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/commit_store" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0" ) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go index 481933f89ad..2788ccddb24 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_5_0/onramp.go @@ -11,13 +11,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/smartcontractkit/chainlink-common/pkg/hashutil" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/arm_contract" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/cache" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" diff --git a/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go index 599a6206a1b..019d30f8c9e 100644 --- a/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go +++ b/core/services/ocr2/plugins/ccip/internal/oraclelib/backfilled_oracle.go @@ -2,16 +2,16 @@ package oraclelib import ( "context" + "sync" "sync/atomic" "time" - "github.com/smartcontractkit/chainlink/v2/core/services" - "go.uber.org/multierr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services" "github.com/smartcontractkit/chainlink/v2/core/services/job" ) diff --git a/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go index 29ed7143b2f..273102068c4 100644 --- a/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go +++ b/core/services/ocr2/plugins/ccip/internal/rpclib/evm.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" "golang.org/x/sync/errgroup" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) var ErrEmptyOutput = errors.New("rpc call output is empty (make sure that the contract method exists and rpc is healthy)") diff --git a/core/services/ocr2/plugins/ccip/observations.go b/core/services/ocr2/plugins/ccip/observations.go index f79d667a550..6860e7a4700 100644 --- a/core/services/ocr2/plugins/ccip/observations.go +++ b/core/services/ocr2/plugins/ccip/observations.go @@ -10,12 +10,13 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipcalc" ) +// CommitObservation are stored to the commit store. // Note if a breaking change is introduced to this struct nodes running different versions // will not be able to unmarshal each other's observations. Do not modify unless you // know what you are doing.