diff --git a/.vscode/settings.json b/.vscode/settings.json index 19bbfe56d3..ed3d2aeafe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.fontLigatures": "'calt', 'liga', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09'", - "editor.formatOnSave": true, + // "editor.formatOnSave": true, "[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" }, diff --git a/contrib/opbot/go.sum b/contrib/opbot/go.sum index 7c659ec02f..a374969705 100644 --- a/contrib/opbot/go.sum +++ b/contrib/opbot/go.sum @@ -92,12 +92,6 @@ github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWk github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o= -github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= -github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk= -github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= diff --git a/core/metrics/base.go b/core/metrics/base.go index 6487e05925..38f01be5bd 100644 --- a/core/metrics/base.go +++ b/core/metrics/base.go @@ -3,6 +3,8 @@ package metrics import ( "context" "fmt" + "net/http" + "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/synapsecns/sanguine/core" @@ -28,7 +30,6 @@ import ( semconv "go.opentelemetry.io/otel/semconv/v1.26.0" "go.opentelemetry.io/otel/trace" "gorm.io/gorm" - "net/http" ) const pyroscopeEndpoint = internal.PyroscopeEndpoint diff --git a/core/metrics/metrics.go b/core/metrics/metrics.go index d09a794b6b..f3f6bf8da3 100644 --- a/core/metrics/metrics.go +++ b/core/metrics/metrics.go @@ -3,6 +3,10 @@ package metrics import ( "context" "fmt" + "net/http" + "os" + "strings" + "github.com/gin-gonic/gin" "github.com/synapsecns/sanguine/core/config" experimentalLogger "github.com/synapsecns/sanguine/core/metrics/logger" @@ -11,9 +15,6 @@ import ( "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" "gorm.io/gorm" - "net/http" - "os" - "strings" ) // Handler collects metrics. diff --git a/go.work.sum b/go.work.sum index 584b23e89b..e9e27d4e17 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1725,6 +1725,8 @@ github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGW github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw= github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= +github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= +github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= github.com/alecthomas/kingpin/v2 v2.3.1 h1:ANLJcKmQm4nIaog7xdr/id6FM6zm5hHnfZrvtKPxqGg= github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU= @@ -1732,6 +1734,7 @@ github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HR github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae h1:C4Q9m+oXOxcSWwYk9XzzafY2xAVAaeubZbUHJkw3PlY= +github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -1849,6 +1852,7 @@ github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRt github.com/celo-org/celo-blockchain v0.0.0-20210222234634-f8c8f6744526 h1:rdY1F8vUybjjsv+V58eaSYsYPTNO+AXK9o7l+BQuhhU= github.com/celo-org/celo-bls-go v0.2.4 h1:V1y92kM5IRJWQZ6DCwqiKLW7swmUA5y/dPJ9YbU4HfA= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI= @@ -2127,6 +2131,7 @@ github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1S github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/ferranbt/fastssz v0.1.2 h1:Dky6dXlngF6Qjc+EfDipAkE83N5I5DE68bY6O0VLNPk= github.com/ferranbt/fastssz v0.1.2/go.mod h1:X5UPrE2u1UJjxHA8X54u04SBwdAQjG2sFtWs39YxyWs= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= @@ -2258,6 +2263,7 @@ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4 github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= @@ -2689,7 +2695,6 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= @@ -3438,8 +3443,6 @@ github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/uudashr/gocognit v1.0.1 h1:MoG2fZ0b/Eo7NXoIwCVFLG5JED3qgQz5/NEE+rOsjPs= github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasthttp v1.41.0 h1:zeR0Z1my1wDHTRiamBCXVglQdbUwgb9uWG3k1HQz6jY= -github.com/valyala/fasthttp v1.41.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/quicktemplate v1.6.3 h1:O7EuMwuH7Q94U2CXD6sOX8AYHqQqWtmIk690IhmpkKA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -3584,6 +3587,7 @@ go.opentelemetry.io/collector/semconv v0.101.0 h1:tOe9iTe9dDCnvz/bqgfNRr4w80kXG8 go.opentelemetry.io/collector/semconv v0.101.0/go.mod h1:8ElcRZ8Cdw5JnvhTOQOdYizkJaQ10Z2fS+R6djOnj6A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= @@ -3672,6 +3676,7 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= @@ -3709,7 +3714,6 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= @@ -3731,6 +3735,7 @@ golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2 golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852 h1:xYq6+9AtI+xP3M4r0N1hCkHrInHDBohhquRgx9Kk6gI= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5 h1:ObuXPmIgI4ZMyQLIz48cJYgSyWdjUXc2SZAdyJMwEAU= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= @@ -3757,7 +3762,6 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -3779,6 +3783,7 @@ golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= diff --git a/services/cctp-relayer/go.mod b/services/cctp-relayer/go.mod index 40ed825d94..964fe4958f 100644 --- a/services/cctp-relayer/go.mod +++ b/services/cctp-relayer/go.mod @@ -7,7 +7,6 @@ toolchain go1.22.4 require ( github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 - github.com/alecthomas/assert v1.0.0 github.com/brianvoe/gofakeit/v6 v6.27.0 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/ethereum/go-ethereum v1.13.8 @@ -49,8 +48,6 @@ require ( github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/Soft/iter v0.1.0 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/alecthomas/colour v0.1.0 // indirect - github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 // indirect github.com/andybalholm/brotli v1.1.0 // indirect github.com/aws/aws-sdk-go-v2 v1.21.2 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.45 // indirect diff --git a/services/cctp-relayer/go.sum b/services/cctp-relayer/go.sum index 13b00bfe08..8eecd02dda 100644 --- a/services/cctp-relayer/go.sum +++ b/services/cctp-relayer/go.sum @@ -106,12 +106,6 @@ github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWk github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o= -github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= -github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk= -github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= diff --git a/services/cctp-relayer/relayer/util_test.go b/services/cctp-relayer/relayer/util_test.go index d42a9a9d2b..2aa970437b 100644 --- a/services/cctp-relayer/relayer/util_test.go +++ b/services/cctp-relayer/relayer/util_test.go @@ -1,9 +1,9 @@ package relayer_test import ( + "github.com/stretchr/testify/assert" "testing" - "github.com/alecthomas/assert" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/synapsecns/sanguine/services/cctp-relayer/relayer" ) diff --git a/services/rfq/go.mod b/services/rfq/go.mod index 73f87732f5..fb54b15999 100644 --- a/services/rfq/go.mod +++ b/services/rfq/go.mod @@ -6,8 +6,8 @@ toolchain go1.22.4 require ( github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 - github.com/alecthomas/assert v1.0.0 github.com/brianvoe/gofakeit/v6 v6.27.0 + github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d github.com/cornelk/hashmap v1.0.8 github.com/dubonzi/otelresty v1.3.0 github.com/ethereum/go-ethereum v1.13.8 @@ -64,8 +64,6 @@ require ( github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/Soft/iter v0.1.0 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/alecthomas/colour v0.1.0 // indirect - github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 // indirect github.com/andybalholm/brotli v1.1.0 // indirect github.com/aws/aws-sdk-go-v2 v1.21.2 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.45 // indirect @@ -80,6 +78,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect github.com/aws/smithy-go v1.15.0 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bcicen/jstream v1.0.1 // indirect github.com/benbjohnson/immutable v0.4.3 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -94,6 +93,13 @@ require ( github.com/c-bata/go-prompt v0.2.6 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/charmbracelet/bubbles v0.18.0 // indirect + github.com/charmbracelet/bubbletea v0.26.5 // indirect + github.com/charmbracelet/lipgloss v0.11.0 // indirect + github.com/charmbracelet/x/ansi v0.1.2 // indirect + github.com/charmbracelet/x/input v0.1.2 // indirect + github.com/charmbracelet/x/term v0.1.1 // indirect + github.com/charmbracelet/x/windows v0.1.2 // indirect github.com/cheekybits/genny v1.0.0 // indirect github.com/chzyer/logex v1.2.1 // indirect github.com/chzyer/test v1.0.0 // indirect @@ -123,6 +129,7 @@ require ( github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -201,9 +208,11 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/libp2p/go-libp2p v0.33.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-tty v0.0.3 // indirect @@ -216,6 +225,9 @@ require ( github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/termenv v0.15.2 // indirect github.com/neverlee/keymutex v0.0.0-20171121013845-f593aa834bf9 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect @@ -269,6 +281,7 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.opencensus.io v0.24.0 // indirect diff --git a/services/rfq/go.sum b/services/rfq/go.sum index 5187cdf645..0b441c24c4 100644 --- a/services/rfq/go.sum +++ b/services/rfq/go.sum @@ -108,12 +108,6 @@ github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWk github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o= -github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= -github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk= -github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= @@ -170,6 +164,8 @@ github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB github.com/aws/smithy-go v1.11.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bcicen/jstream v1.0.1 h1:BXY7Cu4rdmc0rhyTVyT3UkxAiX3bnLpKLas9btbH5ck= github.com/bcicen/jstream v1.0.1/go.mod h1:9ielPxqFry7Y4Tg3j4BfjPocfJ3TbsRtXOAYXYmRuAQ= @@ -227,6 +223,22 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= +github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= +github.com/charmbracelet/bubbletea v0.26.5 h1:90pqTPElAReb/qQUgSMUresTkfwVr0Wx+zczeHHOgxk= +github.com/charmbracelet/bubbletea v0.26.5/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk= +github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d h1:OpthCCWiHBSx6LTAYGGkN9OeuJrKzjobe0q12wO6BX0= +github.com/charmbracelet/huh/spinner v0.0.0-20240618200428-90406d79077d/go.mod h1:CrXBZnOWs3zpyppOZZS7lu2CpLq2jx6U5chL/frRG/E= +github.com/charmbracelet/lipgloss v0.11.0 h1:UoAcbQ6Qml8hDwSWs0Y1cB5TEQuZkDPH/ZqwWWYTG4g= +github.com/charmbracelet/lipgloss v0.11.0/go.mod h1:1UdRTH9gYgpcdNN5oBtjbu/IzNKtzVtb7sqN1t9LNn8= +github.com/charmbracelet/x/ansi v0.1.2 h1:6+LR39uG8DE6zAmbu023YlqjJHkYXDF1z36ZwzO4xZY= +github.com/charmbracelet/x/ansi v0.1.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/input v0.1.2 h1:QJAZr33eOhDowkkEQ24rsJy4Llxlm+fRDf/cQrmqJa0= +github.com/charmbracelet/x/input v0.1.2/go.mod h1:LGBim0maUY4Pitjn/4fHnuXb4KirU3DODsyuHuXdOyA= +github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= +github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= +github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= +github.com/charmbracelet/x/windows v0.1.2/go.mod h1:GLEO/l+lizvFDBPLIOk+49gdX49L9YWMB5t+DZd0jkQ= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= @@ -350,6 +362,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y 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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= @@ -769,6 +783,8 @@ github.com/libp2p/go-libp2p v0.33.0 h1:yTPSr8sJRbfeEYXyeN8VPVSlTlFjtMUwGDRniwaf/ github.com/libp2p/go-libp2p v0.33.0/go.mod h1:RIJFRQVUBKy82dnW7J5f1homqqv6NcsDJAl3e7CRGfE= github.com/lmittmann/w3 v0.10.0 h1:AjQJKfcwHSDLr7cnRbS+0Jio9xt/h1JDBAP/jvLWC58= github.com/lmittmann/w3 v0.10.0/go.mod h1:AydD3eqJiyg7tubFve39JL025kZr8QWO1lemXllK+Sw= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -798,6 +814,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -845,6 +863,12 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= @@ -1128,6 +1152,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= @@ -1436,6 +1462,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc 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-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/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= diff --git a/services/rfq/relayer/cmd/commands.go b/services/rfq/relayer/cmd/commands.go index 0ce6bdb172..5dc6609e7e 100644 --- a/services/rfq/relayer/cmd/commands.go +++ b/services/rfq/relayer/cmd/commands.go @@ -3,7 +3,9 @@ package cmd import ( "fmt" + "math/big" + "github.com/charmbracelet/huh/spinner" "github.com/ethereum/go-ethereum/common" "github.com/synapsecns/sanguine/core" "github.com/synapsecns/sanguine/core/commandline" @@ -87,8 +89,8 @@ var withdrawCommand = &cli.Command{ return fmt.Errorf("could not create relayer: %w", err) } - chainID := c.Uint(chainIDFlag.Name) - if chainID == 0 { + chainID := big.NewInt(c.Int64(chainIDFlag.Name)) + if chainID.Cmp(big.NewInt(0)) == 0 { return fmt.Errorf("valid chain ID is required") } @@ -108,17 +110,41 @@ var withdrawCommand = &cli.Command{ } withdrawRequest := relapi.WithdrawRequest{ - ChainID: uint32(chainID), + ChainID: uint32(chainID.Uint64()), Amount: amount, TokenAddress: common.HexToAddress(tokenAddress), To: common.HexToAddress(to), } - _, err = client.Withdraw(c.Context, &withdrawRequest) + res, err := client.Withdraw(c.Context, &withdrawRequest) if err != nil { return fmt.Errorf("could not start relayer: %w", err) } + var errClient error + var status *relapi.TxHashByNonceResponse + err = spinner.New(). + Title("Waiting for tx..."). + Action(func() { + status, err = client.GetTxHashByNonce( + c.Context, + &relapi.GetTxByNonceRequest{ + ChainID: uint32(chainID.Uint64()), + Nonce: res.Nonce, + }) + if err != nil { + errClient = fmt.Errorf("could not login: %w", err) + } + }).Run() + if err != nil { + return fmt.Errorf("could not get withdrawal tx hash: %w", err) + } + if errClient != nil { + return fmt.Errorf("client error: could not get withdrawal tx hash: %w", err) + } + + fmt.Printf("Withdraw Tx Hash: %s\n", status.Hash) + return nil }, } diff --git a/services/rfq/relayer/relapi/client.go b/services/rfq/relayer/relapi/client.go index f00ecbe707..f4c690cb89 100644 --- a/services/rfq/relayer/relapi/client.go +++ b/services/rfq/relayer/relapi/client.go @@ -3,12 +3,13 @@ package relapi import ( "context" "fmt" + "net/http" + "github.com/dubonzi/otelresty" "github.com/go-http-utils/headers" "github.com/go-resty/resty/v2" "github.com/synapsecns/sanguine/core/metrics" "github.com/valyala/fastjson" - "net/http" ) // RelayerClient is the interface for the relayer client. @@ -18,6 +19,7 @@ type RelayerClient interface { GetQuoteRequestStatusByTxID(ctx context.Context, hash string) (*GetQuoteRequestStatusResponse, error) RetryTransaction(ctx context.Context, txhash string) (*GetTxRetryResponse, error) Withdraw(ctx context.Context, req *WithdrawRequest) (*WithdrawResponse, error) + GetTxHashByNonce(ctx context.Context, req *GetTxByNonceRequest) (*TxHashByNonceResponse, error) GetQuoteRequestByTXID(ctx context.Context, txid string) (*GetQuoteRequestResponse, error) } @@ -108,6 +110,7 @@ type WithdrawResponse struct { Nonce uint64 `json:"nonce"` } +// Withdraw withdraws an ERC20 or Ether from the relayer. func (r *relayerClient) Withdraw(ctx context.Context, req *WithdrawRequest) (*WithdrawResponse, error) { var res WithdrawResponse resp, err := r.client.R().SetContext(ctx). @@ -124,6 +127,32 @@ func (r *relayerClient) Withdraw(ctx context.Context, req *WithdrawRequest) (*Wi return &res, nil } +// TxHashByNonceResponse is the request for getting a transaction hash by nonce. +type TxHashByNonceResponse struct { + Hash string `json:"withdrawTxHash"` +} + +// GetTxByNonceRequest is the request for getting a transaction hash by nonce. +func (r *relayerClient) GetTxHashByNonce(ctx context.Context, req *GetTxByNonceRequest) (*TxHashByNonceResponse, error) { + var res TxHashByNonceResponse + + resp, err := r.client.R().SetContext(ctx). + SetResult(&res). + SetQueryParam("chain_id", fmt.Sprintf("%d", req.ChainID)). + SetQueryParam("nonce", fmt.Sprintf("%d", req.Nonce)). + Get(getTxHashByNonceRoute) + + if err != nil { + return nil, fmt.Errorf("failed to get tx hash by nonce: %w", err) + } + + if resp.StatusCode() != http.StatusOK { + return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode()) + } + + return &res, nil +} + func (r *relayerClient) GetQuoteRequestByTXID(ctx context.Context, txid string) (*GetQuoteRequestResponse, error) { var res GetQuoteRequestResponse resp, err := r.client.R().SetContext(ctx). diff --git a/services/rfq/relayer/relapi/client_test.go b/services/rfq/relayer/relapi/client_test.go index d93e0a5def..81baea2940 100644 --- a/services/rfq/relayer/relapi/client_test.go +++ b/services/rfq/relayer/relapi/client_test.go @@ -1,8 +1,17 @@ package relapi_test import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/synapsecns/sanguine/core/retry" + submitterdb "github.com/synapsecns/sanguine/ethergo/submitter/db" + "github.com/synapsecns/sanguine/services/rfq/relayer/chain" + "github.com/synapsecns/sanguine/services/rfq/relayer/relapi" "github.com/synapsecns/sanguine/services/rfq/relayer/reldb" ) @@ -51,6 +60,181 @@ func (c *RelayerClientSuite) TestRetryTransaction() { c.Equal(resp.TxID, hexutil.Encode(testReq.TransactionID[:])) } +func (c *RelayerClientSuite) TestEthWithdraw() { + backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] + + startBalance, err := backend.BalanceAt(c.GetTestContext(), testWithdrawalAddress, nil) + c.Require().NoError(err) + + withdrawalAmount := big.NewInt(50) + + _, err = c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ + ChainID: uint32(backend.GetChainID()), + To: testWithdrawalAddress, + Amount: withdrawalAmount.String(), + TokenAddress: chain.EthAddress, + }) + c.Require().NoError(err) + + // Wait for the transaction to be mined + err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { + balance, err := backend.BalanceAt(ctx, testWithdrawalAddress, nil) + if err != nil { + return fmt.Errorf("could not fetch balance %w", err) + } + + expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) + + if balance.Cmp(expectedBalance) != 0 { + return fmt.Errorf("balance not updated") + } + + return nil + }) + c.Require().NoError(err) +} + +func (c *RelayerClientSuite) TestERC20Withdraw() { + backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] + + _, erc20 := c.underlying.deployManager.GetMockERC20(c.GetTestContext(), backend) + + startBalance, err := erc20.BalanceOf(&bind.CallOpts{Context: c.GetTestContext()}, testWithdrawalAddress) + c.Require().NoError(err) + + withdrawalAmount := big.NewInt(50) + + _, err = c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ + ChainID: uint32(backend.GetChainID()), + To: testWithdrawalAddress, + Amount: withdrawalAmount.String(), + TokenAddress: erc20.Address(), + }) + c.Require().NoError(err) + + // Wait for the transaction to be mined + err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { + balance, err := erc20.BalanceOf(&bind.CallOpts{Context: ctx}, testWithdrawalAddress) + if err != nil { + return fmt.Errorf("could not get balance %w", err) + } + + expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) + + if balance.Cmp(expectedBalance) != 0 { + return fmt.Errorf("balance not updated") + } + + return nil + }) + c.Require().NoError(err) +} + +func (c *RelayerClientSuite) TestGetTxHash() { + backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] + + _, erc20 := c.underlying.deployManager.GetMockERC20(c.GetTestContext(), backend) + + withdrawalAmount := big.NewInt(50) + + withdrawRes, err := c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ + ChainID: uint32(backend.GetChainID()), + To: testWithdrawalAddress, + Amount: withdrawalAmount.String(), + TokenAddress: erc20.Address(), + }) + c.Require().NoError(err) + + var txHashRes *relapi.TxHashByNonceResponse + + // Wait for the transaction to be mined + err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { + txHashRes, err = c.Client.GetTxHashByNonce( + c.GetTestContext(), + &relapi.GetTxByNonceRequest{ + ChainID: uint32(backend.GetChainID()), + Nonce: withdrawRes.Nonce, + }, + ) + if err != nil { + return fmt.Errorf("could not get hash %w", err) + } + return nil + }) + + c.Require().NoError(err) + c.Require().NotEmpty(txHashRes.Hash) +} + +func (c *RelayerClientSuite) TestEthWithdrawCLI() { + res, err := c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ + ChainID: c.underlying.originChainID, + To: common.HexToAddress(testWithdrawalAddress.String()), + Amount: "1000000000000000000", + TokenAddress: chain.EthAddress, + }) + c.Require().NoError(err) + + // Wait for the transaction to be mined + err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { + status, err := c.underlying.database.SubmitterDB(). + GetNonceStatus( + ctx, + c.underlying.wallet.Address(), + big.NewInt(int64(c.underlying.originChainID)), + res.Nonce, + ) + if err != nil { + return fmt.Errorf("could not get status %w", err) + } + + if status != submitterdb.Stored { + return fmt.Errorf("transaction not mined") + } + + return nil + }) + c.Require().NoError(err) + c.Require().NotNil(res) +} + +func (c *RelayerClientSuite) TestERC20WithdrawCLI() { + backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] + + _, erc20 := c.underlying.deployManager.GetMockERC20(c.GetTestContext(), backend) + + startBalance, err := erc20.BalanceOf(&bind.CallOpts{Context: c.GetTestContext()}, testWithdrawalAddress) + c.Require().NoError(err) + + withdrawalAmount := big.NewInt(1000000000000000000) + + res, err := c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ + ChainID: c.underlying.originChainID, + To: common.HexToAddress(testWithdrawalAddress.String()), + Amount: withdrawalAmount.String(), + TokenAddress: erc20.Address(), + }) + c.Require().NoError(err) + + // Wait for the transaction to be mined + err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { + balance, err := erc20.BalanceOf(&bind.CallOpts{Context: ctx}, testWithdrawalAddress) + if err != nil { + return fmt.Errorf("could not fetch balance %w", err) + } + + expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) + + if balance.Cmp(expectedBalance) != 0 { + return fmt.Errorf("balance not updated") + } + + return nil + }) + + c.Require().NoError(err) + c.Require().NotNil(res) +} func (c *RelayerClientSuite) TestGetQuoteByTX() { testReq := c.underlying.getTestQuoteRequest(reldb.Seen) err := c.underlying.database.StoreQuoteRequest(c.GetTestContext(), testReq) diff --git a/services/rfq/relayer/relapi/handler.go b/services/rfq/relayer/relapi/handler.go index 85644c8139..340180bb9c 100644 --- a/services/rfq/relayer/relapi/handler.go +++ b/services/rfq/relayer/relapi/handler.go @@ -244,6 +244,43 @@ func (h *Handler) Withdraw(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"nonce": nonce}) } +// GetTxByNonceRequest is the request for getting a transaction hash by nonce. +type GetTxByNonceRequest struct { + ChainID uint32 `json:"chain_id"` + Nonce uint64 `json:"nonce"` +} + +// GetTxHashByNonce gets the transaction hash by submitter nonce. +func (h *Handler) GetTxHashByNonce(c *gin.Context) { + chainIDStr := c.Query("chain_id") + nonceStr := c.Query("nonce") + + chainID, ok := new(big.Int).SetString(chainIDStr, 10) + if !ok { + c.JSON(http.StatusBadRequest, gin.H{"error": "invalid chainID"}) + return + } + + nonce, ok := new(big.Int).SetString(nonceStr, 10) + if !ok { + c.JSON(http.StatusBadRequest, gin.H{"error": "invalid nonce"}) + return + } + + tx, err := h.submitter.GetSubmissionStatus(c, chainID, nonce.Uint64()) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("could not get tx hash: %s", err.Error())}) + return + } + + if tx.HasTx() { + c.JSON(http.StatusOK, gin.H{"withdrawTxHash": tx.TxHash().String()}) + return + } + + c.JSON(http.StatusNotFound, gin.H{"error": "transaction not found"}) +} + // tokenIDExists checks if a token ID exists in the config. // note: this method assumes that SanitizeTokenID is a method of relconfig.Config func tokenIDExists(cfg relconfig.Config, tokenAddress common.Address, chainID int) bool { diff --git a/services/rfq/relayer/relapi/server.go b/services/rfq/relayer/relapi/server.go index f57c01e59c..8be2f22e78 100644 --- a/services/rfq/relayer/relapi/server.go +++ b/services/rfq/relayer/relapi/server.go @@ -101,6 +101,7 @@ const ( getQuoteStatusByTxIDRoute = "/status/by_tx_id" getRetryRoute = "/retry" postWithdrawRoute = "/withdraw" + getTxHashByNonceRoute = "/tx_hash/by_nonce" getRequestByTxID = "/request/by_tx_id" ) @@ -123,6 +124,7 @@ func (r *RelayerAPIServer) Run(ctx context.Context) error { if r.cfg.EnableAPIWithdrawals { engine.POST(postWithdrawRoute, h.Withdraw) + engine.GET(getTxHashByNonceRoute, h.GetTxHashByNonce) } r.engine = engine diff --git a/services/rfq/relayer/relapi/server_test.go b/services/rfq/relayer/relapi/server_test.go index e4af4b116c..9d54bcba0c 100644 --- a/services/rfq/relayer/relapi/server_test.go +++ b/services/rfq/relayer/relapi/server_test.go @@ -4,15 +4,14 @@ import ( "context" "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/stretchr/testify/assert" - "github.com/synapsecns/sanguine/services/rfq/relayer/chain" - "github.com/synapsecns/sanguine/services/rfq/relayer/relconfig" "math/big" "net/http" "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/synapsecns/sanguine/services/rfq/relayer/relconfig" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" @@ -208,76 +207,6 @@ func (c *RelayerServerSuite) getTestQuoteRequest(status reldb.QuoteRequestStatus } } -func (c *RelayerClientSuite) TestEthWithdraw() { - backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] - - startBalance, err := backend.BalanceAt(c.GetTestContext(), testWithdrawalAddress, nil) - c.Require().NoError(err) - - withdrawalAmount := big.NewInt(50) - - _, err = c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ - ChainID: uint32(backend.GetChainID()), - To: testWithdrawalAddress, - Amount: withdrawalAmount.String(), - TokenAddress: chain.EthAddress, - }) - c.Require().NoError(err) - - // Wait for the transaction to be mined - err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { - balance, err := backend.BalanceAt(ctx, testWithdrawalAddress, nil) - if err != nil { - return fmt.Errorf("could not fetch balance %w", err) - } - - expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) - - if balance.Cmp(expectedBalance) != 0 { - return fmt.Errorf("balance not updated") - } - - return nil - }) - c.Require().NoError(err) -} - -func (c *RelayerClientSuite) TestERC20Withdraw() { - backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] - - _, erc20 := c.underlying.deployManager.GetMockERC20(c.GetTestContext(), backend) - - startBalance, err := erc20.BalanceOf(&bind.CallOpts{Context: c.GetTestContext()}, testWithdrawalAddress) - c.Require().NoError(err) - - withdrawalAmount := big.NewInt(50) - - _, err = c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ - ChainID: uint32(backend.GetChainID()), - To: testWithdrawalAddress, - Amount: withdrawalAmount.String(), - TokenAddress: erc20.Address(), - }) - c.Require().NoError(err) - - // Wait for the transaction to be mined - err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { - balance, err := erc20.BalanceOf(&bind.CallOpts{Context: ctx}, testWithdrawalAddress) - if err != nil { - return fmt.Errorf("could not get balance %w", err) - } - - expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) - - if balance.Cmp(expectedBalance) != 0 { - return fmt.Errorf("balance not updated") - } - - return nil - }) - c.Require().NoError(err) -} - func TestTokenIDExists(t *testing.T) { cfg := relconfig.Config{ QuotableTokens: map[string][]string{ @@ -360,73 +289,3 @@ func TestToAddressIsWhitelisted(t *testing.T) { }) } } - -func (c *RelayerClientSuite) TestEthWithdrawCLI() { - res, err := c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ - ChainID: c.underlying.originChainID, - To: common.HexToAddress(testWithdrawalAddress.String()), - Amount: "1000000000000000000", - TokenAddress: chain.EthAddress, - }) - c.Require().NoError(err) - - // Wait for the transaction to be mined - err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { - status, err := c.underlying.database.SubmitterDB(). - GetNonceStatus( - ctx, - c.underlying.wallet.Address(), - big.NewInt(int64(c.underlying.originChainID)), - res.Nonce, - ) - if err != nil { - return fmt.Errorf("could not get status %w", err) - } - - if status != submitterdb.Stored { - return fmt.Errorf("transaction not mined") - } - - return nil - }) - c.Require().NoError(err) - c.Require().NotNil(res) -} - -func (c *RelayerClientSuite) TestERC20WithdrawCLI() { - backend := c.underlying.testBackends[uint64(c.underlying.originChainID)] - - _, erc20 := c.underlying.deployManager.GetMockERC20(c.GetTestContext(), backend) - - startBalance, err := erc20.BalanceOf(&bind.CallOpts{Context: c.GetTestContext()}, testWithdrawalAddress) - c.Require().NoError(err) - - withdrawalAmount := big.NewInt(1000000000000000000) - - res, err := c.Client.Withdraw(c.GetTestContext(), &relapi.WithdrawRequest{ - ChainID: c.underlying.originChainID, - To: common.HexToAddress(testWithdrawalAddress.String()), - Amount: withdrawalAmount.String(), - TokenAddress: erc20.Address(), - }) - c.Require().NoError(err) - - // Wait for the transaction to be mined - err = retry.WithBackoff(c.GetTestContext(), func(ctx context.Context) error { - balance, err := erc20.BalanceOf(&bind.CallOpts{Context: ctx}, testWithdrawalAddress) - if err != nil { - return fmt.Errorf("could not fetch balance %w", err) - } - - expectedBalance := new(big.Int).Add(startBalance, withdrawalAmount) - - if balance.Cmp(expectedBalance) != 0 { - return fmt.Errorf("balance not updated") - } - - return nil - }) - - c.Require().NoError(err) - c.Require().NotNil(res) -} diff --git a/services/rfq/relayer/relapi/suite_test.go b/services/rfq/relayer/relapi/suite_test.go index f7fd89532e..321a85a578 100644 --- a/services/rfq/relayer/relapi/suite_test.go +++ b/services/rfq/relayer/relapi/suite_test.go @@ -177,8 +177,8 @@ func (c *RelayerServerSuite) SetupSuite() { g, _ := errgroup.WithContext(c.GetSuiteContext()) for _, chainID := range chainIDs { - chainID := chainID // Setup Anvil backend for the suite to have RPC support + chainID := chainID g.Go(func() error { backend := geth.NewEmbeddedBackendForChainID(c.GetSuiteContext(), c.T(), new(big.Int).SetUint64(chainID)) diff --git a/services/rfq/relayer/relconfig/config_test.go b/services/rfq/relayer/relconfig/config_test.go index 01a94286d4..2d64aec9e1 100644 --- a/services/rfq/relayer/relconfig/config_test.go +++ b/services/rfq/relayer/relconfig/config_test.go @@ -1,10 +1,10 @@ package relconfig_test import ( + "github.com/stretchr/testify/assert" "testing" "time" - "github.com/alecthomas/assert" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/synapsecns/sanguine/services/rfq/relayer/relconfig"