diff --git a/cmd/monitoring/main.go b/cmd/monitoring/main.go index 3fd8c97cf..219df2fca 100644 --- a/cmd/monitoring/main.go +++ b/cmd/monitoring/main.go @@ -1,7 +1,6 @@ package main import ( - "context" "fmt" "github.com/gagliardetto/solana-go/rpc" @@ -44,7 +43,7 @@ func main() { ) monitor, err := commonMonitoring.NewMonitor( - context.Background(), + make(chan struct{}), log, chainConfig, envelopeSourceFactory, diff --git a/go.mod b/go.mod index fdfc2cd74..3a215b068 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/pelletier/go-toml/v2 v2.1.1 github.com/prometheus/client_golang v1.17.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.26.0 diff --git a/go.sum b/go.sum index 49c414005..0f2e9fce0 100644 --- a/go.sum +++ b/go.sum @@ -452,8 +452,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 h1:od+11B83s0mQwAMPP3lhtb0nYz63pIKpJEKddfFpu/M= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7/go.mod h1:cFHRblGbGn/rFYOOGsNbtLicMc1+5YdN0KoebYr93pk= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 24dacdbca..ca590795c 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -14,11 +14,11 @@ require ( github.com/lib/pq v1.10.9 github.com/pelletier/go-toml/v2 v2.1.1 github.com/rs/zerolog v1.30.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240524131846-a10ff1f030c9 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240524160213-b47649f55e0b github.com/smartcontractkit/chainlink-testing-framework v1.28.15 - github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524135402-6bd866a31530 - github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524135402-6bd866a31530 + github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a + github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/smartcontractkit/seth v1.0.9 github.com/stretchr/testify v1.9.0 @@ -359,10 +359,10 @@ require ( github.com/slack-go/slack v0.12.2 // indirect github.com/smartcontractkit/chain-selectors v1.0.10 // indirect github.com/smartcontractkit/chainlink-automation v1.0.3 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa // indirect github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 // indirect github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 133f1195f..df56c5a67 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1406,26 +1406,26 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs= github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 h1:od+11B83s0mQwAMPP3lhtb0nYz63pIKpJEKddfFpu/M= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7/go.mod h1:cFHRblGbGn/rFYOOGsNbtLicMc1+5YdN0KoebYr93pk= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 h1:Sec/GpBpUVaTEax1kSHlTvkzF/+d3w5roAQXaj5+SLA= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69/go.mod h1:ZQKf+0OLzCLYIisH/OdOIQuFRI6bDuw+jPBTATyHfFM= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f h1:k8h4Yjj3kXKm11dujvcknkplDOqmFz+d+8bwQFOzq6E= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f/go.mod h1:reWTkkx0lPclYjRa3kFaV2fmbDl6H06HLiAFhsNoP8E= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540/go.mod h1:sjAmX8K2kbQhvDarZE1ZZgDgmHJ50s0BBc/66vKY2ek= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0= github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 h1:ssh/w3oXWu+C6bE88GuFRC1+0Bx/4ihsbc80XMLrl2k= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69/go.mod h1:VsfjhvWgjxqWja4q+FlXEtX5lu8BSxn10xRo6gi948g= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa h1:mbjbmV83e5u761pqWqbGg+MyH64z0B9QM5ZjboVG2js= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa/go.mod h1:DBWzejxlSL855eM8DphHrxvJ9WhQ9C6cBHEGbcomFwQ= github.com/smartcontractkit/chainlink-testing-framework v1.28.15 h1:mga7N6jtXQ3UOCt43IdsEnCMBh9xjOWPaE9BiM6kr6Q= github.com/smartcontractkit/chainlink-testing-framework v1.28.15/go.mod h1:x1zDOz8zcLjEvs9fNA9y/DMguLam/2+CJdpxX0+rM8A= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU= github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 h1:LQmRsrzzaYYN3wEU1l5tWiccznhvbyGnu2N+wHSXZAo= github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524135402-6bd866a31530 h1:QmIxClaisbyLQ06Ztbq+u1pvd9j/7fDC2QKHq3GbFQg= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524135402-6bd866a31530/go.mod h1:+a2IIu/Q1+fB9mPkbjNyYUZcM91YDYfivzByE9kDIco= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524135402-6bd866a31530 h1:yEddXtOMcIlx+UbI+DfeFcYdyd3xM8/xlCl1Qa9W7ik= -github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524135402-6bd866a31530/go.mod h1:GoS6m5Bn8aAYLgy2231pxbfr4fSD3rmJBd0Jg2m+gvs= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a h1:MvkbkOXU5SKKCEMWcqvuEYDTjDOLBT1UvOaPDFMITtY= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a/go.mod h1:CD4LdBwQCtHjpID2UZTUuISMd06R8AnmcgcYGAgA9+I= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a h1:C3yHYi9OuddN3mi3h6aaAbxjz0pNHhV2T+MD1sCIaZM= +github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a/go.mod h1:hTGmFkhasOS1P+DeUppBu1FmjMKAv/Vijumuqh3o2ow= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/pkg/solana/chainreader/chain_reader.go b/pkg/solana/chainreader/chain_reader.go index c6a3e4a25..10d7b0908 100644 --- a/pkg/solana/chainreader/chain_reader.go +++ b/pkg/solana/chainreader/chain_reader.go @@ -36,8 +36,8 @@ type SolanaChainReaderService struct { } var ( - _ services.Service = &SolanaChainReaderService{} - _ types.ChainReader = &SolanaChainReaderService{} + _ services.Service = &SolanaChainReaderService{} + _ types.ContractReader = &SolanaChainReaderService{} ) // NewChainReaderService is a constructor for a new ChainReaderService for Solana. Returns a nil service on error. @@ -91,7 +91,7 @@ func (s *SolanaChainReaderService) HealthReport() map[string]error { return map[string]error{s.Name(): s.Healthy()} } -// GetLatestValue implements the types.ChainReader interface and requests and parses on-chain +// GetLatestValue implements the types.ContractReader interface and requests and parses on-chain // data named by the provided contract, method, and params. func (s *SolanaChainReaderService) GetLatestValue(ctx context.Context, contractName, method string, params any, returnVal any) error { if err := s.Ready(); err != nil { @@ -169,12 +169,12 @@ func (s *SolanaChainReaderService) GetLatestValue(ctx context.Context, contractN return nil } -// QueryKey implements the types.ChainReader interface. +// QueryKey implements the types.ContractReader interface. func (s *SolanaChainReaderService) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]types.Sequence, error) { return nil, errors.New("unimplemented") } -// Bind implements the types.ChainReader interface and allows new contract bindings to be added +// Bind implements the types.ContractReader interface and allows new contract bindings to be added // to the service. func (s *SolanaChainReaderService) Bind(_ context.Context, bindings []types.BoundContract) error { return s.bindings.Bind(bindings) diff --git a/pkg/solana/chainreader/chain_reader_test.go b/pkg/solana/chainreader/chain_reader_test.go index c644e8a4f..7b34ecacd 100644 --- a/pkg/solana/chainreader/chain_reader_test.go +++ b/pkg/solana/chainreader/chain_reader_test.go @@ -520,7 +520,7 @@ func (r *chainReaderInterfaceTester) Setup(t *testing.T) { } } -func (r *chainReaderInterfaceTester) GetChainReader(t *testing.T) types.ChainReader { +func (r *chainReaderInterfaceTester) GetChainReader(t *testing.T) types.ContractReader { client := new(mockedRPCClient) svc, err := chainreader.NewChainReaderService(logger.Test(t), client, r.conf) if err != nil { @@ -552,6 +552,26 @@ type wrappedTestChainReader struct { testStructQueue []*TestStruct } +func (r *wrappedTestChainReader) Start(ctx context.Context) error { + return nil +} + +func (r *wrappedTestChainReader) Close() error { + return nil +} + +func (r *wrappedTestChainReader) Ready() error { + return nil +} + +func (r *wrappedTestChainReader) HealthReport() map[string]error { + return nil +} + +func (r *wrappedTestChainReader) Name() string { + return "wrappedTestChainReader" +} + func (r *wrappedTestChainReader) GetLatestValue(ctx context.Context, contractName string, method string, params, returnVal any) error { var ( a ag_solana.PublicKey @@ -644,7 +664,7 @@ func (r *wrappedTestChainReader) GetLatestValue(ctx context.Context, contractNam return r.service.GetLatestValue(ctx, contractName, method, params, returnVal) } -// QueryKey implements the types.ChainReader interface. +// QueryKey implements the types.ContractReader interface. func (r *wrappedTestChainReader) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]types.Sequence, error) { r.test.Skip("QueryKey is not yet supported in Solana") return nil, nil @@ -825,15 +845,15 @@ const ( // Required to allow test skipping to be on the same goroutine type skipEventsChainReaderTester struct{ ChainReaderInterfaceTester } -func (s *skipEventsChainReaderTester) GetChainReader(t *testing.T) types.ChainReader { +func (s *skipEventsChainReaderTester) GetChainReader(t *testing.T) types.ContractReader { return &skipEventsChainReader{ - ChainReader: s.ChainReaderInterfaceTester.GetChainReader(t), - t: t, + ContractReader: s.ChainReaderInterfaceTester.GetChainReader(t), + t: t, } } type skipEventsChainReader struct { - types.ChainReader + types.ContractReader t *testing.T } @@ -842,7 +862,7 @@ func (s *skipEventsChainReader) GetLatestValue(ctx context.Context, contractName s.t.Skip("Events are not yet supported in Solana") } - return s.ChainReader.GetLatestValue(ctx, contractName, method, params, returnVal) + return s.ContractReader.GetLatestValue(ctx, contractName, method, params, returnVal) } func (s *skipEventsChainReader) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]types.Sequence, error) { diff --git a/pkg/solana/relay.go b/pkg/solana/relay.go index 68652fcd2..91057e123 100644 --- a/pkg/solana/relay.go +++ b/pkg/solana/relay.go @@ -92,6 +92,10 @@ func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.Confi return configWatcher, err } +func (r *Relayer) NewContractReader(_ []byte) (relaytypes.ContractReader, error) { + return nil, errors.New("contract reader is not supported for solana") +} + func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { ctx, cancel := r.stopCh.NewCtx() defer cancel() @@ -283,7 +287,7 @@ func (p *medianProvider) OnchainConfigCodec() median.OnchainConfigCodec { return median.StandardOnchainConfigCodec{} } -func (p *medianProvider) ChainReader() relaytypes.ChainReader { +func (p *medianProvider) ChainReader() relaytypes.ContractReader { return nil }