From 6696d673d3be52f357e492dfaa60d852d9c6eb02 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Thu, 15 Aug 2024 18:20:37 -0300 Subject: [PATCH 01/13] added config part --- avalanche/network.go | 14 + constants/constants.go | 4 +- evm/evm.go | 27 +- go.mod | 21 +- go.sum | 329 ++++++++++++++++++ .../teleporter.go => interchain/icm/icm.go | 24 +- utils/net.go | 20 ++ 7 files changed, 414 insertions(+), 25 deletions(-) rename teleporter/teleporter.go => interchain/icm/icm.go (92%) diff --git a/avalanche/network.go b/avalanche/network.go index c8b9a5d..1dc0ee2 100644 --- a/avalanche/network.go +++ b/avalanche/network.go @@ -4,6 +4,9 @@ package avalanche import ( + "fmt" + "strings" + "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/utils/constants" ) @@ -90,3 +93,14 @@ func (n Network) GenesisParams() *genesis.Params { } return nil } + +func (n Network) BlockchainEndpoint(blockchainID string) string { + return fmt.Sprintf("%s/ext/bc/%s/rpc", n.Endpoint, blockchainID) +} + +func (n Network) BlockchainWSEndpoint(blockchainID string) string { + trimmedURI := n.Endpoint + trimmedURI = strings.TrimPrefix(trimmedURI, "http://") + trimmedURI = strings.TrimPrefix(trimmedURI, "https://") + return fmt.Sprintf("ws://%s/ext/bc/%s/ws", trimmedURI, blockchainID) +} diff --git a/constants/constants.go b/constants/constants.go index db382c2..0f5750c 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -81,6 +81,6 @@ const ( BLSKeyFileName = "signer.key" // github - AvaLabsOrg = "ava-labs" - TeleporterRepoName = "teleporter" + AvaLabsOrg = "ava-labs" + ICMRepoName = "teleporter" ) diff --git a/evm/evm.go b/evm/evm.go index 78447bf..2538735 100644 --- a/evm/evm.go +++ b/evm/evm.go @@ -168,7 +168,32 @@ func EstimateBaseFee( return baseFee, err } -func FundAddress( +func SetMinBalance( + client ethclient.Client, + privateKey string, + address string, + requiredMinBalance *big.Int, +) error { + balance, err := GetAddressBalance(client, address) + if err != nil { + return err + } + if balance.Cmp(requiredMinBalance) < 0 { + toFund := big.NewInt(0).Sub(requiredMinBalance, balance) + err := Transfer( + client, + privateKey, + address, + toFund, + ) + if err != nil { + return err + } + } + return nil +} + +func Transfer( client ethclient.Client, sourceAddressPrivateKeyStr string, targetAddressStr string, diff --git a/go.mod b/go.mod index 0e34ac7..fd84fab 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,12 @@ module github.com/ava-labs/avalanche-tooling-sdk-go -go 1.21.10 +go 1.21.11 -toolchain go1.22.1 +toolchain go1.22.6 require ( github.com/ava-labs/avalanchego v1.11.5 + github.com/ava-labs/awm-relayer v1.3.3 github.com/ava-labs/coreth v0.13.3-rc.2 github.com/ava-labs/subnet-evm v0.6.4 github.com/aws/aws-sdk-go-v2 v1.30.0 @@ -16,14 +17,24 @@ require ( go.uber.org/zap v1.27.0 golang.org/x/crypto v0.24.0 golang.org/x/exp v0.0.0-20231127185646-65229373498e + golang.org/x/mod v0.20.0 + golang.org/x/net v0.26.0 golang.org/x/sync v0.7.0 google.golang.org/api v0.182.0 ) require ( - github.com/onsi/gomega v1.33.1 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.26.0 // indirect + github.com/ava-labs/teleporter v1.0.1 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.32.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.16.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect ) require ( diff --git a/go.sum b/go.sum index f8cb748..fe3ab75 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,52 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +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/auth v0.4.2 h1:sb0eyLkhRtpq5jA+a8KWw0W70YcdVca7KJ8TM0AFYDg= cloud.google.com/go/auth v0.4.2/go.mod h1:Kqvlz1cf1sNA0D+sYJnkPQOP+JMHkuHeIgVmCRtZOLc= cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= +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= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +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/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +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/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= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -28,14 +66,20 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/ava-labs/avalanche-network-runner v1.7.6 h1:2yXa2Zq099t900ffpn0RG9D5dca98fs3l+/hF7AumIY= +github.com/ava-labs/avalanche-network-runner v1.7.6/go.mod h1:+Br4mCjreTMtnDiUDNXJba500fnchMk0Ygu5qWVj6A4= github.com/ava-labs/avalanchego v1.11.5 h1:3HCE6I1/9BOSrIvwXXuOhVuMGMi926jKhQ+sgU3LEX8= github.com/ava-labs/avalanchego v1.11.5/go.mod h1:XPNUEh0ezPEW1IV6yo6AwvqjTZSG1twGskDb7dVcIRA= +github.com/ava-labs/awm-relayer v1.3.3 h1:7g2Jv/RGUSdCPC9VLcVY7kJJ6Wd6P2+oipcUbwjgnN0= +github.com/ava-labs/awm-relayer v1.3.3/go.mod h1:JOi2g6QpuQNk3xk+YjyS8ujidQOWBYplvsXeOu1pHQ8= github.com/ava-labs/coreth v0.13.3-rc.2 h1:lhyQwln6at1DTs1O586dMSAtGtSfQWlt2WH+Z2kgYdQ= github.com/ava-labs/coreth v0.13.3-rc.2/go.mod h1:4l15XGak3FklhIb7CtlC/1YVwGAfMl83R2zd2N0hNE0= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34 h1:mg9Uw6oZFJKytJxgxnl3uxZOs/SB8CVHg6Io4Tf99Zc= github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/ava-labs/subnet-evm v0.6.4 h1:iOz21dlwU/gTN7ZbD9lVeG9rIUt7MVWu1gnZlekl7nE= github.com/ava-labs/subnet-evm v0.6.4/go.mod h1:kv8NzG+N6hB4brfOE4a7laQNebNgru1sRcMS1OzXy+M= +github.com/ava-labs/teleporter v1.0.1 h1:86bwwZCCb1lsvAqCYeT8jHvzkDRIsXmw1s63VtbCnAE= +github.com/ava-labs/teleporter v1.0.1/go.mod h1:IyxFT32sIQ/5Y5x9LrYoOUldC/VFbHS8JZTAEg6aTCw= github.com/aws/aws-sdk-go-v2 v1.30.0 h1:6qAwtzlfcTtcL8NHtbDQAqgM5s6NDipQTkPxyH/6kAA= github.com/aws/aws-sdk-go-v2 v1.30.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.16 h1:knpCuH7laFVGYTNd99Ns5t+8PuRjDn4HnnZK48csipM= @@ -56,6 +100,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1x github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 h1:Wx0rlZoEJR7JwlSZcHnEa7CNjrSIyVxMFWGAaXy4fJY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod h1:aVMHdE0aHO3v+f/iw01fmXV/5DbfQ3Bi9nN7nd9bE9Y= +github.com/aws/aws-sdk-go-v2/service/kms v1.32.1 h1:FARrQLRQXpCFYylIUVF1dRij6YbPCmtwudq9NBk4kFc= +github.com/aws/aws-sdk-go-v2/service/kms v1.32.1/go.mod h1:8lETO9lelSG2B6KMXFh2OwPPqGV6WQM3RqLAEjP1xaU= github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 h1:aD7AGQhvPuAxlSUfo0CWU7s6FpkbyykMhGYMvlqTjVs= github.com/aws/aws-sdk-go-v2/service/sso v1.20.9/go.mod h1:c1qtZUWtygI6ZdvKppzCSXsDOq5I4luJPZ0Ud3juFCA= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 h1:Pav5q3cA260Zqez42T9UhIlsd9QeypszRPwC9LdSSsQ= @@ -111,6 +157,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw= github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA= 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/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= @@ -166,6 +213,8 @@ github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZi github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= @@ -198,6 +247,9 @@ github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclK github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -224,13 +276,24 @@ github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzq github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -247,23 +310,43 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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= +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/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= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +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/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= @@ -274,8 +357,11 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +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.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= +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/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -289,8 +375,11 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp4 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-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +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/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= @@ -300,6 +389,7 @@ github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +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= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= @@ -318,6 +408,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +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/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= @@ -351,6 +443,8 @@ github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -417,6 +511,8 @@ github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9 github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pires/go-proxyproto v0.6.2 h1:KAZ7UteSOt6urjme6ZldyFm4wDe/z0ZUP0Yv0Dos0d8= @@ -425,6 +521,7 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg= github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= @@ -440,6 +537,7 @@ github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSz github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -461,13 +559,21 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -484,8 +590,11 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -523,7 +632,9 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmv github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -533,6 +644,12 @@ github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= @@ -565,27 +682,57 @@ golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +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/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 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= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= @@ -595,19 +742,39 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= @@ -621,14 +788,26 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +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.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= @@ -638,25 +817,50 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/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-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-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= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20210225134936-a50acf3fe073/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-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/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-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -683,9 +887,12 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -694,6 +901,9 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -702,14 +912,54 @@ golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +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-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-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +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-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -719,14 +969,71 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +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.182.0 h1:if5fPvudRQ78GeRx3RayIoiuV7modtErPIZC/T2bIvE= google.golang.org/api v0.182.0/go.mod h1:cGhjy4caqA5yXRzEhkHI8Y9mfyC2VLTlER2l08xaqtM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +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-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae h1:AH34z6WAGVNkllnKs5raNq3yRq93VnjBG6rpfub/jYk= google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y= @@ -734,10 +1041,21 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +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.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= @@ -749,6 +1067,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -764,6 +1083,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= @@ -782,8 +1103,16 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/teleporter/teleporter.go b/interchain/icm/icm.go similarity index 92% rename from teleporter/teleporter.go rename to interchain/icm/icm.go index cb08230..c25f379 100644 --- a/teleporter/teleporter.go +++ b/interchain/icm/icm.go @@ -1,6 +1,6 @@ // Copyright (C) 2022, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package teleporter +package icm import ( "fmt" @@ -29,7 +29,7 @@ var ( ) func GetLatestVersion() (string, error) { - return utils.GetLatestGithubReleaseVersion(constants.AvaLabsOrg, constants.TeleporterRepoName, "") + return utils.GetLatestGithubReleaseVersion(constants.AvaLabsOrg, constants.ICMRepoName, "") } func getURLs(version string) (string, string, string, string) { @@ -49,7 +49,7 @@ type Deployer struct { func (t *Deployer) CheckAssets() error { if len(t.messengerContractAddress) == 0 || len(t.messengerDeployerAddress) == 0 || len(t.messengerDeployerTx) == 0 || len(t.registryBytecode) == 0 { - return fmt.Errorf("teleporter assets has not been initialized") + return fmt.Errorf("interchain messaging assets has not been initialized") } return nil } @@ -163,24 +163,14 @@ func (t *Deployer) DeployMessenger( } else if messengerAlreadyDeployed { return true, string(t.messengerContractAddress), nil } - messengerDeployerBalance, err := evm.GetAddressBalance( + if err := evm.SetMinBalance( client, + privateKey, string(t.messengerDeployerAddress), - ) - if err != nil { + messengerDeployerRequiredBalance, + ); err != nil { return false, "", err } - if messengerDeployerBalance.Cmp(messengerDeployerRequiredBalance) < 0 { - toFund := big.NewInt(0).Sub(messengerDeployerRequiredBalance, messengerDeployerBalance) - if err := evm.FundAddress( - client, - privateKey, - string(t.messengerDeployerAddress), - toFund, - ); err != nil { - return false, "", err - } - } if err := evm.IssueTx(client, string(t.messengerDeployerTx)); err != nil { return false, "", err } diff --git a/utils/net.go b/utils/net.go index 98bc889..5142a35 100644 --- a/utils/net.go +++ b/utils/net.go @@ -6,11 +6,31 @@ package utils import ( "encoding/json" "errors" + "fmt" "io" "net" "net/http" + "net/url" + "strconv" ) +// Get the host and port from a URI. The URI should be in the format http://host:port or https://host:port or host:port +func GetURIHostAndPort(uri string) (string, uint32, error) { + u, err := url.Parse(uri) + if err != nil { + return "", 0, fmt.Errorf("failed to parse uri %s: %w", uri, err) + } + host, portStr, err := net.SplitHostPort(u.Host) + if err != nil { + return "", 0, fmt.Errorf("failed to split host/port at uri %s: %w", uri, err) + } + port, err := strconv.ParseUint(portStr, 10, 32) + if err != nil { + return "", 0, fmt.Errorf("failed to convert port to uint at uri %s: %w", uri, err) + } + return host, uint32(port), nil +} + func IsValidIP(ipStr string) bool { return net.ParseIP(ipStr) != nil } From 7d39d7f1a0608094d1801ebe75679ebc36c8de25 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Fri, 16 Aug 2024 12:06:30 -0300 Subject: [PATCH 02/13] add conf for relayer --- interchain/relayer/conf.go | 272 +++++++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 interchain/relayer/conf.go diff --git a/interchain/relayer/conf.go b/interchain/relayer/conf.go new file mode 100644 index 0000000..2ced5cd --- /dev/null +++ b/interchain/relayer/conf.go @@ -0,0 +1,272 @@ +// Copyright (C) 2022, Ava Labs, Inc. All rights reserved +// See the file LICENSE for licensing terms. +package relayer + +import ( + "encoding/json" + "fmt" + "math/big" + "os" + + "github.com/ava-labs/avalanche-tooling-sdk-go/avalanche" + "github.com/ava-labs/avalanche-tooling-sdk-go/constants" + "github.com/ava-labs/avalanche-tooling-sdk-go/evm" + "github.com/ava-labs/avalanche-tooling-sdk-go/utils" + "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/awm-relayer/config" + offchainregistry "github.com/ava-labs/awm-relayer/messages/off-chain-registry" + "github.com/ethereum/go-ethereum/crypto" +) + +var defaultRequiredBalance = big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(500)) // 500 AVAX + +func GetBaseRelayerConfig( + logLevel string, + storageLocation string, + network avalanche.Network, +) *config.Config { + return &config.Config{ + LogLevel: logLevel, + PChainAPI: &config.APIConfig{ + BaseURL: network.Endpoint, + }, + InfoAPI: &config.APIConfig{ + BaseURL: network.Endpoint, + }, + StorageLocation: storageLocation, + ProcessMissedBlocks: false, + SourceBlockchains: []*config.SourceBlockchain{}, + DestinationBlockchains: []*config.DestinationBlockchain{}, + } +} + +func AddChainToRelayerConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + teleporterContractAddress string, + teleporterRegistryAddress string, + privateKey string, + rewardAddress string, +) error { + rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) + wsEndpoint := network.BlockchainWSEndpoint(blockchainID.String()) + source := &config.SourceBlockchain{ + SubnetID: subnetID.String(), + BlockchainID: blockchainID.String(), + VM: config.EVM.String(), + RPCEndpoint: config.APIConfig{ + BaseURL: rpcEndpoint, + }, + WSEndpoint: config.APIConfig{ + BaseURL: wsEndpoint, + }, + MessageContracts: map[string]config.MessageProtocolConfig{ + teleporterContractAddress: { + MessageFormat: config.TELEPORTER.String(), + Settings: map[string]interface{}{ + "reward-address": rewardAddress, + }, + }, + offchainregistry.OffChainRegistrySourceAddress.Hex(): { + MessageFormat: config.OFF_CHAIN_REGISTRY.String(), + Settings: map[string]interface{}{ + "teleporter-registry-address": teleporterRegistryAddress, + }, + }, + }, + } + destination := &config.DestinationBlockchain{ + SubnetID: subnetID.String(), + BlockchainID: blockchainID.String(), + VM: config.EVM.String(), + RPCEndpoint: config.APIConfig{ + BaseURL: rpcEndpoint, + }, + AccountPrivateKey: privateKey, + } + if GetSourceConfig(relayerConfig, network, subnetID, blockchainID) == nil { + relayerConfig.SourceBlockchains = append(relayerConfig.SourceBlockchains, source) + } + if GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) == nil { + relayerConfig.DestinationBlockchains = append(relayerConfig.DestinationBlockchains, destination) + } + return nil +} + +func GetSourceConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, +) *config.SourceBlockchain { + rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) + p := utils.Find( + relayerConfig.SourceBlockchains, + func(s *config.SourceBlockchain) bool { + return s.BlockchainID == blockchainID.String() && s.SubnetID == subnetID.String() && s.RPCEndpoint.BaseURL == rpcEndpoint + }, + ) + if p != nil { + return *p + } + return nil +} + +func GetDestinationConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, +) *config.DestinationBlockchain { + rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) + p := utils.Find( + relayerConfig.DestinationBlockchains, + func(s *config.DestinationBlockchain) bool { + return s.BlockchainID == blockchainID.String() && s.SubnetID == subnetID.String() && s.RPCEndpoint.BaseURL == rpcEndpoint + }, + ) + if p != nil { + return *p + } + return nil +} + +// fund the relayer private key associated to [network]/[subnetID]/[blockchainID] +// at [relayerConfig]. if [amount] > 0 transfers it to the account. if, +// afterwards, balance < [requiredMinBalance], transfers remaining amount for that +// if [requiredMinBalance] is nil, uses [defaultRequiredBalance] +func FundRelayer( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + privateKey string, + amount *big.Int, + requiredMinBalance *big.Int, +) error { + destinationConfig := GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) + if destinationConfig == nil { + return fmt.Errorf("relayer destination not found for network %s, subnet %s, blockchain %s", network.Kind.String(), subnetID.String(), blockchainID.String()) + } + return FundRelayerPrivateKey( + network, + blockchainID, + privateKey, + destinationConfig.AccountPrivateKey, + amount, + requiredMinBalance, + ) +} + +// fund [relayerPrivateKey] at [network]/[blockchainID] +// see FundRelayer for [amount]/[requiredMinBalance] logic +func FundRelayerPrivateKey( + network avalanche.Network, + blockchainID ids.ID, + privateKey string, + relayerPrivateKey string, + amount *big.Int, + requiredMinBalance *big.Int, +) error { + relayerPK, err := crypto.HexToECDSA(relayerPrivateKey) + if err != nil { + return err + } + relayerAddress := crypto.PubkeyToAddress(relayerPK.PublicKey) + return FundRelayerAddress( + network, + blockchainID, + privateKey, + relayerAddress.Hex(), + amount, + requiredMinBalance, + ) +} + +// fund [relayerAddress] at [network]/[blockchainID] +// see FundRelayer for [amount]/[requiredMinBalance] logic +func FundRelayerAddress( + network avalanche.Network, + blockchainID ids.ID, + privateKey string, + relayerAddress string, + amount *big.Int, + requiredMinBalance *big.Int, +) error { + if requiredMinBalance == nil { + requiredMinBalance = defaultRequiredBalance + } + client, err := evm.GetClient(network.BlockchainEndpoint(blockchainID.String())) + if err != nil { + return err + } + if amount != nil && amount.Cmp(big.NewInt(0)) > 0 { + if err := evm.Transfer( + client, + privateKey, + relayerAddress, + amount, + ); err != nil { + return err + } + } + return evm.SetMinBalance( + client, + privateKey, + relayerAddress, + requiredMinBalance, + ) +} + +// add a blockchain both as source and as destination into the file at [relayerConfigPath] +func AddChainToRelayerConfigFile( + logLevel string, + relayerConfigPath string, + relayerStorageDir string, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + teleporterContractAddress string, + teleporterRegistryAddress string, + privateKey string, + rewardAddress string, +) error { + awmRelayerConfig := &config.Config{} + if utils.FileExists(relayerConfigPath) { + bs, err := os.ReadFile(relayerConfigPath) + if err != nil { + return err + } + if err := json.Unmarshal(bs, &awmRelayerConfig); err != nil { + return err + } + } else { + awmRelayerConfig = GetBaseRelayerConfig( + logLevel, + relayerStorageDir, + network, + ) + } + if err := AddChainToRelayerConfig( + awmRelayerConfig, + network, + subnetID, + blockchainID, + teleporterContractAddress, + teleporterRegistryAddress, + privateKey, + rewardAddress, + ); err != nil { + return err + } + bs, err := json.MarshalIndent(awmRelayerConfig, "", " ") + if err != nil { + return err + } + if err := os.WriteFile(relayerConfigPath, bs, constants.WriteReadReadPerms); err != nil { + return err + } + return nil +} From 6c231e3878af785551064ded3fdb2c1a3ccb5d3c Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Mon, 19 Aug 2024 12:54:12 -0300 Subject: [PATCH 03/13] start adding local process stuff --- constants/constants.go | 6 +- interchain/relayer/local.go | 212 ++++++++++++++++++++++++++++++++++++ utils/file.go | 9 ++ utils/install.go | 167 ++++++++++++++++++++++++++++ 4 files changed, 392 insertions(+), 2 deletions(-) create mode 100644 interchain/relayer/local.go create mode 100644 utils/install.go diff --git a/constants/constants.go b/constants/constants.go index 0f5750c..2c91852 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -81,6 +81,8 @@ const ( BLSKeyFileName = "signer.key" // github - AvaLabsOrg = "ava-labs" - ICMRepoName = "teleporter" + AvaLabsOrg = "ava-labs" + ICMRepoName = "teleporter" + RelayerRepoName = "awm-relayer" + RelayerBinName = "awm-relayer" ) diff --git a/interchain/relayer/local.go b/interchain/relayer/local.go new file mode 100644 index 0000000..4990ecb --- /dev/null +++ b/interchain/relayer/local.go @@ -0,0 +1,212 @@ +// Copyright (C) 2022, Ava Labs, Inc. All rights reserved +// See the file LICENSE for licensing terms. +package relayer + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "syscall" + "time" + + "github.com/ava-labs/avalanche-cli/pkg/application" + "github.com/ava-labs/avalanche-cli/pkg/binutils" + "github.com/ava-labs/avalanche-tooling-sdk-go/constants" + "github.com/ava-labs/avalanche-tooling-sdk-go/utils" +) + +const ( + localRelayerCheckPoolTime = 100 * time.Millisecond + localRelayerCheckTimeout = 3 * time.Second +) + +type relayerRunFile struct { + Pid int `json:"pid"` +} + +func GetGithubReleaseURL(version string) (string, error) { + goarch, goos := runtime.GOARCH, runtime.GOOS + if goos != "linux" && goos != "darwin" { + return "", fmt.Errorf("OS not supported: %s", goos) + } + trimmedVersion := strings.TrimPrefix(version, "v") + return fmt.Sprintf( + "https://github.com/%s/%s/releases/download/%s/awm-relayer_%s_%s_%s.tar.gz", + constants.AvaLabsOrg, + constants.RelayerRepoName, + version, + trimmedVersion, + goos, + goarch, + ), nil +} + +// TODO: do something as simple as this, but more generic, +// (avago/subnet-evm/relayer/etc): +// - local install in subdir given by tool name and version +// - specify latest release, latest prerelease, or just some version +func InstallRelayer(binDir, version string) (string, error) { + binPath := filepath.Join(binDir, constants.RelayerBinName) + if utils.IsExecutable(binPath) { + return binPath, nil + } + url, err := GetGithubReleaseURL(version) + if err != nil { + return "", err + } + bs, err := utils.HTTPGet(url, "") + if err != nil { + return "", err + } + if err := utils.InstallArchive("tar.gz", bs, binDir); err != nil { + return "", err + } + return binPath, nil +} + +func InstallLatestRelayer(binDir string) (string, error) { + version, err := utils.GetLatestGithubReleaseVersion(constants.AvaLabsOrg, constants.RelayerRepoName, "") + if err != nil { + return "", err + } + versionBinDir := filepath.Join(binDir, version) + return InstallRelayer(versionBinDir, version) +} + +func DeployRelayer( + binDir string, + configPath string, + logFilePath string, + runFilePath string, + storageDir string, +) error { + if err := RelayerCleanup(runFilePath, storageDir); err != nil { + return err + } + downloader := application.NewDownloader() + version, err := downloader.GetLatestReleaseVersion(binutils.GetGithubLatestReleaseURL(constants.AvaLabsOrg, constants.AWMRelayerRepoName)) + if err != nil { + return err + } + versionBinDir := filepath.Join(binDir, version) + binPath, err := installRelayer(versionBinDir, version) + if err != nil { + return err + } + pid, err := executeRelayer(binPath, configPath, logFilePath) + if err != nil { + return err + } + return saveRelayerRunFile(runFilePath, pid) +} + +func RelayerIsUp(runFilePath string) (bool, int, *os.Process, error) { + if !utils.FileExists(runFilePath) { + return false, 0, nil, nil + } + bs, err := os.ReadFile(runFilePath) + if err != nil { + return false, 0, nil, err + } + rf := relayerRunFile{} + if err := json.Unmarshal(bs, &rf); err != nil { + return false, 0, nil, err + } + proc, err := os.FindProcess(rf.Pid) + if err != nil { + // after a reboot without network cleanup, it is expected that the file pid will exist but the process not + err := removeRelayerRunFile(runFilePath) + return false, 0, nil, err + } + if err := proc.Signal(syscall.Signal(0)); err != nil { + // after a reboot without network cleanup, it is expected that the file pid will exist but the process not + // sometimes FindProcess returns without error, but Signal 0 will surely fail if the process doesn't exist + err := removeRelayerRunFile(runFilePath) + return false, 0, nil, err + } + return true, rf.Pid, proc, nil +} + +func RelayerCleanup(runFilePath string, storageDir string) error { + if err := os.RemoveAll(storageDir); err != nil { + return err + } + relayerIsUp, pid, proc, err := RelayerIsUp(runFilePath) + if err != nil { + return err + } + if relayerIsUp { + waitedCh := make(chan struct{}) + go func() { + for { + if err := proc.Signal(syscall.Signal(0)); err != nil { + if errors.Is(err, os.ErrProcessDone) { + close(waitedCh) + return + } else { + fmt.Println("failure checking to process pid %d aliveness due to: %s", proc.Pid, err) + } + } + time.Sleep(localRelayerCheckPoolTime) + } + }() + if err := proc.Signal(os.Interrupt); err != nil { + return fmt.Errorf("failed sending interrupt signal to relayer process with pid %d: %w", pid, err) + } + ctx, cancel := context.WithTimeout(context.Background(), localRelayerCheckTimeout) + defer cancel() + select { + case <-ctx.Done(): + if err := proc.Signal(os.Kill); err != nil { + return fmt.Errorf("failed killing relayer process with pid %d: %w", pid, err) + } + case <-waitedCh: + } + return removeRelayerRunFile(runFilePath) + } + return nil +} + +func removeRelayerRunFile(runFilePath string) error { + err := os.Remove(runFilePath) + if err != nil { + err = fmt.Errorf("failed removing relayer run file %s: %w", runFilePath, err) + } + return err +} + +func saveRelayerRunFile(runFilePath string, pid int) error { + rf := relayerRunFile{ + Pid: pid, + } + bs, err := json.Marshal(&rf) + if err != nil { + return err + } + if err := os.WriteFile(runFilePath, bs, constants.WriteReadReadPerms); err != nil { + return fmt.Errorf("could not write awm relater run file to %s: %w", runFilePath, err) + } + return nil +} + +func executeRelayer(binPath string, configPath string, logFile string) (int, error) { + logWriter, err := os.Create(logFile) + if err != nil { + return 0, err + } + + cmd := exec.Command(binPath, "--config-file", configPath) + cmd.Stdout = logWriter + cmd.Stderr = logWriter + if err := cmd.Start(); err != nil { + return 0, err + } + + return cmd.Process.Pid, nil +} diff --git a/utils/file.go b/utils/file.go index 8bf2e4c..e205ca5 100644 --- a/utils/file.go +++ b/utils/file.go @@ -18,6 +18,15 @@ func FileExists(filename string) bool { return !info.IsDir() } +// IsExecutable checks if a file is executable. +func IsExecutable(filename string) bool { + if !FileExists(filename) { + return false + } + info, _ := os.Stat(filename) + return info.Mode()&0x0100 != 0 +} + // DirectoryExists checks if a directory exists. // // dirName: the name of the directory to check. diff --git a/utils/install.go b/utils/install.go new file mode 100644 index 0000000..8a66478 --- /dev/null +++ b/utils/install.go @@ -0,0 +1,167 @@ +// Copyright (C) 2022, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. +package utils + +import ( + "archive/tar" + "archive/zip" + "bytes" + "compress/gzip" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "strings" + + "github.com/ava-labs/avalanche-tooling-sdk-go/constants" +) + +const maxCopy = 2147483648 // 2 GB + +// Sanitize archive file pathing from "G305: Zip Slip vulnerability" +func sanitizeArchivePath(d, t string) (v string, err error) { + v = filepath.Join(d, t) + if strings.HasPrefix(v, filepath.Clean(d)) { + return v, nil + } + + return "", fmt.Errorf("%s: %s", "content filepath is tainted", t) +} + +// InstallArchive installs the binary archive downloaded +func InstallArchive(ext string, archive []byte, binDir string) error { + // create binDir if it doesn't exist + if err := os.MkdirAll(binDir, constants.DefaultPerms755); err != nil { + return err + } + + if ext == "zip" { + return installZipArchive(archive, binDir) + } + return installTarGzArchive(archive, binDir) +} + +// installZipArchive expects a byte stream of a zip file +func installZipArchive(zipfile []byte, binDir string) error { + bytesReader := bytes.NewReader(zipfile) + zipReader, err := zip.NewReader(bytesReader, int64(len(zipfile))) + if err != nil { + return fmt.Errorf("failed creating zip reader from binary stream: %w", err) + } + + if err := os.MkdirAll(binDir, constants.DefaultPerms755); err != nil { + return fmt.Errorf("failed to create app binary directory: %w", err) + } + + // Closure to address file descriptors issue, uses Close to to not leave open descriptors + extractAndWriteFile := func(f *zip.File) error { + rc, err := f.Open() + if err != nil { + return fmt.Errorf("failed opening zip file: %w", err) + } + + // check for zip slip + path, err := sanitizeArchivePath(binDir, f.Name) + if err != nil { + return err + } + + if f.FileInfo().IsDir() { + if err := os.MkdirAll(path, f.Mode()); err != nil { + return fmt.Errorf("failed creating directory from zip entry: %w", err) + } + } else { + if err := os.MkdirAll(filepath.Dir(path), f.Mode()); err != nil { + return fmt.Errorf("failed creating file from zip entry: %w", err) + } + f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + if err != nil { + return fmt.Errorf("failed opening file from zip entry: %w", err) + } + + _, err = io.CopyN(f, rc, maxCopy) + if err != nil && !errors.Is(err, io.EOF) { + return fmt.Errorf("failed writing zip file entry to disk: %w", err) + } + if err := f.Close(); err != nil { + return err + } + } + if err := rc.Close(); err != nil { + return err + } + return nil + } + + for _, f := range zipReader.File { + err := extractAndWriteFile(f) + if err != nil { + return err + } + } + + return nil +} + +// installTarGzArchive expects a byte array in targz format +func installTarGzArchive(targz []byte, binDir string) error { + byteReader := bytes.NewReader(targz) + uncompressedStream, err := gzip.NewReader(byteReader) + if err != nil { + return fmt.Errorf("failed creating gzip reader from avalanchego binary stream: %w", err) + } + + tarReader := tar.NewReader(uncompressedStream) + for { + header, err := tarReader.Next() + switch { + // if no more files are found return + case errors.Is(err, io.EOF): + return nil + case err != nil: + return fmt.Errorf("failed reading next tar entry: %w", err) + // if the header is nil, just skip it (not sure how this happens) + case header == nil: + continue + } + + // the target location where the dir/file should be created + // check for zip slip + target, err := sanitizeArchivePath(binDir, header.Name) + if err != nil { + return err + } + + // check the file type + switch header.Typeflag { + // if its a dir and it doesn't exist create it + case tar.TypeDir: + if _, err := os.Stat(target); err != nil { + if err := os.MkdirAll(target, constants.DefaultPerms755); err != nil { + return fmt.Errorf("failed creating directory from tar entry %w", err) + } + } + // if it's a file create it + case tar.TypeReg: + // if the containing directory doesn't exist yet, create it + containingDir := filepath.Dir(target) + if err := os.MkdirAll(containingDir, constants.DefaultPerms755); err != nil { + return fmt.Errorf("failed creating directory from tar entry %w", err) + } + f, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + if err != nil { + return fmt.Errorf("failed opening new file from tar entry %w", err) + } + // copy over contents + if _, err := io.CopyN(f, tarReader, maxCopy); err != nil && !errors.Is(err, io.EOF) { + return fmt.Errorf("failed writing tar entry contents to disk: %w", err) + } + // manually close here after each file operation; defering would cause each file close + // to wait until all operations have completed. + if err := f.Close(); err != nil { + return err + } + } + } +} From d51b66ac09c8eec3eb899d8c157a0b0c84ca0836 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Mon, 19 Aug 2024 13:02:32 -0300 Subject: [PATCH 04/13] rename archive funcs --- utils/{install.go => archive.go} | 41 ++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 18 deletions(-) rename utils/{install.go => archive.go} (82%) diff --git a/utils/install.go b/utils/archive.go similarity index 82% rename from utils/install.go rename to utils/archive.go index 8a66478..0a39b0e 100644 --- a/utils/install.go +++ b/utils/archive.go @@ -17,6 +17,14 @@ import ( "github.com/ava-labs/avalanche-tooling-sdk-go/constants" ) +type ArchiveKind int64 + +const ( + Undefined ArchiveKind = iota + Zip + TarGz +) + const maxCopy = 2147483648 // 2 GB // Sanitize archive file pathing from "G305: Zip Slip vulnerability" @@ -29,31 +37,28 @@ func sanitizeArchivePath(d, t string) (v string, err error) { return "", fmt.Errorf("%s: %s", "content filepath is tainted", t) } -// InstallArchive installs the binary archive downloaded -func InstallArchive(ext string, archive []byte, binDir string) error { - // create binDir if it doesn't exist - if err := os.MkdirAll(binDir, constants.DefaultPerms755); err != nil { +// ExtractArchive extracts the archive given as bytes slice [archive], into [outputDir] +func ExtractArchive(kind ArchiveKind, archive []byte, outputDir string) error { + if err := os.MkdirAll(outputDir, constants.DefaultPerms755); err != nil { return err } - - if ext == "zip" { - return installZipArchive(archive, binDir) + switch kind { + case Zip: + return extractZip(archive, outputDir) + case TarGz: + return extractTarGz(archive, outputDir) } - return installTarGzArchive(archive, binDir) + return fmt.Errorf("unsupported archive kind: %d", kind) } -// installZipArchive expects a byte stream of a zip file -func installZipArchive(zipfile []byte, binDir string) error { +// extractZip expects a byte stream of a zip file +func extractZip(zipfile []byte, outputDir string) error { bytesReader := bytes.NewReader(zipfile) zipReader, err := zip.NewReader(bytesReader, int64(len(zipfile))) if err != nil { return fmt.Errorf("failed creating zip reader from binary stream: %w", err) } - if err := os.MkdirAll(binDir, constants.DefaultPerms755); err != nil { - return fmt.Errorf("failed to create app binary directory: %w", err) - } - // Closure to address file descriptors issue, uses Close to to not leave open descriptors extractAndWriteFile := func(f *zip.File) error { rc, err := f.Open() @@ -62,7 +67,7 @@ func installZipArchive(zipfile []byte, binDir string) error { } // check for zip slip - path, err := sanitizeArchivePath(binDir, f.Name) + path, err := sanitizeArchivePath(outputDir, f.Name) if err != nil { return err } @@ -104,8 +109,8 @@ func installZipArchive(zipfile []byte, binDir string) error { return nil } -// installTarGzArchive expects a byte array in targz format -func installTarGzArchive(targz []byte, binDir string) error { +// extractTarGz expects a byte array in targz format +func extractTarGz(targz []byte, outputDir string) error { byteReader := bytes.NewReader(targz) uncompressedStream, err := gzip.NewReader(byteReader) if err != nil { @@ -128,7 +133,7 @@ func installTarGzArchive(targz []byte, binDir string) error { // the target location where the dir/file should be created // check for zip slip - target, err := sanitizeArchivePath(binDir, header.Name) + target, err := sanitizeArchivePath(outputDir, header.Name) if err != nil { return err } From 1b00504064c5752577760f65a05985a9b5d75011 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Mon, 19 Aug 2024 15:14:25 -0300 Subject: [PATCH 05/13] added install lib --- {utils => install}/archive.go | 4 +- install/install.go | 116 ++++++++++++++++++++++++++++++++++ interchain/relayer/local.go | 34 ++++++---- utils/github.go | 10 +++ 4 files changed, 149 insertions(+), 15 deletions(-) rename {utils => install}/archive.go (98%) create mode 100644 install/install.go diff --git a/utils/archive.go b/install/archive.go similarity index 98% rename from utils/archive.go rename to install/archive.go index 0a39b0e..3b9c7e7 100644 --- a/utils/archive.go +++ b/install/archive.go @@ -1,6 +1,6 @@ // Copyright (C) 2022, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. -package utils +package install import ( "archive/tar" @@ -20,7 +20,7 @@ import ( type ArchiveKind int64 const ( - Undefined ArchiveKind = iota + UndefinedArchive ArchiveKind = iota Zip TarGz ) diff --git a/install/install.go b/install/install.go new file mode 100644 index 0000000..3f0eb65 --- /dev/null +++ b/install/install.go @@ -0,0 +1,116 @@ +// Copyright (C) 2022, Ava Labs, Inc. All rights reserved +// See the file LICENSE for licensing terms. +package install + +import ( + "fmt" + "path/filepath" + + "github.com/ava-labs/avalanche-tooling-sdk-go/utils" +) + +type ReleaseKind int64 + +const ( + UndefinedRelease ReleaseKind = iota + LatestRelease + LatestPreRelease + CustomRelease +) + +// installs archive from given [url] into [outputDir], unless +// [relativeBinPath] exists in [outputDir] and is executable. +// verifies [relativeBinPath] exists in [outputDir] after installation, +// and returns full path +func InstallBinary( + url string, + archiveKind ArchiveKind, + outputDir string, + relativeBinPath string, +) (string, error) { + expectedBinPath := filepath.Join(outputDir, relativeBinPath) + if utils.IsExecutable(expectedBinPath) { + return expectedBinPath, nil + } + bs, err := utils.HTTPGet(url, "") + if err != nil { + return "", err + } + if err := ExtractArchive(archiveKind, bs, outputDir); err != nil { + return "", err + } + if !utils.FileExists(expectedBinPath) { + return "", fmt.Errorf("%s does not exist after installing release", expectedBinPath) + } + if !utils.IsExecutable(expectedBinPath) { + return "", fmt.Errorf("release asset %s is not an executable", expectedBinPath) + } + return expectedBinPath, nil +} + +// installs archive into a [version] subdir of [baseDir] +// see InstallBinary from installation checks +func InstallBinaryVersion( + url string, + archiveKind ArchiveKind, + baseDir string, + relativeBinPath string, + version string, +) (string, error) { + return InstallBinary( + url, + archiveKind, + filepath.Join(baseDir, version), + relativeBinPath, + ) +} + +func InstallGithubRelease( + org string, + repo string, + authToken string, + releaseKind ReleaseKind, + customVersion string, + getAssetName func(string) (string, error), + archiveKind ArchiveKind, + baseDir string, + relativeBinPath string, +) (string, error) { + var ( + version string + err error + ) + switch releaseKind { + case LatestRelease: + version, err = utils.GetLatestGithubReleaseVersion(org, repo, authToken) + if err != nil { + return "", err + } + case LatestPreRelease: + version, err = utils.GetLatestGithubPreReleaseVersion(org, repo, authToken) + if err != nil { + return "", err + } + case CustomRelease: + version = customVersion + default: + return "", fmt.Errorf("Unsupported release kind %d", releaseKind) + } + asset, err := getAssetName(version) + if err != nil { + return "", err + } + url := utils.GetGithubReleaseAssetURL( + org, + repo, + version, + asset, + ) + return InstallBinaryVersion( + url, + archiveKind, + baseDir, + relativeBinPath, + version, + ) +} diff --git a/interchain/relayer/local.go b/interchain/relayer/local.go index 4990ecb..53f06c6 100644 --- a/interchain/relayer/local.go +++ b/interchain/relayer/local.go @@ -30,33 +30,32 @@ type relayerRunFile struct { Pid int `json:"pid"` } -func GetGithubReleaseURL(version string) (string, error) { +func GetReleaseURL(version string) (string, error) { goarch, goos := runtime.GOARCH, runtime.GOOS if goos != "linux" && goos != "darwin" { return "", fmt.Errorf("OS not supported: %s", goos) } trimmedVersion := strings.TrimPrefix(version, "v") - return fmt.Sprintf( - "https://github.com/%s/%s/releases/download/%s/awm-relayer_%s_%s_%s.tar.gz", - constants.AvaLabsOrg, + asset := fmt.Sprintf("%s_%s_%s_%s.tar.gz", constants.RelayerRepoName, - version, trimmedVersion, goos, goarch, + ) + return utils.GetGithubReleaseAssetURL( + constants.AvaLabsOrg, + constants.RelayerRepoName, + version, + asset, ), nil } -// TODO: do something as simple as this, but more generic, -// (avago/subnet-evm/relayer/etc): -// - local install in subdir given by tool name and version -// - specify latest release, latest prerelease, or just some version -func InstallRelayer(binDir, version string) (string, error) { - binPath := filepath.Join(binDir, constants.RelayerBinName) +func InstallRelayer(outputDir, version string) (string, error) { + binPath := filepath.Join(outputDir, constants.RelayerBinName) if utils.IsExecutable(binPath) { return binPath, nil } - url, err := GetGithubReleaseURL(version) + url, err := GetReleaseURL(version) if err != nil { return "", err } @@ -64,10 +63,19 @@ func InstallRelayer(binDir, version string) (string, error) { if err != nil { return "", err } - if err := utils.InstallArchive("tar.gz", bs, binDir); err != nil { + if err := utils.ExtractArchive(utils.TarGz, bs, outputDir); err != nil { return "", err } + if !utils.FileExists(binPath) { + return "", fmt.Errorf("%s does not exist after installing release", binPath) + } + if !utils.IsExecutable(binPath) { + return "", fmt.Errorf("release asset %s is not an executable", binPath) + } return binPath, nil + return utils.InstallVersionedBinary( + baseDir, + baseDir string, version string, getURL func(string) (string, error), archiveKind utils.ArchiveKind, relativeBinPath string) } func InstallLatestRelayer(binDir string) (string, error) { diff --git a/utils/github.go b/utils/github.go index 9081dd8..2943c64 100644 --- a/utils/github.go +++ b/utils/github.go @@ -75,3 +75,13 @@ func GetLatestGithubPreReleaseVersion(org, repo, authToken string) (string, erro } return releases[0], nil } + +func GetGithubReleaseAssetURL(org, repo, version, asset string) string { + return fmt.Sprintf( + "https://github.com/%s/%s/releases/download/%s/%s", + org, + repo, + version, + asset, + ) +} From 662b88a03db65dc032ce51c4a350567e4ab84745 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Tue, 20 Aug 2024 10:39:18 -0300 Subject: [PATCH 06/13] add relayer process --- interchain/relayer/local.go | 215 +++++++----------------------------- process/process.go | 171 ++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+), 175 deletions(-) create mode 100644 process/process.go diff --git a/interchain/relayer/local.go b/interchain/relayer/local.go index 53f06c6..0a47bcc 100644 --- a/interchain/relayer/local.go +++ b/interchain/relayer/local.go @@ -3,218 +3,83 @@ package relayer import ( - "context" - "encoding/json" - "errors" "fmt" "os" - "os/exec" - "path/filepath" "runtime" "strings" - "syscall" "time" - "github.com/ava-labs/avalanche-cli/pkg/application" - "github.com/ava-labs/avalanche-cli/pkg/binutils" "github.com/ava-labs/avalanche-tooling-sdk-go/constants" - "github.com/ava-labs/avalanche-tooling-sdk-go/utils" + "github.com/ava-labs/avalanche-tooling-sdk-go/install" + "github.com/ava-labs/avalanche-tooling-sdk-go/process" ) const ( + localRelayerSetupTime = 2 * time.Second localRelayerCheckPoolTime = 100 * time.Millisecond localRelayerCheckTimeout = 3 * time.Second ) -type relayerRunFile struct { - Pid int `json:"pid"` -} - -func GetReleaseURL(version string) (string, error) { +func getAssetName(version string) (string, error) { goarch, goos := runtime.GOARCH, runtime.GOOS if goos != "linux" && goos != "darwin" { return "", fmt.Errorf("OS not supported: %s", goos) } trimmedVersion := strings.TrimPrefix(version, "v") - asset := fmt.Sprintf("%s_%s_%s_%s.tar.gz", + return fmt.Sprintf("%s_%s_%s_%s.tar.gz", constants.RelayerRepoName, trimmedVersion, goos, goarch, - ) - return utils.GetGithubReleaseAssetURL( - constants.AvaLabsOrg, - constants.RelayerRepoName, - version, - asset, ), nil } -func InstallRelayer(outputDir, version string) (string, error) { - binPath := filepath.Join(outputDir, constants.RelayerBinName) - if utils.IsExecutable(binPath) { - return binPath, nil - } - url, err := GetReleaseURL(version) - if err != nil { - return "", err - } - bs, err := utils.HTTPGet(url, "") - if err != nil { - return "", err - } - if err := utils.ExtractArchive(utils.TarGz, bs, outputDir); err != nil { - return "", err - } - if !utils.FileExists(binPath) { - return "", fmt.Errorf("%s does not exist after installing release", binPath) - } - if !utils.IsExecutable(binPath) { - return "", fmt.Errorf("release asset %s is not an executable", binPath) - } - return binPath, nil - return utils.InstallVersionedBinary( - baseDir, - baseDir string, version string, getURL func(string) (string, error), archiveKind utils.ArchiveKind, relativeBinPath string) +func InstallLatest(baseDir string, authToken string) (string, error) { + return install.InstallGithubRelease( + constants.AvaLabsOrg, + constants.RelayerRepoName, + authToken, + install.LatestRelease, + "", + getAssetName, + install.TarGz, + baseDir, + constants.RelayerBinName, + ) } -func InstallLatestRelayer(binDir string) (string, error) { - version, err := utils.GetLatestGithubReleaseVersion(constants.AvaLabsOrg, constants.RelayerRepoName, "") - if err != nil { - return "", err - } - versionBinDir := filepath.Join(binDir, version) - return InstallRelayer(versionBinDir, version) +func InstallCustomVersion(baseDir string, version string) (string, error) { + return install.InstallGithubRelease( + constants.AvaLabsOrg, + constants.RelayerRepoName, + "", + install.CustomRelease, + version, + getAssetName, + install.TarGz, + baseDir, + constants.RelayerBinName, + ) } -func DeployRelayer( - binDir string, +func Execute( + binPath string, configPath string, logFilePath string, runFilePath string, - storageDir string, -) error { - if err := RelayerCleanup(runFilePath, storageDir); err != nil { - return err - } - downloader := application.NewDownloader() - version, err := downloader.GetLatestReleaseVersion(binutils.GetGithubLatestReleaseURL(constants.AvaLabsOrg, constants.AWMRelayerRepoName)) - if err != nil { - return err - } - versionBinDir := filepath.Join(binDir, version) - binPath, err := installRelayer(versionBinDir, version) +) (int, error) { + logWriter, err := os.Create(logFilePath) if err != nil { - return err - } - pid, err := executeRelayer(binPath, configPath, logFilePath) - if err != nil { - return err - } - return saveRelayerRunFile(runFilePath, pid) -} - -func RelayerIsUp(runFilePath string) (bool, int, *os.Process, error) { - if !utils.FileExists(runFilePath) { - return false, 0, nil, nil - } - bs, err := os.ReadFile(runFilePath) - if err != nil { - return false, 0, nil, err - } - rf := relayerRunFile{} - if err := json.Unmarshal(bs, &rf); err != nil { - return false, 0, nil, err - } - proc, err := os.FindProcess(rf.Pid) - if err != nil { - // after a reboot without network cleanup, it is expected that the file pid will exist but the process not - err := removeRelayerRunFile(runFilePath) - return false, 0, nil, err - } - if err := proc.Signal(syscall.Signal(0)); err != nil { - // after a reboot without network cleanup, it is expected that the file pid will exist but the process not - // sometimes FindProcess returns without error, but Signal 0 will surely fail if the process doesn't exist - err := removeRelayerRunFile(runFilePath) - return false, 0, nil, err - } - return true, rf.Pid, proc, nil -} - -func RelayerCleanup(runFilePath string, storageDir string) error { - if err := os.RemoveAll(storageDir); err != nil { - return err - } - relayerIsUp, pid, proc, err := RelayerIsUp(runFilePath) - if err != nil { - return err - } - if relayerIsUp { - waitedCh := make(chan struct{}) - go func() { - for { - if err := proc.Signal(syscall.Signal(0)); err != nil { - if errors.Is(err, os.ErrProcessDone) { - close(waitedCh) - return - } else { - fmt.Println("failure checking to process pid %d aliveness due to: %s", proc.Pid, err) - } - } - time.Sleep(localRelayerCheckPoolTime) - } - }() - if err := proc.Signal(os.Interrupt); err != nil { - return fmt.Errorf("failed sending interrupt signal to relayer process with pid %d: %w", pid, err) - } - ctx, cancel := context.WithTimeout(context.Background(), localRelayerCheckTimeout) - defer cancel() - select { - case <-ctx.Done(): - if err := proc.Signal(os.Kill); err != nil { - return fmt.Errorf("failed killing relayer process with pid %d: %w", pid, err) - } - case <-waitedCh: - } - return removeRelayerRunFile(runFilePath) - } - return nil -} - -func removeRelayerRunFile(runFilePath string) error { - err := os.Remove(runFilePath) - if err != nil { - err = fmt.Errorf("failed removing relayer run file %s: %w", runFilePath, err) + return 0, err } - return err + args := []string{"--config-file", configPath} + return process.Execute(binPath, args, logWriter, logWriter, runFilePath, localRelayerSetupTime) } -func saveRelayerRunFile(runFilePath string, pid int) error { - rf := relayerRunFile{ - Pid: pid, - } - bs, err := json.Marshal(&rf) - if err != nil { - return err - } - if err := os.WriteFile(runFilePath, bs, constants.WriteReadReadPerms); err != nil { - return fmt.Errorf("could not write awm relater run file to %s: %w", runFilePath, err) - } - return nil +func IsRunning(pid int, runFilePath string) (bool, int, *os.Process, error) { + return process.IsRunning(pid, runFilePath) } -func executeRelayer(binPath string, configPath string, logFile string) (int, error) { - logWriter, err := os.Create(logFile) - if err != nil { - return 0, err - } - - cmd := exec.Command(binPath, "--config-file", configPath) - cmd.Stdout = logWriter - cmd.Stderr = logWriter - if err := cmd.Start(); err != nil { - return 0, err - } - - return cmd.Process.Pid, nil +func Cleanup(pid int, runFilePath string, storageDir string) error { + return process.Cleanup(pid, runFilePath, storageDir, localRelayerCheckPoolTime, localRelayerCheckTimeout) } diff --git a/process/process.go b/process/process.go new file mode 100644 index 0000000..031c76c --- /dev/null +++ b/process/process.go @@ -0,0 +1,171 @@ +// Copyright (C) 2022, Ava Labs, Inc. All rights reserved +// See the file LICENSE for licensing terms. +package process + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "os" + "os/exec" + "syscall" + "time" + + "github.com/ava-labs/avalanche-tooling-sdk-go/constants" + "github.com/ava-labs/avalanche-tooling-sdk-go/utils" +) + +type RunFile struct { + Pid int `json:"pid"` +} + +func saveRunFile(pid int, runFilePath string) error { + rf := RunFile{ + Pid: pid, + } + bs, err := json.Marshal(&rf) + if err != nil { + return err + } + if err := os.WriteFile(runFilePath, bs, constants.WriteReadReadPerms); err != nil { + return fmt.Errorf("could not write awm relayer run file to %s: %w", runFilePath, err) + } + return nil +} + +func loadRunFile(runFilePath string) (int, error) { + var pid int + if runFilePath != "" { + if !utils.FileExists(runFilePath) { + return 0, fmt.Errorf("run file %s does not exist", runFilePath) + } + bs, err := os.ReadFile(runFilePath) + if err != nil { + return 0, err + } + rf := RunFile{} + if err := json.Unmarshal(bs, &rf); err != nil { + return 0, err + } + pid = rf.Pid + } + return pid, nil +} + +func removeRunFile(runFilePath string) error { + if runFilePath != "" { + err := os.Remove(runFilePath) + if err != nil { + err = fmt.Errorf("failed removing relayer run file %s: %w", runFilePath, err) + } + return err + } + return nil +} + +func Execute( + binPath string, + args []string, + stdout io.Writer, + stderr io.Writer, + runFilePath string, + setupTime time.Duration, +) (int, error) { + cmd := exec.Command(binPath, args...) + cmd.Stdout = stdout + cmd.Stderr = stderr + if err := cmd.Start(); err != nil { + return 0, err + } + if runFilePath != "" { + if err := saveRunFile(cmd.Process.Pid, runFilePath); err != nil { + return 0, err + } + } + if setupTime > 0 { + time.Sleep(setupTime) + if b, _, _, _ := IsRunning(cmd.Process.Pid, ""); !b { + return 0, fmt.Errorf("process stopped during setup") + } + } + return cmd.Process.Pid, nil +} + +func GetProcess(pid int) (*os.Process, error) { + proc, err := os.FindProcess(pid) + if err != nil { + return nil, err + } + if err := proc.Signal(syscall.Signal(0)); err != nil { + // sometimes FindProcess returns without error, but Signal 0 will surely fail if the process doesn't exist + return nil, err + } + return proc, nil +} + +func IsRunning(pid int, runFilePath string) (bool, int, *os.Process, error) { + if pid != 0 && runFilePath != "" { + return false, 0, nil, fmt.Errorf("either provide a pid or a runFile to check a process") + } + if runFilePath != "" { + var err error + if pid, err = loadRunFile(runFilePath); err != nil { + return false, 0, nil, err + } + } + proc, err := GetProcess(pid) + if err != nil { + return false, 0, nil, removeRunFile(runFilePath) + } + return true, pid, proc, nil +} + +func Cleanup( + pid int, + runFilePath string, + tmpDir string, + poolTime time.Duration, + timeout time.Duration, +) error { + if tmpDir != "" { + if err := os.RemoveAll(tmpDir); err != nil { + return err + } + } + isRunning, pid, proc, err := IsRunning(pid, runFilePath) + if err != nil { + return err + } + if isRunning { + waitedCh := make(chan struct{}) + go func() { + for { + if err := proc.Signal(syscall.Signal(0)); err != nil { + if errors.Is(err, os.ErrProcessDone) { + close(waitedCh) + return + } else { + fmt.Printf("failure checking to process pid %d aliveness due to: %s\n", proc.Pid, err) + } + } + time.Sleep(poolTime) + } + }() + if err := proc.Signal(os.Interrupt); err != nil { + return fmt.Errorf("failed sending interrupt signal to relayer process with pid %d: %w", pid, err) + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + select { + case <-ctx.Done(): + if err := proc.Signal(os.Kill); err != nil { + return fmt.Errorf("failed killing relayer process with pid %d: %w", pid, err) + } + case <-waitedCh: + } + return removeRunFile(runFilePath) + } + return nil +} From 51870bad77aa651e1e0f971b405105a23c8764ba Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Tue, 20 Aug 2024 13:38:36 -0300 Subject: [PATCH 07/13] lint --- install/install.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install.go b/install/install.go index 3f0eb65..127e89f 100644 --- a/install/install.go +++ b/install/install.go @@ -94,7 +94,7 @@ func InstallGithubRelease( case CustomRelease: version = customVersion default: - return "", fmt.Errorf("Unsupported release kind %d", releaseKind) + return "", fmt.Errorf("unsupported release kind %d", releaseKind) } asset, err := getAssetName(version) if err != nil { From c4c111b4aae46b48b69d542570918acc980d903a Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Tue, 20 Aug 2024 15:24:01 -0300 Subject: [PATCH 08/13] address PR comment on add-teleporter --- interchain/icm/icm.go | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/interchain/icm/icm.go b/interchain/icm/icm.go index c25f379..c321894 100644 --- a/interchain/icm/icm.go +++ b/interchain/icm/icm.go @@ -14,11 +14,10 @@ import ( ) const ( - releaseURL = "https://github.com/ava-labs/teleporter/releases/download/%s/" - messengerContractAddressURLFmt = releaseURL + "/TeleporterMessenger_Contract_Address_%s.txt" - messengerDeployerAddressURLFmt = releaseURL + "/TeleporterMessenger_Deployer_Address_%s.txt" - messengerDeployerTxURLFmt = releaseURL + "/TeleporterMessenger_Deployment_Transaction_%s.txt" - registryBytecodeURLFmt = releaseURL + "/TeleporterRegistry_Bytecode_%s.txt" + messengerContractAddressURLFmt = "TeleporterMessenger_Contract_Address_%s.txt" + messengerDeployerAddressURLFmt = "TeleporterMessenger_Deployer_Address_%s.txt" + messengerDeployerTxURLFmt = "TeleporterMessenger_Deployment_Transaction_%s.txt" + registryBytecodeURLFmt = "TeleporterRegistry_Bytecode_%s.txt" ) var ( @@ -33,10 +32,30 @@ func GetLatestVersion() (string, error) { } func getURLs(version string) (string, string, string, string) { - messengerContractAddressURL := fmt.Sprintf(messengerContractAddressURLFmt, version, version) - messengerDeployerAddressURL := fmt.Sprintf(messengerDeployerAddressURLFmt, version, version) - messengerDeployerTxURL := fmt.Sprintf(messengerDeployerTxURLFmt, version, version) - registryBytecodeURL := fmt.Sprintf(registryBytecodeURLFmt, version, version) + messengerContractAddressURL := utils.GetGithubReleaseAssetURL( + constants.AvaLabsOrg, + constants.ICMRepoName, + version, + fmt.Sprintf(messengerContractAddressURLFmt, version), + ) + messengerDeployerAddressURL := utils.GetGithubReleaseAssetURL( + constants.AvaLabsOrg, + constants.ICMRepoName, + version, + fmt.Sprintf(messengerDeployerAddressURLFmt, version), + ) + messengerDeployerTxURL := utils.GetGithubReleaseAssetURL( + constants.AvaLabsOrg, + constants.ICMRepoName, + version, + fmt.Sprintf(messengerDeployerTxURLFmt, version), + ) + registryBytecodeURL := utils.GetGithubReleaseAssetURL( + constants.AvaLabsOrg, + constants.ICMRepoName, + version, + fmt.Sprintf(registryBytecodeURLFmt, version), + ) return messengerContractAddressURL, messengerDeployerAddressURL, messengerDeployerTxURL, registryBytecodeURL } From 25882633d96c13c4e34a804c3c65eae8e83f4c2e Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Wed, 28 Aug 2024 07:49:43 -0300 Subject: [PATCH 09/13] fix process setup timeout --- process/process.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/process/process.go b/process/process.go index 031c76c..2a69059 100644 --- a/process/process.go +++ b/process/process.go @@ -85,9 +85,16 @@ func Execute( } } if setupTime > 0 { + ch := make(chan struct{}) + go func() { + _ = cmd.Wait() + ch <- struct{}{} + }() time.Sleep(setupTime) - if b, _, _, _ := IsRunning(cmd.Process.Pid, ""); !b { + select { + case <-ch: return 0, fmt.Errorf("process stopped during setup") + default: } } return cmd.Process.Pid, nil From 0639918804af06d74619ec0a20e6f01a6373dbf0 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Wed, 28 Aug 2024 22:07:17 -0300 Subject: [PATCH 10/13] split source and destination conf --- interchain/relayer/conf.go | 314 ++++++++++++++++++++++++------------- 1 file changed, 206 insertions(+), 108 deletions(-) diff --git a/interchain/relayer/conf.go b/interchain/relayer/conf.go index 2ced5cd..ccde2d1 100644 --- a/interchain/relayer/conf.go +++ b/interchain/relayer/conf.go @@ -20,81 +20,6 @@ import ( var defaultRequiredBalance = big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(500)) // 500 AVAX -func GetBaseRelayerConfig( - logLevel string, - storageLocation string, - network avalanche.Network, -) *config.Config { - return &config.Config{ - LogLevel: logLevel, - PChainAPI: &config.APIConfig{ - BaseURL: network.Endpoint, - }, - InfoAPI: &config.APIConfig{ - BaseURL: network.Endpoint, - }, - StorageLocation: storageLocation, - ProcessMissedBlocks: false, - SourceBlockchains: []*config.SourceBlockchain{}, - DestinationBlockchains: []*config.DestinationBlockchain{}, - } -} - -func AddChainToRelayerConfig( - relayerConfig *config.Config, - network avalanche.Network, - subnetID ids.ID, - blockchainID ids.ID, - teleporterContractAddress string, - teleporterRegistryAddress string, - privateKey string, - rewardAddress string, -) error { - rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) - wsEndpoint := network.BlockchainWSEndpoint(blockchainID.String()) - source := &config.SourceBlockchain{ - SubnetID: subnetID.String(), - BlockchainID: blockchainID.String(), - VM: config.EVM.String(), - RPCEndpoint: config.APIConfig{ - BaseURL: rpcEndpoint, - }, - WSEndpoint: config.APIConfig{ - BaseURL: wsEndpoint, - }, - MessageContracts: map[string]config.MessageProtocolConfig{ - teleporterContractAddress: { - MessageFormat: config.TELEPORTER.String(), - Settings: map[string]interface{}{ - "reward-address": rewardAddress, - }, - }, - offchainregistry.OffChainRegistrySourceAddress.Hex(): { - MessageFormat: config.OFF_CHAIN_REGISTRY.String(), - Settings: map[string]interface{}{ - "teleporter-registry-address": teleporterRegistryAddress, - }, - }, - }, - } - destination := &config.DestinationBlockchain{ - SubnetID: subnetID.String(), - BlockchainID: blockchainID.String(), - VM: config.EVM.String(), - RPCEndpoint: config.APIConfig{ - BaseURL: rpcEndpoint, - }, - AccountPrivateKey: privateKey, - } - if GetSourceConfig(relayerConfig, network, subnetID, blockchainID) == nil { - relayerConfig.SourceBlockchains = append(relayerConfig.SourceBlockchains, source) - } - if GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) == nil { - relayerConfig.DestinationBlockchains = append(relayerConfig.DestinationBlockchains, destination) - } - return nil -} - func GetSourceConfig( relayerConfig *config.Config, network avalanche.Network, @@ -220,53 +145,226 @@ func FundRelayerAddress( ) } -// add a blockchain both as source and as destination into the file at [relayerConfigPath] -func AddChainToRelayerConfigFile( +func LoadRelayerConfig(relayerConfigPath string) (*config.Config, error) { + relayerConfig := config.Config{} + bs, err := os.ReadFile(relayerConfigPath) + if err != nil { + return nil, err + } + if err := json.Unmarshal(bs, &relayerConfig); err != nil { + return nil, err + } + return &relayerConfig, nil +} + +func SaveRelayerConfig(relayerConfig *config.Config, relayerConfigPath string) error { + bs, err := json.MarshalIndent(relayerConfig, "", " ") + if err != nil { + return err + } + return os.WriteFile(relayerConfigPath, bs, constants.WriteReadReadPerms) +} + +func CreateBaseRelayerConfigFile( + relayerConfigPath string, logLevel string, + storageLocation string, + metricsPort uint16, + network avalanche.Network, +) error { + relayerConfig := CreateBaseRelayerConfig( + logLevel, + storageLocation, + metricsPort, + network, + ) + return SaveRelayerConfig(relayerConfig, relayerConfigPath) +} + +func AddSourceToRelayerConfigFile( relayerConfigPath string, - relayerStorageDir string, network avalanche.Network, subnetID ids.ID, blockchainID ids.ID, - teleporterContractAddress string, - teleporterRegistryAddress string, - privateKey string, - rewardAddress string, + icmRegistryAddress string, + icmMessengerAddress string, + relayerRewardAddress string, ) error { - awmRelayerConfig := &config.Config{} - if utils.FileExists(relayerConfigPath) { - bs, err := os.ReadFile(relayerConfigPath) - if err != nil { - return err - } - if err := json.Unmarshal(bs, &awmRelayerConfig); err != nil { - return err - } - } else { - awmRelayerConfig = GetBaseRelayerConfig( - logLevel, - relayerStorageDir, - network, - ) + relayerConfig, err := LoadRelayerConfig(relayerConfigPath) + if err != nil { + return err } - if err := AddChainToRelayerConfig( - awmRelayerConfig, + AddSourceToRelayerConfig( + relayerConfig, network, subnetID, blockchainID, - teleporterContractAddress, - teleporterRegistryAddress, - privateKey, - rewardAddress, - ); err != nil { + icmRegistryAddress, + icmMessengerAddress, + relayerRewardAddress, + ) + return SaveRelayerConfig(relayerConfig, relayerConfigPath) +} + +func AddDestinationToRelayerConfigFile( + relayerConfigPath string, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + relayerPrivateKey string, +) error { + relayerConfig, err := LoadRelayerConfig(relayerConfigPath) + if err != nil { return err } - bs, err := json.MarshalIndent(awmRelayerConfig, "", " ") + AddDestinationToRelayerConfig( + relayerConfig, + network, + subnetID, + blockchainID, + relayerPrivateKey, + ) + return SaveRelayerConfig(relayerConfig, relayerConfigPath) +} + +func AddBlockchainToRelayerConfigFile( + relayerConfigPath string, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + icmRegistryAddress string, + icmMessengerAddress string, + relayerRewardAddress string, + relayerPrivateKey string, +) error { + relayerConfig, err := LoadRelayerConfig(relayerConfigPath) if err != nil { return err } - if err := os.WriteFile(relayerConfigPath, bs, constants.WriteReadReadPerms); err != nil { - return err + AddBlockchainToRelayerConfig( + relayerConfig, + network, + subnetID, + blockchainID, + icmRegistryAddress, + icmMessengerAddress, + relayerRewardAddress, + relayerPrivateKey, + ) + return SaveRelayerConfig(relayerConfig, relayerConfigPath) +} + +func CreateBaseRelayerConfig( + logLevel string, + storageLocation string, + metricsPort uint16, + network avalanche.Network, +) *config.Config { + relayerConfig := &config.Config{ + LogLevel: logLevel, + PChainAPI: &config.APIConfig{ + BaseURL: network.Endpoint, + QueryParams: map[string]string{}, + }, + InfoAPI: &config.APIConfig{ + BaseURL: network.Endpoint, + QueryParams: map[string]string{}, + }, + StorageLocation: storageLocation, + ProcessMissedBlocks: false, + SourceBlockchains: []*config.SourceBlockchain{}, + DestinationBlockchains: []*config.DestinationBlockchain{}, } - return nil + if metricsPort != 0 { + relayerConfig.MetricsPort = metricsPort + } + return relayerConfig +} + +func AddSourceToRelayerConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + icmRegistryAddress string, + icmMessengerAddress string, + relayerRewardAddress string, +) { + source := &config.SourceBlockchain{ + SubnetID: subnetID.String(), + BlockchainID: blockchainID.String(), + VM: config.EVM.String(), + RPCEndpoint: config.APIConfig{ + BaseURL: network.BlockchainEndpoint(blockchainID.String()), + }, + WSEndpoint: config.APIConfig{ + BaseURL: network.BlockchainWSEndpoint(blockchainID.String()), + }, + MessageContracts: map[string]config.MessageProtocolConfig{ + icmMessengerAddress: { + MessageFormat: config.TELEPORTER.String(), + Settings: map[string]interface{}{ + "reward-address": relayerRewardAddress, + }, + }, + offchainregistry.OffChainRegistrySourceAddress.Hex(): { + MessageFormat: config.OFF_CHAIN_REGISTRY.String(), + Settings: map[string]interface{}{ + "teleporter-registry-address": icmRegistryAddress, + }, + }, + }, + } + if GetSourceConfig(relayerConfig, network, subnetID, blockchainID) == nil { + relayerConfig.SourceBlockchains = append(relayerConfig.SourceBlockchains, source) + } +} + +func AddDestinationToRelayerConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + relayerFundedAddressKey string, +) { + destination := &config.DestinationBlockchain{ + SubnetID: subnetID.String(), + BlockchainID: blockchainID.String(), + VM: config.EVM.String(), + RPCEndpoint: config.APIConfig{ + BaseURL: network.BlockchainEndpoint(blockchainID.String()), + }, + AccountPrivateKey: relayerFundedAddressKey, + } + if GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) == nil { + relayerConfig.DestinationBlockchains = append(relayerConfig.DestinationBlockchains, destination) + } +} + +func AddBlockchainToRelayerConfig( + relayerConfig *config.Config, + network avalanche.Network, + subnetID ids.ID, + blockchainID ids.ID, + icmRegistryAddress string, + icmMessengerAddress string, + relayerRewardAddress string, + relayerPrivateKey string, +) { + AddSourceToRelayerConfig( + relayerConfig, + network, + subnetID, + blockchainID, + icmRegistryAddress, + icmMessengerAddress, + relayerRewardAddress, + ) + AddDestinationToRelayerConfig( + relayerConfig, + network, + subnetID, + blockchainID, + relayerPrivateKey, + ) } From 4eb121bf51bc921ca1c719894da4becf8e447909 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Wed, 28 Aug 2024 22:21:35 -0300 Subject: [PATCH 11/13] nit --- interchain/relayer/conf.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/interchain/relayer/conf.go b/interchain/relayer/conf.go index ccde2d1..d6821b4 100644 --- a/interchain/relayer/conf.go +++ b/interchain/relayer/conf.go @@ -274,9 +274,7 @@ func CreateBaseRelayerConfig( ProcessMissedBlocks: false, SourceBlockchains: []*config.SourceBlockchain{}, DestinationBlockchains: []*config.DestinationBlockchain{}, - } - if metricsPort != 0 { - relayerConfig.MetricsPort = metricsPort + MetricsPort: metricsPort, } return relayerConfig } From dae0319500c2c1835334ce74a06575aadcd695f9 Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Wed, 28 Aug 2024 23:46:56 -0300 Subject: [PATCH 12/13] separate RPC endpoints from network endpoint --- interchain/relayer/conf.go | 82 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/interchain/relayer/conf.go b/interchain/relayer/conf.go index d6821b4..b900ddb 100644 --- a/interchain/relayer/conf.go +++ b/interchain/relayer/conf.go @@ -7,6 +7,7 @@ import ( "fmt" "math/big" "os" + "strings" "github.com/ava-labs/avalanche-tooling-sdk-go/avalanche" "github.com/ava-labs/avalanche-tooling-sdk-go/constants" @@ -22,15 +23,12 @@ var defaultRequiredBalance = big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(500) func GetSourceConfig( relayerConfig *config.Config, - network avalanche.Network, - subnetID ids.ID, blockchainID ids.ID, ) *config.SourceBlockchain { - rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) p := utils.Find( relayerConfig.SourceBlockchains, func(s *config.SourceBlockchain) bool { - return s.BlockchainID == blockchainID.String() && s.SubnetID == subnetID.String() && s.RPCEndpoint.BaseURL == rpcEndpoint + return s.BlockchainID == blockchainID.String() }, ) if p != nil { @@ -41,15 +39,12 @@ func GetSourceConfig( func GetDestinationConfig( relayerConfig *config.Config, - network avalanche.Network, - subnetID ids.ID, blockchainID ids.ID, ) *config.DestinationBlockchain { - rpcEndpoint := network.BlockchainEndpoint(blockchainID.String()) p := utils.Find( relayerConfig.DestinationBlockchains, func(s *config.DestinationBlockchain) bool { - return s.BlockchainID == blockchainID.String() && s.SubnetID == subnetID.String() && s.RPCEndpoint.BaseURL == rpcEndpoint + return s.BlockchainID == blockchainID.String() }, ) if p != nil { @@ -58,26 +53,23 @@ func GetDestinationConfig( return nil } -// fund the relayer private key associated to [network]/[subnetID]/[blockchainID] +// fund the relayer private key associated to [blockchainID] // at [relayerConfig]. if [amount] > 0 transfers it to the account. if, // afterwards, balance < [requiredMinBalance], transfers remaining amount for that // if [requiredMinBalance] is nil, uses [defaultRequiredBalance] func FundRelayer( relayerConfig *config.Config, - network avalanche.Network, - subnetID ids.ID, blockchainID ids.ID, privateKey string, amount *big.Int, requiredMinBalance *big.Int, ) error { - destinationConfig := GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) + destinationConfig := GetDestinationConfig(relayerConfig, blockchainID) if destinationConfig == nil { - return fmt.Errorf("relayer destination not found for network %s, subnet %s, blockchain %s", network.Kind.String(), subnetID.String(), blockchainID.String()) + return fmt.Errorf("relayer destination not found for blockchain %s", blockchainID.String()) } return FundRelayerPrivateKey( - network, - blockchainID, + destinationConfig.RPCEndpoint.BaseURL, privateKey, destinationConfig.AccountPrivateKey, amount, @@ -85,11 +77,10 @@ func FundRelayer( ) } -// fund [relayerPrivateKey] at [network]/[blockchainID] +// fund [relayerPrivateKey] at [rpcEndpoint] // see FundRelayer for [amount]/[requiredMinBalance] logic func FundRelayerPrivateKey( - network avalanche.Network, - blockchainID ids.ID, + rpcEndpoint string, privateKey string, relayerPrivateKey string, amount *big.Int, @@ -101,8 +92,7 @@ func FundRelayerPrivateKey( } relayerAddress := crypto.PubkeyToAddress(relayerPK.PublicKey) return FundRelayerAddress( - network, - blockchainID, + rpcEndpoint, privateKey, relayerAddress.Hex(), amount, @@ -110,11 +100,10 @@ func FundRelayerPrivateKey( ) } -// fund [relayerAddress] at [network]/[blockchainID] +// fund [relayerAddress] at [rpcEndpoint] // see FundRelayer for [amount]/[requiredMinBalance] logic func FundRelayerAddress( - network avalanche.Network, - blockchainID ids.ID, + rpcEndpoint string, privateKey string, relayerAddress string, amount *big.Int, @@ -123,7 +112,7 @@ func FundRelayerAddress( if requiredMinBalance == nil { requiredMinBalance = defaultRequiredBalance } - client, err := evm.GetClient(network.BlockchainEndpoint(blockchainID.String())) + client, err := evm.GetClient(rpcEndpoint) if err != nil { return err } @@ -183,7 +172,8 @@ func CreateBaseRelayerConfigFile( func AddSourceToRelayerConfigFile( relayerConfigPath string, - network avalanche.Network, + rpcEndpoint string, + wsEndpoint string, subnetID ids.ID, blockchainID ids.ID, icmRegistryAddress string, @@ -196,7 +186,8 @@ func AddSourceToRelayerConfigFile( } AddSourceToRelayerConfig( relayerConfig, - network, + rpcEndpoint, + wsEndpoint, subnetID, blockchainID, icmRegistryAddress, @@ -208,7 +199,7 @@ func AddSourceToRelayerConfigFile( func AddDestinationToRelayerConfigFile( relayerConfigPath string, - network avalanche.Network, + rpcEndpoint string, subnetID ids.ID, blockchainID ids.ID, relayerPrivateKey string, @@ -219,7 +210,7 @@ func AddDestinationToRelayerConfigFile( } AddDestinationToRelayerConfig( relayerConfig, - network, + rpcEndpoint, subnetID, blockchainID, relayerPrivateKey, @@ -229,7 +220,8 @@ func AddDestinationToRelayerConfigFile( func AddBlockchainToRelayerConfigFile( relayerConfigPath string, - network avalanche.Network, + rpcEndpoint string, + wsEndpoint string, subnetID ids.ID, blockchainID ids.ID, icmRegistryAddress string, @@ -243,7 +235,8 @@ func AddBlockchainToRelayerConfigFile( } AddBlockchainToRelayerConfig( relayerConfig, - network, + rpcEndpoint, + wsEndpoint, subnetID, blockchainID, icmRegistryAddress, @@ -281,22 +274,29 @@ func CreateBaseRelayerConfig( func AddSourceToRelayerConfig( relayerConfig *config.Config, - network avalanche.Network, + rpcEndpoint string, + wsEndpoint string, subnetID ids.ID, blockchainID ids.ID, icmRegistryAddress string, icmMessengerAddress string, relayerRewardAddress string, ) { + if wsEndpoint == "" { + wsEndpoint = strings.TrimPrefix(rpcEndpoint, "https") + wsEndpoint = strings.TrimPrefix(wsEndpoint, "http") + wsEndpoint = strings.TrimSuffix(wsEndpoint, "rpc") + wsEndpoint = fmt.Sprintf("%s%s%s", "ws", wsEndpoint, "ws") + } source := &config.SourceBlockchain{ SubnetID: subnetID.String(), BlockchainID: blockchainID.String(), VM: config.EVM.String(), RPCEndpoint: config.APIConfig{ - BaseURL: network.BlockchainEndpoint(blockchainID.String()), + BaseURL: rpcEndpoint, }, WSEndpoint: config.APIConfig{ - BaseURL: network.BlockchainWSEndpoint(blockchainID.String()), + BaseURL: wsEndpoint, }, MessageContracts: map[string]config.MessageProtocolConfig{ icmMessengerAddress: { @@ -313,14 +313,14 @@ func AddSourceToRelayerConfig( }, }, } - if GetSourceConfig(relayerConfig, network, subnetID, blockchainID) == nil { + if GetSourceConfig(relayerConfig, blockchainID) == nil { relayerConfig.SourceBlockchains = append(relayerConfig.SourceBlockchains, source) } } func AddDestinationToRelayerConfig( relayerConfig *config.Config, - network avalanche.Network, + rpcEndpoint string, subnetID ids.ID, blockchainID ids.ID, relayerFundedAddressKey string, @@ -330,18 +330,19 @@ func AddDestinationToRelayerConfig( BlockchainID: blockchainID.String(), VM: config.EVM.String(), RPCEndpoint: config.APIConfig{ - BaseURL: network.BlockchainEndpoint(blockchainID.String()), + BaseURL: rpcEndpoint, }, AccountPrivateKey: relayerFundedAddressKey, } - if GetDestinationConfig(relayerConfig, network, subnetID, blockchainID) == nil { + if GetDestinationConfig(relayerConfig, blockchainID) == nil { relayerConfig.DestinationBlockchains = append(relayerConfig.DestinationBlockchains, destination) } } func AddBlockchainToRelayerConfig( relayerConfig *config.Config, - network avalanche.Network, + rpcEndpoint string, + wsEndpoint string, subnetID ids.ID, blockchainID ids.ID, icmRegistryAddress string, @@ -351,7 +352,8 @@ func AddBlockchainToRelayerConfig( ) { AddSourceToRelayerConfig( relayerConfig, - network, + rpcEndpoint, + wsEndpoint, subnetID, blockchainID, icmRegistryAddress, @@ -360,7 +362,7 @@ func AddBlockchainToRelayerConfig( ) AddDestinationToRelayerConfig( relayerConfig, - network, + rpcEndpoint, subnetID, blockchainID, relayerPrivateKey, From 29895f6e11244bdcb24c57fd8692bc719218819d Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Thu, 29 Aug 2024 00:52:00 -0300 Subject: [PATCH 13/13] nit --- interchain/relayer/conf.go | 1 + 1 file changed, 1 insertion(+) diff --git a/interchain/relayer/conf.go b/interchain/relayer/conf.go index b900ddb..617a4dd 100644 --- a/interchain/relayer/conf.go +++ b/interchain/relayer/conf.go @@ -268,6 +268,7 @@ func CreateBaseRelayerConfig( SourceBlockchains: []*config.SourceBlockchain{}, DestinationBlockchains: []*config.DestinationBlockchain{}, MetricsPort: metricsPort, + DBWriteIntervalSeconds: 1, } return relayerConfig }