diff --git a/integration-tests/client/mercury_server.go b/integration-tests/client/mercury_server.go index 1caaa6900ea..207d5c8ab3d 100644 --- a/integration-tests/client/mercury_server.go +++ b/integration-tests/client/mercury_server.go @@ -12,12 +12,14 @@ type GetReportsResult struct { } type MercuryServer struct { + URL string APIClient *resty.Client } func NewMercuryServer(url string) *MercuryServer { rc := resty.New().SetBaseURL(url) return &MercuryServer{ + URL: url, APIClient: rc, } } diff --git a/integration-tests/go.mod b/integration-tests/go.mod index efa610e18d6..7eae8e31a9c 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -14,7 +14,7 @@ require ( github.com/slack-go/slack v0.12.1 github.com/smartcontractkit/chainlink v1.10.0 github.com/smartcontractkit/chainlink-env v0.3.16 - github.com/smartcontractkit/chainlink-testing-framework v1.10.8-0.20230227214757-a2ed28830a3a + github.com/smartcontractkit/chainlink-testing-framework v1.10.9-0.20230301123015-fa17d1a4dc61 github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407 github.com/smartcontractkit/ocr2keepers v0.6.14 github.com/smartcontractkit/ocr2vrf v0.0.0-20230221012516-b4187fdffa0c @@ -24,6 +24,7 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/sync v0.1.0 gopkg.in/guregu/null.v4 v4.0.0 + nhooyr.io/websocket v1.8.7 ) require ( @@ -35,6 +36,7 @@ require ( github.com/NethermindEth/juno v0.0.0-20220630151419-cbd368b222ac // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/aws/constructs-go/constructs/v10 v10.1.255 // indirect github.com/aws/jsii-runtime-go v1.75.0 // indirect github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect @@ -92,9 +94,9 @@ require ( github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/goccy/go-json v0.9.11 // indirect - github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/googleapis v1.1.0 // indirect github.com/gogo/protobuf v1.3.3 // indirect - github.com/gogo/status v1.1.0 // indirect + github.com/gogo/status v1.0.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect @@ -273,12 +275,12 @@ require ( github.com/tidwall/pretty v1.2.0 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect - github.com/uber/jaeger-client-go v2.28.0+incompatible // indirect + github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect github.com/uber/jaeger-lib v2.2.0+incompatible // indirect github.com/ugorji/go/codec v1.2.7 // indirect github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect github.com/valyala/fastjson v1.4.1 // indirect - github.com/weaveworks/common v0.0.0-20230208133027-16871410fca4 // indirect + github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9 // indirect github.com/weaveworks/promrus v1.2.0 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect @@ -292,6 +294,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/goleak v1.2.0 // indirect go.uber.org/multierr v1.9.0 // indirect + go.uber.org/ratelimit v0.2.0 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect @@ -306,7 +309,7 @@ require ( gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect gonum.org/v1/gonum v0.12.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 // indirect + google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect google.golang.org/grpc v1.49.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f3a8a36d0c4..c9c169748cd 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -466,6 +466,7 @@ github.com/gin-contrib/sessions v0.0.5/go.mod h1:vYAuaUPqie3WUSsft6HUlCjlwwoJQs9 github.com/gin-contrib/size v0.0.0-20220707104239-f5a650759656 h1:IxCENnXjmppSWzMedenibLt8tvKg4b7kQ7lTGjGjsgw= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -580,10 +581,13 @@ github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7 github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= @@ -623,8 +627,11 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -636,13 +643,10 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/status v1.0.3 h1:WkVBY59mw7qUNTr/bLwO7J2vesJ0rQ2C3tMXrTd3w5M= github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= -github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= @@ -1069,6 +1073,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= @@ -1107,6 +1112,7 @@ github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6Fm github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a h1:dHCfT5W7gghzPtfsW488uPmEOm85wewI+ypUwibyTdU= github.com/leanovate/gopter v0.2.10-0.20210127095200-9abe2343507a/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= @@ -1790,8 +1796,8 @@ github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230221200635-404a44389f85 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230221200929-d415eda78bff h1:132GK++RRDRTSNCkxjasyoQ4JVDpFIty1Tz3waho+rQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230223033525-5be75fb81118 h1:Srn9VdZq4xYuFWm96AvzmYTvg8Q7P3Eu7ztdVxtZsrU= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230223033525-5be75fb81118/go.mod h1:UPMx1+qH6/T+6DMf3x3ReiD2EJuQOuaG5iIUUPEKL9U= -github.com/smartcontractkit/chainlink-testing-framework v1.10.8-0.20230227214757-a2ed28830a3a h1:5Y12I9R5Kbgj6HBrtUzc4fO7IEadB/lPQwEcOYz1eVg= -github.com/smartcontractkit/chainlink-testing-framework v1.10.8-0.20230227214757-a2ed28830a3a/go.mod h1:De70yRgSL/XwLu/nkC65WSbdXLUF0mcZA5sNY/OMYkA= +github.com/smartcontractkit/chainlink-testing-framework v1.10.9-0.20230301123015-fa17d1a4dc61 h1:gHU9G2SGqY76Xkbsp1l4AtcFh/mFASbo9TIESE4f0So= +github.com/smartcontractkit/chainlink-testing-framework v1.10.9-0.20230301123015-fa17d1a4dc61/go.mod h1:/N2uivJAgULuhNXXbLL3eVlGjE7QcmmEkzo2svEbWzo= github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407 h1:P3dhh6UkjA6Fxj39y4vQflv7GoDCa+QC/Du7CCDxjfQ= github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/smartcontractkit/ocr2keepers v0.6.14 h1:Rg+SYd8PCyd4CcCetwnRKjVEQsHVsV6QOaWcLhi+6sg= @@ -1909,9 +1915,8 @@ github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-client-go v2.20.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.24.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.28.0+incompatible h1:G4QSBfvPKvg5ZM2j9MrJFdfI5iSljY/WnJqOGFao6HI= -github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v1.5.1-0.20181102163054-1fc5c315e03c/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= @@ -2562,7 +2567,6 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180608181217-32ee49c4dd80/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -2635,8 +2639,8 @@ google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 h1:4SPz2GL2CXJt28MTF8V6Ap/9ZiVbQlJeGSd9qtA7DLs= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -2767,6 +2771,8 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= +nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/integration-tests/load/http_gun.go b/integration-tests/load/http_gun.go new file mode 100644 index 00000000000..cb924d62e1c --- /dev/null +++ b/integration-tests/load/http_gun.go @@ -0,0 +1,68 @@ +package load + +import ( + "fmt" + "sync/atomic" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink-testing-framework/loadgen" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" +) + +var ReportTypes = GetReportTypes() + +func mustNewType(t string) abi.Type { + result, err := abi.NewType(t, "", []abi.ArgumentMarshaling{}) + if err != nil { + panic(fmt.Sprintf("Unexpected error during abi.NewType: %s", err)) + } + return result +} + +func GetReportTypes() abi.Arguments { + return []abi.Argument{ + {Name: "feedId", Type: mustNewType("bytes32")}, + {Name: "observationsTimestamp", Type: mustNewType("uint32")}, + {Name: "observationsBlocknumber", Type: mustNewType("uint64")}, + {Name: "median", Type: mustNewType("int192")}, + } +} + +type MercuryHTTPGun struct { + BaseURL string + client *client.MercuryServer + netclient blockchain.EVMClient + feedID string + bn atomic.Uint64 +} + +func NewHTTPGun(baseURL string, client *client.MercuryServer, feedID string, bn uint64) *MercuryHTTPGun { + g := &MercuryHTTPGun{ + BaseURL: baseURL, + client: client, + feedID: feedID, + } + g.bn.Store(bn) + return g +} + +// Call implements example gun call, assertions on response bodies should be done here +func (m *MercuryHTTPGun) Call(l *loadgen.Generator) loadgen.CallResult { + answer, res, err := m.client.GetReports(m.feedID, m.bn.Load()) + if err != nil { + return loadgen.CallResult{Error: "connection error"} + } + if res.Status != "200 OK" { + return loadgen.CallResult{Error: "not 200"} + } + reportElements := map[string]interface{}{} + if err = ReportTypes.UnpackIntoMap(reportElements, []byte(answer.ChainlinkBlob)); err != nil { + return loadgen.CallResult{Error: "blob unpacking error"} + } + if err := testsetups.ValidateReport(reportElements); err != nil { + return loadgen.CallResult{Error: "report validation error"} + } + return loadgen.CallResult{} +} diff --git a/integration-tests/load/mercury_test.go b/integration-tests/load/mercury_test.go new file mode 100644 index 00000000000..058f66f833a --- /dev/null +++ b/integration-tests/load/mercury_test.go @@ -0,0 +1,146 @@ +package load + +import ( + "context" + "os" + "testing" + "time" + + "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink-env/environment" + mercuryserver "github.com/smartcontractkit/chainlink-env/pkg/helm/mercury-server" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + "github.com/smartcontractkit/chainlink-testing-framework/loadgen" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" + "github.com/stretchr/testify/require" +) + +const ( + mercuryFeedID = "mock-feed" +) + +var ( + dbSettings = map[string]interface{}{ + "stateful": "true", + "capacity": "10Gi", + "resources": map[string]interface{}{ + "limits": map[string]interface{}{ + "cpu": "2000m", + "memory": "2048Mi", + }, + }, + } + + serverResources = map[string]interface{}{ + "limits": map[string]interface{}{ + "cpu": "2000m", + "memory": "2048Mi", + }, + } +) + +func setupMercuryLoadEnv( + t *testing.T, + feedID string, + dbSettings map[string]interface{}, + serverResources map[string]interface{}, +) (*environment.Environment, *client.MercuryServer, blockchain.EVMClient, uint64) { + env, isExistingTestEnv, testNetwork, chainlinkNodes, + mercuryServerRemoteUrl, + evmClient, mockServerClient, mercuryServerClient, msRpcPubKey := testsetups.SetupMercuryEnv(t, dbSettings, serverResources) + _ = isExistingTestEnv + + nodesWithoutBootstrap := chainlinkNodes[1:] + ocrConfig := testsetups.BuildMercuryOCR2Config(t, nodesWithoutBootstrap) + verifier, _, _, _ := testsetups.SetupMercuryContracts(t, evmClient, + mercuryServerRemoteUrl, feedID, ocrConfig) + + testsetups.SetupMercuryNodeJobs(t, chainlinkNodes, mockServerClient, verifier.Address(), + feedID, msRpcPubKey, testNetwork.ChainID, 0) + + err := verifier.SetConfig(ocrConfig) + require.NoError(t, err) + + // Wait for the DON to start generating reports + d := 160 * time.Second + log.Info().Msgf("Sleeping for %s to wait for Mercury env to be ready..", d) + time.Sleep(d) + + latestBlockNum, err := evmClient.LatestBlockNumber(context.Background()) + require.NoError(t, err, "Err getting latest block number") + report, _, err := mercuryServerClient.GetReports(feedID, latestBlockNum-5) + require.NoError(t, err, "Error getting report from Mercury Server") + require.NotEmpty(t, report.ChainlinkBlob, "Report response does not contain chainlinkBlob") + return env, mercuryServerClient, evmClient, latestBlockNum +} + +func TestMercuryHTTPLoad(t *testing.T) { + env, msClient, evmClient, latestBlockNumber := setupMercuryLoadEnv(t, mercuryFeedID, dbSettings, serverResources) + + gun := NewHTTPGun(env.URLs[mercuryserver.URLsKey][1], msClient, mercuryFeedID, latestBlockNumber) + go func() { + for { + time.Sleep(5 * time.Second) + bn, _ := evmClient.LatestBlockNumber(context.Background()) + log.Warn().Uint64("Block number", bn).Send() + gun.bn.Store(bn - 5) + } + }() + gen, err := loadgen.NewLoadGenerator(&loadgen.LoadGeneratorConfig{ + T: t, + LokiConfig: ctfClient.NewDefaultLokiConfig( + os.Getenv("LOKI_URL"), + os.Getenv("LOKI_TOKEN")), + Labels: map[string]string{ + "test_group": "stress", + "cluster": "sdlc", + "app": "mercury-server", + "namespace": env.Cfg.Namespace, + "test_id": "http", + }, + Duration: 1200 * time.Second, + Schedule: &loadgen.LoadSchedule{ + Type: loadgen.RPSScheduleType, + StartFrom: 10, + Increase: 5, + StageInterval: 20 * time.Second, + Limit: 1000, + }, + Gun: gun, + }) + require.NoError(t, err) + gen.Run() + _, _ = gen.Wait() +} + +func TestMercuryWSLoad(t *testing.T) { + env, msClient, _, _ := setupMercuryLoadEnv(t, mercuryFeedID, dbSettings, serverResources) + + gen, err := loadgen.NewLoadGenerator(&loadgen.LoadGeneratorConfig{ + T: t, + LokiConfig: ctfClient.NewDefaultLokiConfig( + os.Getenv("LOKI_URL"), + os.Getenv("LOKI_TOKEN")), + Labels: map[string]string{ + "test_group": "stress", + "cluster": "sdlc", + "app": "mercury-server", + "namespace": env.Cfg.Namespace, + "test_id": "ws", + }, + Duration: 1200 * time.Second, + Schedule: &loadgen.LoadSchedule{ + Type: loadgen.InstancesScheduleType, + StartFrom: 10, + Increase: 20, + StageInterval: 10 * time.Second, + Limit: 500, + }, + Instance: NewWSInstance(msClient), + }) + require.NoError(t, err) + gen.Run() + _, _ = gen.Wait() +} diff --git a/integration-tests/load/ws_instance.go b/integration-tests/load/ws_instance.go new file mode 100644 index 00000000000..1e568092b26 --- /dev/null +++ b/integration-tests/load/ws_instance.go @@ -0,0 +1,78 @@ +package load + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink-testing-framework/loadgen" + "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" + "nhooyr.io/websocket" + "nhooyr.io/websocket/wsjson" +) + +type WSConfig struct { + TargetURl string +} + +type WSInstance struct { + srv *client.MercuryServer +} + +func NewWSInstance(srv *client.MercuryServer) *WSInstance { + return &WSInstance{ + srv: srv, + } +} + +// Run create an instance firing read requests against mock ws server +func (m *WSInstance) Run(l *loadgen.Generator) { + c, _, err := websocket.Dial(context.Background(), fmt.Sprintf("%s/ws", m.srv.URL), &websocket.DialOptions{ + HTTPHeader: http.Header{"Authorization": []string{"Basic Y2xpZW50OmNsaWVudHBhc3M="}}, + }) + if err != nil { + l.Log.Error().Err(err).Msg("failed to connect from instance") + //nolint + c.Close(websocket.StatusInternalError, "") + } + l.ResponsesWaitGroup.Add(1) + go func() { + defer l.ResponsesWaitGroup.Done() + for { + select { + case <-l.ResponsesCtx.Done(): + //nolint + c.Close(websocket.StatusNormalClosure, "") + return + default: + startedAt := time.Now() + v := map[string]string{} + err = wsjson.Read(context.Background(), c, &v) + if err != nil { + l.Log.Error().Err(err).Msg("failed read ws msg from instance") + l.ResponsesChan <- loadgen.CallResult{StartedAt: &startedAt, Failed: true, Error: "ws read error"} + } + log.Debug().Interface("Results", v).Msg("Report results") + if v["report"] == "" { + log.Error().Msg("report is empty") + continue + } + reportElements := map[string]interface{}{} + if err = ReportTypes.UnpackIntoMap(reportElements, []byte(v["report"])); err != nil { + l.Log.Error().Err(err).Msg("failed to unpack report") + l.ResponsesChan <- loadgen.CallResult{Error: "blob unpacking error"} + continue + } + if err := testsetups.ValidateReport(reportElements); err != nil { + l.ResponsesChan <- loadgen.CallResult{Error: "report validation error"} + continue + } + log.Debug().Interface("Report", reportElements).Msg("Decoded report") + l.ResponsesChan <- loadgen.CallResult{StartedAt: &startedAt} + } + } + }() +} diff --git a/integration-tests/smoke/mercury_test.go b/integration-tests/smoke/mercury_test.go index 1e6ce343510..0fa2c353dbc 100644 --- a/integration-tests/smoke/mercury_test.go +++ b/integration-tests/smoke/mercury_test.go @@ -100,9 +100,8 @@ func TestMercurySmoke(t *testing.T) { const mercuryFeedId = "ETH-USD-Optimism-Goerli-1" _, isExistingTestEnv, testNetwork, chainlinkNodes, - mercuryServerInternalUrl, mercuryServerRemoteUrl, - evmClient, mockServerClient, mercuryServerClient := testsetups.SetupMercuryEnv(t) - _ = mercuryServerClient + mercuryServerRemoteUrl, + evmClient, mockServerClient, mercuryServerClient, msRpcPubKey := testsetups.SetupMercuryEnv(t, nil, nil) _ = isExistingTestEnv nodesWithoutBootstrap := chainlinkNodes[1:] @@ -111,7 +110,7 @@ func TestMercurySmoke(t *testing.T) { mercuryServerRemoteUrl, mercuryFeedId, ocrConfig) testsetups.SetupMercuryNodeJobs(t, chainlinkNodes, mockServerClient, verifier.Address(), - mercuryFeedId, mercuryServerInternalUrl, testNetwork.ChainID, 0) + mercuryFeedId, msRpcPubKey, testNetwork.ChainID, 0) verifier.SetConfig(ocrConfig) diff --git a/integration-tests/testsetups/mercury.go b/integration-tests/testsetups/mercury.go index 5bcc59dec4d..a984d7c4fb1 100644 --- a/integration-tests/testsetups/mercury.go +++ b/integration-tests/testsetups/mercury.go @@ -1,14 +1,20 @@ package testsetups import ( + "crypto/ed25519" + "crypto/rand" + "encoding/hex" + "encoding/json" "fmt" + "math/big" "os" "strings" "testing" "time" "github.com/lib/pq" - "github.com/rs/zerolog" + "github.com/pkg/errors" + "github.com/rs/zerolog/log" cl_env_config "github.com/smartcontractkit/chainlink-env/config" "github.com/smartcontractkit/chainlink-env/environment" "github.com/smartcontractkit/chainlink-env/pkg/helm/chainlink" @@ -19,11 +25,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" "github.com/smartcontractkit/chainlink-testing-framework/utils" - "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" - "github.com/stretchr/testify/require" - "go.uber.org/zap/zapcore" - "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink/core/services/job" "github.com/smartcontractkit/chainlink/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/core/store/models" @@ -32,12 +33,170 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/config" "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" + "gopkg.in/guregu/null.v4" ) -func SetupMercuryEnv(t *testing.T) ( - *environment.Environment, bool, blockchain.EVMNetwork, []*client.Chainlink, string, string, - blockchain.EVMClient, *ctfClient.MockserverClient, *client.MercuryServer) { - l := zerolog.New(zerolog.NewTestWriter(t)) +type csaKey struct { + NodeName string `json:"nodeName"` + NodeAddress string `json:"nodeAddress"` + PublicKey string `json:"publicKey"` +} + +type oracle struct { + Id string `json:"id"` + Website string `json:"website"` + Name string `json:"name"` + Status string `json:"status"` + NodeAddress []string `json:"nodeAddress"` + OracleAddress string `json:"oracleAddress"` + CsaKeys []csaKey `json:"csaKeys"` + Ocr2ConfigPublicKey []string `json:"ocr2ConfigPublicKey"` + Ocr2OffchainPublicKey []string `json:"ocr2OffchainPublicKey"` + Ocr2OnchainPublicKey []string `json:"ocr2OnchainPublicKey"` +} + +func ValidateReport(r map[string]interface{}) error { + feedIdInterface, ok := r["feedId"] + if !ok { + return errors.Errorf("unpacked report has no 'feedId'") + } + feedID, ok := feedIdInterface.([32]byte) + if !ok { + return errors.Errorf("cannot cast feedId to [32]byte, type is %T", feedID) + } + log.Trace().Str("FeedID", string(feedID[:])).Msg("Feed ID") + + priceInterface, ok := r["median"] + if !ok { + return errors.Errorf("unpacked report has no 'median'") + } + medianPrice, ok := priceInterface.(*big.Int) + if !ok { + return errors.Errorf("cannot cast median to *big.Int, type is %T", medianPrice) + } + log.Trace().Int64("Price", medianPrice.Int64()).Msg("Median price") + + observationsBlockNumberInterface, ok := r["observationsBlocknumber"] + if !ok { + return errors.Errorf("unpacked report has no 'observationsBlocknumber'") + } + observationsBlockNumber, ok := observationsBlockNumberInterface.(uint64) + if !ok { + return errors.Errorf("cannot cast observationsBlocknumber to uint64, type is %T", observationsBlockNumber) + } + log.Trace().Uint64("Block", observationsBlockNumber).Msg("Observation block number") + + observationsTimestampInterface, ok := r["observationsTimestamp"] + if !ok { + return errors.Errorf("unpacked report has no 'observationsTimestamp'") + } + observationsTimestamp, ok := observationsTimestampInterface.(uint32) + if !ok { + return errors.Errorf("cannot cast observationsTimestamp to uint32, type is %T", observationsTimestamp) + } + log.Trace().Uint32("Timestamp", observationsTimestamp).Msg("Observation timestamp") + + return nil +} + +func generateEd25519Keys() (string, string, error) { + var ( + err error + pub ed25519.PublicKey + priv ed25519.PrivateKey + ) + pub, priv, err = ed25519.GenerateKey(rand.Reader) + return hex.EncodeToString(priv), hex.EncodeToString(pub), err +} + +func SetupMercuryServer( + t *testing.T, + testEnv *environment.Environment, + dbSettings map[string]interface{}, + serverSettings map[string]interface{}, +) string { + chainlinkNodes, err := client.ConnectChainlinkNodes(testEnv) + require.NoError(t, err, "Error connecting to Chainlink nodes") + require.NoError(t, err, "Retreiving on-chain wallet addresses for chainlink nodes shouldn't fail") + + // Build rpc config for Mercury server + var msRpcNodesConf []*oracle + for i, chainlinkNode := range chainlinkNodes { + nodeName := fmt.Sprint(i) + nodeAddress, err := chainlinkNode.PrimaryEthAddress() + require.NoError(t, err) + csaKeys, resp, err := chainlinkNode.ReadCSAKeys() + require.NoError(t, err) + csaKeyId := csaKeys.Data[0].ID + ocr2Keys, resp, err := chainlinkNode.ReadOCR2Keys() + _ = ocr2Keys + _ = resp + require.NoError(t, err) + var ocr2Config client.OCR2KeyAttributes + for _, key := range ocr2Keys.Data { + if key.Attributes.ChainType == string(chaintype.EVM) { + ocr2Config = key.Attributes + break + } + } + ocr2ConfigPublicKey := strings.TrimPrefix(ocr2Config.ConfigPublicKey, "ocr2cfg_evm_") + ocr2OffchainPublicKey := strings.TrimPrefix(ocr2Config.OffChainPublicKey, "ocr2off_evm_") + ocr2OnchainPublicKey := strings.TrimPrefix(ocr2Config.OnChainPublicKey, "ocr2on_evm_") + + node := &oracle{ + Id: fmt.Sprint(i), + Name: nodeName, + Status: "active", + NodeAddress: []string{nodeAddress}, + OracleAddress: "0x0000000000000000000000000000000000000000", + CsaKeys: []csaKey{ + { + NodeName: nodeName, + NodeAddress: nodeAddress, + PublicKey: csaKeyId, + }, + }, + Ocr2ConfigPublicKey: []string{ocr2ConfigPublicKey}, + Ocr2OffchainPublicKey: []string{ocr2OffchainPublicKey}, + Ocr2OnchainPublicKey: []string{ocr2OnchainPublicKey}, + } + msRpcNodesConf = append(msRpcNodesConf, node) + } + rpcNodesJsonConf, _ := json.Marshal(msRpcNodesConf) + // result := []interface{}{} + // err = json.Unmarshal([]byte(msRpcNodesJsonConf), &result) + // err = mapstructure.Decode(msRpcNodesConf[0], &result) + + // Generate keys for Mercury RPC server + rpcPrivKey, rpcPubKey, err := generateEd25519Keys() + require.NoError(t, err) + + settings := map[string]interface{}{ + "imageRepo": os.Getenv("MERCURY_SERVER_IMAGE"), + "imageTag": os.Getenv("MERCURY_SERVER_TAG"), + "rpcPrivateKey": rpcPrivKey, + "rpcNodesConf": string(rpcNodesJsonConf), + "prometheus": "true", + } + + if dbSettings != nil { + settings["db"] = dbSettings + } + if serverSettings != nil { + settings["resources"] = serverSettings + } + + testEnv.AddHelm(mercury_server.New(settings)).Run() + + return rpcPubKey +} + +func SetupMercuryEnv(t *testing.T, dbSettings map[string]interface{}, serverResources map[string]interface{}) ( + *environment.Environment, bool, blockchain.EVMNetwork, []*client.Chainlink, string, + blockchain.EVMClient, *ctfClient.MockserverClient, *client.MercuryServer, string) { testNetwork := networks.SelectedNetwork evmConfig := eth.New(nil) if !testNetwork.Simulated { @@ -48,36 +207,34 @@ func SetupMercuryEnv(t *testing.T) ( }) } - mercuryServerInternalUrl := fmt.Sprintf("http://%s:3000", mercury_server.URLsKey) secretsToml := fmt.Sprintf("%s\n%s\n%s\n%s\n", "[[Mercury.Credentials]]", - fmt.Sprintf(`URL = "%s/reports"`, mercuryServerInternalUrl), + fmt.Sprintf(`URL = "%s"`, fmt.Sprintf("%s:1338", mercury_server.URLsKey)), `Username = "node"`, `Password = "nodepass"`, ) testEnvironment := environment.New(&environment.Config{ - // TTL: 1 * time.Hour, + TTL: 12 * time.Hour, NamespacePrefix: fmt.Sprintf("smoke-mercury-%s", strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-")), Test: t, }). AddHelm(mockservercfg.New(nil)). AddHelm(mockserver.New(nil)). AddHelm(evmConfig). - AddHelm(mercury_server.New(map[string]interface{}{ - "imageRepo": os.Getenv("MERCURY_SERVER_IMAGE"), - "imageTag": os.Getenv("MERCURY_SERVER_TAG"), - })). AddHelm(chainlink.New(0, map[string]interface{}{ "replicas": "5", "toml": client.AddNetworksConfig( config.BaseMercuryTomlConfig, testNetwork), "secretsToml": secretsToml, + "prometheus": "true", })) err := testEnvironment.Run() require.NoError(t, err, "Error running test environment") + msRpcPubKey := SetupMercuryServer(t, testEnvironment, dbSettings, serverResources) + chainlinkNodes, err := client.ConnectChainlinkNodes(testEnvironment) require.NoError(t, err, "Error connecting to Chainlink nodes") require.NoError(t, err, "Retreiving on-chain wallet addresses for chainlink nodes shouldn't fail") @@ -96,7 +253,7 @@ func SetupMercuryEnv(t *testing.T) ( t.Cleanup(func() { if isExistingTestEnv { - l.Info().Msg("Do not tear down existing environment") + log.Info().Msg("Do not tear down existing environment") } else { err := actions.TeardownSuite(t, testEnvironment, utils.ProjectRoot, chainlinkNodes, nil, zapcore.PanicLevel, evmClient) require.NoError(t, err, "Error tearing down environment") @@ -104,11 +261,10 @@ func SetupMercuryEnv(t *testing.T) ( }) return testEnvironment, isExistingTestEnv, testNetwork, chainlinkNodes, - mercuryServerInternalUrl, mercuryServerRemoteUrl, evmClient, mockserverClient, mercuryServerClient + mercuryServerRemoteUrl, evmClient, mockserverClient, mercuryServerClient, msRpcPubKey } func SetupMercuryContracts(t *testing.T, evmClient blockchain.EVMClient, mercuryRemoteUrl string, feedId string, ocrConfig contracts.OCRConfig) (contracts.Verifier, contracts.VerifierProxy, contracts.ReadAccessController, contracts.Exchanger) { - l := zerolog.New(zerolog.NewTestWriter(t)) contractDeployer, err := contracts.NewContractDeployer(evmClient) require.NoError(t, err, "Deploying contracts shouldn't fail") @@ -127,8 +283,8 @@ func SetupMercuryContracts(t *testing.T, evmClient blockchain.EVMClient, mercury verifier.SetConfig(ocrConfig) latestConfigDetails, err := verifier.LatestConfigDetails() require.NoError(t, err, "Error getting Verifier.LatestConfigDetails()") - l.Info().Msgf("Latest config digest: %x", latestConfigDetails.ConfigDigest) - l.Info().Msgf("Latest config details: %v", latestConfigDetails) + log.Info().Msgf("Latest config digest: %x", latestConfigDetails.ConfigDigest) + log.Info().Msgf("Latest config details: %v", latestConfigDetails) verifierProxy.InitializeVerifier(latestConfigDetails.ConfigDigest, verifier.Address()) @@ -141,11 +297,10 @@ func SetupMercuryNodeJobs( mockserverClient *ctfClient.MockserverClient, contractID string, feedID string, - mercuryServerUrl string, + mercuryServerPubKey string, chainID int64, keyIndex int, ) { - l := zerolog.New(zerolog.NewTestWriter(t)) err := mockserverClient.SetRandomValuePath("/variable") require.NoError(t, err, "Setting mockserver value path shouldn't fail") @@ -186,6 +341,11 @@ func SetupMercuryNodeJobs( require.NoError(t, err, "Shouldn't fail getting primary ETH address from OCR node %d", nodeIndex+1) nodeOCRKeys, err := chainlinkNodes[nodeIndex].MustReadOCR2Keys() require.NoError(t, err, "Shouldn't fail getting OCR keys from OCR node %d", nodeIndex+1) + csaKeys, _, err := chainlinkNodes[nodeIndex].ReadCSAKeys() + require.NoError(t, err) + csaKeyId := csaKeys.Data[0].ID + _ = csaKeyId + var nodeOCRKeyId []string for _, key := range nodeOCRKeys.Data { if key.Attributes.ChainType == string(chaintype.EVM) { @@ -199,7 +359,7 @@ func SetupMercuryNodeJobs( var feedIdBytes [32]byte copy(feedIdBytes[:], feedID) feedIdHex := fmt.Sprintf("0x%x", feedIdBytes) - l.Info().Msgf("Setup feedID, string: %s, hex: %s", feedID, feedIdHex) + log.Info().Msgf("Setup feedID, string: %s, hex: %s", feedID, feedIdHex) autoOCR2JobSpec := client.OCR2TaskJobSpec{ Name: "ocr2", @@ -219,8 +379,10 @@ func SetupMercuryNodeJobs( "chainID": int(chainID), }, RelayConfigMercuryConfig: map[string]interface{}{ - "feedID": feedIdHex, - "url": fmt.Sprintf("%s/reports", mercuryServerUrl), + "clientPrivKeyID": csaKeyId, + "serverPubKey": fmt.Sprintf("0x%s", mercuryServerPubKey), + "feedID": feedIdHex, + "url": fmt.Sprintf("%s:1338", mercury_server.URLsKey), }, ContractConfigTrackerPollInterval: *models.NewInterval(time.Second * 15), ContractID: contractID, // registryAddr @@ -234,7 +396,7 @@ func SetupMercuryNodeJobs( _, err = chainlinkNodes[nodeIndex].MustCreateJob(&autoOCR2JobSpec) require.NoError(t, err, "Shouldn't fail creating OCR Task job on OCR node %d", nodeIndex+1) } - l.Info().Msg("Done creating OCR automation jobs") + log.Info().Msg("Done creating OCR automation jobs") } func BuildMercuryOCR2Config(