diff --git a/core/capabilities/aggregator_factory.go b/core/capabilities/aggregator_factory.go index 18336e3f802..1abf58b6c12 100644 --- a/core/capabilities/aggregator_factory.go +++ b/core/capabilities/aggregator_factory.go @@ -3,6 +3,7 @@ package capabilities import ( "fmt" + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/aggregators" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/datafeeds" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -14,7 +15,9 @@ func NewAggregator(name string, config values.Map, lggr logger.Logger) (types.Ag switch name { case "data_feeds": mc := streams.NewCodec(lggr) - return datafeeds.NewDataFeedsAggregator(config, mc, lggr) + return datafeeds.NewDataFeedsAggregator(config, mc) + case "identical": + return aggregators.NewIdenticalAggregator(config) default: return nil, fmt.Errorf("aggregator %s not supported", name) } diff --git a/core/capabilities/streams/consensus_agg_test.go b/core/capabilities/streams/consensus_agg_test.go index 04396a38ba9..834889f2c31 100644 --- a/core/capabilities/streams/consensus_agg_test.go +++ b/core/capabilities/streams/consensus_agg_test.go @@ -36,11 +36,11 @@ func TestStreamsConsensusAggregator(t *testing.T) { config := newAggConfig(t, feeds) lggr := logger.TestLogger(t) codec := streams.NewCodec(lggr) - agg, err := datafeeds.NewDataFeedsAggregator(*config, codec, lggr) + agg, err := datafeeds.NewDataFeedsAggregator(*config, codec) require.NoError(t, err) // init round - empty previous Outcome, empty observations - outcome, err := agg.Aggregate(nil, map[commontypes.OracleID][]values.Value{}, Fw) + outcome, err := agg.Aggregate(lggr, nil, map[commontypes.OracleID][]values.Value{}, Fw) require.NoError(t, err) require.False(t, outcome.ShouldReport) @@ -56,7 +56,7 @@ func TestStreamsConsensusAggregator(t *testing.T) { for c := 0; c < T; c++ { obs := newObservations(t, Nw, feeds, Ft+1, allowedSigners) processingStart := time.Now().UnixMilli() - outcome, err = agg.Aggregate(outcome, obs, Fw) + outcome, err = agg.Aggregate(lggr, outcome, obs, Fw) processingTime += time.Now().UnixMilli() - processingStart require.NoError(t, err) } diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 35db6742cb4..5ae5483f93e 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.0 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a 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 9ef8d9255e6..d4e12966685 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-20241010120731-ae3e8f4935a0 h1:nKfjG9fufMQspKO0hFGK2B9ICL+tgajwP+nAXYP0LPc= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0/go.mod h1:DjyfH0AGcqctKB6DaRUpRL6GJ2SbrpiaBkA4h24/oMY= -github.com/smartcontractkit/chainlink-common v0.3.0 h1:mUXHBzzw2qPKyw6gPAC8JhO+ryT8maY+rBi9NFtqEy0= -github.com/smartcontractkit/chainlink-common v0.3.0/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a h1:Q3xj6qjx07IQ3i9q7j8nB5AIWIPq6qImxpuSVqqpizc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a/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/go.mod b/go.mod index 24c841fa59e..b5b555f23fb 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.23 github.com/smartcontractkit/chainlink-automation v0.8.0 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0 - github.com/smartcontractkit/chainlink-common v0.3.0 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a 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 cc8ac4b8687..fe6f099c0b5 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-20241010120731-ae3e8f4935a0 h1:nKfjG9fufMQspKO0hFGK2B9ICL+tgajwP+nAXYP0LPc= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0/go.mod h1:DjyfH0AGcqctKB6DaRUpRL6GJ2SbrpiaBkA4h24/oMY= -github.com/smartcontractkit/chainlink-common v0.3.0 h1:mUXHBzzw2qPKyw6gPAC8JhO+ryT8maY+rBi9NFtqEy0= -github.com/smartcontractkit/chainlink-common v0.3.0/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a h1:Q3xj6qjx07IQ3i9q7j8nB5AIWIPq6qImxpuSVqqpizc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a/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 303294bb929..d41a5bf978e 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -40,7 +40,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.23 github.com/smartcontractkit/chainlink-automation v0.8.0 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0 - github.com/smartcontractkit/chainlink-common v0.3.0 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a 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 8e868f64e8d..92d805567a7 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1402,8 +1402,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-20241010120731-ae3e8f4935a0 h1:nKfjG9fufMQspKO0hFGK2B9ICL+tgajwP+nAXYP0LPc= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0/go.mod h1:DjyfH0AGcqctKB6DaRUpRL6GJ2SbrpiaBkA4h24/oMY= -github.com/smartcontractkit/chainlink-common v0.3.0 h1:mUXHBzzw2qPKyw6gPAC8JhO+ryT8maY+rBi9NFtqEy0= -github.com/smartcontractkit/chainlink-common v0.3.0/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a h1:Q3xj6qjx07IQ3i9q7j8nB5AIWIPq6qImxpuSVqqpizc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a/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 ee4a10afb68..2d757d6d9f0 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.0 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a 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 d5e0cb739c5..a9dbc259c8f 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1379,8 +1379,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-20241010120731-ae3e8f4935a0 h1:nKfjG9fufMQspKO0hFGK2B9ICL+tgajwP+nAXYP0LPc= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241010120731-ae3e8f4935a0/go.mod h1:DjyfH0AGcqctKB6DaRUpRL6GJ2SbrpiaBkA4h24/oMY= -github.com/smartcontractkit/chainlink-common v0.3.0 h1:mUXHBzzw2qPKyw6gPAC8JhO+ryT8maY+rBi9NFtqEy0= -github.com/smartcontractkit/chainlink-common v0.3.0/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a h1:Q3xj6qjx07IQ3i9q7j8nB5AIWIPq6qImxpuSVqqpizc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241014094307-cdeea8fc821a/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=