diff --git a/integration-tests/go.mod b/integration-tests/go.mod index b5c50f3b..9cffbc29 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -370,7 +370,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/slack-go/slack v0.12.2 // indirect github.com/smartcontractkit/chain-selectors v1.0.23 // indirect - github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect + github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240819231147-9746144bfb70 // indirect github.com/smartcontractkit/chainlink-ccip v0.0.0-20240911145028-d346e3ace978 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240906125718-9f0a98d32fbc // indirect @@ -379,9 +379,9 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect - github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 // indirect - github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect - github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect + github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac // indirect + github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20240801223644-b81c0f1b9c79 // indirect + github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20240801223644-b81c0f1b9c79 // indirect github.com/smartcontractkit/wsrpc v0.8.2 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sony/gobreaker v0.5.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f2a135b5..b76ba9b9 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1391,8 +1391,8 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= -github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= -github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= +github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240819231147-9746144bfb70 h1:vb/kX4hi8AAvsjP0bCNDl1Ar/aukFLldvlJ7hXeNxmQ= +github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240819231147-9746144bfb70/go.mod h1:ugDGaY9mUh8VCiQiaTNr7x/ow41BzY/8wCD/51ZrzBM= github.com/smartcontractkit/chainlink-ccip v0.0.0-20240911145028-d346e3ace978 h1:BPuehkAQ8R112SlTitukSdKYRJMY3zkvaQS4VSTNn0Q= github.com/smartcontractkit/chainlink-ccip v0.0.0-20240911145028-d346e3ace978/go.mod h1:X1f4CKlR1RilSgzArQv5HNvMrVSt+Zloihm3REwxhdQ= github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911181800-d00d5184ffaa h1:vG4aRggHzNDFTmMFemhhUAzqTfG159w0+RYjO7/cJ5E= @@ -1419,12 +1419,12 @@ github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.202409111708 github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240911170808-18cc10abf094/go.mod h1:zmzbErOMN3cCGMY4EpvXngky4hIly5cDXX65tLTC5CA= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= -github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= -github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= -github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= -github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac h1:jo3kFDcpF4/hfBLNMhLL7bvjdnJkEaUhbxXIFiC9lVs= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20240801223644-b81c0f1b9c79 h1:TNb1CroCwjZ92s+ILmbwuO0CT/VqpcyjbxChdN2q//s= +github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20240801223644-b81c0f1b9c79/go.mod h1:0y3aCUlAUevgzvGHGQ7qDDhjOHOR9OWED+oIk3aSBwo= +github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20240801223644-b81c0f1b9c79 h1:p7mVwRlLkRlxVat3GOWd/e740VJazR8k6QOipD2LHkk= +github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20240801223644-b81c0f1b9c79/go.mod h1:JjP0TZ026rjAlFuj3SMcC/WO93SBV5vbMr8wTbFpaIg= github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/monitoring/go.mod b/monitoring/go.mod index c02767a3..23eee21c 100644 --- a/monitoring/go.mod +++ b/monitoring/go.mod @@ -2,15 +2,15 @@ module github.com/smartcontractkit/chainlink-starknet/monitoring go 1.22 -toolchain go1.22.1 +toolchain go1.22.5 require ( github.com/NethermindEth/juno v0.3.1 github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb github.com/prometheus/client_golang v1.17.0 - github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911152814-4836d1d7f16b + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37 github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1 - github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c + github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac github.com/stretchr/testify v1.9.0 go.uber.org/multierr v1.11.0 ) @@ -67,7 +67,7 @@ require ( github.com/holiman/uint256 v1.2.4 // indirect github.com/invopop/jsonschema v0.12.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.3 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect @@ -87,7 +87,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/riferrei/srclient v0.5.4 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -99,8 +99,8 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect diff --git a/monitoring/go.sum b/monitoring/go.sum index da1021a1..bbb66d38 100644 --- a/monitoring/go.sum +++ b/monitoring/go.sum @@ -268,8 +268,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -393,8 +393,8 @@ github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99 github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= -github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CMoggKnxNzxsVDMQ= -github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -404,12 +404,12 @@ github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+D github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 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.2.2-0.20240911152814-4836d1d7f16b h1:eW1CSdNcDtOFqjrtfR93KTg80rHP+WWh5UybdJcdU8M= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911152814-4836d1d7f16b/go.mod h1:sjiiPwd4KsYOCf68MwL86EKphdXeT66EY7j53WH5DCc= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37 h1:0RzsB6MqMmxK7tiViR1IaJXoCxXgXes+eptsbnDisFs= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37/go.mod h1:1dP4AZyIwAv8FGlOSLDHv2Nxdjlng6AMbipES1n+gww= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c h1:lIyMbTaF2H0Q71vkwZHX/Ew4KF2BxiKhqEXwF8rn+KI= -github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac h1:jo3kFDcpF4/hfBLNMhLL7bvjdnJkEaUhbxXIFiC9lVs= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -479,12 +479,12 @@ github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= diff --git a/relayer/go.mod b/relayer/go.mod index 5215168e..262719a9 100644 --- a/relayer/go.mod +++ b/relayer/go.mod @@ -2,7 +2,7 @@ module github.com/smartcontractkit/chainlink-starknet/relayer go 1.22 -toolchain go1.22.1 +toolchain go1.22.5 require ( github.com/NethermindEth/juno v0.3.1 @@ -10,8 +10,8 @@ require ( github.com/ethereum/go-ethereum v1.13.8 github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99 github.com/pelletier/go-toml/v2 v2.2.0 - github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911152814-4836d1d7f16b - github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37 + github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa @@ -66,7 +66,7 @@ require ( github.com/holiman/uint256 v1.2.4 // indirect github.com/invopop/jsonschema v0.12.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.3 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect @@ -86,7 +86,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -99,8 +99,8 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect diff --git a/relayer/go.sum b/relayer/go.sum index aac2bc68..7bafd559 100644 --- a/relayer/go.sum +++ b/relayer/go.sum @@ -256,8 +256,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -369,8 +369,8 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CMoggKnxNzxsVDMQ= -github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -378,12 +378,12 @@ github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911152814-4836d1d7f16b h1:eW1CSdNcDtOFqjrtfR93KTg80rHP+WWh5UybdJcdU8M= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911152814-4836d1d7f16b/go.mod h1:sjiiPwd4KsYOCf68MwL86EKphdXeT66EY7j53WH5DCc= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37 h1:0RzsB6MqMmxK7tiViR1IaJXoCxXgXes+eptsbnDisFs= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240911112818-281072114f37/go.mod h1:1dP4AZyIwAv8FGlOSLDHv2Nxdjlng6AMbipES1n+gww= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c h1:lIyMbTaF2H0Q71vkwZHX/Ew4KF2BxiKhqEXwF8rn+KI= -github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac h1:jo3kFDcpF4/hfBLNMhLL7bvjdnJkEaUhbxXIFiC9lVs= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -450,10 +450,10 @@ github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240823153156-2a54df7bffb9 h1:UiRNKd1OgqsLbFwE+wkAWTdiAxXtCBqKIHeBIse4FUA= diff --git a/relayer/pkg/chainlink/cmd/chainlink-starknet/main.go b/relayer/pkg/chainlink/cmd/chainlink-starknet/main.go index 7cf6dc70..23151c35 100644 --- a/relayer/pkg/chainlink/cmd/chainlink-starknet/main.go +++ b/relayer/pkg/chainlink/cmd/chainlink-starknet/main.go @@ -75,9 +75,9 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, loopKs lo if err != nil { return nil, fmt.Errorf("failed to create chain: %w", err) } - ra := &loop.RelayerAdapter{Relayer: pkgstarknet.NewRelayer(c.Logger, chain, capRegistry), RelayerExt: chain} + r := pkgstarknet.NewRelayer(c.Logger, chain, capRegistry) - c.SubService(ra) + c.SubService(r) - return ra, nil + return r, nil } diff --git a/relayer/pkg/chainlink/ocr2/config_digester.go b/relayer/pkg/chainlink/ocr2/config_digester.go index 4272ae31..596672bb 100644 --- a/relayer/pkg/chainlink/ocr2/config_digester.go +++ b/relayer/pkg/chainlink/ocr2/config_digester.go @@ -1,6 +1,7 @@ package ocr2 import ( + "context" "encoding/binary" "errors" "math/big" @@ -32,7 +33,7 @@ func NewOffchainConfigDigester(chainID, contract string) offchainConfigDigester } // TODO: ConfigDigest is byte[32] but what we really want here is a felt -func (d offchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.ConfigDigest, error) { +func (d offchainConfigDigester) ConfigDigest(ctx context.Context, cfg types.ContractConfig) (types.ConfigDigest, error) { configDigest := types.ConfigDigest{} contractAddress, valid := new(big.Int).SetString(strings.TrimPrefix(d.contract, "0x"), 16) @@ -97,7 +98,7 @@ func (d offchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co digest.FillBytes(configDigest[:]) // set first two bytes to the digest prefix - pre, err := d.ConfigDigestPrefix() + pre, err := d.ConfigDigestPrefix(ctx) if err != nil { return configDigest, err } @@ -106,6 +107,6 @@ func (d offchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co return configDigest, nil } -func (offchainConfigDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) { +func (offchainConfigDigester) ConfigDigestPrefix(ctx context.Context) (types.ConfigDigestPrefix, error) { return ConfigDigestPrefixStarknet, nil } diff --git a/relayer/pkg/chainlink/ocr2/config_digester_test.go b/relayer/pkg/chainlink/ocr2/config_digester_test.go index 4ebdef32..c714a50e 100644 --- a/relayer/pkg/chainlink/ocr2/config_digester_test.go +++ b/relayer/pkg/chainlink/ocr2/config_digester_test.go @@ -4,10 +4,13 @@ import ( "strings" "testing" - "github.com/smartcontractkit/libocr/offchainreporting2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/libocr/offchainreporting2/types" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/ocr2" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet" ) @@ -37,23 +40,25 @@ var testConfig = types.ContractConfig{ } func TestConfigDigester(t *testing.T) { + ctx := tests.Context(t) d := ocr2.NewOffchainConfigDigester( "SN_GOERLI", // DEFAULT_CHAIN_ID = StarknetChainId.TESTNET "01dfac180005c5a5efc88d2c37f880320e1764b83dd3a35006690e1ed7da68d7", ) - digest, err := d.ConfigDigest(testConfig) + digest, err := d.ConfigDigest(ctx, testConfig) assert.NoError(t, err) assert.Equal(t, "00047843e1622a4462e1209c9f8559ba43cbf43bf238da490f3b9c8e33f3419e", digest.Hex()) } func TestConfigDigester_InvalidChainID(t *testing.T) { + ctx := tests.Context(t) d := ocr2.NewOffchainConfigDigester( strings.Repeat("a", 256), // chain ID is too long "42c59a00fd21bdc27c7be3e9cc272a9b684037e4a37417c2d5a920081e6e87c", ) - _, err := d.ConfigDigest(testConfig) + _, err := d.ConfigDigest(ctx, testConfig) assert.Error(t, err, "chainID") } diff --git a/relayer/pkg/chainlink/ocr2/contract_transmitter.go b/relayer/pkg/chainlink/ocr2/contract_transmitter.go index b93975d9..89cfd4ba 100644 --- a/relayer/pkg/chainlink/ocr2/contract_transmitter.go +++ b/relayer/pkg/chainlink/ocr2/contract_transmitter.go @@ -119,6 +119,6 @@ func (c *contractTransmitter) LatestConfigDigestAndEpoch( return } -func (c *contractTransmitter) FromAccount() (types.Account, error) { +func (c *contractTransmitter) FromAccount(ctx context.Context) (types.Account, error) { return types.Account(c.accountAddress.String()), nil } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig.go b/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig.go index 1f86e055..47a5b025 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig.go @@ -1,6 +1,7 @@ package medianreport import ( + "context" "fmt" "math/big" @@ -42,7 +43,7 @@ func (codec OnchainConfigCodec) DecodeToFelts(b []byte) ([]*big.Int, error) { } // Decode converts the onchainconfig via the outputs of DecodeToFelts into unsigned big.Ints that libocr expects -func (codec OnchainConfigCodec) Decode(b []byte) (median.OnchainConfig, error) { +func (codec OnchainConfigCodec) Decode(ctx context.Context, b []byte) (median.OnchainConfig, error) { felts, err := codec.DecodeToFelts(b) if err != nil { return median.OnchainConfig{}, err @@ -81,6 +82,6 @@ func (codec OnchainConfigCodec) EncodeFromFelt(version, min, max *big.Int) ([]by } // Encode takes the interface that libocr uses (big.Ints) and serializes it into 3 felts -func (codec OnchainConfigCodec) Encode(c median.OnchainConfig) ([]byte, error) { +func (codec OnchainConfigCodec) Encode(ctx context.Context, c median.OnchainConfig) ([]byte, error) { return codec.EncodeFromFelt(big.NewInt(OnchainConfigVersion), c.Min, c.Max) } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig_test.go b/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig_test.go index 9591c1c2..1b0b8c0e 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig_test.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/onchainconfig_test.go @@ -7,6 +7,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestOnchainConfigCodec(t *testing.T) { @@ -46,15 +48,16 @@ func TestOnchainConfigCodec(t *testing.T) { for _, p := range params { t.Run(p.name, func(t *testing.T) { + ctx := tests.Context(t) cfg := median.OnchainConfig{ Min: p.val[0], Max: p.val[1], } - configBytes, err := codec.Encode(cfg) + configBytes, err := codec.Encode(ctx, cfg) require.NoError(t, err) - newCfg, err := codec.Decode(configBytes) + newCfg, err := codec.Decode(ctx, configBytes) if p.expectErr { assert.Error(t, err) return // exit func if error is verified @@ -67,15 +70,17 @@ func TestOnchainConfigCodec(t *testing.T) { } t.Run("incorrect length", func(t *testing.T) { + ctx := tests.Context(t) b := make([]byte, length-1) - _, err := codec.Decode(b) + _, err := codec.Decode(ctx, b) assert.Error(t, err) }) t.Run("incorrect version", func(t *testing.T) { + ctx := tests.Context(t) b := make([]byte, length) b[0] = 1 - _, err := codec.Decode(b) + _, err := codec.Decode(ctx, b) assert.Error(t, err) }) } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/report.go b/relayer/pkg/chainlink/ocr2/medianreport/report.go index ffb7364b..77b524d4 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/report.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/report.go @@ -1,6 +1,7 @@ package medianreport import ( + "context" "errors" "fmt" "math" @@ -31,7 +32,7 @@ var ( type ReportCodec struct{} -func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types.Report, error) { +func (c ReportCodec) BuildReport(ctx context.Context, oo []median.ParsedAttributedObservation) (types.Report, error) { num := len(oo) if num == 0 { return nil, errors.New("couldn't build report from empty attributed observations") @@ -112,7 +113,7 @@ func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types return report, nil } -func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { +func (c ReportCodec) MedianFromReport(ctx context.Context, report types.Report) (*big.Int, error) { rLen := len(report) if rLen < prefixSizeBytes+juelsPerFeeCoinSizeBytes+gasPriceSizeBytes { return nil, errors.New("invalid report length") @@ -160,7 +161,7 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { return oo[n/2], nil } -func (c ReportCodec) MaxReportLength(n int) (int, error) { +func (c ReportCodec) MaxReportLength(ctx context.Context, n int) (int, error) { return prefixSizeBytes + (n * observationSizeBytes) + juelsPerFeeCoinSizeBytes + gasPriceSizeBytes, nil } diff --git a/relayer/pkg/chainlink/ocr2/medianreport/report_fuzz_test.go b/relayer/pkg/chainlink/ocr2/medianreport/report_fuzz_test.go index 1adb3c34..fb3fb725 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/report_fuzz_test.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/report_fuzz_test.go @@ -11,12 +11,15 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) // go test -tags=go1.18 -fuzz ./... func FuzzReportCodecMedianFromReport(f *testing.F) { + ctx := tests.Context(f) cdc := ReportCodec{} - report, err := cdc.BuildReport([]median.ParsedAttributedObservation{ + report, err := cdc.BuildReport(ctx, []median.ParsedAttributedObservation{ {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(10), JuelsPerFeeCoin: big.NewInt(100000), GasPriceSubunits: big.NewInt(100000)}, {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(10), JuelsPerFeeCoin: big.NewInt(200000), GasPriceSubunits: big.NewInt(200000)}, {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(11), JuelsPerFeeCoin: big.NewInt(300000), GasPriceSubunits: big.NewInt(300000)}, @@ -26,10 +29,11 @@ func FuzzReportCodecMedianFromReport(f *testing.F) { // Seed with valid report f.Add([]byte(report)) f.Fuzz(func(t *testing.T, report []byte) { - med, err := cdc.MedianFromReport(report) + ctx := tests.Context(t) + med, err := cdc.MedianFromReport(ctx, report) if err == nil { // Should always be able to build a report from the medians extracted - _, err = cdc.BuildReport([]median.ParsedAttributedObservation{{Timestamp: uint32(time.Now().Unix()), Value: med, JuelsPerFeeCoin: med, GasPriceSubunits: med}}) + _, err = cdc.BuildReport(ctx, []median.ParsedAttributedObservation{{Timestamp: uint32(time.Now().Unix()), Value: med, JuelsPerFeeCoin: med, GasPriceSubunits: med}}) require.NoError(t, err) } }) diff --git a/relayer/pkg/chainlink/ocr2/medianreport/report_test.go b/relayer/pkg/chainlink/ocr2/medianreport/report_test.go index 9bef6615..1a0670d2 100644 --- a/relayer/pkg/chainlink/ocr2/medianreport/report_test.go +++ b/relayer/pkg/chainlink/ocr2/medianreport/report_test.go @@ -13,9 +13,12 @@ import ( "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestBuildReportWithNegativeValues(t *testing.T) { + ctx := tests.Context(t) c := ReportCodec{} oo := []median.ParsedAttributedObservation{} @@ -27,7 +30,7 @@ func TestBuildReportWithNegativeValues(t *testing.T) { Observer: commontypes.OracleID(1), }) - _, err := c.BuildReport(oo) + _, err := c.BuildReport(ctx, oo) assert.ErrorContains(t, err, "starknet does not support negative values: value = (-10), fee = (10), gas = (10)") oo = []median.ParsedAttributedObservation{} @@ -39,7 +42,7 @@ func TestBuildReportWithNegativeValues(t *testing.T) { Observer: commontypes.OracleID(1), }) - _, err = c.BuildReport(oo) + _, err = c.BuildReport(ctx, oo) assert.ErrorContains(t, err, "starknet does not support negative values: value = (10), fee = (-10), gas = (10)") oo = []median.ParsedAttributedObservation{} @@ -51,11 +54,12 @@ func TestBuildReportWithNegativeValues(t *testing.T) { Observer: commontypes.OracleID(1), }) - _, err = c.BuildReport(oo) + _, err = c.BuildReport(ctx, oo) assert.ErrorContains(t, err, "starknet does not support negative values: value = (10), fee = (10), gas = (-10)") } func TestBuildReportNoObserversOverflow(t *testing.T) { + ctx := tests.Context(t) c := ReportCodec{} oo := []median.ParsedAttributedObservation{} fmt.Println("hello") @@ -73,7 +77,7 @@ func TestBuildReportNoObserversOverflow(t *testing.T) { }) } - report, err := c.BuildReport(oo) + report, err := c.BuildReport(ctx, oo) assert.Nil(t, err) index := timestampSizeBytes @@ -85,6 +89,7 @@ func TestBuildReportNoObserversOverflow(t *testing.T) { } func TestBuildReport(t *testing.T) { + ctx := tests.Context(t) c := ReportCodec{} oo := []median.ParsedAttributedObservation{} @@ -110,7 +115,7 @@ func TestBuildReport(t *testing.T) { observers[i+1] = uint8(i) } - report, err := c.BuildReport(oo) + report, err := c.BuildReport(ctx, oo) assert.NoError(t, err) // validate length @@ -153,9 +158,10 @@ type medianTest struct { } func TestMedianFromReport(t *testing.T) { + ctx := tests.Context(t) cdc := ReportCodec{} // Requires at least one obs - _, err := cdc.BuildReport(nil) + _, err := cdc.BuildReport(ctx, nil) require.Error(t, err) var tt = []medianTest{ { @@ -191,6 +197,7 @@ func TestMedianFromReport(t *testing.T) { for _, tc := range tt { tc := tc t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) var pos []median.ParsedAttributedObservation for i, obs := range tc.obs { pos = append(pos, median.ParsedAttributedObservation{ @@ -200,12 +207,12 @@ func TestMedianFromReport(t *testing.T) { Observer: commontypes.OracleID(uint8(i))}, ) } - report, err := cdc.BuildReport(pos) + report, err := cdc.BuildReport(ctx, pos) require.NoError(t, err) - max, err := cdc.MaxReportLength(len(tc.obs)) + max, err := cdc.MaxReportLength(ctx, len(tc.obs)) require.NoError(t, err) assert.Equal(t, len(report), max) - med, err := cdc.MedianFromReport(report) + med, err := cdc.MedianFromReport(ctx, report) require.NoError(t, err) assert.Equal(t, tc.expectedMedian.String(), med.String()) }) diff --git a/relayer/pkg/chainlink/relay.go b/relayer/pkg/chainlink/relay.go index 8ef911bb..a9e984ae 100644 --- a/relayer/pkg/chainlink/relay.go +++ b/relayer/pkg/chainlink/relay.go @@ -5,9 +5,9 @@ import ( "encoding/json" "errors" "fmt" + "math/big" "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/services" relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/core" @@ -18,17 +18,15 @@ import ( var _ relaytypes.Relayer = (*relayer)(nil) //nolint:staticcheck type relayer struct { - chain starkchain.Chain - stopCh services.StopChan + chain starkchain.Chain lggr logger.Logger } func NewRelayer(lggr logger.Logger, chain starkchain.Chain, capRegistry core.CapabilitiesRegistry) *relayer { return &relayer{ - chain: chain, - stopCh: make(chan struct{}), - lggr: lggr, + chain: chain, + lggr: logger.Named(lggr, "Relayer"), } } @@ -41,7 +39,6 @@ func (r *relayer) Start(context.Context) error { } func (r *relayer) Close() error { - close(r.stopCh) return nil } @@ -59,11 +56,23 @@ func (r *relayer) NewChainWriter(_ context.Context, _ []byte) (relaytypes.ChainW return nil, errors.New("chain writer is not supported for starknet") } -func (r *relayer) NewContractReader(_ []byte) (relaytypes.ContractReader, error) { +func (r *relayer) NewContractReader(ctx context.Context, _ []byte) (relaytypes.ContractReader, error) { return nil, errors.New("contract reader is not supported for starknet") } -func (r *relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { +func (r *relayer) GetChainStatus(ctx context.Context) (relaytypes.ChainStatus, error) { + return r.chain.GetChainStatus(ctx) +} + +func (r *relayer) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []relaytypes.NodeStatus, nextPageToken string, total int, err error) { + return r.chain.ListNodeStatuses(ctx, pageSize, pageToken) +} + +func (r *relayer) Transact(ctx context.Context, from, to string, amount *big.Int, balanceCheck bool) error { + return r.chain.Transact(ctx, from, to, amount, balanceCheck) +} + +func (r *relayer) NewConfigProvider(ctx context.Context, args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { var relayConfig RelayConfig err := json.Unmarshal(args.RelayConfig, &relayConfig) @@ -83,7 +92,7 @@ func (r *relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.Confi return configProvider, nil } -func (r *relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { +func (r *relayer) NewMedianProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { var relayConfig RelayConfig err := json.Unmarshal(rargs.RelayConfig, &relayConfig) @@ -108,34 +117,34 @@ func (r *relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes return medianProvider, nil } -func (r *relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { +func (r *relayer) NewMercuryProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { return nil, errors.New("mercury is not supported for starknet") } -func (r *relayer) NewLLOProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.LLOProvider, error) { +func (r *relayer) NewLLOProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.LLOProvider, error) { return nil, errors.New("data streams is not supported for starknet") } -func (r *relayer) NewFunctionsProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { +func (r *relayer) NewFunctionsProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { return nil, errors.New("functions are not supported for solana") } -func (r *relayer) NewAutomationProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.AutomationProvider, error) { +func (r *relayer) NewAutomationProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.AutomationProvider, error) { return nil, errors.New("automation is not supported for starknet") } -func (r *relayer) NewPluginProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.PluginProvider, error) { +func (r *relayer) NewPluginProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.PluginProvider, error) { return nil, errors.New("plugin provider is not supported for starknet") } -func (r *relayer) NewOCR3CapabilityProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.OCR3CapabilityProvider, error) { +func (r *relayer) NewOCR3CapabilityProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.OCR3CapabilityProvider, error) { return nil, errors.New("ocr3 capability provider is not supported for starknet") } -func (r *relayer) NewCCIPCommitProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPCommitProvider, error) { +func (r *relayer) NewCCIPCommitProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPCommitProvider, error) { return nil, errors.New("ccip.commit is not supported for starknet") } -func (r *relayer) NewCCIPExecProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPExecProvider, error) { +func (r *relayer) NewCCIPExecProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPExecProvider, error) { return nil, errors.New("ccip.exec is not supported for starknet") } diff --git a/relayer/pkg/chainlink/txm/txm.go b/relayer/pkg/chainlink/txm/txm.go index 37613676..2469cadc 100644 --- a/relayer/pkg/chainlink/txm/txm.go +++ b/relayer/pkg/chainlink/txm/txm.go @@ -59,7 +59,7 @@ type starktxm struct { func New(lggr logger.Logger, keystore loop.Keystore, cfg Config, getClient func() (*starknet.Client, error), getFeederClient func() (*starknet.FeederClient, error)) (StarkTXM, error) { txm := &starktxm{ - lggr: logger.Named(lggr, "StarknetTxm"), + lggr: logger.Named(lggr, "Txm"), queue: make(chan Tx, MaxQueueLen), stop: make(chan struct{}), client: utils.NewLazyLoad(getClient), @@ -77,7 +77,7 @@ func (txm *starktxm) Name() string { } func (txm *starktxm) Start(ctx context.Context) error { - return txm.starter.StartOnce("starktxm", func() error { + return txm.starter.StartOnce("Txm", func() error { txm.done.Add(2) // waitgroup: broadcast loop and confirm loop go txm.broadcastLoop() go txm.confirmLoop() @@ -464,7 +464,7 @@ func (txm *starktxm) resyncNonce(ctx context.Context, client *starknet.Client, a } func (txm *starktxm) Close() error { - return txm.starter.StopOnce("starktxm", func() error { + return txm.starter.StopOnce("Txm", func() error { close(txm.stop) txm.done.Wait() return nil