From f9e93217019b2589655dfb4bf428a1187a755a81 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 8 Jan 2025 10:13:20 -0600 Subject: [PATCH] bump chainlink-common; rm unused PluginFactoryConstructor --- commit/factory.go | 28 ---------------------------- execute/factory.go | 29 ----------------------------- go.mod | 14 +++++++------- go.sum | 36 ++++++++++++++++++------------------ pkg/logutil/logutil_test.go | 14 ++++++++------ 5 files changed, 33 insertions(+), 88 deletions(-) diff --git a/commit/factory.go b/commit/factory.go index 92422b773..ced435c7e 100644 --- a/commit/factory.go +++ b/commit/factory.go @@ -7,8 +7,6 @@ import ( "fmt" "time" - "google.golang.org/grpc" - sel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/libocr/commontypes" @@ -67,31 +65,6 @@ const ( maxReportCount = 1 ) -// PluginFactoryConstructor implements common OCR3ReportingPluginClient and is used for initializing a plugin factory -// and a validation service. -type PluginFactoryConstructor struct{} - -func NewPluginFactoryConstructor() *PluginFactoryConstructor { - return &PluginFactoryConstructor{} -} -func (p PluginFactoryConstructor) NewReportingPluginFactory( - ctx context.Context, - config core.ReportingPluginServiceConfig, - grpcProvider grpc.ClientConnInterface, - pipelineRunner core.PipelineRunnerService, - telemetry core.TelemetryService, - errorLog core.ErrorLog, - capRegistry core.CapabilitiesRegistry, - keyValueStore core.KeyValueStore, - relayerSet core.RelayerSet, -) (core.OCR3ReportingPluginFactory, error) { - return nil, errors.New("this functionality should not be used") -} - -func (p PluginFactoryConstructor) NewValidationService(ctx context.Context) (core.ValidationService, error) { - return nil, errors.New("this functionality should not be used") -} - type PluginFactory struct { baseLggr logger.Logger donID plugintypes.DonID @@ -301,5 +274,4 @@ func (p PluginFactory) HealthReport() map[string]error { } // Interface compatibility checks. -var _ core.OCR3ReportingPluginClient = &PluginFactoryConstructor{} var _ core.OCR3ReportingPluginFactory = &PluginFactory{} diff --git a/execute/factory.go b/execute/factory.go index 97bb74580..10011df62 100644 --- a/execute/factory.go +++ b/execute/factory.go @@ -2,11 +2,8 @@ package execute import ( "context" - "errors" "fmt" - "google.golang.org/grpc" - sel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/libocr/commontypes" @@ -64,31 +61,6 @@ const ( maxReportCount = 1 ) -// PluginFactoryConstructor implements common OCR3ReportingPluginClient and is used for initializing a plugin factory -// and a validation service. -type PluginFactoryConstructor struct{} - -func NewPluginFactoryConstructor() *PluginFactoryConstructor { - return &PluginFactoryConstructor{} -} -func (p PluginFactoryConstructor) NewReportingPluginFactory( - ctx context.Context, - config core.ReportingPluginServiceConfig, - grpcProvider grpc.ClientConnInterface, - pipelineRunner core.PipelineRunnerService, - telemetry core.TelemetryService, - errorLog core.ErrorLog, - capRegistry core.CapabilitiesRegistry, - keyValueStore core.KeyValueStore, - relayerSet core.RelayerSet, -) (core.OCR3ReportingPluginFactory, error) { - return nil, errors.New("unimplemented") -} - -func (p PluginFactoryConstructor) NewValidationService(ctx context.Context) (core.ValidationService, error) { - panic("implement me") -} - // PluginFactory implements common ReportingPluginFactory and is used for (re-)initializing commit plugin instances. type PluginFactory struct { baseLggr logger.Logger @@ -244,5 +216,4 @@ func (p PluginFactory) HealthReport() map[string]error { } // Interface compatibility checks. -var _ core.OCR3ReportingPluginClient = &PluginFactoryConstructor{} var _ core.OCR3ReportingPluginFactory = &PluginFactory{} diff --git a/go.mod b/go.mod index a297202ac..0c34ca58c 100644 --- a/go.mod +++ b/go.mod @@ -8,16 +8,16 @@ require ( github.com/prometheus/client_golang v1.20.0 github.com/prometheus/client_model v0.6.1 github.com/smartcontractkit/chain-selectors v1.0.34 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241212163958-6a43e61b9d49 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108151330-147f1997dcf0 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.27.0 + golang.org/x/crypto v0.28.0 golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 golang.org/x/sync v0.8.0 golang.org/x/time v0.3.0 - google.golang.org/grpc v1.66.1 - google.golang.org/protobuf v1.34.2 + google.golang.org/grpc v1.67.1 + google.golang.org/protobuf v1.35.1 ) require ( @@ -51,9 +51,9 @@ require ( go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4fc29736b..a74a2de3a 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXei github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -71,8 +71,8 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3fePb3eCreuAnUA3RBj4= github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241212163958-6a43e61b9d49 h1:ZA92CTX9JtEArrxgZw7PNctVxFS+/DmSXumkwf1WiMY= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241212163958-6a43e61b9d49/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108151330-147f1997dcf0 h1:mkt+Qqhme/d3H3j5Gu13IhTp2WAUpymMR8qZ8T3Aid0= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20250108151330-147f1997dcf0/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -101,28 +101,28 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= -gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= +gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= +gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= -google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/pkg/logutil/logutil_test.go b/pkg/logutil/logutil_test.go index f6c34ef98..7399d57fa 100644 --- a/pkg/logutil/logutil_test.go +++ b/pkg/logutil/logutil_test.go @@ -6,9 +6,10 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) func TestLogWrapper(t *testing.T) { @@ -49,15 +50,16 @@ func TestNamed(t *testing.T) { // Name the base logger. namedLggr := logger.Named(lggr, "ElToroLoco") namedLggr.Info("Monster Jam") - require.Equal(t, 1, hook.Len()) - require.Equal(t, "ElToroLoco", hook.All()[0].LoggerName) + logs := hook.TakeAll() + require.Len(t, logs, 2) + require.Equal(t, "ElToroLoco", logs[1].LoggerName) // Name the named logger. namedLggr2 := logger.Named(namedLggr, "ObiWan") namedLggr2.Info("Star Wars") - - require.Equal(t, 2, hook.Len()) - require.Equal(t, "ElToroLoco.ObiWan", hook.All()[1].LoggerName) + logs = hook.TakeAll() + require.Len(t, logs, 2) + require.Equal(t, "ElToroLoco.ObiWan", logs[1].LoggerName) } func TestLogCopy(t *testing.T) {