From 9f85257c56c5f1ce5be35d983b9f1015a7c30b48 Mon Sep 17 00:00:00 2001 From: Matthew Pendrey Date: Tue, 26 Nov 2024 15:48:32 +0000 Subject: [PATCH] move to iter --- core/scripts/go.mod | 4 ++-- core/scripts/go.sum | 4 ++-- core/services/relay/evm/chain_reader.go | 16 ++++++++++++++-- deployment/go.mod | 4 ++-- deployment/go.sum | 4 ++-- go.mod | 4 ++-- go.sum | 4 ++-- integration-tests/go.mod | 4 ++-- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 4 ++-- integration-tests/load/go.sum | 4 ++-- 11 files changed, 34 insertions(+), 22 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index d40037c4740..0b6a4b99873 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/core/scripts -go 1.23 +go 1.23.3 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../../ @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index ac0d461389b..f9c21d2d4d7 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1094,8 +1094,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg= diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index 400c2814229..341fba3f394 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "iter" "maps" "slices" "strings" @@ -299,7 +300,7 @@ func (cr *chainReader) QueryKey( } func (cr *chainReader) QueryKeys(ctx context.Context, filters []commontypes.ContractKeyFilter, - limitAndSort query.LimitAndSort) ([]commontypes.SequenceWithKey, error) { + limitAndSort query.LimitAndSort) (iter.Seq2[string, commontypes.Sequence], error) { eventQueries := make([]read.EventQuery, 0, len(filters)) for _, filter := range filters { binding, address, err := cr.bindings.GetReader(filter.Contract.ReadIdentifier(filter.KeyFilter.Key)) @@ -330,7 +331,18 @@ func (cr *chainReader) QueryKeys(ctx context.Context, filters []commontypes.Cont }) } - return read.MultiEventTypeQuery(ctx, cr.lp, eventQueries, limitAndSort) + sequenceWithKeys, err := read.MultiEventTypeQuery(ctx, cr.lp, eventQueries, limitAndSort) + if err != nil { + return nil, err + } + + return func(yield func(string, commontypes.Sequence) bool) { + for _, s := range sequenceWithKeys { + if !yield(s.Key, s.Sequence) { + return + } + } + }, nil } func (cr *chainReader) CreateContractType(readIdentifier string, forEncoding bool) (any, error) { diff --git a/deployment/go.mod b/deployment/go.mod index 1be95cf8470..5036ccacb3b 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/deployment -go 1.23 +go 1.23.3 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../ @@ -23,7 +23,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.31 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/deployment/go.sum b/deployment/go.sum index 1180ab534c0..2b7924347a0 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg= diff --git a/go.mod b/go.mod index aa434124b85..e3b74188b06 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/v2 -go 1.23 +go 1.23.3 require ( github.com/Depado/ginprom v1.8.0 @@ -77,7 +77,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.31 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index 1934ae0dcda..804f33bf019 100644 --- a/go.sum +++ b/go.sum @@ -1078,8 +1078,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index c2ccda91abb..38581dbbabb 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/integration-tests -go 1.23 +go 1.23.3 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../ @@ -38,7 +38,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.31 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.16 github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 41e9bc313d7..72639aa3fbc 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1405,8 +1405,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 25f9de68cda..c0e1121ef28 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -1,6 +1,6 @@ module github.com/smartcontractkit/chainlink/load-tests -go 1.23 +go 1.23.3 // Make sure we're working with the latest chainlink libs replace github.com/smartcontractkit/chainlink/v2 => ../../ @@ -17,7 +17,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.16 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 2725494970a..b66aac3bb9a 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=