From 8556332ff8429d547c3fbd441d0746135bbf5981 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Thu, 26 May 2022 09:04:39 -0400 Subject: [PATCH 01/26] Update geth version: 1.10.18 --- go.mod | 4 ++-- go.sum | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index aa292c91..d0861a24 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/vulcanize/ipld-eth-server/v3 go 1.15 require ( - github.com/ethereum/go-ethereum v1.10.17 + github.com/ethereum/go-ethereum v1.10.18 github.com/graph-gophers/graphql-go v1.3.0 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-cid v0.0.7 @@ -28,4 +28,4 @@ require ( github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1 +replace github.com/ethereum/go-ethereum v1.10.18 => github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 diff --git a/go.sum b/go.sum index 2118e8df..fcf03b6c 100644 --- a/go.sum +++ b/go.sum @@ -298,10 +298,12 @@ github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55k github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf h1:sh8rkQZavChcmakYiSlqu2425CHyFXLZZnvm7PDpU8M= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v1.6.2 h1:HlFGsy+9/xrgMmhmN+NGhCc5SHGJ7I+kHosRR1xc/aI= +github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200106141417-aaec0e7bde29/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= @@ -327,12 +329,14 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/ethereum/go-ethereum v1.9.11/go.mod h1:7oC0Ni6dosMv5pxMigm6s0hN8g4haJMBnqmmo0D9YfQ= +github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -354,6 +358,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/gabriel-vasile/mimetype v1.1.2/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/georgysavva/scany v0.2.9 h1:Xt6rjYpHnMClTm/g+oZTnoSxUwiln5GqMNU+QeLNHQU= @@ -608,8 +613,9 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204 h1:+EYBkW+dbi3F/atB+LSQZSWh7+HNrV3A/N0y6DSoy9k= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= +github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -997,6 +1003,7 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= @@ -1549,6 +1556,7 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -1838,8 +1846,8 @@ github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0 h1:hQcbewsJX5Xpd3xdE9n3J github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0/go.mod h1:CuuygZPciwwLV5vNY1LcIi0PZxXZbOmicw1/IkrPpPI= github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= -github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1 h1:BUIaiqqsWM61KfzIowqrGJ8TM2SWwmral4iJ/nhTSe0= -github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1/go.mod h1:mDwZX+QoWdqzQo6SDG3YVqCYACutcSG6uzpziMvTu28= +github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 h1:XgCj40pL5hADIl7ov4NpSK6MMFThUJrPuRnOSjEIae0= +github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1/go.mod h1:HelXH7UT1uWdb+St6UAj4pPf93GOggjIV7pVbrWIZ3o= github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 h1:gm+6SgxcNOCz6mgwvhsxORLXsr9yIFvbJDuoAK85ONs= github.com/vulcanize/ipfs-ethdb/v3 v3.0.1/go.mod h1:SPBTTl5CqRexYfkI66pbzE5nQziYpoQ+7hH0XveA9IU= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= @@ -2324,6 +2332,7 @@ golang.org/x/tools v0.0.0-20191114200427-caa0b0f7d508/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2602,7 +2611,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -- 2.45.2 From 4817674c5cf03f81bf74577f3fb729c31e37518e Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 14:06:38 -0400 Subject: [PATCH 02/26] Upgrade to Go18 and fix broken interfaces --- go.mod | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- go.sum | 208 +++------------------------------------------ 2 files changed, 273 insertions(+), 199 deletions(-) diff --git a/go.mod b/go.mod index d0861a24..edfc9c70 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/vulcanize/ipld-eth-server/v3 -go 1.15 +go 1.18 require ( github.com/ethereum/go-ethereum v1.10.18 @@ -15,7 +15,6 @@ require ( github.com/lib/pq v1.10.5 github.com/machinebox/graphql v0.2.2 github.com/mailgun/groupcache/v2 v2.3.0 - github.com/matryer/is v1.4.0 // indirect github.com/multiformats/go-multihash v0.1.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.19.0 @@ -23,9 +22,266 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 - github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0 + github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1 github.com/vulcanize/gap-filler v0.3.1 - github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 + github.com/vulcanize/ipfs-ethdb/v3 v3.0.2 +) + +require ( + bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc // indirect + github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect + github.com/Stebalien/go-bitfield v0.0.1 // indirect + github.com/VictoriaMetrics/fastcache v1.6.0 // indirect + github.com/benbjohnson/clock v1.1.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/btcsuite/btcd v0.22.1 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/cenkalti/backoff v2.2.1+incompatible // indirect + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cheekybits/genny v1.0.0 // indirect + github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect + github.com/cskr/pubsub v1.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect + github.com/deckarep/golang-set v1.8.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/deepmap/oapi-codegen v1.8.2 // indirect + github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect + github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/flynn/noise v1.0.0 // indirect + github.com/francoispqt/gojay v1.2.13 // indirect + github.com/friendsofgo/graphiql v0.2.2 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect + github.com/georgysavva/scany v0.2.9 // indirect + github.com/go-ole/go-ole v1.2.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.3.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/gopacket v1.1.19 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/graphql-go/graphql v0.7.9 // indirect + github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-bexpr v0.1.10 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/holiman/uint256 v1.2.0 // indirect + github.com/huin/goupnp v1.0.3 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/influxdata/influxdb v1.8.3 // indirect + github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect + github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect + github.com/ipfs/bbloom v0.0.4 // indirect + github.com/ipfs/go-bitswap v0.4.0 // indirect + github.com/ipfs/go-blockservice v0.1.7 // indirect + github.com/ipfs/go-cidutil v0.0.2 // indirect + github.com/ipfs/go-datastore v0.4.6 // indirect + github.com/ipfs/go-ds-measure v0.1.0 // indirect + github.com/ipfs/go-fetcher v1.5.0 // indirect + github.com/ipfs/go-filestore v1.0.0 // indirect + github.com/ipfs/go-fs-lock v0.0.7 // indirect + github.com/ipfs/go-graphsync v0.8.0 // indirect + github.com/ipfs/go-ipfs v0.10.0 // indirect + github.com/ipfs/go-ipfs-chunker v0.0.5 // indirect + github.com/ipfs/go-ipfs-config v0.16.0 // indirect + github.com/ipfs/go-ipfs-delay v0.0.1 // indirect + github.com/ipfs/go-ipfs-exchange-interface v0.0.1 // indirect + github.com/ipfs/go-ipfs-exchange-offline v0.0.1 // indirect + github.com/ipfs/go-ipfs-files v0.0.8 // indirect + github.com/ipfs/go-ipfs-keystore v0.0.2 // indirect + github.com/ipfs/go-ipfs-pinner v0.1.2 // indirect + github.com/ipfs/go-ipfs-posinfo v0.0.1 // indirect + github.com/ipfs/go-ipfs-pq v0.0.2 // indirect + github.com/ipfs/go-ipfs-provider v0.6.1 // indirect + github.com/ipfs/go-ipfs-routing v0.1.0 // indirect + github.com/ipfs/go-ipfs-util v0.0.2 // indirect + github.com/ipfs/go-ipld-cbor v0.0.5 // indirect + github.com/ipfs/go-ipld-legacy v0.1.0 // indirect + github.com/ipfs/go-ipns v0.1.2 // indirect + github.com/ipfs/go-log v1.0.5 // indirect + github.com/ipfs/go-log/v2 v2.3.0 // indirect + github.com/ipfs/go-merkledag v0.4.0 // indirect + github.com/ipfs/go-metrics-interface v0.0.1 // indirect + github.com/ipfs/go-mfs v0.1.2 // indirect + github.com/ipfs/go-namesys v0.3.1 // indirect + github.com/ipfs/go-path v0.1.2 // indirect + github.com/ipfs/go-peertaskqueue v0.4.0 // indirect + github.com/ipfs/go-unixfs v0.2.5 // indirect + github.com/ipfs/go-unixfsnode v1.1.3 // indirect + github.com/ipfs/go-verifcid v0.0.1 // indirect + github.com/ipfs/interface-go-ipfs-core v0.5.1 // indirect + github.com/ipld/go-codec-dagpb v1.3.0 // indirect + github.com/ipld/go-ipld-prime v0.12.2 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.10.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.1.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.8.1 // indirect + github.com/jackc/pgx/v4 v4.13.0 // indirect + github.com/jackc/puddle v1.1.3 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect + github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect + github.com/jbenet/goprocess v0.1.4 // indirect + github.com/jinzhu/copier v0.2.4 // indirect + github.com/klauspost/compress v1.11.7 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/koron/go-ssdp v0.0.2 // indirect + github.com/libp2p/go-addr-util v0.1.0 // indirect + github.com/libp2p/go-buffer-pool v0.0.2 // indirect + github.com/libp2p/go-cidranger v1.1.0 // indirect + github.com/libp2p/go-conn-security-multistream v0.2.1 // indirect + github.com/libp2p/go-doh-resolver v0.3.1 // indirect + github.com/libp2p/go-eventbus v0.2.1 // indirect + github.com/libp2p/go-flow-metrics v0.0.3 // indirect + github.com/libp2p/go-libp2p v0.15.0 // indirect + github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 // indirect + github.com/libp2p/go-libp2p-autonat v0.4.2 // indirect + github.com/libp2p/go-libp2p-blankhost v0.2.0 // indirect + github.com/libp2p/go-libp2p-circuit v0.4.0 // indirect + github.com/libp2p/go-libp2p-connmgr v0.2.4 // indirect + github.com/libp2p/go-libp2p-core v0.9.0 // indirect + github.com/libp2p/go-libp2p-discovery v0.5.1 // indirect + github.com/libp2p/go-libp2p-kad-dht v0.13.1 // indirect + github.com/libp2p/go-libp2p-kbucket v0.4.7 // indirect + github.com/libp2p/go-libp2p-loggables v0.1.0 // indirect + github.com/libp2p/go-libp2p-mplex v0.4.1 // indirect + github.com/libp2p/go-libp2p-nat v0.0.6 // indirect + github.com/libp2p/go-libp2p-noise v0.2.2 // indirect + github.com/libp2p/go-libp2p-peerstore v0.2.8 // indirect + github.com/libp2p/go-libp2p-pnet v0.2.0 // indirect + github.com/libp2p/go-libp2p-pubsub v0.5.4 // indirect + github.com/libp2p/go-libp2p-pubsub-router v0.4.0 // indirect + github.com/libp2p/go-libp2p-quic-transport v0.12.0 // indirect + github.com/libp2p/go-libp2p-record v0.1.3 // indirect + github.com/libp2p/go-libp2p-routing-helpers v0.2.3 // indirect + github.com/libp2p/go-libp2p-swarm v0.5.3 // indirect + github.com/libp2p/go-libp2p-tls v0.2.0 // indirect + github.com/libp2p/go-libp2p-transport-upgrader v0.4.6 // indirect + github.com/libp2p/go-libp2p-xor v0.0.0-20210714161855-5c005aca55db // indirect + github.com/libp2p/go-libp2p-yamux v0.5.4 // indirect + github.com/libp2p/go-maddr-filter v0.1.0 // indirect + github.com/libp2p/go-mplex v0.3.0 // indirect + github.com/libp2p/go-msgio v0.0.6 // indirect + github.com/libp2p/go-nat v0.0.5 // indirect + github.com/libp2p/go-netroute v0.1.6 // indirect + github.com/libp2p/go-openssl v0.0.7 // indirect + github.com/libp2p/go-reuseport v0.0.2 // indirect + github.com/libp2p/go-reuseport-transport v0.0.5 // indirect + github.com/libp2p/go-sockaddr v0.1.1 // indirect + github.com/libp2p/go-stream-muxer-multistream v0.3.0 // indirect + github.com/libp2p/go-tcp-transport v0.2.8 // indirect + github.com/libp2p/go-ws-transport v0.5.0 // indirect + github.com/libp2p/go-yamux/v2 v2.2.0 // indirect + github.com/libp2p/zeroconf/v2 v2.0.0 // indirect + github.com/lucas-clemente/quic-go v0.26.0 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect + github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect + github.com/marten-seemann/qtls-go1-18 v0.1.1 // indirect + github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect + github.com/matryer/is v1.4.0 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/miekg/dns v1.1.43 // indirect + github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect + github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect + github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect + github.com/minio/sha256-simd v1.0.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/pointerstructure v1.2.0 // indirect + github.com/mr-tron/base58 v1.2.0 // indirect + github.com/multiformats/go-base32 v0.0.3 // indirect + github.com/multiformats/go-base36 v0.1.0 // indirect + github.com/multiformats/go-multiaddr v0.4.0 // indirect + github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect + github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect + github.com/multiformats/go-multibase v0.0.3 // indirect + github.com/multiformats/go-multicodec v0.3.0 // indirect + github.com/multiformats/go-multistream v0.2.2 // indirect + github.com/multiformats/go-varint v0.0.6 // indirect + github.com/nxadm/tail v1.4.8 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect + github.com/pganalyze/pg_query_go/v2 v2.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.30.0 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/tsdb v0.7.1 // indirect + github.com/rjeczalik/notify v0.9.1 // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/segmentio/fasthash v1.0.3 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect + github.com/stretchr/objx v0.2.0 // indirect + github.com/stretchr/testify v1.7.1 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/thoas/go-funk v0.9.2 // indirect + github.com/tklauser/go-sysconf v0.3.5 // indirect + github.com/tklauser/numcpus v0.2.2 // indirect + github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect + github.com/valyala/fastjson v1.6.3 // indirect + github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect + github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect + github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect + github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect + github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 // indirect + github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect + github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect + go.opencensus.io v0.23.0 // indirect + go.opentelemetry.io/otel v0.20.0 // indirect + go.opentelemetry.io/otel/metric v0.20.0 // indirect + go.opentelemetry.io/otel/trace v0.20.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/dig v1.10.0 // indirect + go.uber.org/fx v1.13.1 // indirect + go.uber.org/multierr v1.7.0 // indirect + go.uber.org/zap v1.19.0 // indirect + go4.org v0.0.0-20200411211856-f5505b9728dd // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect + golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/urfave/cli.v1 v1.20.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + lukechampine.com/blake3 v1.1.6 // indirect ) replace github.com/ethereum/go-ethereum v1.10.18 => github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 diff --git a/go.sum b/go.sum index fcf03b6c..77943992 100644 --- a/go.sum +++ b/go.sum @@ -23,18 +23,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -42,13 +30,9 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -90,13 +74,10 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -130,9 +111,7 @@ github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1: github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -172,10 +151,8 @@ github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MR github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= @@ -211,8 +188,6 @@ github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuP github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= @@ -220,11 +195,7 @@ github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3h github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go/v2 v2.0.3 h1:ZA346ACHIZctef6trOTwBAEvPVm1k0uLm/bb2Atc+S8= @@ -291,7 +262,6 @@ github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70d github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= @@ -302,7 +272,6 @@ github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r github.com/docker/docker v1.6.2 h1:HlFGsy+9/xrgMmhmN+NGhCc5SHGJ7I+kHosRR1xc/aI= github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200106141417-aaec0e7bde29/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -323,19 +292,15 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/ethereum/go-ethereum v1.9.11/go.mod h1:7oC0Ni6dosMv5pxMigm6s0hN8g4haJMBnqmmo0D9YfQ= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -435,7 +400,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -455,7 +419,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -478,9 +441,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -492,7 +453,6 @@ github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -503,12 +463,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -520,10 +475,6 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -559,29 +510,20 @@ github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4n github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -598,12 +540,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= @@ -613,7 +551,6 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -837,7 +774,6 @@ github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvB github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= github.com/ipld/go-ipld-prime v0.12.2 h1:StIquYvKIRuSEAtjJDr39fyzBtziioHPwVC75tBiXzo= github.com/ipld/go-ipld-prime v0.12.2/go.mod h1:PaeLYq8k6dJLmDUSLrzkEpoGV4PEfe/1OtFN/eALOc8= -github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -863,7 +799,6 @@ github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5W github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= @@ -889,7 +824,6 @@ github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJs github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= github.com/jackc/pgtype v1.8.1 h1:9k0IXtdJXHJbyAWQgbWr1lU+MEhPXZz6RIXxfR5oxXs= github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= @@ -952,7 +886,6 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= @@ -976,7 +909,6 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -1331,7 +1263,6 @@ github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZ github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= @@ -1343,8 +1274,9 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lucas-clemente/quic-go v0.21.2/go.mod h1:vF5M1XqhBAHgbjKcJOXY3JZz3GP0T3FQhz/uyOUS38Q= -github.com/lucas-clemente/quic-go v0.23.0 h1:5vFnKtZ6nHDFsc/F3uuiF4T3y/AXaQdxjUqiVw26GZE= github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= +github.com/lucas-clemente/quic-go v0.26.0 h1:ALBQXr9UJ8A1LyzvceX4jd9QFsHvlI0RR6BkV16o00A= +github.com/lucas-clemente/quic-go v0.26.0/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/machinebox/graphql v0.2.2 h1:dWKpJligYKhYKO5A2gvNhkJdQMNZeChZYyBbrZkBZfo= @@ -1364,11 +1296,15 @@ github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0a github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.5/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= +github.com/marten-seemann/qtls-go1-16 v0.1.5 h1:o9JrYPPco/Nukd/HpOHMHZoBDXQqoNtUCmny98/1uqQ= +github.com/marten-seemann/qtls-go1-16 v0.1.5/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= -github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk= github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= +github.com/marten-seemann/qtls-go1-17 v0.1.1 h1:DQjHPq+aOzUeh9/lixAGunn6rIOQyWChPSI4+hgW7jc= +github.com/marten-seemann/qtls-go1-17 v0.1.1/go.mod h1:C2ekUKcDdz9SDWxec1N/MvcXBpaX9l3Nx67XaR84L5s= +github.com/marten-seemann/qtls-go1-18 v0.1.1 h1:qp7p7XXUFL7fpBvSS1sWD+uSqPvzNQK43DH+/qEkj0Y= +github.com/marten-seemann/qtls-go1-18 v0.1.1/go.mod h1:mJttiymBAByA49mhlNZZGrH5u1uXYZJ+RW28Py7f4m4= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= @@ -1382,7 +1318,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -1394,7 +1329,6 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -1417,7 +1351,6 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1439,7 +1372,6 @@ github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1457,7 +1389,6 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -1591,7 +1522,6 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -1624,7 +1554,6 @@ github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXx github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= @@ -1632,7 +1561,6 @@ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= @@ -1699,7 +1627,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -1825,7 +1752,6 @@ github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefld github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= @@ -1842,14 +1768,14 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0 h1:hQcbewsJX5Xpd3xdE9n3JpGyuzUqMhwhpQCpbN+9Uiw= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0/go.mod h1:CuuygZPciwwLV5vNY1LcIi0PZxXZbOmicw1/IkrPpPI= +github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1 h1:QGfGmetv5P7KNzdShrbdbvVLyJwLjVs0vaq7TgZh5eE= +github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1/go.mod h1:P95TRqVP0Df73sh9ZCo+hZnzVumhKFut1AHRrrpBpG8= github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 h1:XgCj40pL5hADIl7ov4NpSK6MMFThUJrPuRnOSjEIae0= github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1/go.mod h1:HelXH7UT1uWdb+St6UAj4pPf93GOggjIV7pVbrWIZ3o= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 h1:gm+6SgxcNOCz6mgwvhsxORLXsr9yIFvbJDuoAK85ONs= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.1/go.mod h1:SPBTTl5CqRexYfkI66pbzE5nQziYpoQ+7hH0XveA9IU= +github.com/vulcanize/ipfs-ethdb/v3 v3.0.2 h1:3RstoWZ8tqeP2/xx6jn4CQZRdc95UbCjLeSQvDjQgoc= +github.com/vulcanize/ipfs-ethdb/v3 v3.0.2/go.mod h1:6vDzCaDjsuxjZwCs2HXTl5mRCKouucHVcPeCfE9TbDg= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0 h1:Q81c4u7hT+BR5kNfNQhEF0VT2pmL7+Kk0wD+ORYl7iA= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= @@ -1895,9 +1821,6 @@ github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxt go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1948,7 +1871,6 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= @@ -1979,7 +1901,6 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2032,9 +1953,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -2106,19 +2026,14 @@ golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2132,17 +2047,7 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2191,11 +2096,9 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2208,7 +2111,6 @@ golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2236,18 +2138,14 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2256,24 +2154,12 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2319,7 +2205,6 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2369,10 +2254,6 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 h1:0c3L82FDQ5rt1bjTBlchS8t6RQ6299/+5bWMnRLh+uI= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2412,23 +2293,6 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2481,42 +2345,7 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2543,18 +2372,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2588,7 +2407,6 @@ gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= -- 2.45.2 From 27d9413544832c56ea18c1f39f2bed62eaa65459 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 14:12:23 -0400 Subject: [PATCH 03/26] Update Go version in dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8e21c2f2..bc269fe9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as builder +FROM golang:1.18-alpine as builder RUN apk --update --no-cache add make git g++ linux-headers # DEBUG -- 2.45.2 From 89b9a05234699350efcf4a77122d51a4978fa547 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 14:42:45 -0400 Subject: [PATCH 04/26] Update make file to download dependencies --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index c128ff6a..f023c2e1 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ $(BIN)/gometalinter.v2: .PHONY: installtools installtools: | $(LINT) $(GOOSE) $(GINKGO) echo "Installing tools" + go mod download .PHONY: metalint metalint: | $(METALINT) -- 2.45.2 From 6c82eafef1978ccaf26d78238a9f626cc294557f Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 15:27:23 -0400 Subject: [PATCH 05/26] Update go version for integration tests. --- .github/workflows/on-pr.yaml | 186 +-------------------------------- .github/workflows/publish.yaml | 3 + .github/workflows/tests.yaml | 181 ++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+), 184 deletions(-) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 4a9bd625..1f195f42 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -2,187 +2,5 @@ name: Docker Build on: [pull_request] jobs: - build: - name: Run docker build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Run docker build - run: make docker-build - test: - name: Run unit tests - env: - GOPATH: /tmp/go - # To run the unit tests you need to add secrets to your repository. - BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} - BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} - BUILD_KEY: ${{ secrets.BUILD_KEY }} - #strategy: - # matrix: - # go-version: [1.16.x, 1.17.x] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Passed experience with GHA has taught me to store variables in files instead of passing them as variables. - - name: Output variables to files - run: | - echo $GITHUB_REPOSITORY > /tmp/git_repository - echo $GITHUB_HEAD_REF > /tmp/git_head_ref - echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> /tmp/key - echo ${{ env.BUILD_KEY }} >> /tmp/key - echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/key - chmod 400 /tmp/key - cat /tmp/git_repository - cat /tmp/git_head_ref - - - name: Raw SCP - run: | - scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_repository ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_repository - scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_head_ref ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_head_ref - scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key .github/workflows/run_unit_test.sh ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/run_unit_test.sh - - - name: Trigger Unit Test - run: | - ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} chmod +x /tmp/run_unit_test.sh /tmp/run_unit_test.sh - ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh - - - name: Get the logs and cat them - run: | - scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log . - cat ./test.log - - - name: Check Error Code - run: | - scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt . - [ $(cat ./return_test.txt) -eq 0 ] - - integrationtest: - name: Run integration tests - env: - STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb - GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b - GOPATH: /tmp/go - DB_WRITE: true - ETH_FORWARD_ETH_CALLS: false - ETH_PROXY_ON_ERROR: false - ETH_HTTP_PATH: "go-ethereum:8545" - strategy: - matrix: - go-version: [1.16.x] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Create GOPATH - run: mkdir -p /tmp/go - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v2 - with: - path: "./ipld-eth-server" - - uses: actions/checkout@v2 - with: - ref: ${{ env.STACK_ORCHESTRATOR_REF }} - path: "./stack-orchestrator/" - repository: vulcanize/stack-orchestrator - - uses: actions/checkout@v2 - with: - ref: ${{ env.GO_ETHEREUM_REF }} - repository: vulcanize/go-ethereum - path: "./go-ethereum/" - - name: Create config file - run: | - echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh - echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh - echo db_write=$DB_WRITE >> ./config.sh - echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh - echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh - echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh - cat ./config.sh - - name: Build geth - run: | - cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts - ./compile-geth.sh \ - -p "$GITHUB_WORKSPACE/config.sh" \ - -e docker - - name: Run docker compose - run: | - docker-compose \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ - --env-file "$GITHUB_WORKSPACE/config.sh" \ - up -d --build - - name: Test - run: | - cd $GITHUB_WORKSPACE/ipld-eth-server - while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ - while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ - make integrationtest - - integrationtest_forwardethcalls: - name: Run integration tests for direct proxy fall-through of eth_calls - env: - STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb - GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b - GOPATH: /tmp/go - DB_WRITE: false - ETH_FORWARD_ETH_CALLS: true - ETH_PROXY_ON_ERROR: false - ETH_HTTP_PATH: "go-ethereum:8545" - strategy: - matrix: - go-version: [1.16.x] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Create GOPATH - run: mkdir -p /tmp/go - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v2 - with: - path: "./ipld-eth-server" - - uses: actions/checkout@v2 - with: - ref: ${{ env.STACK_ORCHESTRATOR_REF }} - path: "./stack-orchestrator/" - repository: vulcanize/stack-orchestrator - - uses: actions/checkout@v2 - with: - ref: ${{ env.GO_ETHEREUM_REF }} - repository: vulcanize/go-ethereum - path: "./go-ethereum/" - - name: Create config file - run: | - echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh - echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh - echo db_write=$DB_WRITE >> ./config.sh - echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh - echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh - echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh - cat ./config.sh - - name: Build geth - run: | - cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts - ./compile-geth.sh \ - -p "$GITHUB_WORKSPACE/config.sh" \ - -e docker - - name: Run docker compose - run: | - docker-compose \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ - -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ - --env-file "$GITHUB_WORKSPACE/config.sh" \ - up -d --build - - name: Test - run: | - cd $GITHUB_WORKSPACE/ipld-eth-server - while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ - while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ - make integrationtest + run-tests: + uses: ./.github/workflows/tests.yml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2315bc22..44cb84ec 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,9 +3,12 @@ on: release: types: [published] jobs: + run-tests: + uses: ./.github/workflows/tests.yml build: name: Run docker build runs-on: ubuntu-latest + needs: run-tests steps: - uses: actions/checkout@v2 - name: Get the version diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..1886a1d6 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,181 @@ +name: Test the stack. +on: + workflow_call: + +jobs: + build: + name: Run docker build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run docker build + run: make docker-build + test: + name: Run unit tests + env: + GOPATH: /tmp/go + # To run the unit tests you need to add secrets to your repository. + BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} + BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} + BUILD_KEY: ${{ secrets.BUILD_KEY }} + #strategy: + # matrix: + # go-version: [1.16.x, 1.17.x] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Passed experience with GHA has taught me to store variables in files instead of passing them as variables. + - name: Output variables to files + run: | + echo $GITHUB_REPOSITORY > /tmp/git_repository + echo $GITHUB_HEAD_REF > /tmp/git_head_ref + echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> /tmp/key + echo ${{ env.BUILD_KEY }} >> /tmp/key + echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/key + chmod 400 /tmp/key + cat /tmp/git_repository + cat /tmp/git_head_ref + + - name: Raw SCP + run: | + scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_repository ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_repository + scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_head_ref ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_head_ref + scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key .github/workflows/run_unit_test.sh ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/run_unit_test.sh + + - name: Trigger Unit Test + run: | + ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} chmod +x /tmp/run_unit_test.sh /tmp/run_unit_test.sh + ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh + + - name: Get the logs and cat them + run: | + scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log . + cat ./test.log + + - name: Check Error Code + run: | + scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt . + [ $(cat ./return_test.txt) -eq 0 ] + + integrationtest: + name: Run integration tests + env: + STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb + GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b + GOPATH: /tmp/go + DB_WRITE: true + ETH_FORWARD_ETH_CALLS: false + ETH_PROXY_ON_ERROR: false + ETH_HTTP_PATH: "go-ethereum:8545" + runs-on: ubuntu-latest + steps: + - name: Create GOPATH + run: mkdir -p /tmp/go + - uses: actions/setup-go@v3 + with: + go-version: ">=1.18.0" + check-latest: true + - uses: actions/checkout@v2 + with: + path: "./ipld-eth-server" + - uses: actions/checkout@v2 + with: + ref: ${{ env.STACK_ORCHESTRATOR_REF }} + path: "./stack-orchestrator/" + repository: vulcanize/stack-orchestrator + - uses: actions/checkout@v2 + with: + ref: ${{ env.GO_ETHEREUM_REF }} + repository: vulcanize/go-ethereum + path: "./go-ethereum/" + - name: Create config file + run: | + echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh + echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh + echo db_write=$DB_WRITE >> ./config.sh + echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh + echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh + echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh + cat ./config.sh + - name: Build geth + run: | + cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts + ./compile-geth.sh \ + -p "$GITHUB_WORKSPACE/config.sh" \ + -e docker + - name: Run docker compose + run: | + docker-compose \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ + --env-file "$GITHUB_WORKSPACE/config.sh" \ + up -d --build + - name: Test + run: | + cd $GITHUB_WORKSPACE/ipld-eth-server + while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ + while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ + make integrationtest + + integrationtest_forwardethcalls: + name: Run integration tests for direct proxy fall-through of eth_calls + env: + STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb + GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b + GOPATH: /tmp/go + DB_WRITE: false + ETH_FORWARD_ETH_CALLS: true + ETH_PROXY_ON_ERROR: false + ETH_HTTP_PATH: "go-ethereum:8545" + runs-on: ubuntu-latest + steps: + - name: Create GOPATH + run: mkdir -p /tmp/go + - uses: actions/setup-go@v3 + with: + go-version: ">=1.18.0" + check-latest: true + - uses: actions/checkout@v2 + with: + path: "./ipld-eth-server" + - uses: actions/checkout@v2 + with: + ref: ${{ env.STACK_ORCHESTRATOR_REF }} + path: "./stack-orchestrator/" + repository: vulcanize/stack-orchestrator + - uses: actions/checkout@v2 + with: + ref: ${{ env.GO_ETHEREUM_REF }} + repository: vulcanize/go-ethereum + path: "./go-ethereum/" + - name: Create config file + run: | + echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh + echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh + echo db_write=$DB_WRITE >> ./config.sh + echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh + echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh + echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh + cat ./config.sh + - name: Build geth + run: | + cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts + ./compile-geth.sh \ + -p "$GITHUB_WORKSPACE/config.sh" \ + -e docker + - name: Run docker compose + run: | + docker-compose \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \ + -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ + --env-file "$GITHUB_WORKSPACE/config.sh" \ + up -d --build + - name: Test + run: | + cd $GITHUB_WORKSPACE/ipld-eth-server + while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \ + while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \ + make integrationtest -- 2.45.2 From 222fa6d6ed858b9701124a608b0651b7e10fda59 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 15:28:01 -0400 Subject: [PATCH 06/26] update file name --- .github/workflows/on-pr.yaml | 2 +- .github/workflows/publish.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 1f195f42..8dd62a87 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -3,4 +3,4 @@ name: Docker Build on: [pull_request] jobs: run-tests: - uses: ./.github/workflows/tests.yml + uses: ./.github/workflows/tests.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 44cb84ec..dad74f78 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,7 +4,7 @@ on: types: [published] jobs: run-tests: - uses: ./.github/workflows/tests.yml + uses: ./.github/workflows/tests.yaml build: name: Run docker build runs-on: ubuntu-latest -- 2.45.2 From 5c6fb45d36726759933e173e354c8073b8503a47 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Fri, 27 May 2022 15:42:02 -0400 Subject: [PATCH 07/26] install packages. --- .github/workflows/tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1886a1d6..b5abb2e5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -112,6 +112,10 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build + - name: Install packages + run: | + go install github.com/onsi/ginkgo/v2/ginkgo@latest + which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server @@ -173,6 +177,10 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build + - name: Install packages + run: | + go install github.com/onsi/ginkgo/v2/ginkgo@latest + which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server -- 2.45.2 From cf8c08f01e973c563632bd7b77cd305cae519881 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Tue, 31 May 2022 09:49:37 -0400 Subject: [PATCH 08/26] Update gingko version and secret --- .github/workflows/on-pr.yaml | 4 ++++ .github/workflows/publish.yaml | 4 ++++ .github/workflows/tests.yaml | 16 ++++++++-------- Makefile | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 8dd62a87..4020bdcc 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -4,3 +4,7 @@ on: [pull_request] jobs: run-tests: uses: ./.github/workflows/tests.yaml + secrets: + BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} + BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} + BUILD_KEY: ${{ secrets.BUILD_KEY }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index dad74f78..0e70dd1c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,6 +5,10 @@ on: jobs: run-tests: uses: ./.github/workflows/tests.yaml + secrets: + BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} + BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} + BUILD_KEY: ${{ secrets.BUILD_KEY }} build: name: Run docker build runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b5abb2e5..2bf9220b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,13 @@ name: Test the stack. on: workflow_call: + secrets: + BUILD_HOSTNAME: + required: true + BUILD_USERNAME: + required: true + BUILD_KEY: + required: true jobs: build: @@ -45,6 +52,7 @@ jobs: - name: Trigger Unit Test run: | + ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/v2/ginkgo@latest ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} chmod +x /tmp/run_unit_test.sh /tmp/run_unit_test.sh ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh @@ -112,10 +120,6 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build - - name: Install packages - run: | - go install github.com/onsi/ginkgo/v2/ginkgo@latest - which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server @@ -177,10 +181,6 @@ jobs: -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \ --env-file "$GITHUB_WORKSPACE/config.sh" \ up -d --build - - name: Install packages - run: | - go install github.com/onsi/ginkgo/v2/ginkgo@latest - which ginkgo - name: Test run: | cd $GITHUB_WORKSPACE/ipld-eth-server diff --git a/Makefile b/Makefile index f023c2e1..d99a52fc 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PKGS = go list ./... | grep -v "^vendor/" ## Testing library GINKGO = $(BIN)/ginkgo $(BIN)/ginkgo: - go get -u github.com/onsi/ginkgo/ginkgo + go run github.com/onsi/ginkgo/ginkgo ## Migration tool GOOSE = $(BIN)/goose -- 2.45.2 From c556845d1a41bfdccc9862de82b07024f1ad0cf0 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Tue, 31 May 2022 10:15:04 -0400 Subject: [PATCH 09/26] Update unit test download package --- .github/workflows/tests.yaml | 3 +-- Makefile | 16 ++++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2bf9220b..2306898b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -52,8 +52,7 @@ jobs: - name: Trigger Unit Test run: | - ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/v2/ginkgo@latest - ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} chmod +x /tmp/run_unit_test.sh /tmp/run_unit_test.sh + ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/ginkgo@latest ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh - name: Get the logs and cat them diff --git a/Makefile b/Makefile index d99a52fc..a45346a4 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,6 @@ BASE = $(GOPATH)/src/$(PACKAGE) PKGS = go list ./... | grep -v "^vendor/" # Tools -## Testing library -GINKGO = $(BIN)/ginkgo -$(BIN)/ginkgo: - go run github.com/onsi/ginkgo/ginkgo ## Migration tool GOOSE = $(BIN)/goose @@ -26,7 +22,7 @@ $(BIN)/gometalinter.v2: .PHONY: installtools -installtools: | $(LINT) $(GOOSE) $(GINKGO) +installtools: | $(LINT) $(GOOSE) echo "Installing tools" go mod download @@ -55,19 +51,19 @@ TEST_CONNECT_STRING = postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATAB TEST_CONNECT_STRING_LOCAL = postgresql://$(USER)@$(HOST_NAME):$(PORT)/$(TEST_DB)?sslmode=disable .PHONY: test -test: | $(GINKGO) $(GOOSE) +test: | $(GOOSE) go vet ./... go fmt ./... - $(GINKGO) -r --skipPackage=test + go run github.com/onsi/ginkgo/ginkgo -r --skipPackage=test .PHONY: integrationtest -integrationtest: | $(GINKGO) $(GOOSE) +integrationtest: | $(GOOSE) go vet ./... go fmt ./... - $(GINKGO) -r test/ -v + go run github.com/onsi/ginkgo/ginkgo -r test/ -v .PHONY: test_local -test_local: | $(GINKGO) $(GOOSE) +test_local: | $(GOOSE) go vet ./... go fmt ./... ./scripts/run_unit_test.sh -- 2.45.2 From 8966d1b6c26eb23ddafaf82012d6b565e51f9231 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Tue, 31 May 2022 13:29:48 -0400 Subject: [PATCH 10/26] Update vulcanize dependencies --- go.mod | 4 ++-- go.sum | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index edfc9c70..816117c4 100644 --- a/go.mod +++ b/go.mod @@ -22,9 +22,9 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 - github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1 + github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2 github.com/vulcanize/gap-filler v0.3.1 - github.com/vulcanize/ipfs-ethdb/v3 v3.0.2 + github.com/vulcanize/ipfs-ethdb/v3 v3.0.3 ) require ( diff --git a/go.sum b/go.sum index 77943992..0a4d6cb8 100644 --- a/go.sum +++ b/go.sum @@ -463,7 +463,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1496,7 +1495,6 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1504,7 +1502,6 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -1768,14 +1765,14 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1 h1:QGfGmetv5P7KNzdShrbdbvVLyJwLjVs0vaq7TgZh5eE= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.1/go.mod h1:P95TRqVP0Df73sh9ZCo+hZnzVumhKFut1AHRrrpBpG8= +github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2 h1:YZ24WFrrnTC3of2EFfMIQsGUCk1hkDu++l0TIw6RrFw= +github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2/go.mod h1:PrVSnKWJhnbCYUAIHESAwnXITN5df3IBckmkmQIBv7o= github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 h1:XgCj40pL5hADIl7ov4NpSK6MMFThUJrPuRnOSjEIae0= github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1/go.mod h1:HelXH7UT1uWdb+St6UAj4pPf93GOggjIV7pVbrWIZ3o= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.2 h1:3RstoWZ8tqeP2/xx6jn4CQZRdc95UbCjLeSQvDjQgoc= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.2/go.mod h1:6vDzCaDjsuxjZwCs2HXTl5mRCKouucHVcPeCfE9TbDg= +github.com/vulcanize/ipfs-ethdb/v3 v3.0.3 h1:KyNMtSKZk2ZuU+mwAv/SdNEeigFkCxvsTDqxHDpwUL8= +github.com/vulcanize/ipfs-ethdb/v3 v3.0.3/go.mod h1:hi3c5YadpoJc0A6Du9OzEAhGxtk0S1pTSAY/rApvuA0= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0 h1:Q81c4u7hT+BR5kNfNQhEF0VT2pmL7+Kk0wD+ORYl7iA= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= @@ -2033,7 +2030,6 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2159,12 +2155,10 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -- 2.45.2 From 613dd6acf4d5a0e806b66d7439e7875125bfb6c3 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Wed, 1 Jun 2022 08:23:03 -0400 Subject: [PATCH 11/26] Update commands for calling unit tests --- .github/workflows/run_unit_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_unit_test.sh b/.github/workflows/run_unit_test.sh index 8b80c5ab..cfffa990 100755 --- a/.github/workflows/run_unit_test.sh +++ b/.github/workflows/run_unit_test.sh @@ -13,7 +13,7 @@ cd ipld-eth-server rm -f /tmp/git_head_ref /tmp/git_repository # Spin up DB -docker-compose up -d ipld-eth-db +docker-compose -f docker-compose.yml up -d ipld-eth-db trap "docker-compose down --remove-orphans; cd $start_dir ; rm -r $temp_dir" SIGINT SIGTERM ERR sleep 10 @@ -23,7 +23,7 @@ PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=pass echo $? > /tmp/return_test.txt # Clean up -docker-compose down -v --remove-orphans +docker-compose -f docker-compose.yml down -v --remove-orphans cd $start_dir rm -fr $temp_dir -- 2.45.2 From e2b83a5737a7e76549e9e25962c8799cfcf241bf Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Wed, 1 Jun 2022 08:26:11 -0400 Subject: [PATCH 12/26] Use latest version of statediff --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 816117c4..43e74ba9 100644 --- a/go.mod +++ b/go.mod @@ -284,4 +284,4 @@ require ( lukechampine.com/blake3 v1.1.6 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.18 => github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 +replace github.com/ethereum/go-ethereum v1.10.18 => github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.2 diff --git a/go.sum b/go.sum index 0a4d6cb8..8df04b33 100644 --- a/go.sum +++ b/go.sum @@ -1769,8 +1769,8 @@ github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2 h1:YZ24WFrrnTC3of2EFfMIQ github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2/go.mod h1:PrVSnKWJhnbCYUAIHESAwnXITN5df3IBckmkmQIBv7o= github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= -github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1 h1:XgCj40pL5hADIl7ov4NpSK6MMFThUJrPuRnOSjEIae0= -github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.1/go.mod h1:HelXH7UT1uWdb+St6UAj4pPf93GOggjIV7pVbrWIZ3o= +github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.2 h1:hAZFOtnfdHtVgiwtcNFZDxCEN01c4W5Xsw+1K/IlHBA= +github.com/vulcanize/go-ethereum v1.10.18-statediff-3.2.2/go.mod h1:HelXH7UT1uWdb+St6UAj4pPf93GOggjIV7pVbrWIZ3o= github.com/vulcanize/ipfs-ethdb/v3 v3.0.3 h1:KyNMtSKZk2ZuU+mwAv/SdNEeigFkCxvsTDqxHDpwUL8= github.com/vulcanize/ipfs-ethdb/v3 v3.0.3/go.mod h1:hi3c5YadpoJc0A6Du9OzEAhGxtk0S1pTSAY/rApvuA0= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= -- 2.45.2 From 248d9eb7a2d46df04df61ad8d57a8c780b90adfc Mon Sep 17 00:00:00 2001 From: Abdul Rabbani <58230246+abdulrabbani00@users.noreply.github.com> Date: Thu, 2 Jun 2022 08:49:23 -0400 Subject: [PATCH 13/26] Update github variable to work with tags (#164) * Update github variable to work with tags * Update tests.yaml * Use conditional for reference --- .github/workflows/tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2306898b..999d1544 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,13 +36,14 @@ jobs: - name: Output variables to files run: | echo $GITHUB_REPOSITORY > /tmp/git_repository - echo $GITHUB_HEAD_REF > /tmp/git_head_ref + [ -z "$GITHUB_HEAD_REF" ] && echo $GITHUB_REF_NAME > /tmp/git_head_ref || echo $GITHUB_HEAD_REF > /tmp/git_head_ref echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> /tmp/key echo ${{ env.BUILD_KEY }} >> /tmp/key echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/key chmod 400 /tmp/key cat /tmp/git_repository cat /tmp/git_head_ref + echo - name: Raw SCP run: | -- 2.45.2 From f144d932cdecc4a11c86ad4aed3c8b850fe26a07 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Wed, 25 May 2022 18:43:53 +0530 Subject: [PATCH 14/26] Implement graphql query to get header with transactions --- pkg/eth/cid_retriever.go | 85 ++++++++++++++++++++++- pkg/graphql/graphql.go | 142 ++++++++++++++++++++++++++++++++++++++- pkg/graphql/schema.go | 72 ++++++++++++++------ 3 files changed, 277 insertions(+), 22 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index bcebcde7..0872d76d 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -576,7 +576,7 @@ func (ecr *CIDRetriever) RetrieveBlockByNumber(blockNumber int64) (models.Header // RetrieveHeaderCIDByHash returns the header for the given block hash func (ecr *CIDRetriever) RetrieveHeaderCIDByHash(tx *sqlx.Tx, blockHash common.Hash) (models.HeaderModel, error) { log.Debug("retrieving header cids for block hash ", blockHash.String()) - pgStr := `SELECT block_hash,cid,mh_key FROM eth.header_cids + pgStr := `SELECT block_hash, CAST(block_number as Text), parent_hash, cid, mh_key, timestamp FROM eth.header_cids WHERE block_hash = $1` var headerCID models.HeaderModel return headerCID, tx.Get(&headerCID, pgStr, blockHash.String()) @@ -604,3 +604,86 @@ func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []stri var rctCIDs []models.ReceiptModel return rctCIDs, tx.Select(&rctCIDs, pgStr, pq.Array(txHashes)) } + +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]models.HeaderModel, [][]models.TxModel, error) { + log.Debug("retrieving header cids and tx cids for block number ", blockNumber) + + // Begin new db tx + tx, err := ecr.db.Beginx() + if err != nil { + return nil, nil, err + } + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + var headerCIDs []models.HeaderModel + headerCIDs, err = ecr.RetrieveHeaderCIDs(tx, blockNumber) + if err != nil { + log.Error("header cid retrieval error") + return nil, nil, err + } + if len(headerCIDs) < 1 { + return nil, nil, fmt.Errorf("header cid retrieval error, no header CIDs found at block %d", blockNumber) + } + + var allTxCIDs [][]models.TxModel + for _, headerCID := range headerCIDs { + var txCIDs []models.TxModel + txCIDs, err = ecr.RetrieveTxCIDsByHeaderID(tx, headerCID.BlockHash) + if err != nil { + log.Error("tx cid retrieval error") + return nil, nil, err + } + allTxCIDs = append(allTxCIDs, txCIDs) + } + + return headerCIDs, allTxCIDs, nil +} + +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (models.HeaderModel, []models.TxModel, error) { + log.Debug("retrieving header cid and tx cids for block hash ", blockHash.String()) + + // Begin new db tx + tx, err := ecr.db.Beginx() + if err != nil { + return models.HeaderModel{}, nil, err + } + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + var headerCID models.HeaderModel + headerCID, err = ecr.RetrieveHeaderCIDByHash(tx, blockHash) + if err != nil { + log.Error("header cid retrieval error") + return models.HeaderModel{}, nil, err + } + if err != nil { + return models.HeaderModel{}, nil, err + } + fmt.Println("RetrieveHeaderAndTxCIDsByBlockHash", headerCID.ParentHash, headerCID.Timestamp) + + var txCIDs []models.TxModel + txCIDs, err = ecr.RetrieveTxCIDsByHeaderID(tx, headerCID.BlockHash) + if err != nil { + log.Error("tx cid retrieval error") + return models.HeaderModel{}, nil, err + } + + return headerCID, txCIDs, nil +} diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 465bf286..588261e6 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -22,6 +22,8 @@ import ( "context" "database/sql" "errors" + "fmt" + "math/big" "time" "github.com/ethereum/go-ethereum/common" @@ -32,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/vulcanize/ipld-eth-server/v3/pkg/eth" ) @@ -1017,7 +1020,7 @@ func (r *Resolver) GetStorageAt(ctx context.Context, args struct { return nil, err } - if bytes.Compare(rlpValue, eth.EmptyNodeValue) == 0 { + if bytes.Equal(rlpValue, eth.EmptyNodeValue) { return &StorageResult{value: eth.EmptyNodeValue, cid: cid, ipldBlock: ipldBlock}, nil } @@ -1122,3 +1125,140 @@ func decomposeGQLLogs(logCIDs []eth.LogResult) []logsCID { return logs } + +type EthTransactionCid struct { + cid string + txHash string + index int32 + src string + dst string +} + +func (t EthTransactionCid) Cid(ctx context.Context) string { + return t.cid +} + +func (t EthTransactionCid) TxHash(ctx context.Context) string { + return t.txHash +} + +func (t EthTransactionCid) Index(ctx context.Context) int32 { + return t.index +} + +func (t EthTransactionCid) Src(ctx context.Context) string { + return t.src +} + +func (t EthTransactionCid) Dst(ctx context.Context) string { + return t.dst +} + +type EthTransactionCidsConnection struct { + nodes []*EthTransactionCid +} + +func (transactionCIDResult EthTransactionCidsConnection) Nodes(ctx context.Context) []*EthTransactionCid { + return transactionCIDResult.nodes +} + +type EthHeaderCid struct { + cid string + blockNumber hexutil.Uint64 + blockHash string + parentHash string + timestamp hexutil.Uint64 + transactions []*EthTransactionCid +} + +func (h EthHeaderCid) Cid(ctx context.Context) string { + return h.cid +} + +func (h EthHeaderCid) BlockNumber(ctx context.Context) hexutil.Uint64 { + return h.blockNumber +} + +func (h EthHeaderCid) BlockHash(ctx context.Context) string { + return h.blockHash +} + +func (h EthHeaderCid) ParentHash(ctx context.Context) string { + return h.parentHash +} + +func (h EthHeaderCid) Timestamp(ctx context.Context) hexutil.Uint64 { + return h.timestamp +} + +func (h EthHeaderCid) EthTransactionCidsByHeaderId(ctx context.Context) EthTransactionCidsConnection { + return EthTransactionCidsConnection{nodes: h.transactions} +} + +type EthHeaderCidsConnection struct { + nodes []*EthHeaderCid +} + +func (headerCIDResult EthHeaderCidsConnection) Nodes(ctx context.Context) []*EthHeaderCid { + return headerCIDResult.nodes +} + +type EthHeaderCidCondition struct { + BlockNumber *hexutil.Big + BlockHash *string +} + +func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { + Condition *EthHeaderCidCondition +}) (*EthHeaderCidsConnection, error) { + var headerCIDs []models.HeaderModel + var allTxCIDs [][]models.TxModel + var err error + if args.Condition.BlockHash != nil { + headerCID, txCIDs, err := r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(common.HexToHash(*args.Condition.BlockHash)) + if err != nil { + return nil, err + } + + headerCIDs = append(headerCIDs, headerCID) + allTxCIDs = append(allTxCIDs, txCIDs) + } else if args.Condition.BlockNumber != nil { + headerCIDs, allTxCIDs, err = r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(args.Condition.BlockNumber.ToInt().Int64()) + if err != nil { + return nil, err + } + } else { + return nil, fmt.Errorf("provide block number or block hash") + } + + var resultNodes []*EthHeaderCid + for idx, headerCID := range headerCIDs { + blockNumber := new(big.Int) + blockNumber.SetString(headerCID.BlockNumber, 10) + + ethHeaderCidNode := EthHeaderCid{ + cid: headerCID.CID, + blockNumber: hexutil.Uint64(blockNumber.Uint64()), + blockHash: headerCID.BlockHash, + parentHash: headerCID.ParentHash, + timestamp: hexutil.Uint64(headerCID.Timestamp), + } + + txCIDs := allTxCIDs[idx] + for _, txCID := range txCIDs { + ethHeaderCidNode.transactions = append(ethHeaderCidNode.transactions, &EthTransactionCid{ + cid: txCID.CID, + txHash: txCID.TxHash, + index: int32(txCID.Index), + src: txCID.Src, + dst: txCID.Dst, + }) + } + + resultNodes = append(resultNodes, ðHeaderCidNode) + } + + return &EthHeaderCidsConnection{ + nodes: resultNodes, + }, nil +} diff --git a/pkg/graphql/schema.go b/pkg/graphql/schema.go index b70765ac..f85d489a 100644 --- a/pkg/graphql/schema.go +++ b/pkg/graphql/schema.go @@ -138,16 +138,16 @@ const schema string = ` # empty, results will not be filtered by address. addresses: [Address!] # Topics list restricts matches to particular event topics. Each event has a list - # of topics. Topics matches a prefix of that list. An empty element array matches any - # topic. Non-empty elements represent an alternative that matches any of the - # contained topics. - # - # Examples: - # - [] or nil matches any topic list - # - [[A]] matches topic A in first position - # - [[], [B]] matches any topic in first position, B in second position - # - [[A], [B]] matches topic A in first position, B in second position - # - [[A, B]], [C, D]] matches topic (A OR B) in first position, (C OR D) in second position + # of topics. Topics matches a prefix of that list. An empty element array matches any + # topic. Non-empty elements represent an alternative that matches any of the + # contained topics. + # + # Examples: + # - [] or nil matches any topic list + # - [[A]] matches topic A in first position + # - [[], [B]] matches any topic in first position, B in second position + # - [[A], [B]] matches topic A in first position, B in second position + # - [[A, B]], [C, D]] matches topic (A OR B) in first position, (C OR D) in second position topics: [[Bytes32!]!] } @@ -258,16 +258,16 @@ const schema string = ` # empty, results will not be filtered by address. addresses: [Address!] # Topics list restricts matches to particular event topics. Each event has a list - # of topics. Topics matches a prefix of that list. An empty element array matches any - # topic. Non-empty elements represent an alternative that matches any of the - # contained topics. - # - # Examples: - # - [] or nil matches any topic list - # - [[A]] matches topic A in first position - # - [[], [B]] matches any topic in first position, B in second position - # - [[A], [B]] matches topic A in first position, B in second position - # - [[A, B]], [C, D]] matches topic (A OR B) in first position, (C OR D) in second position + # of topics. Topics matches a prefix of that list. An empty element array matches any + # topic. Non-empty elements represent an alternative that matches any of the + # contained topics. + # + # Examples: + # - [] or nil matches any topic list + # - [[A]] matches topic A in first position + # - [[], [B]] matches any topic in first position, B in second position + # - [[A], [B]] matches topic A in first position, B in second position + # - [[A, B]], [C, D]] matches topic (A OR B) in first position, (C OR D) in second position topics: [[Bytes32!]!] } @@ -282,6 +282,36 @@ const schema string = ` ipldBlock: Bytes! } + input EthHeaderCidCondition { + blockNumber: BigInt + blockHash: String + } + + type EthTransactionCid { + cid: String! + txHash: String! + index: Int! + src: String! + dst: String! + } + + type EthTransactionCidsConnection { + nodes: [EthTransactionCid]! + } + + type EthHeaderCid { + cid: String! + blockNumber: Long! + blockHash: String! + parentHash: String! + timestamp: Long! + ethTransactionCidsByHeaderId: EthTransactionCidsConnection! + } + + type EthHeaderCidsConnection { + nodes: [EthHeaderCid]! + } + type Query { # Block fetches an Ethereum block by number or by hash. If neither is # supplied, the most recent known block is returned. @@ -302,5 +332,7 @@ const schema string = ` # Get contract logs by block hash and contract address. getLogs(blockHash: Bytes32!, contract: Address): [Log!] + + allEthHeaderCids(condition: EthHeaderCidCondition): EthHeaderCidsConnection } ` -- 2.45.2 From fe7329c2844a5a685c6a66bf350e8dca04fdbf4b Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Thu, 26 May 2022 19:57:23 +0530 Subject: [PATCH 15/26] Add custom implementation for graphql scalar BigInt --- pkg/graphql/graphql.go | 22 +++++----- pkg/graphql/schema.go | 8 ++-- pkg/graphql/types.go | 94 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 14 deletions(-) create mode 100644 pkg/graphql/types.go diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 588261e6..44738003 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -23,7 +23,6 @@ import ( "database/sql" "errors" "fmt" - "math/big" "time" "github.com/ethereum/go-ethereum/common" @@ -1164,10 +1163,10 @@ func (transactionCIDResult EthTransactionCidsConnection) Nodes(ctx context.Conte type EthHeaderCid struct { cid string - blockNumber hexutil.Uint64 + blockNumber BigInt blockHash string parentHash string - timestamp hexutil.Uint64 + timestamp BigInt transactions []*EthTransactionCid } @@ -1175,7 +1174,7 @@ func (h EthHeaderCid) Cid(ctx context.Context) string { return h.cid } -func (h EthHeaderCid) BlockNumber(ctx context.Context) hexutil.Uint64 { +func (h EthHeaderCid) BlockNumber(ctx context.Context) BigInt { return h.blockNumber } @@ -1187,7 +1186,7 @@ func (h EthHeaderCid) ParentHash(ctx context.Context) string { return h.parentHash } -func (h EthHeaderCid) Timestamp(ctx context.Context) hexutil.Uint64 { +func (h EthHeaderCid) Timestamp(ctx context.Context) BigInt { return h.timestamp } @@ -1204,7 +1203,7 @@ func (headerCIDResult EthHeaderCidsConnection) Nodes(ctx context.Context) []*Eth } type EthHeaderCidCondition struct { - BlockNumber *hexutil.Big + BlockNumber *BigInt BlockHash *string } @@ -1233,15 +1232,18 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { var resultNodes []*EthHeaderCid for idx, headerCID := range headerCIDs { - blockNumber := new(big.Int) - blockNumber.SetString(headerCID.BlockNumber, 10) + var blockNumber BigInt + blockNumber.UnmarshalText([]byte(headerCID.BlockNumber)) + + var timestamp BigInt + timestamp.SetUint64(headerCID.Timestamp) ethHeaderCidNode := EthHeaderCid{ cid: headerCID.CID, - blockNumber: hexutil.Uint64(blockNumber.Uint64()), + blockNumber: blockNumber, blockHash: headerCID.BlockHash, parentHash: headerCID.ParentHash, - timestamp: hexutil.Uint64(headerCID.Timestamp), + timestamp: timestamp, } txCIDs := allTxCIDs[idx] diff --git a/pkg/graphql/schema.go b/pkg/graphql/schema.go index f85d489a..b8f5ef6d 100644 --- a/pkg/graphql/schema.go +++ b/pkg/graphql/schema.go @@ -25,8 +25,7 @@ const schema string = ` # An empty byte string is represented as '0x'. Byte strings must have an even number of hexadecimal nybbles. scalar Bytes # BigInt is a large integer. Input is accepted as either a JSON number or as a string. - # Strings may be either decimal or 0x-prefixed hexadecimal. Output values are all - # 0x-prefixed hexadecimal. + # Input and output strings may be either decimal or 0x-prefixed hexadecimal depending upon the resolver implementation. scalar BigInt # Long is a 64 bit unsigned integer. scalar Long @@ -301,10 +300,10 @@ const schema string = ` type EthHeaderCid { cid: String! - blockNumber: Long! + blockNumber: BigInt! blockHash: String! parentHash: String! - timestamp: Long! + timestamp: BigInt! ethTransactionCidsByHeaderId: EthTransactionCidsConnection! } @@ -333,6 +332,7 @@ const schema string = ` # Get contract logs by block hash and contract address. getLogs(blockHash: Bytes32!, contract: Address): [Log!] + # PostGraphile alternative to get headers with transactions using block number or block hash. allEthHeaderCids(condition: EthHeaderCidCondition): EthHeaderCidsConnection } ` diff --git a/pkg/graphql/types.go b/pkg/graphql/types.go new file mode 100644 index 00000000..2756070d --- /dev/null +++ b/pkg/graphql/types.go @@ -0,0 +1,94 @@ +// VulcanizeDB +// Copyright © 2022 Vulcanize + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. + +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package graphql + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common/hexutil" +) + +type BigInt big.Int + +// ToInt converts b to a big.Int. +func (b *BigInt) ToInt() *big.Int { + return (*big.Int)(b) +} + +// String returns value of b as a decimal string. +func (b *BigInt) String() string { + return b.ToInt().String() +} + +// SetUint64 sets b to x and returns x. +func (b *BigInt) SetUint64(x uint64) *BigInt { + var val big.Int + val.SetUint64(x) + *b = (BigInt)(val) + return b +} + +// MarshalText implements encoding.TextMarshaler +func (b BigInt) MarshalText() ([]byte, error) { + return []byte(b.String()), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler +func (b *BigInt) UnmarshalText(input []byte) error { + raw, err := checkNumberText(input) + if err != nil { + return err + } + if len(raw) > 64 { + return hexutil.ErrBig256Range + } + + var val big.Int + val.SetString(string(input[:]), 10) + *b = (BigInt)(val) + return nil +} + +// ImplementsGraphQLType returns true if BigInt implements the provided GraphQL type. +func (b BigInt) ImplementsGraphQLType(name string) bool { return name == "BigInt" } + +// UnmarshalGraphQL unmarshals the provided GraphQL query data. +func (b *BigInt) UnmarshalGraphQL(input interface{}) error { + var err error + switch input := input.(type) { + case string: + return b.UnmarshalText([]byte(input)) + case int32: + var num big.Int + num.SetInt64(int64(input)) + *b = BigInt(num) + default: + err = fmt.Errorf("unexpected type %T for BigInt", input) + } + return err +} + +func checkNumberText(input []byte) (raw []byte, err error) { + if len(input) == 0 { + return nil, nil // empty strings are allowed + } + if len(input) > 1 && input[0] == '0' { + return nil, hexutil.ErrLeadingZero + } + return input, nil +} -- 2.45.2 From da1c8b233206f060cd8c256d02be6875a9342ce9 Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 27 May 2022 19:16:10 +0530 Subject: [PATCH 16/26] Implement single query for transactions and blockByMhKey --- go.mod | 1 + pkg/eth/cid_retriever.go | 42 +++++++++++++++++++---- pkg/eth/ipld_fetcher.go | 36 +++++++++++++++++++- pkg/graphql/graphql.go | 73 ++++++++++++++++++++++++++++++++++++++++ pkg/graphql/schema.go | 17 ++++++++++ pkg/shared/functions.go | 14 ++++++++ 6 files changed, 175 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 43e74ba9..cfc23a2b 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2 + github.com/thoas/go-funk v0.9.2 github.com/vulcanize/gap-filler v0.3.1 github.com/vulcanize/ipfs-ethdb/v3 v3.0.3 ) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 0872d76d..dc77608c 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -26,6 +26,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/lib/pq" log "github.com/sirupsen/logrus" + "github.com/thoas/go-funk" "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" ) @@ -592,6 +593,17 @@ func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderID(tx *sqlx.Tx, headerID string) return txCIDs, tx.Select(&txCIDs, pgStr, headerID) } +func (ecr *CIDRetriever) RetrieveTxCIDsByBlockNumber(tx *sqlx.Tx, blockNumber int64) ([]models.TxModel, error) { + log.Debug("retrieving tx cids for block number ", blockNumber) + pgStr := `SELECT CAST(block_number as Text), header_id, index, tx_hash, cid, mh_key, + dst, src, tx_data, tx_type, value + FROM eth.transaction_cids + WHERE block_number = $1 + ORDER BY index` + var txCIDs []models.TxModel + return txCIDs, tx.Select(&txCIDs, pgStr, blockNumber) +} + // RetrieveReceiptCIDsByTxIDs retrieves receipt CIDs by their associated tx IDs func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []string) ([]models.ReceiptModel, error) { log.Debugf("retrieving receipt cids for tx hashes %v", txHashes) @@ -635,13 +647,30 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) } var allTxCIDs [][]models.TxModel + txCIDs, err := ecr.RetrieveTxCIDsByBlockNumber(tx, blockNumber) + if err != nil { + log.Error("tx cid retrieval error") + return nil, nil, err + } + + txCIDsByHeaderID := funk.Reduce( + txCIDs, + func(acc map[string][]models.TxModel, txCID models.TxModel) map[string][]models.TxModel { + if _, ok := acc[txCID.HeaderID]; !ok { + acc[txCID.HeaderID] = []models.TxModel{} + } + + txCIDs = append(acc[txCID.HeaderID], txCID) + acc[txCID.HeaderID] = txCIDs + return acc + }, + make(map[string][]models.TxModel), + ) + + txCIDsByHeaderIDMap := txCIDsByHeaderID.(map[string][]models.TxModel) + for _, headerCID := range headerCIDs { - var txCIDs []models.TxModel - txCIDs, err = ecr.RetrieveTxCIDsByHeaderID(tx, headerCID.BlockHash) - if err != nil { - log.Error("tx cid retrieval error") - return nil, nil, err - } + txCIDs := txCIDsByHeaderIDMap[headerCID.BlockHash] allTxCIDs = append(allTxCIDs, txCIDs) } @@ -676,7 +705,6 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Has if err != nil { return models.HeaderModel{}, nil, err } - fmt.Println("RetrieveHeaderAndTxCIDsByBlockHash", headerCID.ParentHash, headerCID.Timestamp) var txCIDs []models.TxModel txCIDs, err = ecr.RetrieveTxCIDsByHeaderID(tx, headerCID.BlockHash) diff --git a/pkg/eth/ipld_fetcher.go b/pkg/eth/ipld_fetcher.go index 8396d368..6b191eb8 100644 --- a/pkg/eth/ipld_fetcher.go +++ b/pkg/eth/ipld_fetcher.go @@ -20,11 +20,13 @@ import ( "errors" "fmt" "math/big" + "strconv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/jmoiron/sqlx" log "github.com/sirupsen/logrus" + "github.com/thoas/go-funk" "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" ) @@ -99,7 +101,7 @@ func (f *IPLDFetcher) Fetch(cids CIDWrapper) (*IPLDs, error) { return iplds, err } -// FetchHeaders fetches headers +// FetchHeader fetches header func (f *IPLDFetcher) FetchHeader(tx *sqlx.Tx, c models.HeaderModel) (models.IPLDModel, error) { log.Debug("fetching header ipld") headerBytes, err := shared.FetchIPLDByMhKey(tx, c.MhKey) @@ -112,6 +114,38 @@ func (f *IPLDFetcher) FetchHeader(tx *sqlx.Tx, c models.HeaderModel) (models.IPL }, nil } +// FetchHeaders fetches headers +func (f *IPLDFetcher) FetchHeaders(tx *sqlx.Tx, cids []models.HeaderModel) ([]models.IPLDModel, error) { + log.Debug("fetching header iplds") + headerIPLDs := make([]models.IPLDModel, len(cids)) + + blockNumbers := make([]uint64, len(cids)) + mhKeys := make([]string, len(cids)) + for i, c := range cids { + var err error + mhKeys[i] = c.MhKey + blockNumbers[i], err = strconv.ParseUint(c.BlockNumber, 10, 64) + if err != nil { + return nil, err + } + } + + fetchedIPLDs, err := shared.FetchIPLDsByMhKeysAndBlockNumbers(tx, mhKeys, blockNumbers) + if err != nil { + return nil, err + } + + for i, c := range cids { + headerIPLD := funk.Find(fetchedIPLDs, func(ipld models.IPLDModel) bool { + return ipld.Key == c.MhKey + }).(models.IPLDModel) + + headerIPLDs[i] = headerIPLD + } + + return headerIPLDs, nil +} + // FetchUncles fetches uncles func (f *IPLDFetcher) FetchUncles(tx *sqlx.Tx, cids []models.UncleModel) ([]models.IPLDModel, error) { log.Debug("fetching uncle iplds") diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 44738003..2de90c46 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -1161,13 +1161,33 @@ func (transactionCIDResult EthTransactionCidsConnection) Nodes(ctx context.Conte return transactionCIDResult.nodes } +type IPFSBlock struct { + key string + data string +} + +func (b IPFSBlock) Key(ctx context.Context) string { + return b.key +} + +func (b IPFSBlock) Data(ctx context.Context) string { + return b.data +} + type EthHeaderCid struct { cid string blockNumber BigInt blockHash string parentHash string timestamp BigInt + stateRoot string + td BigInt + txRoot string + receiptRoot string + uncleRoot string + bloom string transactions []*EthTransactionCid + ipfsBlock IPFSBlock } func (h EthHeaderCid) Cid(ctx context.Context) string { @@ -1190,10 +1210,38 @@ func (h EthHeaderCid) Timestamp(ctx context.Context) BigInt { return h.timestamp } +func (h EthHeaderCid) StateRoot(ctx context.Context) string { + return h.stateRoot +} + +func (h EthHeaderCid) Td(ctx context.Context) BigInt { + return h.td +} + +func (h EthHeaderCid) TxRoot(ctx context.Context) string { + return h.txRoot +} + +func (h EthHeaderCid) ReceiptRoot(ctx context.Context) string { + return h.receiptRoot +} + +func (h EthHeaderCid) UncleRoot(ctx context.Context) string { + return h.uncleRoot +} + +func (h EthHeaderCid) Bloom(ctx context.Context) string { + return h.bloom +} + func (h EthHeaderCid) EthTransactionCidsByHeaderId(ctx context.Context) EthTransactionCidsConnection { return EthTransactionCidsConnection{nodes: h.transactions} } +func (h EthHeaderCid) BlockByMhKey(ctx context.Context) IPFSBlock { + return h.ipfsBlock +} + type EthHeaderCidsConnection struct { nodes []*EthHeaderCid } @@ -1230,6 +1278,17 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { return nil, fmt.Errorf("provide block number or block hash") } + // Begin tx + tx, err := r.backend.DB.Beginx() + if err != nil { + return nil, err + } + + headerIPLDs, err := r.backend.Fetcher.FetchHeaders(tx, headerCIDs) + if err != nil { + return nil, err + } + var resultNodes []*EthHeaderCid for idx, headerCID := range headerCIDs { var blockNumber BigInt @@ -1238,12 +1297,21 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { var timestamp BigInt timestamp.SetUint64(headerCID.Timestamp) + var td BigInt + td.UnmarshalText([]byte(headerCID.TotalDifficulty)) + ethHeaderCidNode := EthHeaderCid{ cid: headerCID.CID, blockNumber: blockNumber, blockHash: headerCID.BlockHash, parentHash: headerCID.ParentHash, timestamp: timestamp, + stateRoot: headerCID.StateRoot, + td: td, + txRoot: headerCID.TxRoot, + receiptRoot: headerCID.RctRoot, + uncleRoot: headerCID.UncleRoot, + bloom: hexutil.Bytes(headerCID.Bloom).String(), } txCIDs := allTxCIDs[idx] @@ -1257,6 +1325,11 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { }) } + ethHeaderCidNode.ipfsBlock = IPFSBlock{ + key: headerIPLDs[idx].Key, + data: hexutil.Bytes(headerIPLDs[idx].Data).String(), + } + resultNodes = append(resultNodes, ðHeaderCidNode) } diff --git a/pkg/graphql/schema.go b/pkg/graphql/schema.go index b8f5ef6d..2a25043e 100644 --- a/pkg/graphql/schema.go +++ b/pkg/graphql/schema.go @@ -29,6 +29,8 @@ const schema string = ` scalar BigInt # Long is a 64 bit unsigned integer. scalar Long + # BigFloat is a floating point number. + scalar BigFloat schema { query: Query @@ -298,13 +300,28 @@ const schema string = ` nodes: [EthTransactionCid]! } + type IPFSBlock { + key: String! + data: String! + } + type EthHeaderCid { cid: String! blockNumber: BigInt! blockHash: String! parentHash: String! timestamp: BigInt! + stateRoot: String! + + # TODO: Use BigFloat + td: BigInt! + + txRoot: String! + receiptRoot: String! + uncleRoot: String! + bloom: String! ethTransactionCidsByHeaderId: EthTransactionCidsConnection! + blockByMhKey: IPFSBlock! } type EthHeaderCidsConnection { diff --git a/pkg/shared/functions.go b/pkg/shared/functions.go index b1ac4550..c17d1b01 100644 --- a/pkg/shared/functions.go +++ b/pkg/shared/functions.go @@ -19,6 +19,7 @@ package shared import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/statediff/indexer/ipld" + "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" dshelp "github.com/ipfs/go-ipfs-ds-help" @@ -77,6 +78,19 @@ func FetchIPLDByMhKey(tx *sqlx.Tx, mhKey string) ([]byte, error) { return block, tx.Get(&block, pgStr, mhKey) } +// FetchIPLDByMhKeysAndBlockNumbers is used to retrieve iplds from Postgres blockstore with the provided tx, mhkey strings and blockNumbers +func FetchIPLDsByMhKeysAndBlockNumbers(tx *sqlx.Tx, mhKeys []string, blockNumbers []uint64) ([]models.IPLDModel, error) { + var blocks []models.IPLDModel + pgStr := `SELECT key, data, block_number FROM public.blocks WHERE key IN (?) AND block_number IN (?)` + query, args, err := sqlx.In(pgStr, mhKeys, blockNumbers) + if err != nil { + return blocks, err + } + query = tx.Rebind(query) + + return blocks, tx.Select(&blocks, query, args...) +} + // MultihashKeyFromCID converts a cid into a blockstore-prefixed multihash db key string func MultihashKeyFromCID(c cid.Cid) string { dbKey := dshelp.MultihashToDsKey(c.Hash()) -- 2.45.2 From 9550d6046792a750a8728220f5baabcbe44ca3bb Mon Sep 17 00:00:00 2001 From: nabarun Date: Mon, 30 May 2022 12:01:27 +0530 Subject: [PATCH 17/26] Add query ethTransactionCidByTxHash --- pkg/eth/cid_retriever.go | 32 +++++++++++++++++++++++++++ pkg/graphql/graphql.go | 48 +++++++++++++++++++++++++++++++++++----- pkg/graphql/schema.go | 4 ++++ 3 files changed, 79 insertions(+), 5 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index dc77608c..81190809 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -593,6 +593,7 @@ func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderID(tx *sqlx.Tx, headerID string) return txCIDs, tx.Select(&txCIDs, pgStr, headerID) } +// RetrieveTxCIDsByBlockNumber retrieves all tx CIDs for the given blockNumber func (ecr *CIDRetriever) RetrieveTxCIDsByBlockNumber(tx *sqlx.Tx, blockNumber int64) ([]models.TxModel, error) { log.Debug("retrieving tx cids for block number ", blockNumber) pgStr := `SELECT CAST(block_number as Text), header_id, index, tx_hash, cid, mh_key, @@ -617,6 +618,7 @@ func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []stri return rctCIDs, tx.Select(&rctCIDs, pgStr, pq.Array(txHashes)) } +// RetrieveHeaderAndTxCIDsByBlockNumber retrieves header CIDs and their associated tx CIDs by block number func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]models.HeaderModel, [][]models.TxModel, error) { log.Debug("retrieving header cids and tx cids for block number ", blockNumber) @@ -677,6 +679,7 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) return headerCIDs, allTxCIDs, nil } +// RetrieveHeaderAndTxCIDsByBlockHash retrieves header CID and their associated tx CIDs by block hash func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (models.HeaderModel, []models.TxModel, error) { log.Debug("retrieving header cid and tx cids for block hash ", blockHash.String()) @@ -715,3 +718,32 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Has return headerCID, txCIDs, nil } + +// RetrieveTxCIDByHash returns the tx for the given tx hash +func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (models.TxModel, error) { + log.Debug("retrieving tx cid for tx hash ", txHash) + + // Begin new db tx + tx, err := ecr.db.Beginx() + if err != nil { + return models.TxModel{}, err + } + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + pgStr := `SELECT CAST(block_number as Text), header_id, index, tx_hash, cid, mh_key, + dst, src, tx_data, tx_type, value + FROM eth.transaction_cids + WHERE tx_hash = $1 + ORDER BY index` + var txCID models.TxModel + return txCID, tx.Get(&txCID, pgStr, txHash) +} diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 2de90c46..c5553993 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -1126,11 +1126,12 @@ func decomposeGQLLogs(logCIDs []eth.LogResult) []logsCID { } type EthTransactionCid struct { - cid string - txHash string - index int32 - src string - dst string + cid string + txHash string + index int32 + src string + dst string + ipfsBlock IPFSBlock } func (t EthTransactionCid) Cid(ctx context.Context) string { @@ -1153,6 +1154,10 @@ func (t EthTransactionCid) Dst(ctx context.Context) string { return t.dst } +func (t EthTransactionCid) BlockByMhKey(ctx context.Context) IPFSBlock { + return t.ipfsBlock +} + type EthTransactionCidsConnection struct { nodes []*EthTransactionCid } @@ -1337,3 +1342,36 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { nodes: resultNodes, }, nil } + +func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { + TxHash string +}) (*EthTransactionCid, error) { + txCID, err := r.backend.Retriever.RetrieveTxCIDByHash(args.TxHash) + + if err != nil { + return nil, err + } + + // Begin tx + tx, err := r.backend.DB.Beginx() + if err != nil { + return nil, err + } + + txIPLDs, err := r.backend.Fetcher.FetchTrxs(tx, []models.TxModel{txCID}) + if err != nil { + return nil, err + } + + return &EthTransactionCid{ + cid: txCID.CID, + txHash: txCID.TxHash, + index: int32(txCID.Index), + src: txCID.Src, + dst: txCID.Dst, + ipfsBlock: IPFSBlock{ + key: txIPLDs[0].Key, + data: hexutil.Bytes(txIPLDs[0].Data).String(), + }, + }, nil +} diff --git a/pkg/graphql/schema.go b/pkg/graphql/schema.go index 2a25043e..48a2309c 100644 --- a/pkg/graphql/schema.go +++ b/pkg/graphql/schema.go @@ -294,6 +294,7 @@ const schema string = ` index: Int! src: String! dst: String! + blockByMhKey: IPFSBlock! } type EthTransactionCidsConnection { @@ -351,5 +352,8 @@ const schema string = ` # PostGraphile alternative to get headers with transactions using block number or block hash. allEthHeaderCids(condition: EthHeaderCidCondition): EthHeaderCidsConnection + + # PostGraphile alternative to get transactions using transaction hash. + ethTransactionCidByTxHash(txHash: String!): EthTransactionCid } ` -- 2.45.2 From 217cfc63ec95f3a5207ac820c5237493a9fe70ff Mon Sep 17 00:00:00 2001 From: nabarun Date: Mon, 30 May 2022 17:24:14 +0530 Subject: [PATCH 18/26] Return empty headerCIDs and commit db tx --- pkg/eth/cid_retriever.go | 3 --- pkg/eth/ipld_fetcher.go | 4 ++++ pkg/graphql/graphql.go | 21 +++++++++++++++++++++ pkg/graphql/schema.go | 5 ----- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 81190809..206ca791 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -644,9 +644,6 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) log.Error("header cid retrieval error") return nil, nil, err } - if len(headerCIDs) < 1 { - return nil, nil, fmt.Errorf("header cid retrieval error, no header CIDs found at block %d", blockNumber) - } var allTxCIDs [][]models.TxModel txCIDs, err := ecr.RetrieveTxCIDsByBlockNumber(tx, blockNumber) diff --git a/pkg/eth/ipld_fetcher.go b/pkg/eth/ipld_fetcher.go index 6b191eb8..965028c1 100644 --- a/pkg/eth/ipld_fetcher.go +++ b/pkg/eth/ipld_fetcher.go @@ -119,6 +119,10 @@ func (f *IPLDFetcher) FetchHeaders(tx *sqlx.Tx, cids []models.HeaderModel) ([]mo log.Debug("fetching header iplds") headerIPLDs := make([]models.IPLDModel, len(cids)) + if len(cids) < 1 { + return headerIPLDs, nil + } + blockNumbers := make([]uint64, len(cids)) mhKeys := make([]string, len(cids)) for i, c := range cids { diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index c5553993..19480ab5 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -36,6 +36,7 @@ import ( "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/vulcanize/ipld-eth-server/v3/pkg/eth" + "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" ) var ( @@ -1288,6 +1289,16 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { if err != nil { return nil, err } + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() headerIPLDs, err := r.backend.Fetcher.FetchHeaders(tx, headerCIDs) if err != nil { @@ -1357,6 +1368,16 @@ func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { if err != nil { return nil, err } + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() txIPLDs, err := r.backend.Fetcher.FetchTrxs(tx, []models.TxModel{txCID}) if err != nil { diff --git a/pkg/graphql/schema.go b/pkg/graphql/schema.go index 48a2309c..eb0d89fc 100644 --- a/pkg/graphql/schema.go +++ b/pkg/graphql/schema.go @@ -29,8 +29,6 @@ const schema string = ` scalar BigInt # Long is a 64 bit unsigned integer. scalar Long - # BigFloat is a floating point number. - scalar BigFloat schema { query: Query @@ -313,10 +311,7 @@ const schema string = ` parentHash: String! timestamp: BigInt! stateRoot: String! - - # TODO: Use BigFloat td: BigInt! - txRoot: String! receiptRoot: String! uncleRoot: String! -- 2.45.2 From 7f15befdeeb5b0f946308d26b39b25aefebededb Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Mon, 30 May 2022 18:09:50 +0530 Subject: [PATCH 19/26] Add custom implementation for Bytes to be returned as string --- pkg/graphql/graphql.go | 6 +++--- pkg/graphql/types.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 19480ab5..1c8cc31b 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -1327,7 +1327,7 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { txRoot: headerCID.TxRoot, receiptRoot: headerCID.RctRoot, uncleRoot: headerCID.UncleRoot, - bloom: hexutil.Bytes(headerCID.Bloom).String(), + bloom: Bytes(headerCID.Bloom).String(), } txCIDs := allTxCIDs[idx] @@ -1343,7 +1343,7 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { ethHeaderCidNode.ipfsBlock = IPFSBlock{ key: headerIPLDs[idx].Key, - data: hexutil.Bytes(headerIPLDs[idx].Data).String(), + data: Bytes(headerIPLDs[idx].Data).String(), } resultNodes = append(resultNodes, ðHeaderCidNode) @@ -1392,7 +1392,7 @@ func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { dst: txCID.Dst, ipfsBlock: IPFSBlock{ key: txIPLDs[0].Key, - data: hexutil.Bytes(txIPLDs[0].Data).String(), + data: Bytes(txIPLDs[0].Data).String(), }, }, nil } diff --git a/pkg/graphql/types.go b/pkg/graphql/types.go index 2756070d..7213cecc 100644 --- a/pkg/graphql/types.go +++ b/pkg/graphql/types.go @@ -17,12 +17,40 @@ package graphql import ( + "encoding/hex" "fmt" "math/big" "github.com/ethereum/go-ethereum/common/hexutil" ) +// Bytes marshals as a JSON string with \x prefix. +// The empty slice marshals as "\x". +type Bytes []byte + +// MarshalText implements encoding.TextMarshaler +func (b Bytes) MarshalText() ([]byte, error) { + result := make([]byte, len(b)*2+2) + copy(result, `\x`) + hex.Encode(result[2:], b) + return result, nil +} + +// String returns the hex encoding of b. +func (b Bytes) String() string { + return b.encode() +} + +// Encode encodes b as a hex string with "\x" prefix. +// This is to make the output to be the same as given by postgraphile. +// graphql-go prepends another "\" to the output resulting in prefix "\\x". +func (b Bytes) encode() string { + result := make([]byte, len(b)*2+2) + copy(result, `\x`) + hex.Encode(result[2:], b) + return string(result) +} + type BigInt big.Int // ToInt converts b to a big.Int. -- 2.45.2 From 80413211c2a9d0d5ff34c44dcca6d5a817c9b488 Mon Sep 17 00:00:00 2001 From: nabarun Date: Mon, 30 May 2022 19:41:03 +0530 Subject: [PATCH 20/26] Remove block_number from queries for v3 schema --- pkg/eth/cid_retriever.go | 36 +++++++++++++++++++++++++++--------- pkg/eth/ipld_fetcher.go | 5 +---- pkg/shared/functions.go | 6 +++--- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 206ca791..789ad459 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -577,7 +577,8 @@ func (ecr *CIDRetriever) RetrieveBlockByNumber(blockNumber int64) (models.Header // RetrieveHeaderCIDByHash returns the header for the given block hash func (ecr *CIDRetriever) RetrieveHeaderCIDByHash(tx *sqlx.Tx, blockHash common.Hash) (models.HeaderModel, error) { log.Debug("retrieving header cids for block hash ", blockHash.String()) - pgStr := `SELECT block_hash, CAST(block_number as Text), parent_hash, cid, mh_key, timestamp FROM eth.header_cids + pgStr := `SELECT block_hash, CAST(block_number as Text), parent_hash, cid, mh_key, CAST(td as Text), + state_root,uncle_root,tx_root,receipt_root,bloom,timestamp FROM eth.header_cids WHERE block_hash = $1` var headerCID models.HeaderModel return headerCID, tx.Get(&headerCID, pgStr, blockHash.String()) @@ -593,16 +594,27 @@ func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderID(tx *sqlx.Tx, headerID string) return txCIDs, tx.Select(&txCIDs, pgStr, headerID) } -// RetrieveTxCIDsByBlockNumber retrieves all tx CIDs for the given blockNumber -func (ecr *CIDRetriever) RetrieveTxCIDsByBlockNumber(tx *sqlx.Tx, blockNumber int64) ([]models.TxModel, error) { - log.Debug("retrieving tx cids for block number ", blockNumber) - pgStr := `SELECT CAST(block_number as Text), header_id, index, tx_hash, cid, mh_key, +// RetrieveTxCIDsByHeaderIDs retrieves all tx CIDs for the given headerIDs +func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderIDs(tx *sqlx.Tx, headerIDs []string) ([]models.TxModel, error) { + log.Debug("retrieving tx cids for headerIDs ", headerIDs) + pgStr := `SELECT header_id, index, tx_hash, cid, mh_key, dst, src, tx_data, tx_type, value FROM eth.transaction_cids - WHERE block_number = $1 + WHERE header_id in (?) ORDER BY index` + var txCIDs []models.TxModel - return txCIDs, tx.Select(&txCIDs, pgStr, blockNumber) + if len(headerIDs) < 1 { + return txCIDs, nil + } + + query, args, err := sqlx.In(pgStr, headerIDs) + if err != nil { + return txCIDs, err + } + query = tx.Rebind(query) + + return txCIDs, tx.Select(&txCIDs, query, args...) } // RetrieveReceiptCIDsByTxIDs retrieves receipt CIDs by their associated tx IDs @@ -646,7 +658,13 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) } var allTxCIDs [][]models.TxModel - txCIDs, err := ecr.RetrieveTxCIDsByBlockNumber(tx, blockNumber) + txHeaderIDs := funk.Map( + headerCIDs, + func(headerCID models.HeaderModel) string { + return headerCID.BlockHash + }, + ) + txCIDs, err := ecr.RetrieveTxCIDsByHeaderIDs(tx, txHeaderIDs.([]string)) if err != nil { log.Error("tx cid retrieval error") return nil, nil, err @@ -736,7 +754,7 @@ func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (models.TxModel, err } }() - pgStr := `SELECT CAST(block_number as Text), header_id, index, tx_hash, cid, mh_key, + pgStr := `SELECT header_id, index, tx_hash, cid, mh_key, dst, src, tx_data, tx_type, value FROM eth.transaction_cids WHERE tx_hash = $1 diff --git a/pkg/eth/ipld_fetcher.go b/pkg/eth/ipld_fetcher.go index 965028c1..fa0d4c57 100644 --- a/pkg/eth/ipld_fetcher.go +++ b/pkg/eth/ipld_fetcher.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" "math/big" - "strconv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/statediff/indexer/models" @@ -123,18 +122,16 @@ func (f *IPLDFetcher) FetchHeaders(tx *sqlx.Tx, cids []models.HeaderModel) ([]mo return headerIPLDs, nil } - blockNumbers := make([]uint64, len(cids)) mhKeys := make([]string, len(cids)) for i, c := range cids { var err error mhKeys[i] = c.MhKey - blockNumbers[i], err = strconv.ParseUint(c.BlockNumber, 10, 64) if err != nil { return nil, err } } - fetchedIPLDs, err := shared.FetchIPLDsByMhKeysAndBlockNumbers(tx, mhKeys, blockNumbers) + fetchedIPLDs, err := shared.FetchIPLDsByMhKeys(tx, mhKeys) if err != nil { return nil, err } diff --git a/pkg/shared/functions.go b/pkg/shared/functions.go index c17d1b01..eede20bc 100644 --- a/pkg/shared/functions.go +++ b/pkg/shared/functions.go @@ -79,10 +79,10 @@ func FetchIPLDByMhKey(tx *sqlx.Tx, mhKey string) ([]byte, error) { } // FetchIPLDByMhKeysAndBlockNumbers is used to retrieve iplds from Postgres blockstore with the provided tx, mhkey strings and blockNumbers -func FetchIPLDsByMhKeysAndBlockNumbers(tx *sqlx.Tx, mhKeys []string, blockNumbers []uint64) ([]models.IPLDModel, error) { +func FetchIPLDsByMhKeys(tx *sqlx.Tx, mhKeys []string) ([]models.IPLDModel, error) { var blocks []models.IPLDModel - pgStr := `SELECT key, data, block_number FROM public.blocks WHERE key IN (?) AND block_number IN (?)` - query, args, err := sqlx.In(pgStr, mhKeys, blockNumbers) + pgStr := `SELECT key, data FROM public.blocks WHERE key IN (?)` + query, args, err := sqlx.In(pgStr, mhKeys) if err != nil { return blocks, err } -- 2.45.2 From 0c44882cb274d5c8dec08f9472b530627e1b2c73 Mon Sep 17 00:00:00 2001 From: nabarun Date: Wed, 1 Jun 2022 14:45:48 +0530 Subject: [PATCH 21/26] Added test for allEthHeaderCids query --- pkg/graphql/client.go | 106 ++++++++++++++++++++++++++++++++++++ pkg/graphql/graphql_test.go | 99 +++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) diff --git a/pkg/graphql/client.go b/pkg/graphql/client.go index 1040b1bc..255c0951 100644 --- a/pkg/graphql/client.go +++ b/pkg/graphql/client.go @@ -36,6 +36,48 @@ type GetLogs struct { Responses []LogResponse `json:"getLogs"` } +type IPFSBlockResp struct { + Key string `json:"key"` + Data string `json:"data"` +} + +type EthTransactionCidResp struct { + Cid string `json:"cid"` + TxHash string `json:"txHash"` + Index int32 `json:"index"` + Src string `json:"src"` + Dst string `json:"dst"` + BlockByMhKey IPFSBlockResp `json:"blockByMhKey"` +} + +type EthTransactionCidsByHeaderIdResp struct { + Nodes []EthTransactionCidResp `json:"nodes"` +} + +type EthHeaderCidResp struct { + Cid string `json:"cid"` + BlockNumber BigInt `json:"blockNumber"` + BlockHash string `json:"blockHash"` + ParentHash string `json:"parentHash"` + Timestamp BigInt `json:"timestamp"` + StateRoot string `json:"stateRoot"` + Td BigInt `json:"td"` + TxRoot string `json:"txRoot"` + ReceiptRoot string `json:"receiptRoot"` + UncleRoot string `json:"uncleRoot"` + Bloom string `json:"bloom"` + EthTransactionCidsByHeaderId EthTransactionCidsByHeaderIdResp `json:"ethTransactionCidsByHeaderId"` + BlockByMhKey IPFSBlockResp `json:"blockByMhKey"` +} + +type AllEthHeaderCidsResp struct { + Nodes []EthHeaderCidResp `json:"nodes"` +} + +type AllEthHeaderCids struct { + Response AllEthHeaderCidsResp `json:"allEthHeaderCids"` +} + type Client struct { client *gqlclient.Client } @@ -117,3 +159,67 @@ func (c *Client) GetStorageAt(ctx context.Context, hash common.Hash, address com } return &storageAt.Response, nil } + +func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCondition) (*AllEthHeaderCidsResp, error) { + var params string + if condition.BlockHash != nil { + params = fmt.Sprintf(`blockHash: "%s"`, *condition.BlockHash) + } + if condition.BlockNumber != nil { + params += fmt.Sprintf(`blockNumber: "%s"`, condition.BlockNumber.String()) + } + + getLogsQuery := fmt.Sprintf(` + query{ + allEthHeaderCids(condition: { %s }) { + nodes { + cid + blockNumber + blockHash + parentHash + timestamp + stateRoot + td + txRoot + receiptRoot + uncleRoot + bloom + blockByMhKey { + key + data + } + ethTransactionCidsByHeaderId { + nodes { + cid + txHash + index + src + dst + } + } + } + } + } + `, params) + + req := gqlclient.NewRequest(getLogsQuery) + req.Header.Set("Cache-Control", "no-cache") + + var respData map[string]interface{} + err := c.client.Run(ctx, req, &respData) + if err != nil { + return nil, err + } + + jsonStr, err := json.Marshal(respData) + if err != nil { + return nil, err + } + + var allEthHeaderCids AllEthHeaderCids + err = json.Unmarshal(jsonStr, &allEthHeaderCids) + if err != nil { + return nil, err + } + return &allEthHeaderCids.Response, nil +} diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index 50375b3a..031ddb70 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "math/big" + "strconv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -30,6 +31,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/statediff" + "github.com/ethereum/go-ethereum/statediff/indexer/models" sdtypes "github.com/ethereum/go-ethereum/statediff/types" "github.com/jmoiron/sqlx" . "github.com/onsi/ginkgo" @@ -250,4 +252,101 @@ var _ = Describe("GraphQL", func() { Expect(storageRes.Value).To(Equal(common.Hash{})) }) }) + + Describe("allEthHeaderCids", func() { + It("Retrieves header_cids that matches the provided blockNumber", func() { + allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockNumber: new(graphql.BigInt).SetUint64(2)}) + Expect(err).ToNot(HaveOccurred()) + + headerCIDs, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(2) + Expect(err).ToNot(HaveOccurred()) + + // Begin tx + tx, err := backend.DB.Beginx() + Expect(err).ToNot(HaveOccurred()) + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + headerIPLDs, err := backend.Fetcher.FetchHeaders(tx, headerCIDs) + Expect(err).ToNot(HaveOccurred()) + + for idx, headerCID := range headerCIDs { + ethHeaderCid := allEthHeaderCidsResp.Nodes[idx] + + compareEthHeaderCid(ethHeaderCid, headerCID, txCIDs[idx], headerIPLDs[idx]) + } + }) + + It("Retrieves header_cids that matches the provided blockHash", func() { + blockHash := blocks[2].Hash().String() + allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockHash: &blockHash}) + Expect(err).ToNot(HaveOccurred()) + + headerCID, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[2].Hash()) + Expect(err).ToNot(HaveOccurred()) + + // Begin tx + tx, err := backend.DB.Beginx() + Expect(err).ToNot(HaveOccurred()) + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + headerIPLDs, err := backend.Fetcher.FetchHeaders(tx, []models.HeaderModel{headerCID}) + Expect(err).ToNot(HaveOccurred()) + Expect(len(allEthHeaderCidsResp.Nodes)).To(Equal(1)) + + Expect(len(allEthHeaderCidsResp.Nodes)).To(Equal(1)) + ethHeaderCid := allEthHeaderCidsResp.Nodes[0] + compareEthHeaderCid(ethHeaderCid, headerCID, txCIDs, headerIPLDs[0]) + }) + }) }) + +func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID models.HeaderModel, txCIDs []models.TxModel, headerIPLD models.IPLDModel) { + blockNumber, err := strconv.ParseInt(headerCID.BlockNumber, 10, 64) + Expect(err).ToNot(HaveOccurred()) + + td, err := strconv.ParseInt(headerCID.TotalDifficulty, 10, 64) + Expect(err).ToNot(HaveOccurred()) + + Expect(ethHeaderCid.Cid).To(Equal(headerCID.CID)) + Expect(ethHeaderCid.BlockNumber).To(Equal(*new(graphql.BigInt).SetUint64(uint64(blockNumber)))) + Expect(ethHeaderCid.BlockHash).To(Equal(headerCID.BlockHash)) + Expect(ethHeaderCid.ParentHash).To(Equal(headerCID.ParentHash)) + Expect(ethHeaderCid.Timestamp).To(Equal(*new(graphql.BigInt).SetUint64(headerCID.Timestamp))) + Expect(ethHeaderCid.StateRoot).To(Equal(headerCID.StateRoot)) + Expect(ethHeaderCid.Td).To(Equal(*new(graphql.BigInt).SetUint64(uint64(td)))) + Expect(ethHeaderCid.TxRoot).To(Equal(headerCID.TxRoot)) + Expect(ethHeaderCid.ReceiptRoot).To(Equal(headerCID.RctRoot)) + Expect(ethHeaderCid.UncleRoot).To(Equal(headerCID.UncleRoot)) + Expect(ethHeaderCid.Bloom).To(Equal(graphql.Bytes(headerCID.Bloom).String())) + + for tIdx, txCID := range txCIDs { + ethTxCid := ethHeaderCid.EthTransactionCidsByHeaderId.Nodes[tIdx] + + Expect(ethTxCid.Cid).To(Equal(txCID.CID)) + Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) + Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) + Expect(ethTxCid.Src).To(Equal(txCID.Src)) + Expect(ethTxCid.Dst).To(Equal(txCID.Dst)) + } + + Expect(ethHeaderCid.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerIPLD.Data).String())) + Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerIPLD.Key)) +} -- 2.45.2 From b3d9e01d67a8cffe9ad8b38daec77834ec31bceb Mon Sep 17 00:00:00 2001 From: nabarun Date: Wed, 1 Jun 2022 16:45:02 +0530 Subject: [PATCH 22/26] Add test for ethTransactionCidByTxHash query --- pkg/graphql/client.go | 46 +++++++++++++++++++++++++++++++-- pkg/graphql/graphql_test.go | 51 +++++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/pkg/graphql/client.go b/pkg/graphql/client.go index 255c0951..53420db8 100644 --- a/pkg/graphql/client.go +++ b/pkg/graphql/client.go @@ -50,6 +50,10 @@ type EthTransactionCidResp struct { BlockByMhKey IPFSBlockResp `json:"blockByMhKey"` } +type EthTransactionCidByTxHash struct { + Response EthTransactionCidResp `json:"ethTransactionCidByTxHash"` +} + type EthTransactionCidsByHeaderIdResp struct { Nodes []EthTransactionCidResp `json:"nodes"` } @@ -169,7 +173,7 @@ func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCon params += fmt.Sprintf(`blockNumber: "%s"`, condition.BlockNumber.String()) } - getLogsQuery := fmt.Sprintf(` + getHeadersQuery := fmt.Sprintf(` query{ allEthHeaderCids(condition: { %s }) { nodes { @@ -202,7 +206,7 @@ func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCon } `, params) - req := gqlclient.NewRequest(getLogsQuery) + req := gqlclient.NewRequest(getHeadersQuery) req.Header.Set("Cache-Control", "no-cache") var respData map[string]interface{} @@ -223,3 +227,41 @@ func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCon } return &allEthHeaderCids.Response, nil } + +func (c *Client) EthTransactionCidByTxHash(ctx context.Context, txHash string) (*EthTransactionCidResp, error) { + getTxQuery := fmt.Sprintf(` + query{ + ethTransactionCidByTxHash(txHash: "%s") { + cid + txHash + index + src + dst + blockByMhKey { + data + } + } + } + `, txHash) + + req := gqlclient.NewRequest(getTxQuery) + req.Header.Set("Cache-Control", "no-cache") + + var respData map[string]interface{} + err := c.client.Run(ctx, req, &respData) + if err != nil { + return nil, err + } + + jsonStr, err := json.Marshal(respData) + if err != nil { + return nil, err + } + + var ethTxCid EthTransactionCidByTxHash + err = json.Unmarshal(jsonStr, ðTxCid) + if err != nil { + return nil, err + } + return ðTxCid.Response, nil +} diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index 031ddb70..fc8259a4 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -286,11 +286,11 @@ var _ = Describe("GraphQL", func() { }) It("Retrieves header_cids that matches the provided blockHash", func() { - blockHash := blocks[2].Hash().String() + blockHash := blocks[1].Hash().String() allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockHash: &blockHash}) Expect(err).ToNot(HaveOccurred()) - headerCID, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[2].Hash()) + headerCID, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash()) Expect(err).ToNot(HaveOccurred()) // Begin tx @@ -316,6 +316,38 @@ var _ = Describe("GraphQL", func() { compareEthHeaderCid(ethHeaderCid, headerCID, txCIDs, headerIPLDs[0]) }) }) + + Describe("ethTransactionCidByTxHash", func() { + It("Retrieves tx_cid that matches the provided txHash", func() { + txHash := blocks[2].Transactions()[0].Hash().String() + ethTransactionCidResp, err := client.EthTransactionCidByTxHash(ctx, txHash) + Expect(err).ToNot(HaveOccurred()) + + txCID, err := backend.Retriever.RetrieveTxCIDByHash(txHash) + Expect(err).ToNot(HaveOccurred()) + + compareEthTxCid(*ethTransactionCidResp, txCID) + + // Begin tx + tx, err := backend.DB.Beginx() + Expect(err).ToNot(HaveOccurred()) + defer func() { + if p := recover(); p != nil { + shared.Rollback(tx) + panic(p) + } else if err != nil { + shared.Rollback(tx) + } else { + err = tx.Commit() + } + }() + + txIPLDs, err := backend.Fetcher.FetchTrxs(tx, []models.TxModel{txCID}) + Expect(err).ToNot(HaveOccurred()) + Expect(len(txIPLDs)).To(Equal(1)) + Expect(ethTransactionCidResp.BlockByMhKey.Data).To(Equal(graphql.Bytes(txIPLDs[0].Data).String())) + }) + }) }) func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID models.HeaderModel, txCIDs []models.TxModel, headerIPLD models.IPLDModel) { @@ -339,14 +371,17 @@ func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID models for tIdx, txCID := range txCIDs { ethTxCid := ethHeaderCid.EthTransactionCidsByHeaderId.Nodes[tIdx] - - Expect(ethTxCid.Cid).To(Equal(txCID.CID)) - Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) - Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) - Expect(ethTxCid.Src).To(Equal(txCID.Src)) - Expect(ethTxCid.Dst).To(Equal(txCID.Dst)) + compareEthTxCid(ethTxCid, txCID) } Expect(ethHeaderCid.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerIPLD.Data).String())) Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerIPLD.Key)) } + +func compareEthTxCid(ethTxCid graphql.EthTransactionCidResp, txCID models.TxModel) { + Expect(ethTxCid.Cid).To(Equal(txCID.CID)) + Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) + Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) + Expect(ethTxCid.Src).To(Equal(txCID.Src)) + Expect(ethTxCid.Dst).To(Equal(txCID.Dst)) +} -- 2.45.2 From 6bd563e3d5002959924a838651f2883cc5ecc010 Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 3 Jun 2022 14:30:20 +0530 Subject: [PATCH 23/26] Use GORM to retrieve data from database --- go.mod | 19 ++-- go.sum | 29 +++-- pkg/eth/cid_retriever.go | 217 ++++++++++++++---------------------- pkg/eth/ipld_fetcher.go | 35 ------ pkg/graphql/graphql.go | 53 ++------- pkg/graphql/graphql_test.go | 73 ++---------- pkg/shared/functions.go | 14 --- 7 files changed, 138 insertions(+), 302 deletions(-) diff --git a/go.mod b/go.mod index cfc23a2b..a6ef0b0b 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v1.0.1 github.com/ipfs/go-ipfs-ds-help v1.0.0 github.com/ipfs/go-ipld-format v0.2.0 + github.com/jinzhu/now v1.1.5 // indirect github.com/jmoiron/sqlx v1.3.5 github.com/joho/godotenv v1.4.0 github.com/lib/pq v1.10.5 @@ -22,10 +23,13 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 + github.com/thoas/go-funk v0.9.2 // indirect github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.2 - github.com/thoas/go-funk v0.9.2 github.com/vulcanize/gap-filler v0.3.1 github.com/vulcanize/ipfs-ethdb/v3 v3.0.3 + golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + gorm.io/driver/postgres v1.3.7 + gorm.io/gorm v1.23.5 ) require ( @@ -124,18 +128,19 @@ require ( github.com/ipld/go-codec-dagpb v1.3.0 // indirect github.com/ipld/go-ipld-prime v0.12.2 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.10.0 // indirect + github.com/jackc/pgconn v1.12.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.1.1 // indirect + github.com/jackc/pgproto3/v2 v2.3.0 // indirect github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/pgtype v1.8.1 // indirect - github.com/jackc/pgx/v4 v4.13.0 // indirect - github.com/jackc/puddle v1.1.3 // indirect + github.com/jackc/pgtype v1.11.0 // indirect + github.com/jackc/pgx/v4 v4.16.1 // indirect + github.com/jackc/puddle v1.2.1 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect github.com/jinzhu/copier v0.2.4 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect github.com/klauspost/compress v1.11.7 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/koron/go-ssdp v0.0.2 // indirect @@ -244,7 +249,6 @@ require ( github.com/stretchr/testify v1.7.1 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/thoas/go-funk v0.9.2 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect @@ -266,7 +270,6 @@ require ( go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.19.0 // indirect go4.org v0.0.0-20200411211856-f5505b9728dd // indirect - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect diff --git a/go.sum b/go.sum index 8df04b33..eb2c8782 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,7 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= @@ -788,8 +789,9 @@ github.com/jackc/pgconn v1.7.0/go.mod h1:sF/lPpNEMEOp+IYhyQGdAvrG20gWf6A1tKlr0v7 github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.0 h1:4EYhlDVEMsJ30nNj0mmgwIUXoq7e9sMJrVC2ED6QlCU= github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8= +github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= @@ -807,8 +809,9 @@ github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwX github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.5/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1 h1:7PQ/4gLoqnl87ZxL7xjO0DR5gYuviDCZxQJsUlFW1eI= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= +github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= @@ -821,8 +824,9 @@ github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkAL github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.8.1 h1:9k0IXtdJXHJbyAWQgbWr1lU+MEhPXZz6RIXxfR5oxXs= github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= +github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= @@ -833,15 +837,17 @@ github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6 github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= github.com/jackc/pgx/v4 v4.8.1/go.mod h1:4HOLxrl8wToZJReD04/yB20GDwf4KBYETvlHciCnwW0= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.13.0 h1:JCjhT5vmhMAf/YwBHLvrBn4OGdIQBiFG6ym8Zmdx570= github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= +github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y= +github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.2/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3 h1:JnPg/5Q9xVJGfjsO5CPUOjnJps1JaRUm8I9FXVCFK94= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1 h1:gI8os0wpRXFd4FiAY2dWiqRK037tjj3t7rKFeO4X5iw= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= @@ -866,8 +872,12 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jinzhu/copier v0.2.4 h1:dT3tI+8GzU8DjJFCj9mLYtjfRtUmK7edauduQdcZCpI= github.com/jinzhu/copier v0.2.4/go.mod h1:24xnZezI2Yqac9J61UC6/dG/k76ttpq0DdJI3QmUvro= github.com/jinzhu/gorm v1.9.12/go.mod h1:vhTjlKSJUTWNtcbQtrMBFCxy7eXTzeCAzfL5fBZT/Qs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -1920,8 +1930,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2423,6 +2433,11 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/postgres v1.3.7 h1:FKF6sIMDHDEvvMF/XJvbnCl0nu6KSKUaPXevJ4r+VYQ= +gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= +gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.5 h1:TnlF26wScKSvknUC/Rn8t0NLLM22fypYBlvj1+aH6dM= +gorm.io/gorm v1.23.5/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 789ad459..04a5c719 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -26,7 +26,8 @@ import ( "github.com/jmoiron/sqlx" "github.com/lib/pq" log "github.com/sirupsen/logrus" - "github.com/thoas/go-funk" + "gorm.io/driver/postgres" + "gorm.io/gorm" "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" ) @@ -40,13 +41,70 @@ type Retriever interface { // CIDRetriever satisfies the CIDRetriever interface for ethereum type CIDRetriever struct { - db *sqlx.DB + db *sqlx.DB + gormDB *gorm.DB +} + +type IPLD struct { + models.IPLDModel +} + +// TableName overrides the table name used by IPLD +func (IPLD) TableName() string { + return "public.blocks" +} + +type HeaderCid struct { + CID string `gorm:"column:cid"` + BlockHash string `gorm:"primaryKey"` + BlockNumber string + ParentHash string + Timestamp uint64 + StateRoot string + TotalDifficulty string `gorm:"column:td"` + TxRoot string + RctRoot string `gorm:"column:receipt_root"` + UncleRoot string + Bloom []byte + MhKey string + TransactionCids []TransactionCid `gorm:"foreignKey:HeaderID;references:BlockHash"` + IPLD IPLD `gorm:"foreignKey:MhKey;references:Key"` +} + +// TableName overrides the table name used by HeaderCid +func (HeaderCid) TableName() string { + return "eth.header_cids" +} + +type TransactionCid struct { + CID string `gorm:"column:cid"` + TxHash string `gorm:"primaryKey"` + HeaderID string `gorm:"column:header_id"` + Index int64 + Src string + Dst string + MhKey string + IPLD IPLD `gorm:"foreignKey:MhKey;references:Key"` +} + +// TableName overrides the table name used by TransactionCid +func (TransactionCid) TableName() string { + return "eth.transaction_cids" } // NewCIDRetriever returns a pointer to a new CIDRetriever which supports the CIDRetriever interface func NewCIDRetriever(db *sqlx.DB) *CIDRetriever { + gormDB, err := gorm.Open(postgres.New(postgres.Config{ + Conn: db, + }), &gorm.Config{}) + if err != nil { + log.Error(err) + return nil + } + return &CIDRetriever{ - db: db, + db: db, + gormDB: gormDB, } } @@ -594,29 +652,6 @@ func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderID(tx *sqlx.Tx, headerID string) return txCIDs, tx.Select(&txCIDs, pgStr, headerID) } -// RetrieveTxCIDsByHeaderIDs retrieves all tx CIDs for the given headerIDs -func (ecr *CIDRetriever) RetrieveTxCIDsByHeaderIDs(tx *sqlx.Tx, headerIDs []string) ([]models.TxModel, error) { - log.Debug("retrieving tx cids for headerIDs ", headerIDs) - pgStr := `SELECT header_id, index, tx_hash, cid, mh_key, - dst, src, tx_data, tx_type, value - FROM eth.transaction_cids - WHERE header_id in (?) - ORDER BY index` - - var txCIDs []models.TxModel - if len(headerIDs) < 1 { - return txCIDs, nil - } - - query, args, err := sqlx.In(pgStr, headerIDs) - if err != nil { - return txCIDs, err - } - query = tx.Rebind(query) - - return txCIDs, tx.Select(&txCIDs, query, args...) -} - // RetrieveReceiptCIDsByTxIDs retrieves receipt CIDs by their associated tx IDs func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []string) ([]models.ReceiptModel, error) { log.Debugf("retrieving receipt cids for tx hashes %v", txHashes) @@ -631,134 +666,50 @@ func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []stri } // RetrieveHeaderAndTxCIDsByBlockNumber retrieves header CIDs and their associated tx CIDs by block number -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]models.HeaderModel, [][]models.TxModel, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCid, error) { log.Debug("retrieving header cids and tx cids for block number ", blockNumber) - // Begin new db tx - tx, err := ecr.db.Beginx() - if err != nil { - return nil, nil, err - } - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() + var headerCIDs []HeaderCid - var headerCIDs []models.HeaderModel - headerCIDs, err = ecr.RetrieveHeaderCIDs(tx, blockNumber) + // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 + // Will use join for TransactionCids once preload for 1:N is supported. + err := ecr.gormDB.Preload("TransactionCids").Joins("IPLD").Find(&headerCIDs, "block_number = ?", blockNumber).Error if err != nil { log.Error("header cid retrieval error") - return nil, nil, err + return nil, err } - var allTxCIDs [][]models.TxModel - txHeaderIDs := funk.Map( - headerCIDs, - func(headerCID models.HeaderModel) string { - return headerCID.BlockHash - }, - ) - txCIDs, err := ecr.RetrieveTxCIDsByHeaderIDs(tx, txHeaderIDs.([]string)) - if err != nil { - log.Error("tx cid retrieval error") - return nil, nil, err - } - - txCIDsByHeaderID := funk.Reduce( - txCIDs, - func(acc map[string][]models.TxModel, txCID models.TxModel) map[string][]models.TxModel { - if _, ok := acc[txCID.HeaderID]; !ok { - acc[txCID.HeaderID] = []models.TxModel{} - } - - txCIDs = append(acc[txCID.HeaderID], txCID) - acc[txCID.HeaderID] = txCIDs - return acc - }, - make(map[string][]models.TxModel), - ) - - txCIDsByHeaderIDMap := txCIDsByHeaderID.(map[string][]models.TxModel) - - for _, headerCID := range headerCIDs { - txCIDs := txCIDsByHeaderIDMap[headerCID.BlockHash] - allTxCIDs = append(allTxCIDs, txCIDs) - } - - return headerCIDs, allTxCIDs, nil + return headerCIDs, nil } // RetrieveHeaderAndTxCIDsByBlockHash retrieves header CID and their associated tx CIDs by block hash -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (models.HeaderModel, []models.TxModel, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (HeaderCid, error) { log.Debug("retrieving header cid and tx cids for block hash ", blockHash.String()) - // Begin new db tx - tx, err := ecr.db.Beginx() - if err != nil { - return models.HeaderModel{}, nil, err - } - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() + var headerCID HeaderCid - var headerCID models.HeaderModel - headerCID, err = ecr.RetrieveHeaderCIDByHash(tx, blockHash) + // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 + // Will use join for TransactionCids once preload for 1:N is supported. + err := ecr.gormDB.Preload("TransactionCids").Joins("IPLD").First(&headerCID, "block_hash = ?", blockHash.String()).Error if err != nil { log.Error("header cid retrieval error") - return models.HeaderModel{}, nil, err - } - if err != nil { - return models.HeaderModel{}, nil, err + return headerCID, err } - var txCIDs []models.TxModel - txCIDs, err = ecr.RetrieveTxCIDsByHeaderID(tx, headerCID.BlockHash) - if err != nil { - log.Error("tx cid retrieval error") - return models.HeaderModel{}, nil, err - } - - return headerCID, txCIDs, nil + return headerCID, nil } // RetrieveTxCIDByHash returns the tx for the given tx hash -func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (models.TxModel, error) { +func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (TransactionCid, error) { log.Debug("retrieving tx cid for tx hash ", txHash) - // Begin new db tx - tx, err := ecr.db.Beginx() - if err != nil { - return models.TxModel{}, err - } - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() + var txCID TransactionCid - pgStr := `SELECT header_id, index, tx_hash, cid, mh_key, - dst, src, tx_data, tx_type, value - FROM eth.transaction_cids - WHERE tx_hash = $1 - ORDER BY index` - var txCID models.TxModel - return txCID, tx.Get(&txCID, pgStr, txHash) + err := ecr.gormDB.Joins("IPLD").First(&txCID, "tx_hash = ?", txHash).Error + if err != nil { + log.Error("header cid retrieval error") + return txCID, err + } + + return txCID, nil } diff --git a/pkg/eth/ipld_fetcher.go b/pkg/eth/ipld_fetcher.go index fa0d4c57..751f03f5 100644 --- a/pkg/eth/ipld_fetcher.go +++ b/pkg/eth/ipld_fetcher.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/jmoiron/sqlx" log "github.com/sirupsen/logrus" - "github.com/thoas/go-funk" "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" ) @@ -113,40 +112,6 @@ func (f *IPLDFetcher) FetchHeader(tx *sqlx.Tx, c models.HeaderModel) (models.IPL }, nil } -// FetchHeaders fetches headers -func (f *IPLDFetcher) FetchHeaders(tx *sqlx.Tx, cids []models.HeaderModel) ([]models.IPLDModel, error) { - log.Debug("fetching header iplds") - headerIPLDs := make([]models.IPLDModel, len(cids)) - - if len(cids) < 1 { - return headerIPLDs, nil - } - - mhKeys := make([]string, len(cids)) - for i, c := range cids { - var err error - mhKeys[i] = c.MhKey - if err != nil { - return nil, err - } - } - - fetchedIPLDs, err := shared.FetchIPLDsByMhKeys(tx, mhKeys) - if err != nil { - return nil, err - } - - for i, c := range cids { - headerIPLD := funk.Find(fetchedIPLDs, func(ipld models.IPLDModel) bool { - return ipld.Key == c.MhKey - }).(models.IPLDModel) - - headerIPLDs[i] = headerIPLD - } - - return headerIPLDs, nil -} - // FetchUncles fetches uncles func (f *IPLDFetcher) FetchUncles(tx *sqlx.Tx, cids []models.UncleModel) ([]models.IPLDModel, error) { log.Debug("fetching uncle iplds") diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 1c8cc31b..b42de133 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -33,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/vulcanize/ipld-eth-server/v3/pkg/eth" "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" @@ -1264,19 +1263,17 @@ type EthHeaderCidCondition struct { func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { Condition *EthHeaderCidCondition }) (*EthHeaderCidsConnection, error) { - var headerCIDs []models.HeaderModel - var allTxCIDs [][]models.TxModel + var headerCIDs []eth.HeaderCid var err error if args.Condition.BlockHash != nil { - headerCID, txCIDs, err := r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(common.HexToHash(*args.Condition.BlockHash)) + headerCID, err := r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(common.HexToHash(*args.Condition.BlockHash)) if err != nil { return nil, err } headerCIDs = append(headerCIDs, headerCID) - allTxCIDs = append(allTxCIDs, txCIDs) } else if args.Condition.BlockNumber != nil { - headerCIDs, allTxCIDs, err = r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(args.Condition.BlockNumber.ToInt().Int64()) + headerCIDs, err = r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(args.Condition.BlockNumber.ToInt().Int64()) if err != nil { return nil, err } @@ -1300,13 +1297,8 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { } }() - headerIPLDs, err := r.backend.Fetcher.FetchHeaders(tx, headerCIDs) - if err != nil { - return nil, err - } - var resultNodes []*EthHeaderCid - for idx, headerCID := range headerCIDs { + for _, headerCID := range headerCIDs { var blockNumber BigInt blockNumber.UnmarshalText([]byte(headerCID.BlockNumber)) @@ -1328,10 +1320,13 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { receiptRoot: headerCID.RctRoot, uncleRoot: headerCID.UncleRoot, bloom: Bytes(headerCID.Bloom).String(), + ipfsBlock: IPFSBlock{ + key: headerCID.IPLD.Key, + data: Bytes(headerCID.IPLD.Data).String(), + }, } - txCIDs := allTxCIDs[idx] - for _, txCID := range txCIDs { + for _, txCID := range headerCID.TransactionCids { ethHeaderCidNode.transactions = append(ethHeaderCidNode.transactions, &EthTransactionCid{ cid: txCID.CID, txHash: txCID.TxHash, @@ -1341,11 +1336,6 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { }) } - ethHeaderCidNode.ipfsBlock = IPFSBlock{ - key: headerIPLDs[idx].Key, - data: Bytes(headerIPLDs[idx].Data).String(), - } - resultNodes = append(resultNodes, ðHeaderCidNode) } @@ -1363,27 +1353,6 @@ func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { return nil, err } - // Begin tx - tx, err := r.backend.DB.Beginx() - if err != nil { - return nil, err - } - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() - - txIPLDs, err := r.backend.Fetcher.FetchTrxs(tx, []models.TxModel{txCID}) - if err != nil { - return nil, err - } - return &EthTransactionCid{ cid: txCID.CID, txHash: txCID.TxHash, @@ -1391,8 +1360,8 @@ func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { src: txCID.Src, dst: txCID.Dst, ipfsBlock: IPFSBlock{ - key: txIPLDs[0].Key, - data: Bytes(txIPLDs[0].Data).String(), + key: txCID.IPLD.Key, + data: Bytes(txCID.IPLD.Data).String(), }, }, nil } diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index fc8259a4..4744005b 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -31,7 +31,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/statediff" - "github.com/ethereum/go-ethereum/statediff/indexer/models" sdtypes "github.com/ethereum/go-ethereum/statediff/types" "github.com/jmoiron/sqlx" . "github.com/onsi/ginkgo" @@ -258,30 +257,13 @@ var _ = Describe("GraphQL", func() { allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockNumber: new(graphql.BigInt).SetUint64(2)}) Expect(err).ToNot(HaveOccurred()) - headerCIDs, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(2) - Expect(err).ToNot(HaveOccurred()) - - // Begin tx - tx, err := backend.DB.Beginx() - Expect(err).ToNot(HaveOccurred()) - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() - - headerIPLDs, err := backend.Fetcher.FetchHeaders(tx, headerCIDs) + headerCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(2) Expect(err).ToNot(HaveOccurred()) for idx, headerCID := range headerCIDs { ethHeaderCid := allEthHeaderCidsResp.Nodes[idx] - compareEthHeaderCid(ethHeaderCid, headerCID, txCIDs[idx], headerIPLDs[idx]) + compareEthHeaderCid(ethHeaderCid, headerCID) } }) @@ -290,30 +272,12 @@ var _ = Describe("GraphQL", func() { allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockHash: &blockHash}) Expect(err).ToNot(HaveOccurred()) - headerCID, txCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash()) + headerCID, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash()) Expect(err).ToNot(HaveOccurred()) - // Begin tx - tx, err := backend.DB.Beginx() - Expect(err).ToNot(HaveOccurred()) - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() - - headerIPLDs, err := backend.Fetcher.FetchHeaders(tx, []models.HeaderModel{headerCID}) - Expect(err).ToNot(HaveOccurred()) - Expect(len(allEthHeaderCidsResp.Nodes)).To(Equal(1)) - Expect(len(allEthHeaderCidsResp.Nodes)).To(Equal(1)) ethHeaderCid := allEthHeaderCidsResp.Nodes[0] - compareEthHeaderCid(ethHeaderCid, headerCID, txCIDs, headerIPLDs[0]) + compareEthHeaderCid(ethHeaderCid, headerCID) }) }) @@ -328,29 +292,12 @@ var _ = Describe("GraphQL", func() { compareEthTxCid(*ethTransactionCidResp, txCID) - // Begin tx - tx, err := backend.DB.Beginx() - Expect(err).ToNot(HaveOccurred()) - defer func() { - if p := recover(); p != nil { - shared.Rollback(tx) - panic(p) - } else if err != nil { - shared.Rollback(tx) - } else { - err = tx.Commit() - } - }() - - txIPLDs, err := backend.Fetcher.FetchTrxs(tx, []models.TxModel{txCID}) - Expect(err).ToNot(HaveOccurred()) - Expect(len(txIPLDs)).To(Equal(1)) - Expect(ethTransactionCidResp.BlockByMhKey.Data).To(Equal(graphql.Bytes(txIPLDs[0].Data).String())) + Expect(ethTransactionCidResp.BlockByMhKey.Data).To(Equal(graphql.Bytes(txCID.IPLD.Data).String())) }) }) }) -func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID models.HeaderModel, txCIDs []models.TxModel, headerIPLD models.IPLDModel) { +func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID eth.HeaderCid) { blockNumber, err := strconv.ParseInt(headerCID.BlockNumber, 10, 64) Expect(err).ToNot(HaveOccurred()) @@ -369,16 +316,16 @@ func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID models Expect(ethHeaderCid.UncleRoot).To(Equal(headerCID.UncleRoot)) Expect(ethHeaderCid.Bloom).To(Equal(graphql.Bytes(headerCID.Bloom).String())) - for tIdx, txCID := range txCIDs { + for tIdx, txCID := range headerCID.TransactionCids { ethTxCid := ethHeaderCid.EthTransactionCidsByHeaderId.Nodes[tIdx] compareEthTxCid(ethTxCid, txCID) } - Expect(ethHeaderCid.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerIPLD.Data).String())) - Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerIPLD.Key)) + Expect(ethHeaderCid.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerCID.IPLD.Data).String())) + Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerCID.IPLD.Key)) } -func compareEthTxCid(ethTxCid graphql.EthTransactionCidResp, txCID models.TxModel) { +func compareEthTxCid(ethTxCid graphql.EthTransactionCidResp, txCID eth.TransactionCid) { Expect(ethTxCid.Cid).To(Equal(txCID.CID)) Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) diff --git a/pkg/shared/functions.go b/pkg/shared/functions.go index eede20bc..b1ac4550 100644 --- a/pkg/shared/functions.go +++ b/pkg/shared/functions.go @@ -19,7 +19,6 @@ package shared import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/statediff/indexer/ipld" - "github.com/ethereum/go-ethereum/statediff/indexer/models" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" dshelp "github.com/ipfs/go-ipfs-ds-help" @@ -78,19 +77,6 @@ func FetchIPLDByMhKey(tx *sqlx.Tx, mhKey string) ([]byte, error) { return block, tx.Get(&block, pgStr, mhKey) } -// FetchIPLDByMhKeysAndBlockNumbers is used to retrieve iplds from Postgres blockstore with the provided tx, mhkey strings and blockNumbers -func FetchIPLDsByMhKeys(tx *sqlx.Tx, mhKeys []string) ([]models.IPLDModel, error) { - var blocks []models.IPLDModel - pgStr := `SELECT key, data FROM public.blocks WHERE key IN (?)` - query, args, err := sqlx.In(pgStr, mhKeys) - if err != nil { - return blocks, err - } - query = tx.Rebind(query) - - return blocks, tx.Select(&blocks, query, args...) -} - // MultihashKeyFromCID converts a cid into a blockstore-prefixed multihash db key string func MultihashKeyFromCID(c cid.Cid) string { dbKey := dshelp.MultihashToDsKey(c.Hash()) -- 2.45.2 From c19cc5c44d823ff62944decb5cf6ee1fe3dd5f89 Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 3 Jun 2022 14:45:52 +0530 Subject: [PATCH 24/26] Select required fields in transaction_cids --- pkg/eth/cid_retriever.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 04a5c719..c554be75 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -673,7 +673,9 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 // Will use join for TransactionCids once preload for 1:N is supported. - err := ecr.gormDB.Preload("TransactionCids").Joins("IPLD").Find(&headerCIDs, "block_number = ?", blockNumber).Error + err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { + return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") + }).Joins("IPLD").Find(&headerCIDs, "block_number = ?", blockNumber).Error if err != nil { log.Error("header cid retrieval error") return nil, err @@ -690,7 +692,9 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Has // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 // Will use join for TransactionCids once preload for 1:N is supported. - err := ecr.gormDB.Preload("TransactionCids").Joins("IPLD").First(&headerCID, "block_hash = ?", blockHash.String()).Error + err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { + return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") + }).Joins("IPLD").First(&headerCID, "block_hash = ?", blockHash.String()).Error if err != nil { log.Error("header cid retrieval error") return headerCID, err -- 2.45.2 From 31e9a7dc5ec7accf128dc8fa7b7a0e69f9069e3d Mon Sep 17 00:00:00 2001 From: nikugogoi <95nikass@gmail.com> Date: Mon, 6 Jun 2022 15:36:29 +0530 Subject: [PATCH 25/26] Review changes --- pkg/eth/cid_retriever.go | 40 ++++++++++++--------- pkg/graphql/client.go | 72 ++++++++++++++++++------------------- pkg/graphql/graphql.go | 2 +- pkg/graphql/graphql_test.go | 8 ++--- 4 files changed, 64 insertions(+), 58 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index c554be75..5da663a3 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -45,16 +45,16 @@ type CIDRetriever struct { gormDB *gorm.DB } -type IPLD struct { +type IPLDModelRecord struct { models.IPLDModel } // TableName overrides the table name used by IPLD -func (IPLD) TableName() string { +func (IPLDModelRecord) TableName() string { return "public.blocks" } -type HeaderCid struct { +type HeaderCidRecord struct { CID string `gorm:"column:cid"` BlockHash string `gorm:"primaryKey"` BlockNumber string @@ -67,16 +67,19 @@ type HeaderCid struct { UncleRoot string Bloom []byte MhKey string - TransactionCids []TransactionCid `gorm:"foreignKey:HeaderID;references:BlockHash"` - IPLD IPLD `gorm:"foreignKey:MhKey;references:Key"` + + // gorm doesn't check if foreign key exists in database. + // It is required to eager load relations using preload. + TransactionCids []TransactionCidRecord `gorm:"foreignKey:HeaderID;references:BlockHash"` + IPLD IPLDModelRecord `gorm:"foreignKey:MhKey;references:Key"` } // TableName overrides the table name used by HeaderCid -func (HeaderCid) TableName() string { +func (HeaderCidRecord) TableName() string { return "eth.header_cids" } -type TransactionCid struct { +type TransactionCidRecord struct { CID string `gorm:"column:cid"` TxHash string `gorm:"primaryKey"` HeaderID string `gorm:"column:header_id"` @@ -84,11 +87,11 @@ type TransactionCid struct { Src string Dst string MhKey string - IPLD IPLD `gorm:"foreignKey:MhKey;references:Key"` + IPLD IPLDModelRecord `gorm:"foreignKey:MhKey;references:Key"` } // TableName overrides the table name used by TransactionCid -func (TransactionCid) TableName() string { +func (TransactionCidRecord) TableName() string { return "eth.transaction_cids" } @@ -97,6 +100,7 @@ func NewCIDRetriever(db *sqlx.DB) *CIDRetriever { gormDB, err := gorm.Open(postgres.New(postgres.Config{ Conn: db, }), &gorm.Config{}) + if err != nil { log.Error(err) return nil @@ -227,7 +231,7 @@ func (ecr *CIDRetriever) RetrieveHeaderCIDs(tx *sqlx.Tx, blockNumber int64) ([]m log.Debug("retrieving header cids for block ", blockNumber) headers := make([]models.HeaderModel, 0) pgStr := `SELECT CAST(block_number as Text), block_hash,parent_hash,cid,mh_key,CAST(td as Text),node_id, - CAST(reward as Text), state_root,uncle_root,tx_root,receipt_root,bloom,timestamp,times_validated, + CAST(reward as Text), state_root, uncle_root, tx_root, receipt_root, bloom, timestamp, times_validated, coinbase FROM eth.header_cids WHERE block_number = $1` return headers, tx.Select(&headers, pgStr, blockNumber) @@ -636,7 +640,7 @@ func (ecr *CIDRetriever) RetrieveBlockByNumber(blockNumber int64) (models.Header func (ecr *CIDRetriever) RetrieveHeaderCIDByHash(tx *sqlx.Tx, blockHash common.Hash) (models.HeaderModel, error) { log.Debug("retrieving header cids for block hash ", blockHash.String()) pgStr := `SELECT block_hash, CAST(block_number as Text), parent_hash, cid, mh_key, CAST(td as Text), - state_root,uncle_root,tx_root,receipt_root,bloom,timestamp FROM eth.header_cids + state_root, uncle_root, tx_root, receipt_root, bloom, timestamp FROM eth.header_cids WHERE block_hash = $1` var headerCID models.HeaderModel return headerCID, tx.Get(&headerCID, pgStr, blockHash.String()) @@ -666,16 +670,17 @@ func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []stri } // RetrieveHeaderAndTxCIDsByBlockNumber retrieves header CIDs and their associated tx CIDs by block number -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCid, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCidRecord, error) { log.Debug("retrieving header cids and tx cids for block number ", blockNumber) - var headerCIDs []HeaderCid + var headerCIDs []HeaderCidRecord // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 // Will use join for TransactionCids once preload for 1:N is supported. err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") }).Joins("IPLD").Find(&headerCIDs, "block_number = ?", blockNumber).Error + if err != nil { log.Error("header cid retrieval error") return nil, err @@ -685,16 +690,17 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) } // RetrieveHeaderAndTxCIDsByBlockHash retrieves header CID and their associated tx CIDs by block hash -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (HeaderCid, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (HeaderCidRecord, error) { log.Debug("retrieving header cid and tx cids for block hash ", blockHash.String()) - var headerCID HeaderCid + var headerCID HeaderCidRecord // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 // Will use join for TransactionCids once preload for 1:N is supported. err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") }).Joins("IPLD").First(&headerCID, "block_hash = ?", blockHash.String()).Error + if err != nil { log.Error("header cid retrieval error") return headerCID, err @@ -704,10 +710,10 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Has } // RetrieveTxCIDByHash returns the tx for the given tx hash -func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (TransactionCid, error) { +func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (TransactionCidRecord, error) { log.Debug("retrieving tx cid for tx hash ", txHash) - var txCID TransactionCid + var txCID TransactionCidRecord err := ecr.gormDB.Joins("IPLD").First(&txCID, "tx_hash = ?", txHash).Error if err != nil { diff --git a/pkg/graphql/client.go b/pkg/graphql/client.go index 53420db8..80b32c96 100644 --- a/pkg/graphql/client.go +++ b/pkg/graphql/client.go @@ -21,14 +21,14 @@ type GetStorageAt struct { } type LogResponse struct { - Topics []common.Hash `json:"topics"` - Data hexutil.Bytes `json:"data"` - Transaction TransactionResp `json:"transaction"` - ReceiptCID string `json:"receiptCID"` - Status int32 `json:"status"` + Topics []common.Hash `json:"topics"` + Data hexutil.Bytes `json:"data"` + Transaction TransactionResponse `json:"transaction"` + ReceiptCID string `json:"receiptCID"` + Status int32 `json:"status"` } -type TransactionResp struct { +type TransactionResponse struct { Hash common.Hash `json:"hash"` } @@ -36,50 +36,50 @@ type GetLogs struct { Responses []LogResponse `json:"getLogs"` } -type IPFSBlockResp struct { +type IPFSBlockResponse struct { Key string `json:"key"` Data string `json:"data"` } -type EthTransactionCidResp struct { - Cid string `json:"cid"` - TxHash string `json:"txHash"` - Index int32 `json:"index"` - Src string `json:"src"` - Dst string `json:"dst"` - BlockByMhKey IPFSBlockResp `json:"blockByMhKey"` +type EthTransactionCidResponse struct { + Cid string `json:"cid"` + TxHash string `json:"txHash"` + Index int32 `json:"index"` + Src string `json:"src"` + Dst string `json:"dst"` + BlockByMhKey IPFSBlockResponse `json:"blockByMhKey"` } type EthTransactionCidByTxHash struct { - Response EthTransactionCidResp `json:"ethTransactionCidByTxHash"` + Response EthTransactionCidResponse `json:"ethTransactionCidByTxHash"` } -type EthTransactionCidsByHeaderIdResp struct { - Nodes []EthTransactionCidResp `json:"nodes"` +type EthTransactionCidsByHeaderIdResponse struct { + Nodes []EthTransactionCidResponse `json:"nodes"` } -type EthHeaderCidResp struct { - Cid string `json:"cid"` - BlockNumber BigInt `json:"blockNumber"` - BlockHash string `json:"blockHash"` - ParentHash string `json:"parentHash"` - Timestamp BigInt `json:"timestamp"` - StateRoot string `json:"stateRoot"` - Td BigInt `json:"td"` - TxRoot string `json:"txRoot"` - ReceiptRoot string `json:"receiptRoot"` - UncleRoot string `json:"uncleRoot"` - Bloom string `json:"bloom"` - EthTransactionCidsByHeaderId EthTransactionCidsByHeaderIdResp `json:"ethTransactionCidsByHeaderId"` - BlockByMhKey IPFSBlockResp `json:"blockByMhKey"` +type EthHeaderCidResponse struct { + Cid string `json:"cid"` + BlockNumber BigInt `json:"blockNumber"` + BlockHash string `json:"blockHash"` + ParentHash string `json:"parentHash"` + Timestamp BigInt `json:"timestamp"` + StateRoot string `json:"stateRoot"` + Td BigInt `json:"td"` + TxRoot string `json:"txRoot"` + ReceiptRoot string `json:"receiptRoot"` + UncleRoot string `json:"uncleRoot"` + Bloom string `json:"bloom"` + EthTransactionCidsByHeaderId EthTransactionCidsByHeaderIdResponse `json:"ethTransactionCidsByHeaderId"` + BlockByMhKey IPFSBlockResponse `json:"blockByMhKey"` } -type AllEthHeaderCidsResp struct { - Nodes []EthHeaderCidResp `json:"nodes"` +type AllEthHeaderCidsResponse struct { + Nodes []EthHeaderCidResponse `json:"nodes"` } type AllEthHeaderCids struct { - Response AllEthHeaderCidsResp `json:"allEthHeaderCids"` + Response AllEthHeaderCidsResponse `json:"allEthHeaderCids"` } type Client struct { @@ -164,7 +164,7 @@ func (c *Client) GetStorageAt(ctx context.Context, hash common.Hash, address com return &storageAt.Response, nil } -func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCondition) (*AllEthHeaderCidsResp, error) { +func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCondition) (*AllEthHeaderCidsResponse, error) { var params string if condition.BlockHash != nil { params = fmt.Sprintf(`blockHash: "%s"`, *condition.BlockHash) @@ -228,7 +228,7 @@ func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCon return &allEthHeaderCids.Response, nil } -func (c *Client) EthTransactionCidByTxHash(ctx context.Context, txHash string) (*EthTransactionCidResp, error) { +func (c *Client) EthTransactionCidByTxHash(ctx context.Context, txHash string) (*EthTransactionCidResponse, error) { getTxQuery := fmt.Sprintf(` query{ ethTransactionCidByTxHash(txHash: "%s") { diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index b42de133..137409d7 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -1263,7 +1263,7 @@ type EthHeaderCidCondition struct { func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { Condition *EthHeaderCidCondition }) (*EthHeaderCidsConnection, error) { - var headerCIDs []eth.HeaderCid + var headerCIDs []eth.HeaderCidRecord var err error if args.Condition.BlockHash != nil { headerCID, err := r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(common.HexToHash(*args.Condition.BlockHash)) diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index 4744005b..f61c9b65 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -181,7 +181,7 @@ var _ = Describe("GraphQL", func() { { Topics: test_helpers.MockLog1.Topics, Data: hexutil.Bytes(test_helpers.MockLog1.Data), - Transaction: graphql.TransactionResp{Hash: test_helpers.MockTransactions[0].Hash()}, + Transaction: graphql.TransactionResponse{Hash: test_helpers.MockTransactions[0].Hash()}, ReceiptCID: test_helpers.Rct1CID.String(), Status: int32(test_helpers.MockReceipts[0].Status), }, @@ -198,7 +198,7 @@ var _ = Describe("GraphQL", func() { { Topics: test_helpers.MockLog6.Topics, Data: hexutil.Bytes(test_helpers.MockLog6.Data), - Transaction: graphql.TransactionResp{Hash: test_helpers.MockTransactions[3].Hash()}, + Transaction: graphql.TransactionResponse{Hash: test_helpers.MockTransactions[3].Hash()}, ReceiptCID: test_helpers.Rct4CID.String(), Status: int32(test_helpers.MockReceipts[3].Status), }, @@ -297,7 +297,7 @@ var _ = Describe("GraphQL", func() { }) }) -func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID eth.HeaderCid) { +func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResponse, headerCID eth.HeaderCidRecord) { blockNumber, err := strconv.ParseInt(headerCID.BlockNumber, 10, 64) Expect(err).ToNot(HaveOccurred()) @@ -325,7 +325,7 @@ func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResp, headerCID eth.He Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerCID.IPLD.Key)) } -func compareEthTxCid(ethTxCid graphql.EthTransactionCidResp, txCID eth.TransactionCid) { +func compareEthTxCid(ethTxCid graphql.EthTransactionCidResponse, txCID eth.TransactionCidRecord) { Expect(ethTxCid.Cid).To(Equal(txCID.CID)) Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) -- 2.45.2 From 1fc53ccab159bf935dd7cce1023b5a81d8cecc27 Mon Sep 17 00:00:00 2001 From: nikugogoi <95nikass@gmail.com> Date: Mon, 6 Jun 2022 16:46:53 +0530 Subject: [PATCH 26/26] Rename Cid to CID --- pkg/eth/cid_retriever.go | 42 +++++++++---------- pkg/graphql/client.go | 44 ++++++++++---------- pkg/graphql/graphql.go | 82 ++++++++++++++++++------------------- pkg/graphql/graphql_test.go | 66 ++++++++++++++--------------- 4 files changed, 117 insertions(+), 117 deletions(-) diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index 5da663a3..7e27342b 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -54,7 +54,7 @@ func (IPLDModelRecord) TableName() string { return "public.blocks" } -type HeaderCidRecord struct { +type HeaderCIDRecord struct { CID string `gorm:"column:cid"` BlockHash string `gorm:"primaryKey"` BlockNumber string @@ -70,16 +70,16 @@ type HeaderCidRecord struct { // gorm doesn't check if foreign key exists in database. // It is required to eager load relations using preload. - TransactionCids []TransactionCidRecord `gorm:"foreignKey:HeaderID;references:BlockHash"` + TransactionCIDs []TransactionCIDRecord `gorm:"foreignKey:HeaderID;references:BlockHash"` IPLD IPLDModelRecord `gorm:"foreignKey:MhKey;references:Key"` } -// TableName overrides the table name used by HeaderCid -func (HeaderCidRecord) TableName() string { +// TableName overrides the table name used by HeaderCIDRecord +func (HeaderCIDRecord) TableName() string { return "eth.header_cids" } -type TransactionCidRecord struct { +type TransactionCIDRecord struct { CID string `gorm:"column:cid"` TxHash string `gorm:"primaryKey"` HeaderID string `gorm:"column:header_id"` @@ -90,8 +90,8 @@ type TransactionCidRecord struct { IPLD IPLDModelRecord `gorm:"foreignKey:MhKey;references:Key"` } -// TableName overrides the table name used by TransactionCid -func (TransactionCidRecord) TableName() string { +// TableName overrides the table name used by TransactionCIDRecord +func (TransactionCIDRecord) TableName() string { return "eth.transaction_cids" } @@ -367,8 +367,8 @@ func (ecr *CIDRetriever) RetrieveRctCIDsByHeaderID(tx *sqlx.Tx, rctFilter Receip pgStr, args = receiptFilterConditions(&id, pgStr, args, rctFilter, trxHashes) pgStr += ` ORDER BY transaction_cids.index` - receiptCids := make([]models.ReceiptModel, 0) - return receiptCids, tx.Select(&receiptCids, pgStr, args...) + receiptCIDs := make([]models.ReceiptModel, 0) + return receiptCIDs, tx.Select(&receiptCIDs, pgStr, args...) } // RetrieveFilteredGQLLogs retrieves and returns all the log cIDs provided blockHash that conform to the provided @@ -462,8 +462,8 @@ func (ecr *CIDRetriever) RetrieveRctCIDs(tx *sqlx.Tx, rctFilter ReceiptFilter, b pgStr, args = receiptFilterConditions(&id, pgStr, args, rctFilter, txHashes) pgStr += ` ORDER BY transaction_cids.index` - receiptCids := make([]models.ReceiptModel, 0) - return receiptCids, tx.Select(&receiptCids, pgStr, args...) + receiptCIDs := make([]models.ReceiptModel, 0) + return receiptCIDs, tx.Select(&receiptCIDs, pgStr, args...) } func hasTopics(topics [][]string) bool { @@ -670,14 +670,14 @@ func (ecr *CIDRetriever) RetrieveReceiptCIDsByTxIDs(tx *sqlx.Tx, txHashes []stri } // RetrieveHeaderAndTxCIDsByBlockNumber retrieves header CIDs and their associated tx CIDs by block number -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCidRecord, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCIDRecord, error) { log.Debug("retrieving header cids and tx cids for block number ", blockNumber) - var headerCIDs []HeaderCidRecord + var headerCIDs []HeaderCIDRecord // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 - // Will use join for TransactionCids once preload for 1:N is supported. - err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { + // Will use join for TransactionCIDs once preload for 1:N is supported. + err := ecr.gormDB.Preload("TransactionCIDs", func(tx *gorm.DB) *gorm.DB { return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") }).Joins("IPLD").Find(&headerCIDs, "block_number = ?", blockNumber).Error @@ -690,14 +690,14 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) } // RetrieveHeaderAndTxCIDsByBlockHash retrieves header CID and their associated tx CIDs by block hash -func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (HeaderCidRecord, error) { +func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash) (HeaderCIDRecord, error) { log.Debug("retrieving header cid and tx cids for block hash ", blockHash.String()) - var headerCID HeaderCidRecord + var headerCID HeaderCIDRecord // https://github.com/go-gorm/gorm/issues/4083#issuecomment-778883283 - // Will use join for TransactionCids once preload for 1:N is supported. - err := ecr.gormDB.Preload("TransactionCids", func(tx *gorm.DB) *gorm.DB { + // Will use join for TransactionCIDs once preload for 1:N is supported. + err := ecr.gormDB.Preload("TransactionCIDs", func(tx *gorm.DB) *gorm.DB { return tx.Select("cid", "tx_hash", "index", "src", "dst", "header_id") }).Joins("IPLD").First(&headerCID, "block_hash = ?", blockHash.String()).Error @@ -710,10 +710,10 @@ func (ecr *CIDRetriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Has } // RetrieveTxCIDByHash returns the tx for the given tx hash -func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (TransactionCidRecord, error) { +func (ecr *CIDRetriever) RetrieveTxCIDByHash(txHash string) (TransactionCIDRecord, error) { log.Debug("retrieving tx cid for tx hash ", txHash) - var txCID TransactionCidRecord + var txCID TransactionCIDRecord err := ecr.gormDB.Joins("IPLD").First(&txCID, "tx_hash = ?", txHash).Error if err != nil { diff --git a/pkg/graphql/client.go b/pkg/graphql/client.go index 80b32c96..096b7a06 100644 --- a/pkg/graphql/client.go +++ b/pkg/graphql/client.go @@ -11,7 +11,7 @@ import ( ) type StorageResponse struct { - Cid string `json:"cid"` + CID string `json:"cid"` Value common.Hash `json:"value"` IpldBlock hexutil.Bytes `json:"ipldBlock"` } @@ -41,8 +41,8 @@ type IPFSBlockResponse struct { Data string `json:"data"` } -type EthTransactionCidResponse struct { - Cid string `json:"cid"` +type EthTransactionCIDResponse struct { + CID string `json:"cid"` TxHash string `json:"txHash"` Index int32 `json:"index"` Src string `json:"src"` @@ -50,16 +50,16 @@ type EthTransactionCidResponse struct { BlockByMhKey IPFSBlockResponse `json:"blockByMhKey"` } -type EthTransactionCidByTxHash struct { - Response EthTransactionCidResponse `json:"ethTransactionCidByTxHash"` +type EthTransactionCIDByTxHash struct { + Response EthTransactionCIDResponse `json:"ethTransactionCidByTxHash"` } -type EthTransactionCidsByHeaderIdResponse struct { - Nodes []EthTransactionCidResponse `json:"nodes"` +type EthTransactionCIDsByHeaderIdResponse struct { + Nodes []EthTransactionCIDResponse `json:"nodes"` } -type EthHeaderCidResponse struct { - Cid string `json:"cid"` +type EthHeaderCIDResponse struct { + CID string `json:"cid"` BlockNumber BigInt `json:"blockNumber"` BlockHash string `json:"blockHash"` ParentHash string `json:"parentHash"` @@ -70,16 +70,16 @@ type EthHeaderCidResponse struct { ReceiptRoot string `json:"receiptRoot"` UncleRoot string `json:"uncleRoot"` Bloom string `json:"bloom"` - EthTransactionCidsByHeaderId EthTransactionCidsByHeaderIdResponse `json:"ethTransactionCidsByHeaderId"` + EthTransactionCIDsByHeaderId EthTransactionCIDsByHeaderIdResponse `json:"ethTransactionCidsByHeaderId"` BlockByMhKey IPFSBlockResponse `json:"blockByMhKey"` } -type AllEthHeaderCidsResponse struct { - Nodes []EthHeaderCidResponse `json:"nodes"` +type AllEthHeaderCIDsResponse struct { + Nodes []EthHeaderCIDResponse `json:"nodes"` } -type AllEthHeaderCids struct { - Response AllEthHeaderCidsResponse `json:"allEthHeaderCids"` +type AllEthHeaderCIDs struct { + Response AllEthHeaderCIDsResponse `json:"allEthHeaderCids"` } type Client struct { @@ -164,7 +164,7 @@ func (c *Client) GetStorageAt(ctx context.Context, hash common.Hash, address com return &storageAt.Response, nil } -func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCondition) (*AllEthHeaderCidsResponse, error) { +func (c *Client) AllEthHeaderCIDs(ctx context.Context, condition EthHeaderCIDCondition) (*AllEthHeaderCIDsResponse, error) { var params string if condition.BlockHash != nil { params = fmt.Sprintf(`blockHash: "%s"`, *condition.BlockHash) @@ -220,15 +220,15 @@ func (c *Client) AllEthHeaderCids(ctx context.Context, condition EthHeaderCidCon return nil, err } - var allEthHeaderCids AllEthHeaderCids - err = json.Unmarshal(jsonStr, &allEthHeaderCids) + var allEthHeaderCIDs AllEthHeaderCIDs + err = json.Unmarshal(jsonStr, &allEthHeaderCIDs) if err != nil { return nil, err } - return &allEthHeaderCids.Response, nil + return &allEthHeaderCIDs.Response, nil } -func (c *Client) EthTransactionCidByTxHash(ctx context.Context, txHash string) (*EthTransactionCidResponse, error) { +func (c *Client) EthTransactionCIDByTxHash(ctx context.Context, txHash string) (*EthTransactionCIDResponse, error) { getTxQuery := fmt.Sprintf(` query{ ethTransactionCidByTxHash(txHash: "%s") { @@ -258,10 +258,10 @@ func (c *Client) EthTransactionCidByTxHash(ctx context.Context, txHash string) ( return nil, err } - var ethTxCid EthTransactionCidByTxHash - err = json.Unmarshal(jsonStr, ðTxCid) + var ethTxCID EthTransactionCIDByTxHash + err = json.Unmarshal(jsonStr, ðTxCID) if err != nil { return nil, err } - return ðTxCid.Response, nil + return ðTxCID.Response, nil } diff --git a/pkg/graphql/graphql.go b/pkg/graphql/graphql.go index 137409d7..853afec9 100644 --- a/pkg/graphql/graphql.go +++ b/pkg/graphql/graphql.go @@ -1125,7 +1125,7 @@ func decomposeGQLLogs(logCIDs []eth.LogResult) []logsCID { return logs } -type EthTransactionCid struct { +type EthTransactionCID struct { cid string txHash string index int32 @@ -1134,35 +1134,35 @@ type EthTransactionCid struct { ipfsBlock IPFSBlock } -func (t EthTransactionCid) Cid(ctx context.Context) string { +func (t EthTransactionCID) Cid(ctx context.Context) string { return t.cid } -func (t EthTransactionCid) TxHash(ctx context.Context) string { +func (t EthTransactionCID) TxHash(ctx context.Context) string { return t.txHash } -func (t EthTransactionCid) Index(ctx context.Context) int32 { +func (t EthTransactionCID) Index(ctx context.Context) int32 { return t.index } -func (t EthTransactionCid) Src(ctx context.Context) string { +func (t EthTransactionCID) Src(ctx context.Context) string { return t.src } -func (t EthTransactionCid) Dst(ctx context.Context) string { +func (t EthTransactionCID) Dst(ctx context.Context) string { return t.dst } -func (t EthTransactionCid) BlockByMhKey(ctx context.Context) IPFSBlock { +func (t EthTransactionCID) BlockByMhKey(ctx context.Context) IPFSBlock { return t.ipfsBlock } -type EthTransactionCidsConnection struct { - nodes []*EthTransactionCid +type EthTransactionCIDsConnection struct { + nodes []*EthTransactionCID } -func (transactionCIDResult EthTransactionCidsConnection) Nodes(ctx context.Context) []*EthTransactionCid { +func (transactionCIDResult EthTransactionCIDsConnection) Nodes(ctx context.Context) []*EthTransactionCID { return transactionCIDResult.nodes } @@ -1179,7 +1179,7 @@ func (b IPFSBlock) Data(ctx context.Context) string { return b.data } -type EthHeaderCid struct { +type EthHeaderCID struct { cid string blockNumber BigInt blockHash string @@ -1191,79 +1191,79 @@ type EthHeaderCid struct { receiptRoot string uncleRoot string bloom string - transactions []*EthTransactionCid + transactions []*EthTransactionCID ipfsBlock IPFSBlock } -func (h EthHeaderCid) Cid(ctx context.Context) string { +func (h EthHeaderCID) Cid(ctx context.Context) string { return h.cid } -func (h EthHeaderCid) BlockNumber(ctx context.Context) BigInt { +func (h EthHeaderCID) BlockNumber(ctx context.Context) BigInt { return h.blockNumber } -func (h EthHeaderCid) BlockHash(ctx context.Context) string { +func (h EthHeaderCID) BlockHash(ctx context.Context) string { return h.blockHash } -func (h EthHeaderCid) ParentHash(ctx context.Context) string { +func (h EthHeaderCID) ParentHash(ctx context.Context) string { return h.parentHash } -func (h EthHeaderCid) Timestamp(ctx context.Context) BigInt { +func (h EthHeaderCID) Timestamp(ctx context.Context) BigInt { return h.timestamp } -func (h EthHeaderCid) StateRoot(ctx context.Context) string { +func (h EthHeaderCID) StateRoot(ctx context.Context) string { return h.stateRoot } -func (h EthHeaderCid) Td(ctx context.Context) BigInt { +func (h EthHeaderCID) Td(ctx context.Context) BigInt { return h.td } -func (h EthHeaderCid) TxRoot(ctx context.Context) string { +func (h EthHeaderCID) TxRoot(ctx context.Context) string { return h.txRoot } -func (h EthHeaderCid) ReceiptRoot(ctx context.Context) string { +func (h EthHeaderCID) ReceiptRoot(ctx context.Context) string { return h.receiptRoot } -func (h EthHeaderCid) UncleRoot(ctx context.Context) string { +func (h EthHeaderCID) UncleRoot(ctx context.Context) string { return h.uncleRoot } -func (h EthHeaderCid) Bloom(ctx context.Context) string { +func (h EthHeaderCID) Bloom(ctx context.Context) string { return h.bloom } -func (h EthHeaderCid) EthTransactionCidsByHeaderId(ctx context.Context) EthTransactionCidsConnection { - return EthTransactionCidsConnection{nodes: h.transactions} +func (h EthHeaderCID) EthTransactionCidsByHeaderId(ctx context.Context) EthTransactionCIDsConnection { + return EthTransactionCIDsConnection{nodes: h.transactions} } -func (h EthHeaderCid) BlockByMhKey(ctx context.Context) IPFSBlock { +func (h EthHeaderCID) BlockByMhKey(ctx context.Context) IPFSBlock { return h.ipfsBlock } -type EthHeaderCidsConnection struct { - nodes []*EthHeaderCid +type EthHeaderCIDsConnection struct { + nodes []*EthHeaderCID } -func (headerCIDResult EthHeaderCidsConnection) Nodes(ctx context.Context) []*EthHeaderCid { +func (headerCIDResult EthHeaderCIDsConnection) Nodes(ctx context.Context) []*EthHeaderCID { return headerCIDResult.nodes } -type EthHeaderCidCondition struct { +type EthHeaderCIDCondition struct { BlockNumber *BigInt BlockHash *string } func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { - Condition *EthHeaderCidCondition -}) (*EthHeaderCidsConnection, error) { - var headerCIDs []eth.HeaderCidRecord + Condition *EthHeaderCIDCondition +}) (*EthHeaderCIDsConnection, error) { + var headerCIDs []eth.HeaderCIDRecord var err error if args.Condition.BlockHash != nil { headerCID, err := r.backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(common.HexToHash(*args.Condition.BlockHash)) @@ -1297,7 +1297,7 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { } }() - var resultNodes []*EthHeaderCid + var resultNodes []*EthHeaderCID for _, headerCID := range headerCIDs { var blockNumber BigInt blockNumber.UnmarshalText([]byte(headerCID.BlockNumber)) @@ -1308,7 +1308,7 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { var td BigInt td.UnmarshalText([]byte(headerCID.TotalDifficulty)) - ethHeaderCidNode := EthHeaderCid{ + ethHeaderCIDNode := EthHeaderCID{ cid: headerCID.CID, blockNumber: blockNumber, blockHash: headerCID.BlockHash, @@ -1326,8 +1326,8 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { }, } - for _, txCID := range headerCID.TransactionCids { - ethHeaderCidNode.transactions = append(ethHeaderCidNode.transactions, &EthTransactionCid{ + for _, txCID := range headerCID.TransactionCIDs { + ethHeaderCIDNode.transactions = append(ethHeaderCIDNode.transactions, &EthTransactionCID{ cid: txCID.CID, txHash: txCID.TxHash, index: int32(txCID.Index), @@ -1336,24 +1336,24 @@ func (r *Resolver) AllEthHeaderCids(ctx context.Context, args struct { }) } - resultNodes = append(resultNodes, ðHeaderCidNode) + resultNodes = append(resultNodes, ðHeaderCIDNode) } - return &EthHeaderCidsConnection{ + return &EthHeaderCIDsConnection{ nodes: resultNodes, }, nil } func (r *Resolver) EthTransactionCidByTxHash(ctx context.Context, args struct { TxHash string -}) (*EthTransactionCid, error) { +}) (*EthTransactionCID, error) { txCID, err := r.backend.Retriever.RetrieveTxCIDByHash(args.TxHash) if err != nil { return nil, err } - return &EthTransactionCid{ + return &EthTransactionCID{ cid: txCID.CID, txHash: txCID.TxHash, index: int32(txCID.Index), diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index f61c9b65..33397572 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -254,81 +254,81 @@ var _ = Describe("GraphQL", func() { Describe("allEthHeaderCids", func() { It("Retrieves header_cids that matches the provided blockNumber", func() { - allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockNumber: new(graphql.BigInt).SetUint64(2)}) + allEthHeaderCIDsResp, err := client.AllEthHeaderCIDs(ctx, graphql.EthHeaderCIDCondition{BlockNumber: new(graphql.BigInt).SetUint64(2)}) Expect(err).ToNot(HaveOccurred()) headerCIDs, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockNumber(2) Expect(err).ToNot(HaveOccurred()) for idx, headerCID := range headerCIDs { - ethHeaderCid := allEthHeaderCidsResp.Nodes[idx] + ethHeaderCID := allEthHeaderCIDsResp.Nodes[idx] - compareEthHeaderCid(ethHeaderCid, headerCID) + compareEthHeaderCID(ethHeaderCID, headerCID) } }) It("Retrieves header_cids that matches the provided blockHash", func() { blockHash := blocks[1].Hash().String() - allEthHeaderCidsResp, err := client.AllEthHeaderCids(ctx, graphql.EthHeaderCidCondition{BlockHash: &blockHash}) + allEthHeaderCIDsResp, err := client.AllEthHeaderCIDs(ctx, graphql.EthHeaderCIDCondition{BlockHash: &blockHash}) Expect(err).ToNot(HaveOccurred()) headerCID, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash()) Expect(err).ToNot(HaveOccurred()) - Expect(len(allEthHeaderCidsResp.Nodes)).To(Equal(1)) - ethHeaderCid := allEthHeaderCidsResp.Nodes[0] - compareEthHeaderCid(ethHeaderCid, headerCID) + Expect(len(allEthHeaderCIDsResp.Nodes)).To(Equal(1)) + ethHeaderCID := allEthHeaderCIDsResp.Nodes[0] + compareEthHeaderCID(ethHeaderCID, headerCID) }) }) Describe("ethTransactionCidByTxHash", func() { It("Retrieves tx_cid that matches the provided txHash", func() { txHash := blocks[2].Transactions()[0].Hash().String() - ethTransactionCidResp, err := client.EthTransactionCidByTxHash(ctx, txHash) + ethTransactionCIDResp, err := client.EthTransactionCIDByTxHash(ctx, txHash) Expect(err).ToNot(HaveOccurred()) txCID, err := backend.Retriever.RetrieveTxCIDByHash(txHash) Expect(err).ToNot(HaveOccurred()) - compareEthTxCid(*ethTransactionCidResp, txCID) + compareEthTxCID(*ethTransactionCIDResp, txCID) - Expect(ethTransactionCidResp.BlockByMhKey.Data).To(Equal(graphql.Bytes(txCID.IPLD.Data).String())) + Expect(ethTransactionCIDResp.BlockByMhKey.Data).To(Equal(graphql.Bytes(txCID.IPLD.Data).String())) }) }) }) -func compareEthHeaderCid(ethHeaderCid graphql.EthHeaderCidResponse, headerCID eth.HeaderCidRecord) { +func compareEthHeaderCID(ethHeaderCID graphql.EthHeaderCIDResponse, headerCID eth.HeaderCIDRecord) { blockNumber, err := strconv.ParseInt(headerCID.BlockNumber, 10, 64) Expect(err).ToNot(HaveOccurred()) td, err := strconv.ParseInt(headerCID.TotalDifficulty, 10, 64) Expect(err).ToNot(HaveOccurred()) - Expect(ethHeaderCid.Cid).To(Equal(headerCID.CID)) - Expect(ethHeaderCid.BlockNumber).To(Equal(*new(graphql.BigInt).SetUint64(uint64(blockNumber)))) - Expect(ethHeaderCid.BlockHash).To(Equal(headerCID.BlockHash)) - Expect(ethHeaderCid.ParentHash).To(Equal(headerCID.ParentHash)) - Expect(ethHeaderCid.Timestamp).To(Equal(*new(graphql.BigInt).SetUint64(headerCID.Timestamp))) - Expect(ethHeaderCid.StateRoot).To(Equal(headerCID.StateRoot)) - Expect(ethHeaderCid.Td).To(Equal(*new(graphql.BigInt).SetUint64(uint64(td)))) - Expect(ethHeaderCid.TxRoot).To(Equal(headerCID.TxRoot)) - Expect(ethHeaderCid.ReceiptRoot).To(Equal(headerCID.RctRoot)) - Expect(ethHeaderCid.UncleRoot).To(Equal(headerCID.UncleRoot)) - Expect(ethHeaderCid.Bloom).To(Equal(graphql.Bytes(headerCID.Bloom).String())) + Expect(ethHeaderCID.CID).To(Equal(headerCID.CID)) + Expect(ethHeaderCID.BlockNumber).To(Equal(*new(graphql.BigInt).SetUint64(uint64(blockNumber)))) + Expect(ethHeaderCID.BlockHash).To(Equal(headerCID.BlockHash)) + Expect(ethHeaderCID.ParentHash).To(Equal(headerCID.ParentHash)) + Expect(ethHeaderCID.Timestamp).To(Equal(*new(graphql.BigInt).SetUint64(headerCID.Timestamp))) + Expect(ethHeaderCID.StateRoot).To(Equal(headerCID.StateRoot)) + Expect(ethHeaderCID.Td).To(Equal(*new(graphql.BigInt).SetUint64(uint64(td)))) + Expect(ethHeaderCID.TxRoot).To(Equal(headerCID.TxRoot)) + Expect(ethHeaderCID.ReceiptRoot).To(Equal(headerCID.RctRoot)) + Expect(ethHeaderCID.UncleRoot).To(Equal(headerCID.UncleRoot)) + Expect(ethHeaderCID.Bloom).To(Equal(graphql.Bytes(headerCID.Bloom).String())) - for tIdx, txCID := range headerCID.TransactionCids { - ethTxCid := ethHeaderCid.EthTransactionCidsByHeaderId.Nodes[tIdx] - compareEthTxCid(ethTxCid, txCID) + for tIdx, txCID := range headerCID.TransactionCIDs { + ethTxCID := ethHeaderCID.EthTransactionCIDsByHeaderId.Nodes[tIdx] + compareEthTxCID(ethTxCID, txCID) } - Expect(ethHeaderCid.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerCID.IPLD.Data).String())) - Expect(ethHeaderCid.BlockByMhKey.Key).To(Equal(headerCID.IPLD.Key)) + Expect(ethHeaderCID.BlockByMhKey.Data).To(Equal(graphql.Bytes(headerCID.IPLD.Data).String())) + Expect(ethHeaderCID.BlockByMhKey.Key).To(Equal(headerCID.IPLD.Key)) } -func compareEthTxCid(ethTxCid graphql.EthTransactionCidResponse, txCID eth.TransactionCidRecord) { - Expect(ethTxCid.Cid).To(Equal(txCID.CID)) - Expect(ethTxCid.TxHash).To(Equal(txCID.TxHash)) - Expect(ethTxCid.Index).To(Equal(int32(txCID.Index))) - Expect(ethTxCid.Src).To(Equal(txCID.Src)) - Expect(ethTxCid.Dst).To(Equal(txCID.Dst)) +func compareEthTxCID(ethTxCID graphql.EthTransactionCIDResponse, txCID eth.TransactionCIDRecord) { + Expect(ethTxCID.CID).To(Equal(txCID.CID)) + Expect(ethTxCID.TxHash).To(Equal(txCID.TxHash)) + Expect(ethTxCID.Index).To(Equal(int32(txCID.Index))) + Expect(ethTxCID.Src).To(Equal(txCID.Src)) + Expect(ethTxCID.Dst).To(Equal(txCID.Dst)) } -- 2.45.2