From 650b827f4f4e911b24f7f5318c818874f7b93631 Mon Sep 17 00:00:00 2001 From: Cedric Date: Wed, 16 Oct 2024 21:21:59 +0100 Subject: [PATCH] [chore] Fix incorrect jobID in RequestRoundTracker (#14811) --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- core/services/ocr2/delegate.go | 3 ++- core/services/ocr2/plugins/median/services.go | 2 +- core/services/relay/evm/evm.go | 2 +- core/services/relay/evm/median.go | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 12 files changed, 19 insertions(+), 18 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index c3775bc91c2..d58d6745bfb 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.20.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index a6775342e07..2ccaed63c10 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1074,8 +1074,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.0 h1:hFz2EHU06bkEfhcqhK8Jd github.com/smartcontractkit/chainlink-automation v0.8.0/go.mod h1:ObdjDfgGIaiE48Bb3yYcx1CeGBm392WlEw92U83LlUA= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1:aMG3BllvgeL/vsqkebuAhWoIWOnitKnN1VxibdzGnYo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 h1:rF8Vh9QXGXANnCs8Jl5o4Wp9mlkeVqKu0NohP9oWSII= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 h1:WERgv6CtOMVLCa0d1YhO3BrP94TwDT+QSVKvH5PZ5Xw= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY= github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU= github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk= diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index adb68398e9e..2536e11a402 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -634,7 +634,8 @@ func (d *Delegate) newServicesGenericPlugin( provider, err := relayer.NewPluginProvider(ctx, types.RelayArgs{ ExternalJobID: jb.ExternalJobID, - JobID: spec.ID, + JobID: jb.ID, + OracleSpecID: spec.ID, ContractID: spec.ContractID, New: d.isNewlyCreatedJob, RelayConfig: spec.RelayConfig.Bytes(), diff --git a/core/services/ocr2/plugins/median/services.go b/core/services/ocr2/plugins/median/services.go index 866044fcc92..c696bef8607 100644 --- a/core/services/ocr2/plugins/median/services.go +++ b/core/services/ocr2/plugins/median/services.go @@ -63,7 +63,6 @@ func NewMedianServices(ctx context.Context, cfg MedianConfig, chEnhancedTelem chan ocrcommon.EnhancedTelemetryData, errorLog loop.ErrorLog, - ) (srvs []job.ServiceCtx, err error) { var pluginConfig config.PluginConfig err = json.Unmarshal(jb.OCR2OracleSpec.PluginConfig.Bytes(), &pluginConfig) @@ -86,6 +85,7 @@ func NewMedianServices(ctx context.Context, provider, err := relayer.NewPluginProvider(ctx, types.RelayArgs{ ExternalJobID: jb.ExternalJobID, JobID: jb.ID, + OracleSpecID: *jb.OCR2OracleSpecID, ContractID: spec.ContractID, New: isNewlyCreatedJob, RelayConfig: spec.RelayConfig.Bytes(), diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index 49d937c82c6..0f270328bb9 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -863,7 +863,7 @@ func (r *Relayer) NewMedianProvider(ctx context.Context, rargs commontypes.Relay return nil, err } - medianContract, err := newMedianContract(configWatcher.ContractConfigTracker(), configWatcher.contractAddress, configWatcher.chain, rargs.JobID, r.ds, lggr) + medianContract, err := newMedianContract(configWatcher.ContractConfigTracker(), configWatcher.contractAddress, configWatcher.chain, rargs.JobID, rargs.OracleSpecID, r.ds, lggr) if err != nil { return nil, err } diff --git a/core/services/relay/evm/median.go b/core/services/relay/evm/median.go index 60a63994bdc..1dddb201ebb 100644 --- a/core/services/relay/evm/median.go +++ b/core/services/relay/evm/median.go @@ -31,7 +31,7 @@ type medianContract struct { requestRoundTracker *RequestRoundTracker } -func newMedianContract(configTracker types.ContractConfigTracker, contractAddress common.Address, chain legacyevm.Chain, specID int32, ds sqlutil.DataSource, lggr logger.Logger) (*medianContract, error) { +func newMedianContract(configTracker types.ContractConfigTracker, contractAddress common.Address, chain legacyevm.Chain, jobID int32, oracleSpecID int32, ds sqlutil.DataSource, lggr logger.Logger) (*medianContract, error) { lggr = logger.Named(lggr, "MedianContract") contract, err := offchain_aggregator_wrapper.NewOffchainAggregator(contractAddress, chain.Client()) if err != nil { @@ -57,10 +57,10 @@ func newMedianContract(configTracker types.ContractConfigTracker, contractAddres contractFilterer, chain.Client(), chain.LogBroadcaster(), - specID, + jobID, lggr, ds, - NewRoundRequestedDB(ds, specID, lggr), + NewRoundRequestedDB(ds, oracleSpecID, lggr), chain.Config().EVM(), ), }, nil diff --git a/go.mod b/go.mod index 83a1a983dfe..939d70b9a8d 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.0 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 github.com/smartcontractkit/chainlink-cosmos v0.5.1 github.com/smartcontractkit/chainlink-data-streams v0.1.0 github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index b2c21ccb770..9f0a8267599 100644 --- a/go.sum +++ b/go.sum @@ -1057,8 +1057,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.0 h1:hFz2EHU06bkEfhcqhK8Jd github.com/smartcontractkit/chainlink-automation v0.8.0/go.mod h1:ObdjDfgGIaiE48Bb3yYcx1CeGBm392WlEw92U83LlUA= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1:aMG3BllvgeL/vsqkebuAhWoIWOnitKnN1VxibdzGnYo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 h1:rF8Vh9QXGXANnCs8Jl5o4Wp9mlkeVqKu0NohP9oWSII= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 h1:WERgv6CtOMVLCa0d1YhO3BrP94TwDT+QSVKvH5PZ5Xw= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY= github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU= github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 4c1d5c556ff..c8fabc84dc2 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -40,7 +40,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.0 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.11-0.20241011153842-b2804aed25b4 github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 953e61a5855..16d05018a29 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1404,8 +1404,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.0 h1:hFz2EHU06bkEfhcqhK8Jd github.com/smartcontractkit/chainlink-automation v0.8.0/go.mod h1:ObdjDfgGIaiE48Bb3yYcx1CeGBm392WlEw92U83LlUA= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1:aMG3BllvgeL/vsqkebuAhWoIWOnitKnN1VxibdzGnYo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 h1:rF8Vh9QXGXANnCs8Jl5o4Wp9mlkeVqKu0NohP9oWSII= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 h1:WERgv6CtOMVLCa0d1YhO3BrP94TwDT+QSVKvH5PZ5Xw= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY= github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU= github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index a68616af4ce..2c77f9dc2b8 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -15,7 +15,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.11-0.20241011153842-b2804aed25b4 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 92e8eb6488b..66751cf23fa 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1381,8 +1381,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.0 h1:hFz2EHU06bkEfhcqhK8Jd github.com/smartcontractkit/chainlink-automation v0.8.0/go.mod h1:ObdjDfgGIaiE48Bb3yYcx1CeGBm392WlEw92U83LlUA= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7 h1:aMG3BllvgeL/vsqkebuAhWoIWOnitKnN1VxibdzGnYo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241014104242-9227e5c976a7/go.mod h1:H4BTXnZBhwRdsAFjqWZpB1/f3IZnuB/Ql7pXPmokzXg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8 h1:rF8Vh9QXGXANnCs8Jl5o4Wp9mlkeVqKu0NohP9oWSII= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241015141757-516fee04cae8/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2 h1:WERgv6CtOMVLCa0d1YhO3BrP94TwDT+QSVKvH5PZ5Xw= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241016173514-b7b7f6310ac2/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= github.com/smartcontractkit/chainlink-cosmos v0.5.1 h1:2xeZWh+4/w7xalTdAu8jqgFuxZ291aYTEwZhlQEv/BY= github.com/smartcontractkit/chainlink-cosmos v0.5.1/go.mod h1:c1wUtVxXUqW4PzuCQhuHaBDZFv9XAQjhKTqam7GLGIU= github.com/smartcontractkit/chainlink-data-streams v0.1.0 h1:wcRJRm7eqfbgN+Na+GjAe0/IUn6XwmSagFHqIWHHBGk=