From ba0af4c120c09c9fe2ea906b27c828b4ee4d15be Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 11:25:33 -0300 Subject: [PATCH 01/36] Upgrading sdk version i go.mod and go.sum --- go.mod | 61 +++++++++++++++++++++++++++++++++++--------------------- go.sum | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 476190da..f250db6f 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.21 toolchain go1.21.0 require ( - github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775 - github.com/ethereum/go-ethereum v1.13.14 + github.com/Layr-Labs/eigensdk-go v0.1.12 + github.com/ethereum/go-ethereum v1.14.0 github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 - github.com/testcontainers/testcontainers-go v0.29.1 + github.com/testcontainers/testcontainers-go v0.30.0 github.com/urfave/cli v1.22.14 go.uber.org/mock v0.4.0 - golang.org/x/crypto v0.18.0 + golang.org/x/crypto v0.22.0 ) require ( @@ -23,15 +23,29 @@ require ( github.com/Microsoft/hcsshim v0.11.4 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect + github.com/aws/smithy-go v1.20.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect @@ -40,29 +54,29 @@ require ( github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect - github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.3+incompatible // indirect + github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fjl/memsize v0.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect @@ -105,6 +119,7 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/supranational/blst v0.3.11 // indirect @@ -115,22 +130,22 @@ require ( github.com/urfave/cli/v2 v2.27.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.15.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.20.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/grpc v1.58.3 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index a6a98f47..758332b4 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775 h1:xQQ4xnlzO1n0nU2HPizd00H2N3zacJjbSPwLhOHxZEo= github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775/go.mod h1:ECU8/Ocsf+dGcN2rs8I1PScq4dOkQqY+vgwnq30Ov4M= +github.com/Layr-Labs/eigensdk-go v0.1.12 h1:Drf59iJLvnTm2Om9AwAyUMiZeJaTI8ZameIrnhjopSY= +github.com/Layr-Labs/eigensdk-go v0.1.12/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -29,6 +31,34 @@ 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/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= +github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA= +github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE= +github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs= +github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= +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.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk= +github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 h1:yl7wcqbisxPzknJVfWTLnK83McUvXba+pz2+tPbIUmQ= +github.com/aws/aws-sdk-go-v2/service/kms v1.31.0/go.mod h1:2snWQJQUKsbN66vAawJuOGX7dr37pfOq9hb0tZDGIqQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw= +github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -52,13 +82,16 @@ github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaY github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -82,6 +115,8 @@ github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUp github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -100,6 +135,7 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -113,12 +149,17 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= +github.com/ethereum/go-ethereum v1.14.0 h1:xRWC5NlB6g1x7vNy4HDBLuqVNbtLrc7v8S6+Uxim1LU= +github.com/ethereum/go-ethereum v1.14.0/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -142,6 +183,7 @@ github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= @@ -180,6 +222,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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= @@ -374,6 +417,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 h1:17JxqqJY66GmZVHkmAsGEkcIu0oCe3AM420QDgGwZx0= +github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466/go.mod h1:9dIRpgIY7hVhoqfe0/FcYp0bpInZaT7dc3BYOprrIUE= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -406,6 +451,7 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/testcontainers/testcontainers-go v0.29.1 h1:z8kxdFlovA2y97RWx98v/TQ+tR+SXZm6p35M+xB92zk= github.com/testcontainers/testcontainers-go v0.29.1/go.mod h1:SnKnKQav8UcgtKqjp/AD8bE1MqZm+3TDb/B8crE3XnI= +github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= @@ -443,18 +489,22 @@ github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFi github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -475,6 +525,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= @@ -488,6 +540,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -519,6 +573,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -559,6 +615,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -571,6 +629,7 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -586,6 +645,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -624,6 +685,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 1c1041fd505ba72f89ffd4649ac2d8a211fa2f16 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 11:58:21 -0300 Subject: [PATCH 02/36] upgrade go-ethereum in go.sum --- go.sum | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go.sum b/go.sum index 758332b4..97ee3272 100644 --- a/go.sum +++ b/go.sum @@ -82,15 +82,18 @@ github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaY github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= @@ -629,6 +632,7 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/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= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 63e3f2c74085aa7d9fb86cf78bb6dd86929adfd4 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 12:42:15 -0300 Subject: [PATCH 03/36] fixing some compilation errors --- operator/registration.go | 6 +++--- plugin/cmd/main.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/operator/registration.go b/operator/registration.go index 3299e480..82ab321f 100644 --- a/operator/registration.go +++ b/operator/registration.go @@ -51,8 +51,8 @@ func (o *Operator) registerOperatorOnStartup( func (o *Operator) RegisterOperatorWithEigenlayer() error { op := eigenSdkTypes.Operator{ - Address: o.operatorAddr.String(), - EarningsReceiverAddress: o.operatorAddr.String(), + Address: o.operatorAddr.String(), + DelegationApproverAddress: o.operatorAddr.String(), } _, err := o.eigenlayerWriter.RegisterAsOperator(context.Background(), op) if err != nil { @@ -79,7 +79,7 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big. o.logger.Errorf("Error assembling Mint tx") return err } - _, err = o.avsWriter.TxMgr.Send(context.Background(), tx) + _, err = o.avsWriter.TxMgr.Send(context.Background(), tx, true) if err != nil { o.logger.Errorf("Error submitting Mint tx") return err diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index b0b7a60f..4df69e06 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -222,13 +222,13 @@ func plugin(ctx *cli.Context) { logger.Errorf("Error assembling Mint tx") return } - _, err = avsWriter.TxMgr.Send(context.Background(), tx) + _, err = avsWriter.TxMgr.Send(context.Background(), tx, true) if err != nil { logger.Errorf("Error submitting Mint tx") return } - _, err = clients.ElChainWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount) + _, err = clients.ElChainWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount, true) if err != nil { logger.Errorf("Error depositing into strategy") return From dca8411096799fdd44fb9413b41d2b334258deb4 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 13:25:59 -0300 Subject: [PATCH 04/36] fixing challenger.go --- challenger/challenger.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/challenger/challenger.go b/challenger/challenger.go index 0812e915..10ad594b 100644 --- a/challenger/challenger.go +++ b/challenger/challenger.go @@ -18,7 +18,7 @@ import ( type Challenger struct { logger logging.Logger - ethClient ethclient.Client + ethClient ethclient.InstrumentedClient avsReader chainio.AvsReaderer avsWriter chainio.AvsWriterer avsSubscriber chainio.AvsSubscriberer @@ -47,10 +47,10 @@ func NewChallenger(c *config.Config) (*Challenger, error) { } challenger := &Challenger{ - ethClient: c.EthHttpClient, logger: c.Logger, - avsWriter: avsWriter, + ethClient: c.EthHttpClient, avsReader: avsReader, + avsWriter: avsWriter, avsSubscriber: avsSubscriber, tasks: make(map[uint32]cstaskmanager.IIncredibleSquaringTaskManagerTask), taskResponses: make(map[uint32]types.TaskResponseData), From cc9a42e693b776b0258ab471ca3c8133ef9d7845 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 15:15:50 -0300 Subject: [PATCH 05/36] config.go upgraded --- core/config/config.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/config/config.go b/core/config/config.go index 70f54548..02a9fc1f 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -16,6 +16,7 @@ import ( "github.com/Layr-Labs/eigensdk-go/crypto/bls" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/signerv2" + "github.com/ethereum/go-ethereum/ethclient" sdkutils "github.com/Layr-Labs/eigensdk-go/utils" ) @@ -31,8 +32,8 @@ type Config struct { // only take an ethclient or an rpcUrl (and build the ethclient at each constructor site) EthHttpRpcUrl string EthWsRpcUrl string - EthHttpClient eth.Client - EthWsClient eth.Client + EthHttpClient eth.InstrumentedClient + EthWsClient eth.WsBackend OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address AggregatorServerIpPortAddr string @@ -84,13 +85,14 @@ func NewConfig(ctx *cli.Context) (*Config, error) { return nil, err } - ethRpcClient, err := eth.NewClient(configRaw.EthRpcUrl) + ethRpcClient, err := ethclient.Dial(configRaw.EthRpcUrl) if err != nil { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } + ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) - ethWsClient, err := eth.NewClient(configRaw.EthWsUrl) + ethWsClient, err := ethclient.Dial(configRaw.EthWsUrl) if err != nil { logger.Errorf("Cannot create ws ethclient", "err", err) return nil, err @@ -133,7 +135,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { Logger: logger, EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, - EthHttpClient: ethRpcClient, + EthHttpClient: *ethRpcClientInstrumented, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), From c2b5236078a19608e3554dddcea4c67e6daa472b Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 15:26:22 -0300 Subject: [PATCH 06/36] BuildAvsSubscriber fixed --- core/chainio/avs_subscriber.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/chainio/avs_subscriber.go b/core/chainio/avs_subscriber.go index fcf7db1d..08f7b056 100644 --- a/core/chainio/avs_subscriber.go +++ b/core/chainio/avs_subscriber.go @@ -37,7 +37,7 @@ func BuildAvsSubscriberFromConfig(config *config.Config) (*AvsSubscriber, error) ) } -func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient eth.Client, logger sdklogging.Logger) (*AvsSubscriber, error) { +func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient eth.WsBackend, logger sdklogging.Logger) (*AvsSubscriber, error) { avsContractBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, blsOperatorStateRetrieverAddr, ethclient, logger) if err != nil { logger.Errorf("Failed to create contract bindings", "err", err) From 18fb98231ac88c8e7b69c91aecf4a44cbf35264e Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 15:38:38 -0300 Subject: [PATCH 07/36] adding missing parameter to Send --- core/chainio/avs_writer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index 1a19f23e..ea9c3d74 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -87,7 +87,7 @@ func (w *AvsWriter) SendNewTaskNumberToSquare(ctx context.Context, numToSquare * w.logger.Errorf("Error assembling CreateNewTask tx") return cstaskmanager.IIncredibleSquaringTaskManagerTask{}, 0, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting CreateNewTask tx") return cstaskmanager.IIncredibleSquaringTaskManagerTask{}, 0, err @@ -115,7 +115,7 @@ func (w *AvsWriter) SendAggregatedResponse( w.logger.Error("Error submitting SubmitTaskResponse tx while calling respondToTask", "err", err) return nil, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting respondToTask tx") return nil, err @@ -140,7 +140,7 @@ func (w *AvsWriter) RaiseChallenge( w.logger.Errorf("Error assembling RaiseChallenge tx") return nil, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting RaiseChallenge tx") return nil, err From 4f475650d08ec0c8c905559d8867dc86cf3a0059 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 16:02:43 -0300 Subject: [PATCH 08/36] changing to logger := testutils.GetTestLogger() --- aggregator/aggregator_test.go | 4 ++-- challenger/challenger_test.go | 4 ++-- go.sum | 9 +++++++++ operator/registration_test.go | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index 8f5bae63..a61e6e69 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -13,8 +13,8 @@ import ( "go.uber.org/mock/gomock" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" blsaggservmock "github.com/Layr-Labs/eigensdk-go/services/mocks/blsagg" + "github.com/Layr-Labs/eigensdk-go/testutils" sdktypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/incredible-squaring-avs/aggregator/mocks" @@ -79,7 +79,7 @@ func TestSendNewTask(t *testing.T) { func createMockAggregator( mockCtrl *gomock.Controller, operatorPubkeyDict map[sdktypes.OperatorId]types.OperatorInfo, ) (*Aggregator, *chainiomocks.MockAvsWriterer, *blsaggservmock.MockBlsAggregationService, error) { - logger := sdklogging.NewNoopLogger() + logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) mockBlsAggregationService := blsaggservmock.NewMockBlsAggregationService(mockCtrl) diff --git a/challenger/challenger_test.go b/challenger/challenger_test.go index e1447d73..100fd83e 100644 --- a/challenger/challenger_test.go +++ b/challenger/challenger_test.go @@ -6,7 +6,7 @@ import ( "testing" mockethclient "github.com/Layr-Labs/eigensdk-go/chainio/mocks" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/testutils" aggtypes "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/mocks" chtypes "github.com/Layr-Labs/incredible-squaring-avs/challenger/types" @@ -171,7 +171,7 @@ func TestProcessTaskResponseLog(t *testing.T) { } func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomocks.MockAvsWriterer, *chainiomocks.MockAvsReaderer, *chainiomocks.MockAvsSubscriberer, *mockethclient.MockEthClient, error) { - logger := sdklogging.NewNoopLogger() + logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) mockAvsReader := chainiomocks.NewMockAvsReaderer(mockCtrl) mockAvsSubscriber := chainiomocks.NewMockAvsSubscriberer(mockCtrl) diff --git a/go.sum b/go.sum index 97ee3272..435f6b31 100644 --- a/go.sum +++ b/go.sum @@ -138,6 +138,7 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= @@ -162,6 +163,7 @@ github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -186,6 +188,7 @@ github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/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= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= @@ -225,6 +228,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -454,6 +458,7 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/testcontainers/testcontainers-go v0.29.1 h1:z8kxdFlovA2y97RWx98v/TQ+tR+SXZm6p35M+xB92zk= github.com/testcontainers/testcontainers-go v0.29.1/go.mod h1:SnKnKQav8UcgtKqjp/AD8bE1MqZm+3TDb/B8crE3XnI= +github.com/testcontainers/testcontainers-go v0.30.0 h1:jmn/XS22q4YRrcMwWg0pAwlClzs/abopbsBzrepyc4E= github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= @@ -492,9 +497,11 @@ github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFi github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= @@ -502,11 +509,13 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMey go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= diff --git a/operator/registration_test.go b/operator/registration_test.go index ec5e3afe..00984f2b 100644 --- a/operator/registration_test.go +++ b/operator/registration_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/testutils" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/metrics" @@ -32,7 +32,7 @@ func IntegrationTestOperatorRegistration(t *testing.T) { } func createMockOperator() (*Operator, error) { - logger := sdklogging.NewNoopLogger() + logger := testutils.GetTestLogger() reg := prometheus.NewRegistry() noopMetrics := metrics.NewNoopMetrics() From e65fbde9151ac32255116835e79e77670cfba54c Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 18:11:50 -0300 Subject: [PATCH 09/36] challenger fixed --- challenger/challenger.go | 4 +- challenger/challenger_test.go | 72 +++++++++++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 6 deletions(-) diff --git a/challenger/challenger.go b/challenger/challenger.go index 10ad594b..5e96f8aa 100644 --- a/challenger/challenger.go +++ b/challenger/challenger.go @@ -5,7 +5,7 @@ import ( "context" "math/big" - ethclient "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" @@ -18,7 +18,7 @@ import ( type Challenger struct { logger logging.Logger - ethClient ethclient.InstrumentedClient + ethClient eth.InstrumentedClient avsReader chainio.AvsReaderer avsWriter chainio.AvsWriterer avsSubscriber chainio.AvsSubscriberer diff --git a/challenger/challenger_test.go b/challenger/challenger_test.go index 100fd83e..68e6edef 100644 --- a/challenger/challenger_test.go +++ b/challenger/challenger_test.go @@ -3,9 +3,10 @@ package challenger import ( "context" "math/big" + "reflect" "testing" - mockethclient "github.com/Layr-Labs/eigensdk-go/chainio/mocks" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/testutils" aggtypes "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/mocks" @@ -13,6 +14,7 @@ import ( cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" chainiomocks "github.com/Layr-Labs/incredible-squaring-avs/core/chainio/mocks" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" @@ -22,6 +24,66 @@ var MOCK_OPERATOR_ID = [32]byte{207, 73, 226, 221, 104, 100, 123, 41, 192, 3, 9, var MOCK_OPERATOR_STAKE = big.NewInt(100) var MOCK_OPERATOR_BLS_PRIVATE_KEY_STRING = "50" +const ( + TransactionHash = "0x0000000000000000000000000000000000000000000000000000000000001234" + TransactionNashNotInFake = "0xabcd" + BlockNumber = 1234 +) + +// MockEthClient is a mock of Client interface. +type MockEthClient struct { + ctrl *gomock.Controller + recorder *MockEthClientMockRecorder +} + +// MockEthClientMockRecorder is the mock recorder for MockEthClient. +type MockEthClientMockRecorder struct { + mock *MockEthClient +} + +// NewMockEthClient creates a new mock instance. +func NewMockEthClient(ctrl *gomock.Controller) *MockEthClient { + mock := &MockEthClient{ctrl: ctrl} + mock.recorder = &MockEthClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockEthClient) EXPECT() *MockEthClientMockRecorder { + return m.recorder +} + +// BalanceAt mocks base method. +func (m *MockEthClient) BalanceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (*big.Int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BalanceAt", arg0, arg1, arg2) + ret0, _ := ret[0].(*big.Int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BalanceAt indicates an expected call of BalanceAt. +func (mr *MockEthClientMockRecorder) BalanceAt(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BalanceAt", reflect.TypeOf((*MockEthClient)(nil).BalanceAt), arg0, arg1, arg2) +} + +// TransactionByHash indicates an expected call of TransactionByHash. +func (mr *MockEthClientMockRecorder) TransactionByHash(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByHash", reflect.TypeOf((*MockEthClient)(nil).TransactionByHash), arg0, arg1) +} + +// TransactionByHash mocks base method. +func (m *MockEthClient) TransactionByHash(arg0 context.Context, arg1 common.Hash) (*types.Transaction, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TransactionByHash", arg0, arg1) + ret0, _ := ret[0].(*types.Transaction) + ret1, _ := ret[1].(bool) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + // @samlaf I tried pulling the MockTask struct froma ggregator_test but getting error: "undefined: aggregator.MockTask" type MockTask struct { TaskNum uint32 @@ -170,17 +232,19 @@ func TestProcessTaskResponseLog(t *testing.T) { } -func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomocks.MockAvsWriterer, *chainiomocks.MockAvsReaderer, *chainiomocks.MockAvsSubscriberer, *mockethclient.MockEthClient, error) { +func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomocks.MockAvsWriterer, *chainiomocks.MockAvsReaderer, *chainiomocks.MockAvsSubscriberer, *MockEthClient, error) { logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) mockAvsReader := chainiomocks.NewMockAvsReaderer(mockCtrl) mockAvsSubscriber := chainiomocks.NewMockAvsSubscriberer(mockCtrl) - mockEthClient := mockethclient.NewMockEthClient(mockCtrl) + mockEthClient := NewMockEthClient(mockCtrl) + mockEthClientInstrumented, _ := eth.NewInstrumentedClient("", nil) // TODO, add RPC URL + challenger := &Challenger{ logger: logger, avsWriter: mockAvsWriter, avsReader: mockAvsReader, - ethClient: mockEthClient, + ethClient: *mockEthClientInstrumented, avsSubscriber: mockAvsSubscriber, tasks: make(map[uint32]cstaskmanager.IIncredibleSquaringTaskManagerTask), taskResponses: make(map[uint32]chtypes.TaskResponseData), From e1d4e359d90493ea4f61fc78ba1fed4d3736cd4c Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 19:04:45 -0300 Subject: [PATCH 10/36] hashFunction in aggregator.go --- aggregator/aggregator.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 0b5d2605..6f788630 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -2,6 +2,8 @@ package aggregator import ( "context" + "crypto/sha256" + "encoding/json" "math/big" "sync" "time" @@ -106,8 +108,17 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { } operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, c.Logger) + + hashFunction := func(taskResponse sdktypes.TaskResponse) (sdktypes.TaskResponseDigest, error) { + taskResponseBytes, err := json.Marshal(taskResponse) + if err != nil { + return sdktypes.TaskResponseDigest{}, err + } + return sdktypes.TaskResponseDigest(sha256.Sum256(taskResponseBytes)), nil + } + avsRegistryService := avsregistry.NewAvsRegistryServiceChainCaller(avsReader, operatorPubkeysService, c.Logger) - blsAggregationService := blsagg.NewBlsAggregatorService(avsRegistryService, c.Logger) + blsAggregationService := blsagg.NewBlsAggregatorService(avsRegistryService, hashFunction, c.Logger) return &Aggregator{ logger: c.Logger, From ab045cf2dd2361dbf1b8f428c75c6325c6a684dc Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 8 Oct 2024 19:08:15 -0300 Subject: [PATCH 11/36] MockBlsAggregationService in aggregator_test.go --- aggregator/aggregator_test.go | 73 +++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index a61e6e69..6fabdf98 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -3,6 +3,7 @@ package aggregator import ( "context" "math/big" + "reflect" "testing" "time" @@ -13,7 +14,8 @@ import ( "go.uber.org/mock/gomock" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - blsaggservmock "github.com/Layr-Labs/eigensdk-go/services/mocks/blsagg" + blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation" + "github.com/Layr-Labs/eigensdk-go/testutils" sdktypes "github.com/Layr-Labs/eigensdk-go/types" @@ -27,6 +29,71 @@ var MOCK_OPERATOR_ID = [32]byte{207, 73, 226, 221, 104, 100, 123, 41, 192, 3, 9, var MOCK_OPERATOR_STAKE = big.NewInt(100) var MOCK_OPERATOR_BLS_PRIVATE_KEY_STRING = "50" +// MockBlsAggregationService is a mock of BlsAggregationService interface. +type MockBlsAggregationService struct { + ctrl *gomock.Controller + recorder *MockBlsAggregationServiceMockRecorder +} + +// MockBlsAggregationServiceMockRecorder is the mock recorder for MockBlsAggregationService. +type MockBlsAggregationServiceMockRecorder struct { + mock *MockBlsAggregationService +} + +// NewMockBlsAggregationService creates a new mock instance. +func NewMockBlsAggregationService(ctrl *gomock.Controller) *MockBlsAggregationService { + mock := &MockBlsAggregationService{ctrl: ctrl} + mock.recorder = &MockBlsAggregationServiceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBlsAggregationService) EXPECT() *MockBlsAggregationServiceMockRecorder { + return m.recorder +} + +// GetResponseChannel mocks base method. +func (m *MockBlsAggregationService) GetResponseChannel() <-chan blsagg.BlsAggregationServiceResponse { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetResponseChannel") + ret0, _ := ret[0].(<-chan blsagg.BlsAggregationServiceResponse) + return ret0 +} + +// GetResponseChannel indicates an expected call of GetResponseChannel. +func (mr *MockBlsAggregationServiceMockRecorder) GetResponseChannel() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseChannel", reflect.TypeOf((*MockBlsAggregationService)(nil).GetResponseChannel)) +} + +// InitializeNewTask mocks base method. +func (m *MockBlsAggregationService) InitializeNewTask(arg0, arg1 uint32, arg2 sdktypes.QuorumNums, arg3 sdktypes.QuorumThresholdPercentages, arg4 time.Duration) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitializeNewTask", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) + return ret0 +} + +// InitializeNewTask indicates an expected call of InitializeNewTask. +func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTask(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeNewTask", reflect.TypeOf((*MockBlsAggregationService)(nil).InitializeNewTask), arg0, arg1, arg2, arg3, arg4) +} + +// ProcessNewSignature mocks base method. +func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 sdktypes.Bytes32, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProcessNewSignature", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) + return ret0 +} + +// ProcessNewSignature indicates an expected call of ProcessNewSignature. +func (mr *MockBlsAggregationServiceMockRecorder) ProcessNewSignature(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessNewSignature", reflect.TypeOf((*MockBlsAggregationService)(nil).ProcessNewSignature), arg0, arg1, arg2, arg3, arg4) +} + type MockTask struct { TaskNum uint32 BlockNumber uint32 @@ -78,10 +145,10 @@ func TestSendNewTask(t *testing.T) { func createMockAggregator( mockCtrl *gomock.Controller, operatorPubkeyDict map[sdktypes.OperatorId]types.OperatorInfo, -) (*Aggregator, *chainiomocks.MockAvsWriterer, *blsaggservmock.MockBlsAggregationService, error) { +) (*Aggregator, *chainiomocks.MockAvsWriterer, *MockBlsAggregationService, error) { logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) - mockBlsAggregationService := blsaggservmock.NewMockBlsAggregationService(mockCtrl) + mockBlsAggregationService := NewMockBlsAggregationService(mockCtrl) aggregator := &Aggregator{ logger: logger, From bb10b7300419e53cdc0d597f8811cb9532f64b00 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 16:37:43 -0300 Subject: [PATCH 12/36] fixing config.go --- core/config/config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/config/config.go b/core/config/config.go index 02a9fc1f..7ecff9d5 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -32,7 +32,7 @@ type Config struct { // only take an ethclient or an rpcUrl (and build the ethclient at each constructor site) EthHttpRpcUrl string EthWsRpcUrl string - EthHttpClient eth.InstrumentedClient + EthHttpClient eth.HttpBackend EthWsClient eth.WsBackend OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address @@ -90,7 +90,6 @@ func NewConfig(ctx *cli.Context) (*Config, error) { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) ethWsClient, err := ethclient.Dial(configRaw.EthWsUrl) if err != nil { @@ -135,7 +134,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { Logger: logger, EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, - EthHttpClient: *ethRpcClientInstrumented, + EthHttpClient: ethRpcClient, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), From 588a6a51dc2ddddc76d4c5be6491ef1a4ebd7eb8 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 16:38:28 -0300 Subject: [PATCH 13/36] fixing avs_reader avs_writer y bindings --- core/chainio/avs_reader.go | 14 +++++++------- core/chainio/avs_writer.go | 16 ++++++++-------- core/chainio/bindings.go | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/chainio/avs_reader.go b/core/chainio/avs_reader.go index 55bcc48f..0b709b64 100644 --- a/core/chainio/avs_reader.go +++ b/core/chainio/avs_reader.go @@ -16,7 +16,7 @@ import ( ) type AvsReaderer interface { - sdkavsregistry.AvsRegistryReader + sdkavsregistry.ChainReader CheckSignatures( ctx context.Context, msgHash [32]byte, quorumNumbers []byte, referenceBlockNumber uint32, nonSignerStakesAndSignature cstaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature, @@ -25,17 +25,17 @@ type AvsReaderer interface { } type AvsReader struct { - sdkavsregistry.AvsRegistryReader + sdkavsregistry.ChainReader AvsServiceBindings *AvsManagersBindings logger logging.Logger } -var _ AvsReaderer = (*AvsReader)(nil) +//var _ AvsReaderer = (*AvsReader)(nil) func BuildAvsReaderFromConfig(c *config.Config) (*AvsReader, error) { return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) } -func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsReader, error) { +func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.HttpBackend, logger logging.Logger) (*AvsReader, error) { avsManagersBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { return nil, err @@ -44,11 +44,11 @@ func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcomm if err != nil { return nil, err } - return NewAvsReader(avsRegistryReader, avsManagersBindings, logger) + return NewAvsReader(*avsRegistryReader, avsManagersBindings, logger) } -func NewAvsReader(avsRegistryReader sdkavsregistry.AvsRegistryReader, avsServiceBindings *AvsManagersBindings, logger logging.Logger) (*AvsReader, error) { +func NewAvsReader(avsRegistryReader sdkavsregistry.ChainReader, avsServiceBindings *AvsManagersBindings, logger logging.Logger) (*AvsReader, error) { return &AvsReader{ - AvsRegistryReader: avsRegistryReader, + ChainReader: avsRegistryReader, AvsServiceBindings: avsServiceBindings, logger: logger, }, nil diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index ea9c3d74..e19bd77a 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -18,7 +18,7 @@ import ( ) type AvsWriterer interface { - avsregistry.AvsRegistryWriter + avsregistry.ChainWriter SendNewTaskNumberToSquare( ctx context.Context, @@ -41,20 +41,20 @@ type AvsWriterer interface { } type AvsWriter struct { - avsregistry.AvsRegistryWriter + avsregistry.ChainWriter AvsContractBindings *AvsManagersBindings logger logging.Logger TxMgr txmgr.TxManager - client eth.Client + client eth.HttpBackend } -var _ AvsWriterer = (*AvsWriter)(nil) +//var _ AvsWriterer = (*AvsWriter)(nil) func BuildAvsWriterFromConfig(c *config.Config) (*AvsWriter, error) { return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) } -func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsWriter, error) { +func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.HttpBackend, logger logging.Logger) (*AvsWriter, error) { avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { logger.Error("Failed to create contract bindings", "err", err) @@ -64,11 +64,11 @@ func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStat if err != nil { return nil, err } - return NewAvsWriter(avsRegistryWriter, avsServiceBindings, logger, txMgr), nil + return NewAvsWriter(*avsRegistryWriter, avsServiceBindings, logger, txMgr), nil } -func NewAvsWriter(avsRegistryWriter avsregistry.AvsRegistryWriter, avsServiceBindings *AvsManagersBindings, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter { +func NewAvsWriter(avsRegistryWriter avsregistry.ChainWriter, avsServiceBindings *AvsManagersBindings, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter { return &AvsWriter{ - AvsRegistryWriter: avsRegistryWriter, + ChainWriter: avsRegistryWriter, AvsContractBindings: avsServiceBindings, logger: logger, TxMgr: txMgr, diff --git a/core/chainio/bindings.go b/core/chainio/bindings.go index c9c53da0..f42ac9fa 100644 --- a/core/chainio/bindings.go +++ b/core/chainio/bindings.go @@ -17,11 +17,11 @@ import ( type AvsManagersBindings struct { TaskManager *cstaskmanager.ContractIncredibleSquaringTaskManager ServiceManager *csservicemanager.ContractIncredibleSquaringServiceManager - ethClient eth.Client + ethClient eth.HttpBackend logger logging.Logger } -func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient eth.Client, logger logging.Logger) (*AvsManagersBindings, error) { +func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient eth.HttpBackend, logger logging.Logger) (*AvsManagersBindings, error) { contractRegistryCoordinator, err := regcoord.NewContractRegistryCoordinator(registryCoordinatorAddr, ethclient) if err != nil { return nil, err From 8a16a93038903829244a8f3d078552fbe291f75d Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 17:56:51 -0300 Subject: [PATCH 14/36] fixing avs writer and reader --- core/chainio/avs_reader.go | 2 +- core/chainio/avs_writer.go | 6 +++--- core/config/config.go | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/chainio/avs_reader.go b/core/chainio/avs_reader.go index 0b709b64..890a4c61 100644 --- a/core/chainio/avs_reader.go +++ b/core/chainio/avs_reader.go @@ -33,7 +33,7 @@ type AvsReader struct { //var _ AvsReaderer = (*AvsReader)(nil) func BuildAvsReaderFromConfig(c *config.Config) (*AvsReader, error) { - return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) + return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, &c.EthHttpClient, c.Logger) } func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.HttpBackend, logger logging.Logger) (*AvsReader, error) { avsManagersBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index e19bd77a..2be49437 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -54,13 +54,13 @@ func BuildAvsWriterFromConfig(c *config.Config) (*AvsWriter, error) { return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) } -func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.HttpBackend, logger logging.Logger) (*AvsWriter, error) { - avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) +func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.InstrumentedClient, logger logging.Logger) (*AvsWriter, error) { + avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ðHttpClient, logger) if err != nil { logger.Error("Failed to create contract bindings", "err", err) return nil, err } - avsRegistryWriter, err := avsregistry.BuildAvsRegistryChainWriter(registryCoordinatorAddr, operatorStateRetrieverAddr, logger, ethHttpClient, txMgr) + avsRegistryWriter, err := avsregistry.BuildAvsRegistryChainWriter(registryCoordinatorAddr, operatorStateRetrieverAddr, logger, ðHttpClient, txMgr) if err != nil { return nil, err } diff --git a/core/config/config.go b/core/config/config.go index 7ecff9d5..02a9fc1f 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -32,7 +32,7 @@ type Config struct { // only take an ethclient or an rpcUrl (and build the ethclient at each constructor site) EthHttpRpcUrl string EthWsRpcUrl string - EthHttpClient eth.HttpBackend + EthHttpClient eth.InstrumentedClient EthWsClient eth.WsBackend OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address @@ -90,6 +90,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } + ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) ethWsClient, err := ethclient.Dial(configRaw.EthWsUrl) if err != nil { @@ -134,7 +135,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { Logger: logger, EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, - EthHttpClient: ethRpcClient, + EthHttpClient: *ethRpcClientInstrumented, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), From 74e13e9fb3ebc8c1de549f9a409a9fcb310bb6b0 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 18:52:10 -0300 Subject: [PATCH 15/36] AvsWriterer and AvsReaderer fixed --- core/chainio/avs_reader.go | 11 ++++++++++- core/chainio/avs_writer.go | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/chainio/avs_reader.go b/core/chainio/avs_reader.go index 890a4c61..92bcb9ac 100644 --- a/core/chainio/avs_reader.go +++ b/core/chainio/avs_reader.go @@ -4,6 +4,7 @@ import ( "context" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" gethcommon "github.com/ethereum/go-ethereum/common" sdkavsregistry "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" @@ -16,12 +17,20 @@ import ( ) type AvsReaderer interface { - sdkavsregistry.ChainReader + //sdkavsregistry.ChainReader CheckSignatures( ctx context.Context, msgHash [32]byte, quorumNumbers []byte, referenceBlockNumber uint32, nonSignerStakesAndSignature cstaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature, ) (cstaskmanager.IBLSSignatureCheckerQuorumStakeTotals, error) GetErc20Mock(ctx context.Context, tokenAddr gethcommon.Address) (*erc20mock.ContractERC20Mock, error) + GetOperatorId( + opts *bind.CallOpts, + operatorAddress common.Address, + ) ([32]byte, error) + IsOperatorRegistered( + opts *bind.CallOpts, + operatorAddress common.Address, + ) (bool, error) } type AvsReader struct { diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index 2be49437..b772cc58 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -18,7 +18,7 @@ import ( ) type AvsWriterer interface { - avsregistry.ChainWriter + //avsregistry.ChainWriter SendNewTaskNumberToSquare( ctx context.Context, From 253ea2b7ba32fe6352b966ec03c78a034f7a276c Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 18:52:23 -0300 Subject: [PATCH 16/36] operator.go fixed --- operator/operator.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/operator/operator.go b/operator/operator.go index 4296f169..e53b4e04 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -40,7 +40,7 @@ const SEM_VER = "0.0.1" type Operator struct { config types.NodeConfig logger logging.Logger - ethClient eth.Client + ethClient eth.InstrumentedClient // TODO(samlaf): remove both avsWriter and eigenlayerWrite from operator // they are only used for registration, so we should make a special registration package // this way, auditing this operator code makes it obvious that operators don't need to @@ -52,8 +52,8 @@ type Operator struct { avsWriter *chainio.AvsWriter avsReader chainio.AvsReaderer avsSubscriber chainio.AvsSubscriberer - eigenlayerReader sdkelcontracts.ELReader - eigenlayerWriter sdkelcontracts.ELWriter + eigenlayerReader sdkelcontracts.ChainReader + eigenlayerWriter sdkelcontracts.ChainWriter blsKeypair *bls.KeyPair operatorId sdktypes.OperatorId operatorAddr common.Address @@ -88,7 +88,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { // Setup Node Api nodeApi := nodeapi.NewNodeApi(AVS_NAME, SEM_VER, c.NodeApiIpPortAddress, logger) - var ethRpcClient, ethWsClient eth.Client + var ethRpcClient, ethWsClient *eth.InstrumentedClient if c.EnableMetrics { rpcCallsCollector := rpccalls.NewCollector(AVS_NAME, reg) ethRpcClient, err = eth.NewInstrumentedClient(c.EthRpcUrl, rpcCallsCollector) @@ -102,12 +102,12 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { return nil, err } } else { - ethRpcClient, err = eth.NewClient(c.EthRpcUrl) + ethRpcClient, err = eth.NewInstrumentedClient(c.EthRpcUrl, nil) if err != nil { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethWsClient, err = eth.NewClient(c.EthWsUrl) + ethWsClient, err = eth.NewInstrumentedClient(c.EthWsUrl, nil) if err != nil { logger.Errorf("Cannot create ws ethclient", "err", err) return nil, err @@ -171,7 +171,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(c.AVSRegistryCoordinatorAddress), - common.HexToAddress(c.OperatorStateRetrieverAddress), ethRpcClient, logger, + common.HexToAddress(c.OperatorStateRetrieverAddress), *ethRpcClient, logger, ) if err != nil { logger.Error("Cannot create AvsWriter", "err", err) @@ -216,12 +216,12 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { metricsReg: reg, metrics: avsAndEigenMetrics, nodeApi: nodeApi, - ethClient: ethRpcClient, + ethClient: *ethRpcClient, avsWriter: avsWriter, avsReader: avsReader, avsSubscriber: avsSubscriber, - eigenlayerReader: sdkClients.ElChainReader, - eigenlayerWriter: sdkClients.ElChainWriter, + eigenlayerReader: *sdkClients.ElChainReader, + eigenlayerWriter: *sdkClients.ElChainWriter, blsKeypair: blsKeyPair, operatorAddr: common.HexToAddress(c.OperatorAddress), aggregatorServerIpPortAddr: c.AggregatorServerIpPortAddress, From 5fdb7d77b44140e62902caf5aa3fce66eea94538 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 18:57:47 -0300 Subject: [PATCH 17/36] registration.go fixed --- operator/registration.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/operator/registration.go b/operator/registration.go index 82ab321f..a1ddcbb9 100644 --- a/operator/registration.go +++ b/operator/registration.go @@ -54,7 +54,7 @@ func (o *Operator) RegisterOperatorWithEigenlayer() error { Address: o.operatorAddr.String(), DelegationApproverAddress: o.operatorAddr.String(), } - _, err := o.eigenlayerWriter.RegisterAsOperator(context.Background(), op) + _, err := o.eigenlayerWriter.RegisterAsOperator(context.Background(), op, true) if err != nil { o.logger.Error("Error registering operator with eigenlayer", "err", err) return err @@ -85,7 +85,7 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big. return err } - _, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount) + _, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount, true) if err != nil { o.logger.Errorf("Error depositing into strategy", "err", err) return err @@ -116,8 +116,9 @@ func (o *Operator) RegisterOperatorWithAvs( _, err = o.avsWriter.RegisterOperatorInQuorumWithAVSRegistryCoordinator( context.Background(), operatorEcdsaKeyPair, operatorToAvsRegistrationSigSalt, operatorToAvsRegistrationSigExpiry, - o.blsKeypair, quorumNumbers, socket, + o.blsKeypair, quorumNumbers, socket, true, ) + if err != nil { o.logger.Errorf("Unable to register operator with avs registry coordinator") return err From da50d14b704aa2bfde009434d5dc923f4e14a1cb Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 18:58:01 -0300 Subject: [PATCH 18/36] aggregator.go fixed --- aggregator/aggregator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 6f788630..73c76e8b 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -14,6 +14,7 @@ import ( sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" "github.com/Layr-Labs/eigensdk-go/services/avsregistry" blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation" + "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo" oprsinfoserv "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo" sdktypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" @@ -107,7 +108,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { return nil, err } - operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, c.Logger) + operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, nil, operatorsinfo.Opts{}, c.Logger) hashFunction := func(taskResponse sdktypes.TaskResponse) (sdktypes.TaskResponseDigest, error) { taskResponseBytes, err := json.Marshal(taskResponse) From 4880aafbaef02f90a79ae40b6b106224190f449c Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 18:58:14 -0300 Subject: [PATCH 19/36] RegisterOperatorInQuorumWithAVSRegistryCoordinator in main.go fixed --- plugin/cmd/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index 4df69e06..0f5d7123 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -184,7 +184,7 @@ func plugin(ctx *cli.Context) { r, err := clients.AvsRegistryChainWriter.RegisterOperatorInQuorumWithAVSRegistryCoordinator( goCtx, operatorEcdsaPrivateKey, operatorToAvsRegistrationSigSalt, operatorToAvsRegistrationSigExpiry, - blsKeypair, quorumNumbers, socket, + blsKeypair, quorumNumbers, socket, true, ) if err != nil { logger.Errorf("Error assembling CreateNewTask tx") From db0e8c70fb33b2ce1521d745bc0717517c9bd171 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 19:04:33 -0300 Subject: [PATCH 20/36] main.go fixed --- plugin/cmd/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index 0f5d7123..cb21a7a3 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -23,6 +23,7 @@ import ( "github.com/Layr-Labs/incredible-squaring-avs/types" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" "github.com/urfave/cli" ) @@ -104,7 +105,7 @@ func plugin(ctx *cli.Context) { PromMetricsIpPortAddress: avsConfig.EigenMetricsIpPortAddress, } logger, _ := logging.NewZapLogger(logging.Development) - ethHttpClient, err := eth.NewClient(avsConfig.EthRpcUrl) + ethHttpClient, err := ethclient.Dial(avsConfig.EthRpcUrl) if err != nil { fmt.Println("can't connect to eth client") fmt.Println(err) @@ -152,11 +153,12 @@ func plugin(ctx *cli.Context) { return } txMgr := txmgr.NewSimpleTxManager(skWallet, ethHttpClient, logger, common.HexToAddress(avsConfig.OperatorAddress)) + ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethHttpClient, nil) avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(avsConfig.AVSRegistryCoordinatorAddress), common.HexToAddress(avsConfig.OperatorStateRetrieverAddress), - ethHttpClient, + *ethRpcClientInstrumented, logger, ) if err != nil { From 1210835d9fb696cf388cb13e3eeb6ee8b0fec62e Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 9 Oct 2024 19:04:45 -0300 Subject: [PATCH 21/36] integration_test.go fixed --- tests/integration/integration_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 963cc173..dd510f8e 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" ) @@ -60,11 +61,11 @@ func TestIntegration(t *testing.T) { if err != nil { t.Fatalf("Failed to create logger: %s", err.Error()) } - ethRpcClient, err := eth.NewClient(aggConfigRaw.EthRpcUrl) + ethRpcClient, err := ethclient.Dial(aggConfigRaw.EthRpcUrl) if err != nil { t.Fatalf("Failed to create eth client: %s", err.Error()) } - ethWsClient, err := eth.NewClient(aggConfigRaw.EthWsUrl) + ethWsClient, err := ethclient.Dial(aggConfigRaw.EthWsUrl) if err != nil { t.Fatalf("Failed to create eth client: %s", err.Error()) } @@ -97,11 +98,13 @@ func TestIntegration(t *testing.T) { } txMgr := txmgr.NewSimpleTxManager(skWallet, ethRpcClient, logger, aggregatorAddr) + ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) + config := &config.Config{ EcdsaPrivateKey: aggregatorEcdsaPrivateKey, Logger: logger, EthHttpRpcUrl: aggConfigRaw.EthRpcUrl, - EthHttpClient: ethRpcClient, + EthHttpClient: *ethRpcClientInstrumented, EthWsRpcUrl: aggConfigRaw.EthWsUrl, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), From fef94ea0a3136b26712f13a799c61860f8ed5b29 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Thu, 10 Oct 2024 16:39:00 -0300 Subject: [PATCH 22/36] challenger fixed --- aggregator/aggregator_test.go | 2 +- challenger/challenger.go | 11 ++++++++--- challenger/challenger_test.go | 4 +--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index 6fabdf98..b97b42f1 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -81,7 +81,7 @@ func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTask(arg0, arg1, a } // ProcessNewSignature mocks base method. -func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 sdktypes.Bytes32, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error { +func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 interface{}, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ProcessNewSignature", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(error) diff --git a/challenger/challenger.go b/challenger/challenger.go index 5e96f8aa..f11dfd37 100644 --- a/challenger/challenger.go +++ b/challenger/challenger.go @@ -5,20 +5,25 @@ import ( "context" "math/big" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/ethereum/go-ethereum/accounts/abi" + commoneth "github.com/ethereum/go-ethereum/common" + typeseth "github.com/ethereum/go-ethereum/core/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/types" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" ) +type ChallengerClient interface { + TransactionByHash(ctx context.Context, hash commoneth.Hash) (tx *typeseth.Transaction, isPending bool, err error) +} + type Challenger struct { logger logging.Logger - ethClient eth.InstrumentedClient + ethClient ChallengerClient avsReader chainio.AvsReaderer avsWriter chainio.AvsWriterer avsSubscriber chainio.AvsSubscriberer @@ -48,7 +53,7 @@ func NewChallenger(c *config.Config) (*Challenger, error) { challenger := &Challenger{ logger: c.Logger, - ethClient: c.EthHttpClient, + ethClient: &c.EthHttpClient, avsReader: avsReader, avsWriter: avsWriter, avsSubscriber: avsSubscriber, diff --git a/challenger/challenger_test.go b/challenger/challenger_test.go index 68e6edef..e3f6db6d 100644 --- a/challenger/challenger_test.go +++ b/challenger/challenger_test.go @@ -6,7 +6,6 @@ import ( "reflect" "testing" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/testutils" aggtypes "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/mocks" @@ -238,13 +237,12 @@ func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomoc mockAvsReader := chainiomocks.NewMockAvsReaderer(mockCtrl) mockAvsSubscriber := chainiomocks.NewMockAvsSubscriberer(mockCtrl) mockEthClient := NewMockEthClient(mockCtrl) - mockEthClientInstrumented, _ := eth.NewInstrumentedClient("", nil) // TODO, add RPC URL challenger := &Challenger{ logger: logger, avsWriter: mockAvsWriter, avsReader: mockAvsReader, - ethClient: *mockEthClientInstrumented, + ethClient: mockEthClient, avsSubscriber: mockAvsSubscriber, tasks: make(map[uint32]cstaskmanager.IIncredibleSquaringTaskManagerTask), taskResponses: make(map[uint32]chtypes.TaskResponseData), From 4e032081a61e03bc80668432d49ad84d39d36532 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Mon, 14 Oct 2024 16:22:14 -0300 Subject: [PATCH 23/36] Adding interface EthClientInterface --- common/abi.go | 26 ++++++++++++++++++++++++++ core/chainio/avs_writer.go | 11 ++++++----- core/chainio/bindings.go | 3 ++- core/config/config.go | 5 ++--- operator/operator.go | 14 ++++++++------ plugin/cmd/main.go | 4 +--- tests/integration/integration_test.go | 5 +---- 7 files changed, 46 insertions(+), 22 deletions(-) diff --git a/common/abi.go b/common/abi.go index c93fe157..3e048272 100644 --- a/common/abi.go +++ b/common/abi.go @@ -1,8 +1,34 @@ package common import ( + "context" _ "embed" + "math/big" + + "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) //go:embed abis/IncredibleSquaringTaskManager.json var IncredibleSquaringTaskManagerAbi []byte + +type EthClientInterface interface { + wallet.EthBackend + TransactionByHash(context.Context, common.Hash) (*types.Transaction, bool, error) + ChainID(ctx context.Context) (*big.Int, error) + + SuggestGasTipCap(ctx context.Context) (*big.Int, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) + CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + BlockNumber(ctx context.Context) (uint64, error) + CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) + PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) + PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SuggestGasPrice(ctx context.Context) (*big.Int, error) +} diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index b772cc58..8ccf7b91 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -4,6 +4,7 @@ import ( "context" "math/big" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -48,19 +49,19 @@ type AvsWriter struct { client eth.HttpBackend } -//var _ AvsWriterer = (*AvsWriter)(nil) +var _ AvsWriterer = (*AvsWriter)(nil) func BuildAvsWriterFromConfig(c *config.Config) (*AvsWriter, error) { - return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) + return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, &c.EthHttpClient, c.Logger) } -func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.InstrumentedClient, logger logging.Logger) (*AvsWriter, error) { - avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ðHttpClient, logger) +func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsWriter, error) { + avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { logger.Error("Failed to create contract bindings", "err", err) return nil, err } - avsRegistryWriter, err := avsregistry.BuildAvsRegistryChainWriter(registryCoordinatorAddr, operatorStateRetrieverAddr, logger, ðHttpClient, txMgr) + avsRegistryWriter, err := avsregistry.BuildAvsRegistryChainWriter(registryCoordinatorAddr, operatorStateRetrieverAddr, logger, ethHttpClient, txMgr) if err != nil { return nil, err } diff --git a/core/chainio/bindings.go b/core/chainio/bindings.go index f42ac9fa..617b6a3b 100644 --- a/core/chainio/bindings.go +++ b/core/chainio/bindings.go @@ -9,6 +9,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" erc20mock "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/ERC20Mock" csservicemanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringServiceManager" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" @@ -21,7 +22,7 @@ type AvsManagersBindings struct { logger logging.Logger } -func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient eth.HttpBackend, logger logging.Logger) (*AvsManagersBindings, error) { +func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsManagersBindings, error) { contractRegistryCoordinator, err := regcoord.NewContractRegistryCoordinator(registryCoordinatorAddr, ethclient) if err != nil { return nil, err diff --git a/core/config/config.go b/core/config/config.go index 02a9fc1f..e9d727be 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -32,7 +32,7 @@ type Config struct { // only take an ethclient or an rpcUrl (and build the ethclient at each constructor site) EthHttpRpcUrl string EthWsRpcUrl string - EthHttpClient eth.InstrumentedClient + EthHttpClient ethclient.Client EthWsClient eth.WsBackend OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address @@ -90,7 +90,6 @@ func NewConfig(ctx *cli.Context) (*Config, error) { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) ethWsClient, err := ethclient.Dial(configRaw.EthWsUrl) if err != nil { @@ -135,7 +134,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { Logger: logger, EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, - EthHttpClient: *ethRpcClientInstrumented, + EthHttpClient: *ethRpcClient, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), diff --git a/operator/operator.go b/operator/operator.go index e53b4e04..b415cbf8 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -8,9 +8,11 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" "github.com/prometheus/client_golang/prometheus" "github.com/Layr-Labs/incredible-squaring-avs/aggregator" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" @@ -40,7 +42,7 @@ const SEM_VER = "0.0.1" type Operator struct { config types.NodeConfig logger logging.Logger - ethClient eth.InstrumentedClient + ethClient sdkcommon.EthClientInterface // TODO(samlaf): remove both avsWriter and eigenlayerWrite from operator // they are only used for registration, so we should make a special registration package // this way, auditing this operator code makes it obvious that operators don't need to @@ -88,7 +90,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { // Setup Node Api nodeApi := nodeapi.NewNodeApi(AVS_NAME, SEM_VER, c.NodeApiIpPortAddress, logger) - var ethRpcClient, ethWsClient *eth.InstrumentedClient + var ethRpcClient, ethWsClient sdkcommon.EthClientInterface if c.EnableMetrics { rpcCallsCollector := rpccalls.NewCollector(AVS_NAME, reg) ethRpcClient, err = eth.NewInstrumentedClient(c.EthRpcUrl, rpcCallsCollector) @@ -102,12 +104,12 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { return nil, err } } else { - ethRpcClient, err = eth.NewInstrumentedClient(c.EthRpcUrl, nil) + ethRpcClient, err = ethclient.Dial(c.EthRpcUrl) if err != nil { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethWsClient, err = eth.NewInstrumentedClient(c.EthWsUrl, nil) + ethWsClient, err = ethclient.Dial(c.EthWsUrl) if err != nil { logger.Errorf("Cannot create ws ethclient", "err", err) return nil, err @@ -171,7 +173,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(c.AVSRegistryCoordinatorAddress), - common.HexToAddress(c.OperatorStateRetrieverAddress), *ethRpcClient, logger, + common.HexToAddress(c.OperatorStateRetrieverAddress), ethRpcClient, logger, ) if err != nil { logger.Error("Cannot create AvsWriter", "err", err) @@ -216,7 +218,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { metricsReg: reg, metrics: avsAndEigenMetrics, nodeApi: nodeApi, - ethClient: *ethRpcClient, + ethClient: ethRpcClient, avsWriter: avsWriter, avsReader: avsReader, avsSubscriber: avsSubscriber, diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index cb21a7a3..f441ed7d 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -9,7 +9,6 @@ import ( "time" sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" @@ -153,12 +152,11 @@ func plugin(ctx *cli.Context) { return } txMgr := txmgr.NewSimpleTxManager(skWallet, ethHttpClient, logger, common.HexToAddress(avsConfig.OperatorAddress)) - ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethHttpClient, nil) avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(avsConfig.AVSRegistryCoordinatorAddress), common.HexToAddress(avsConfig.OperatorStateRetrieverAddress), - *ethRpcClientInstrumented, + ethHttpClient, logger, ) if err != nil { diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index dd510f8e..d71cc2ad 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -11,7 +11,6 @@ import ( "time" "github.com/Layr-Labs/eigensdk-go/chainio/clients" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" @@ -98,13 +97,11 @@ func TestIntegration(t *testing.T) { } txMgr := txmgr.NewSimpleTxManager(skWallet, ethRpcClient, logger, aggregatorAddr) - ethRpcClientInstrumented := eth.NewInstrumentedClientFromClient(ethRpcClient, nil) - config := &config.Config{ EcdsaPrivateKey: aggregatorEcdsaPrivateKey, Logger: logger, EthHttpRpcUrl: aggConfigRaw.EthRpcUrl, - EthHttpClient: *ethRpcClientInstrumented, + EthHttpClient: *ethRpcClient, EthWsRpcUrl: aggConfigRaw.EthWsUrl, EthWsClient: ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), From e607abab46458c01b3711e9f311734530a6fe24b Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Mon, 14 Oct 2024 16:56:12 -0300 Subject: [PATCH 24/36] fix errors with pointers --- core/chainio/avs_reader.go | 4 ++-- core/chainio/avs_subscriber.go | 6 +++--- core/config/config.go | 5 ++--- tests/integration/integration_test.go | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/chainio/avs_reader.go b/core/chainio/avs_reader.go index 92bcb9ac..19d4d1f1 100644 --- a/core/chainio/avs_reader.go +++ b/core/chainio/avs_reader.go @@ -8,9 +8,9 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" sdkavsregistry "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" logging "github.com/Layr-Labs/eigensdk-go/logging" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" erc20mock "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/ERC20Mock" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/config" @@ -44,7 +44,7 @@ type AvsReader struct { func BuildAvsReaderFromConfig(c *config.Config) (*AvsReader, error) { return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, &c.EthHttpClient, c.Logger) } -func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.HttpBackend, logger logging.Logger) (*AvsReader, error) { +func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsReader, error) { avsManagersBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { return nil, err diff --git a/core/chainio/avs_subscriber.go b/core/chainio/avs_subscriber.go index 08f7b056..d0c6a488 100644 --- a/core/chainio/avs_subscriber.go +++ b/core/chainio/avs_subscriber.go @@ -6,9 +6,9 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/config" ) @@ -32,12 +32,12 @@ func BuildAvsSubscriberFromConfig(config *config.Config) (*AvsSubscriber, error) return BuildAvsSubscriber( config.IncredibleSquaringRegistryCoordinatorAddr, config.OperatorStateRetrieverAddr, - config.EthWsClient, + &config.EthWsClient, config.Logger, ) } -func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient eth.WsBackend, logger sdklogging.Logger) (*AvsSubscriber, error) { +func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient sdkcommon.EthClientInterface, logger sdklogging.Logger) (*AvsSubscriber, error) { avsContractBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, blsOperatorStateRetrieverAddr, ethclient, logger) if err != nil { logger.Errorf("Failed to create contract bindings", "err", err) diff --git a/core/config/config.go b/core/config/config.go index e9d727be..56058a2d 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -10,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/urfave/cli" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" "github.com/Layr-Labs/eigensdk-go/crypto/bls" @@ -33,7 +32,7 @@ type Config struct { EthHttpRpcUrl string EthWsRpcUrl string EthHttpClient ethclient.Client - EthWsClient eth.WsBackend + EthWsClient ethclient.Client OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address AggregatorServerIpPortAddr string @@ -135,7 +134,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, EthHttpClient: *ethRpcClient, - EthWsClient: ethWsClient, + EthWsClient: *ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), AggregatorServerIpPortAddr: configRaw.AggregatorServerIpPortAddr, diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index d71cc2ad..b853277e 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -103,7 +103,7 @@ func TestIntegration(t *testing.T) { EthHttpRpcUrl: aggConfigRaw.EthRpcUrl, EthHttpClient: *ethRpcClient, EthWsRpcUrl: aggConfigRaw.EthWsUrl, - EthWsClient: ethWsClient, + EthWsClient: *ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), AggregatorServerIpPortAddr: aggConfigRaw.AggregatorServerIpPortAddr, From cb9225becea29c12443c4c1fda264b9d64263139 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 15 Oct 2024 11:11:18 -0300 Subject: [PATCH 25/36] aggregator hash function fixed to match the one used by the operator --- aggregator/aggregator.go | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 73c76e8b..3691c742 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -2,13 +2,13 @@ package aggregator import ( "context" - "crypto/sha256" - "encoding/json" "math/big" "sync" "time" "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/ethereum/go-ethereum/accounts/abi" + "golang.org/x/crypto/sha3" "github.com/Layr-Labs/eigensdk-go/chainio/clients" sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" @@ -110,12 +110,43 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, nil, operatorsinfo.Opts{}, c.Logger) + // This is the same hash function used by the operator to hash the task response before signing it. hashFunction := func(taskResponse sdktypes.TaskResponse) (sdktypes.TaskResponseDigest, error) { - taskResponseBytes, err := json.Marshal(taskResponse) + // The order here has to match the field ordering of cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse + taskResponseType, err := abi.NewType("tuple", "", []abi.ArgumentMarshaling{ + { + Name: "referenceTaskIndex", + Type: "uint32", + }, + { + Name: "numberSquared", + Type: "uint256", + }, + }) if err != nil { return sdktypes.TaskResponseDigest{}, err } - return sdktypes.TaskResponseDigest(sha256.Sum256(taskResponseBytes)), nil + arguments := abi.Arguments{ + { + Type: taskResponseType, + }, + } + + encodeTaskResponseByte, err := arguments.Pack(taskResponse) + if err != nil { + return sdktypes.TaskResponseDigest{}, err + } + + if err != nil { + return sdktypes.TaskResponseDigest{}, err + } + + var taskResponseDigest [32]byte + hasher := sha3.NewLegacyKeccak256() + hasher.Write(encodeTaskResponseByte) + copy(taskResponseDigest[:], hasher.Sum(nil)[:32]) + + return taskResponseDigest, nil } avsRegistryService := avsregistry.NewAvsRegistryServiceChainCaller(avsReader, operatorPubkeysService, c.Logger) From fdb994279a16cdf6e091ca20a36602af654964e2 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 15 Oct 2024 15:38:23 -0300 Subject: [PATCH 26/36] removing extra if err != nil --- aggregator/aggregator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 3691c742..e0d5190a 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -2,6 +2,7 @@ package aggregator import ( "context" + "fmt" "math/big" "sync" "time" @@ -124,6 +125,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { }, }) if err != nil { + fmt.Println("Error creating taskResponseType") return sdktypes.TaskResponseDigest{}, err } arguments := abi.Arguments{ @@ -134,10 +136,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { encodeTaskResponseByte, err := arguments.Pack(taskResponse) if err != nil { - return sdktypes.TaskResponseDigest{}, err - } - - if err != nil { + fmt.Println("Error Packing taskResponse") return sdktypes.TaskResponseDigest{}, err } From aae8ccd1a9630a4f8891e2a66e3c9d7bf684ebe0 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 15 Oct 2024 18:11:32 -0300 Subject: [PATCH 27/36] try 3 times to get responses from task manager --- tests/integration/integration_test.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index b853277e..61c90487 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -175,16 +175,24 @@ func TestIntegration(t *testing.T) { t.Fatalf("Task hash is empty") } - // check if the task response is recorded in the contract for task index 1 - taskResponseHash, err := avsReader.AvsServiceBindings.TaskManager.AllTaskResponses(&bind.CallOpts{}, 1) - log.Printf("taskResponseHash: %v", taskResponseHash) - if err != nil { - t.Fatalf("Cannot get task response hash: %s", err.Error()) - } - if taskResponseHash == [32]byte{} { + received := false + for i := 0; i < 3; i++ { + // check if the task response is recorded in the contract for task index 1 + taskResponseHash, err := avsReader.AvsServiceBindings.TaskManager.AllTaskResponses(&bind.CallOpts{}, 1) + log.Printf("taskResponseHash: %v", taskResponseHash) + if err != nil { + t.Fatalf("Cannot get task response hash: %s", err.Error()) + } + + if taskResponseHash != [32]byte{} { + received = true + break + } + } + + if !received { t.Fatalf("Task response hash is empty") } - } // TODO(samlaf): have to advance chain to a block where the task is answered From 0bcc22b914ad880ca7e32ce01af95cc811e175ec Mon Sep 17 00:00:00 2001 From: tomasarrachea Date: Wed, 16 Oct 2024 17:54:15 -0300 Subject: [PATCH 28/36] pin foundry version for tests --- tests/integration/integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 61c90487..7f22fa3e 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -204,7 +204,7 @@ func startAnvilTestContainer() testcontainers.Container { ctx := context.Background() req := testcontainers.ContainerRequest{ - Image: "ghcr.io/foundry-rs/foundry:latest", + Image: "ghcr.io/foundry-rs/foundry:nightly-3abac322efdb69e27b6fe8748b72754ae878f64d@sha256:871b66957335636a02c6c324c969db9adb1d6d64f148753c4a986cf32a40dc3c", Mounts: testcontainers.ContainerMounts{ testcontainers.ContainerMount{ Source: testcontainers.GenericBindMountSource{ From a7824da01240b031722466873916471b45456719 Mon Sep 17 00:00:00 2001 From: tomasarrachea Date: Fri, 18 Oct 2024 12:31:43 -0300 Subject: [PATCH 29/36] fix aggregator task response processing --- aggregator/aggregator.go | 2 +- aggregator/rpc_server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index e0d5190a..f09f4935 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -136,7 +136,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { encodeTaskResponseByte, err := arguments.Pack(taskResponse) if err != nil { - fmt.Println("Error Packing taskResponse") + c.Logger.Error("Error Packing taskResponse", err) return sdktypes.TaskResponseDigest{}, err } diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index c7027bbe..a07f5e81 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -65,7 +65,7 @@ func (agg *Aggregator) ProcessSignedTaskResponse(signedTaskResponse *SignedTaskR agg.taskResponsesMu.Unlock() err = agg.blsAggregationService.ProcessNewSignature( - context.Background(), taskIndex, taskResponseDigest, + context.Background(), taskIndex, signedTaskResponse.TaskResponse, &signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId, ) return err From fae8ffd30f86209ed1e1f21d67cc5c1e1f45bf03 Mon Sep 17 00:00:00 2001 From: tomasarrachea Date: Fri, 18 Oct 2024 12:45:06 -0300 Subject: [PATCH 30/36] fix aggregator test --- aggregator/aggregator.go | 3 +-- aggregator/rpc_server_test.go | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index f09f4935..e3f3116a 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -2,7 +2,6 @@ package aggregator import ( "context" - "fmt" "math/big" "sync" "time" @@ -125,7 +124,7 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { }, }) if err != nil { - fmt.Println("Error creating taskResponseType") + c.Logger.Error("Error creating taskResponseType") return sdktypes.TaskResponseDigest{}, err } arguments := abi.Arguments{ diff --git a/aggregator/rpc_server_test.go b/aggregator/rpc_server_test.go index 6de6c99f..5997a1ef 100644 --- a/aggregator/rpc_server_test.go +++ b/aggregator/rpc_server_test.go @@ -48,13 +48,11 @@ func TestProcessSignedTaskResponse(t *testing.T) { NumberToSquare: NUMBER_TO_SQUARE, }, *MOCK_OPERATOR_KEYPAIR) assert.Nil(t, err) - signedTaskResponseDigest, err := core.GetTaskResponseDigest(&signedTaskResponse.TaskResponse) - assert.Nil(t, err) // TODO(samlaf): is this the right way to test writing to external service? // or is there some wisdom to "don't mock 3rd party code"? // see https://hynek.me/articles/what-to-mock-in-5-mins/ - mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponseDigest, + mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponse.TaskResponse, &signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId) err = aggregator.ProcessSignedTaskResponse(signedTaskResponse, nil) assert.Nil(t, err) From ac306302d9e2891b80a44ef37fcf90f9a9a00ea2 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Mon, 11 Nov 2024 17:45:58 -0300 Subject: [PATCH 31/36] cli/actions fixed (ReadYamlConfig moved here) --- cli/actions/deposit_into_strategy.go | 3 +- cli/actions/print_operator_status.go | 3 +- cli/actions/read_config.go | 35 +++++++++++++++++++ cli/actions/register_operator_with_avs.go | 3 +- .../register_operator_with_eigenlayer.go | 6 ++-- go.mod | 5 +-- go.sum | 6 ++++ 7 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 cli/actions/read_config.go diff --git a/cli/actions/deposit_into_strategy.go b/cli/actions/deposit_into_strategy.go index 0ccf9bdf..06a2235f 100644 --- a/cli/actions/deposit_into_strategy.go +++ b/cli/actions/deposit_into_strategy.go @@ -6,7 +6,6 @@ import ( "log" "math/big" - sdkutils "github.com/Layr-Labs/eigensdk-go/utils" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -18,7 +17,7 @@ func DepositIntoStrategy(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := sdkutils.ReadYamlConfig(configPath, &nodeConfig) + err := ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/print_operator_status.go b/cli/actions/print_operator_status.go index 88bdcf95..e40e98c3 100644 --- a/cli/actions/print_operator_status.go +++ b/cli/actions/print_operator_status.go @@ -4,7 +4,6 @@ import ( "encoding/json" "log" - sdkutils "github.com/Layr-Labs/eigensdk-go/utils" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -15,7 +14,7 @@ func PrintOperatorStatus(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := sdkutils.ReadYamlConfig(configPath, &nodeConfig) + err := ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/read_config.go b/cli/actions/read_config.go new file mode 100644 index 00000000..b01f2455 --- /dev/null +++ b/cli/actions/read_config.go @@ -0,0 +1,35 @@ +package actions + +import ( + "errors" + "log" + "os" + "path/filepath" + + "gopkg.in/yaml.v3" +) + +func ReadYamlConfig(path string, o interface{}) error { + if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { + log.Fatal("Path ", path, " does not exist") + } + b, err := ReadFile(path) + if err != nil { + return err + } + + err = yaml.Unmarshal(b, o) + if err != nil { + log.Fatalf("unable to parse file with error %#v", err) + } + + return nil +} + +func ReadFile(path string) ([]byte, error) { + b, err := os.ReadFile(filepath.Clean(path)) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/cli/actions/register_operator_with_avs.go b/cli/actions/register_operator_with_avs.go index e2a19342..8f8e14dd 100644 --- a/cli/actions/register_operator_with_avs.go +++ b/cli/actions/register_operator_with_avs.go @@ -6,7 +6,6 @@ import ( "os" sdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" - sdkutils "github.com/Layr-Labs/eigensdk-go/utils" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -17,7 +16,7 @@ func RegisterOperatorWithAvs(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := sdkutils.ReadYamlConfig(configPath, &nodeConfig) + err := ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/register_operator_with_eigenlayer.go b/cli/actions/register_operator_with_eigenlayer.go index 53ff3134..12bda8c3 100644 --- a/cli/actions/register_operator_with_eigenlayer.go +++ b/cli/actions/register_operator_with_eigenlayer.go @@ -2,10 +2,10 @@ package actions import ( "encoding/json" - "github.com/urfave/cli" "log" - sdkutils "github.com/Layr-Labs/eigensdk-go/utils" + "github.com/urfave/cli" + "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -15,7 +15,7 @@ func RegisterOperatorWithEigenlayer(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := sdkutils.ReadYamlConfig(configPath, &nodeConfig) + err := ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/go.mod b/go.mod index f250db6f..d1ec0907 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.21.0 require ( - github.com/Layr-Labs/eigensdk-go v0.1.12 + github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469 github.com/ethereum/go-ethereum v1.14.0 github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 @@ -59,7 +59,7 @@ require ( github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.5+incompatible // indirect + github.com/docker/docker v25.0.6+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/ethereum/c-kzg-4844 v1.0.0 // indirect @@ -108,6 +108,7 @@ require ( github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/posthog/posthog-go v1.2.24 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.48.0 // indirect diff --git a/go.sum b/go.sum index 435f6b31..d88711d7 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775 h1:xQQ4xnl github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775/go.mod h1:ECU8/Ocsf+dGcN2rs8I1PScq4dOkQqY+vgwnq30Ov4M= github.com/Layr-Labs/eigensdk-go v0.1.12 h1:Drf59iJLvnTm2Om9AwAyUMiZeJaTI8ZameIrnhjopSY= github.com/Layr-Labs/eigensdk-go v0.1.12/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469 h1:zBmTZdIio/xzftdBvyCOLMGtRhmmqRbwSufHjL5dNbI= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -140,6 +142,8 @@ github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+ github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg= +github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -390,6 +394,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posthog/posthog-go v1.2.24 h1:A+iG4saBJemo++VDlcWovbYf8KFFNUfrCoJtsc40RPA= +github.com/posthog/posthog-go v1.2.24/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= From 86fdfffe7e9f42cf03a7694c0a5a31d9e4edc9f2 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Mon, 11 Nov 2024 18:03:38 -0300 Subject: [PATCH 32/36] Read config fixed --- cli/actions/deposit_into_strategy.go | 3 ++- cli/actions/print_operator_status.go | 3 ++- cli/actions/register_operator_with_avs.go | 3 ++- .../register_operator_with_eigenlayer.go | 3 ++- {cli/actions => common}/read_config.go | 17 ++++++++++++++++- core/config/config.go | 6 ++++-- operator/cmd/main.go | 6 +++--- plugin/cmd/main.go | 5 +++-- tests/integration/integration_test.go | 8 +++++--- 9 files changed, 39 insertions(+), 15 deletions(-) rename {cli/actions => common}/read_config.go (67%) diff --git a/cli/actions/deposit_into_strategy.go b/cli/actions/deposit_into_strategy.go index 06a2235f..94f64bf8 100644 --- a/cli/actions/deposit_into_strategy.go +++ b/cli/actions/deposit_into_strategy.go @@ -6,6 +6,7 @@ import ( "log" "math/big" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -17,7 +18,7 @@ func DepositIntoStrategy(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := ReadYamlConfig(configPath, &nodeConfig) + err := commonincredible.ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/print_operator_status.go b/cli/actions/print_operator_status.go index e40e98c3..36648170 100644 --- a/cli/actions/print_operator_status.go +++ b/cli/actions/print_operator_status.go @@ -4,6 +4,7 @@ import ( "encoding/json" "log" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -14,7 +15,7 @@ func PrintOperatorStatus(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := ReadYamlConfig(configPath, &nodeConfig) + err := commonincredible.ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/register_operator_with_avs.go b/cli/actions/register_operator_with_avs.go index 8f8e14dd..dfea077b 100644 --- a/cli/actions/register_operator_with_avs.go +++ b/cli/actions/register_operator_with_avs.go @@ -6,6 +6,7 @@ import ( "os" sdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -16,7 +17,7 @@ func RegisterOperatorWithAvs(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := ReadYamlConfig(configPath, &nodeConfig) + err := commonincredible.ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/register_operator_with_eigenlayer.go b/cli/actions/register_operator_with_eigenlayer.go index 12bda8c3..786c440b 100644 --- a/cli/actions/register_operator_with_eigenlayer.go +++ b/cli/actions/register_operator_with_eigenlayer.go @@ -6,6 +6,7 @@ import ( "github.com/urfave/cli" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" @@ -15,7 +16,7 @@ func RegisterOperatorWithEigenlayer(ctx *cli.Context) error { configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := ReadYamlConfig(configPath, &nodeConfig) + err := commonincredible.ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/cli/actions/read_config.go b/common/read_config.go similarity index 67% rename from cli/actions/read_config.go rename to common/read_config.go index b01f2455..a7e2cfd7 100644 --- a/cli/actions/read_config.go +++ b/common/read_config.go @@ -1,6 +1,7 @@ -package actions +package common import ( + "encoding/json" "errors" "log" "os" @@ -33,3 +34,17 @@ func ReadFile(path string) ([]byte, error) { } return b, nil } + +func ReadJsonConfig(path string, o interface{}) error { + b, err := ReadFile(path) + if err != nil { + return err + } + + err = json.Unmarshal(b, o) + if err != nil { + log.Fatalf("unable to parse file with error %#v", err) + } + + return nil +} diff --git a/core/config/config.go b/core/config/config.go index 56058a2d..565ea042 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -10,6 +10,8 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/urfave/cli" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" "github.com/Layr-Labs/eigensdk-go/crypto/bls" @@ -69,7 +71,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { var configRaw ConfigRaw configFilePath := ctx.GlobalString(ConfigFileFlag.Name) if configFilePath != "" { - sdkutils.ReadYamlConfig(configFilePath, &configRaw) + commonincredible.ReadYamlConfig(configFilePath, &configRaw) } var credibleSquaringDeploymentRaw IncredibleSquaringDeploymentRaw @@ -77,7 +79,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { if _, err := os.Stat(credibleSquaringDeploymentFilePath); errors.Is(err, os.ErrNotExist) { panic("Path " + credibleSquaringDeploymentFilePath + " does not exist") } - sdkutils.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw) + commonincredible.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw) logger, err := sdklogging.NewZapLogger(configRaw.Environment) if err != nil { diff --git a/operator/cmd/main.go b/operator/cmd/main.go index d033bfa2..2af0a7b4 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -8,11 +8,11 @@ import ( "github.com/urfave/cli" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" + "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/Layr-Labs/incredible-squaring-avs/operator" "github.com/Layr-Labs/incredible-squaring-avs/types" - - sdkutils "github.com/Layr-Labs/eigensdk-go/utils" ) func main() { @@ -34,7 +34,7 @@ func operatorMain(ctx *cli.Context) error { log.Println("Initializing Operator") configPath := ctx.GlobalString(config.ConfigFileFlag.Name) nodeConfig := types.NodeConfig{} - err := sdkutils.ReadYamlConfig(configPath, &nodeConfig) + err := commonincredible.ReadYamlConfig(configPath, &nodeConfig) if err != nil { return err } diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index f441ed7d..1cc9bafa 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -8,6 +8,8 @@ import ( "os" "time" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" + sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" @@ -17,7 +19,6 @@ import ( "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/signerv2" sdktypes "github.com/Layr-Labs/eigensdk-go/types" - "github.com/Layr-Labs/eigensdk-go/utils" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" "github.com/Layr-Labs/incredible-squaring-avs/types" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -86,7 +87,7 @@ func plugin(ctx *cli.Context) { configPath := ctx.GlobalString(ConfigFileFlag.Name) avsConfig := types.NodeConfig{} - err := utils.ReadYamlConfig(configPath, &avsConfig) + err := commonincredible.ReadYamlConfig(configPath, &avsConfig) if err != nil { fmt.Println(err) return diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 7f22fa3e..4aad7e82 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" + "github.com/Layr-Labs/eigensdk-go/chainio/clients" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" @@ -48,13 +50,13 @@ func TestIntegration(t *testing.T) { /* Prepare the config file for aggregator */ var aggConfigRaw config.ConfigRaw aggConfigFilePath := "../../config-files/aggregator.yaml" - sdkutils.ReadYamlConfig(aggConfigFilePath, &aggConfigRaw) + commonincredible.ReadYamlConfig(aggConfigFilePath, &aggConfigRaw) aggConfigRaw.EthRpcUrl = "http://" + anvilEndpoint aggConfigRaw.EthWsUrl = "ws://" + anvilEndpoint var credibleSquaringDeploymentRaw config.IncredibleSquaringDeploymentRaw credibleSquaringDeploymentFilePath := "../../contracts/script/output/31337/credible_squaring_avs_deployment_output.json" - sdkutils.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw) + commonincredible.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw) logger, err := sdklogging.NewZapLogger(aggConfigRaw.Environment) if err != nil { @@ -115,7 +117,7 @@ func TestIntegration(t *testing.T) { /* Prepare the config file for operator */ nodeConfig := types.NodeConfig{} nodeConfigFilePath := "../../config-files/operator.anvil.yaml" - err = sdkutils.ReadYamlConfig(nodeConfigFilePath, &nodeConfig) + err = commonincredible.ReadYamlConfig(nodeConfigFilePath, &nodeConfig) if err != nil { t.Fatalf("Failed to read yaml config: %s", err.Error()) } From 500525721c479832d25873954c584f52bf26ed60 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Mon, 11 Nov 2024 18:35:17 -0300 Subject: [PATCH 33/36] errors about context fixed --- operator/registration.go | 16 +++++----------- plugin/cmd/main.go | 15 +++++---------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/operator/registration.go b/operator/registration.go index a1ddcbb9..389ac8e6 100644 --- a/operator/registration.go +++ b/operator/registration.go @@ -16,10 +16,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/Layr-Labs/eigensdk-go/crypto/bls" eigenSdkTypes "github.com/Layr-Labs/eigensdk-go/types" - - regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" ) func (o *Operator) registerOperatorOnStartup( @@ -63,7 +60,7 @@ func (o *Operator) RegisterOperatorWithEigenlayer() error { } func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big.Int) error { - _, tokenAddr, err := o.eigenlayerReader.GetStrategyAndUnderlyingToken(&bind.CallOpts{}, strategyAddr) + _, tokenAddr, err := o.eigenlayerReader.GetStrategyAndUnderlyingToken(context.Background(), strategyAddr) if err != nil { o.logger.Error("Failed to fetch strategy contract", "err", err) return err @@ -74,6 +71,10 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big. return err } txOpts, err := o.avsWriter.TxMgr.GetNoSendTxOpts() + if err != nil { + o.logger.Error("Failed to fetch GetNoSendTxOpts", "err", err) + return err + } tx, err := contractErc20Mock.Mint(txOpts, o.operatorAddr, amount) if err != nil { o.logger.Errorf("Error assembling Mint tx") @@ -175,10 +176,3 @@ func (o *Operator) PrintOperatorStatus() error { fmt.Println(string(operatorStatusJson)) return nil } - -func pubKeyG1ToBN254G1Point(p *bls.G1Point) regcoord.BN254G1Point { - return regcoord.BN254G1Point{ - X: p.X.BigInt(new(big.Int)), - Y: p.Y.BigInt(new(big.Int)), - } -} diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index 1cc9bafa..b022ab57 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -13,7 +13,6 @@ import ( sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" - regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" "github.com/Layr-Labs/eigensdk-go/crypto/bls" sdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" "github.com/Layr-Labs/eigensdk-go/logging" @@ -21,7 +20,6 @@ import ( sdktypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" "github.com/Layr-Labs/incredible-squaring-avs/types" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/urfave/cli" @@ -135,6 +133,10 @@ func plugin(ctx *cli.Context) { return } clients, err := sdkclients.BuildAll(buildClientConfig, operatorEcdsaPrivateKey, logger) + if err != nil { + fmt.Println(err) + return + } avsReader, err := chainio.BuildAvsReader( common.HexToAddress(avsConfig.AVSRegistryCoordinatorAddress), common.HexToAddress(avsConfig.OperatorStateRetrieverAddress), @@ -202,7 +204,7 @@ func plugin(ctx *cli.Context) { return } strategyAddr := common.HexToAddress(ctx.GlobalString(StrategyAddrFlag.Name)) - _, tokenAddr, err := clients.ElChainReader.GetStrategyAndUnderlyingToken(&bind.CallOpts{}, strategyAddr) + _, tokenAddr, err := clients.ElChainReader.GetStrategyAndUnderlyingToken(context.Background(), strategyAddr) if err != nil { logger.Error("Failed to fetch strategy contract", "err", err) return @@ -239,10 +241,3 @@ func plugin(ctx *cli.Context) { fmt.Println("Invalid operation type") } } - -func pubKeyG1ToBN254G1Point(p *bls.G1Point) regcoord.BN254G1Point { - return regcoord.BN254G1Point{ - X: p.X.BigInt(new(big.Int)), - Y: p.Y.BigInt(new(big.Int)), - } -} From ba4761cdce486a8e7e44193e41084b8ed538d882 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 12 Nov 2024 15:56:54 -0300 Subject: [PATCH 34/36] createMockAggregator: unused parameter --- aggregator/aggregator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index b97b42f1..cbe2b96f 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -144,7 +144,7 @@ func TestSendNewTask(t *testing.T) { } func createMockAggregator( - mockCtrl *gomock.Controller, operatorPubkeyDict map[sdktypes.OperatorId]types.OperatorInfo, + mockCtrl *gomock.Controller, _ map[sdktypes.OperatorId]types.OperatorInfo, ) (*Aggregator, *chainiomocks.MockAvsWriterer, *MockBlsAggregationService, error) { logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) From b6e4bc610e201829a896124ecdd99d39f866d0a7 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Tue, 12 Nov 2024 18:34:57 -0300 Subject: [PATCH 35/36] Use go sdk updated --- aggregator/cmd/main.go | 3 +++ go.mod | 2 +- go.sum | 2 ++ operator/cmd/main.go | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/aggregator/cmd/main.go b/aggregator/cmd/main.go index 908ffa31..eb48d890 100644 --- a/aggregator/cmd/main.go +++ b/aggregator/cmd/main.go @@ -9,6 +9,7 @@ import ( "github.com/urfave/cli" + "github.com/Layr-Labs/eigensdk-go/telemetry" "github.com/Layr-Labs/incredible-squaring-avs/aggregator" "github.com/Layr-Labs/incredible-squaring-avs/core/config" ) @@ -22,6 +23,8 @@ var ( func main() { + _ = telemetry.InitTelemetry("phc_AGsxzgr4ETSVddRFfZXdHUnWLIW8ExxCBSqPLmc6qbl", "e77c390f-223e-4dda-aa3d-3e554c3f7270") + app := cli.NewApp() app.Flags = config.Flags app.Version = fmt.Sprintf("%s-%s-%s", Version, GitCommit, GitDate) diff --git a/go.mod b/go.mod index d1ec0907..0c4b6295 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.21.0 require ( - github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469 + github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2 github.com/ethereum/go-ethereum v1.14.0 github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index d88711d7..6db43312 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ github.com/Layr-Labs/eigensdk-go v0.1.12 h1:Drf59iJLvnTm2Om9AwAyUMiZeJaTI8ZameIr github.com/Layr-Labs/eigensdk-go v0.1.12/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs= github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469 h1:zBmTZdIio/xzftdBvyCOLMGtRhmmqRbwSufHjL5dNbI= github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2 h1:GXDGOMvkDqdZcVPTxFRTihMaz/PByRLNqc5V1s8ijnw= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= diff --git a/operator/cmd/main.go b/operator/cmd/main.go index 2af0a7b4..1c4f5b05 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -8,6 +8,7 @@ import ( "github.com/urfave/cli" + "github.com/Layr-Labs/eigensdk-go/telemetry" commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" @@ -23,6 +24,9 @@ func main() { app.Description = "Service that reads numbers onchain, squares, signs, and sends them to the aggregator." app.Action = operatorMain + + _ = telemetry.InitTelemetry("phc_AGsxzgr4ETSVddRFfZXdHUnWLIW8ExxCBSqPLmc6qbl", "e77c390f-223e-4dda-aa3d-3e554c3f7270") + err := app.Run(os.Args) if err != nil { log.Fatalln("Application failed. Message:", err) From 21afd24218c4d2ce59f012dfa59f970be56cb3d9 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 13 Nov 2024 12:19:14 -0300 Subject: [PATCH 36/36] upgrade sdk commit --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0c4b6295..bd782b66 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.21.0 require ( - github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2 + github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241113150248-3aff91acf6f4 github.com/ethereum/go-ethereum v1.14.0 github.com/prometheus/client_golang v1.19.0 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 6db43312..c0d412ab 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469 h1:zBmTZd github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241108213203-a5ad59992469/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2 h1:GXDGOMvkDqdZcVPTxFRTihMaz/PByRLNqc5V1s8ijnw= github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241112205251-eeed9ff769d2/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241113150248-3aff91acf6f4 h1:jHVVR5oR7Y7GIQ3RpTodpqhVVxMi3iRIl5fTgjBRCRE= +github.com/Layr-Labs/eigensdk-go v0.1.13-0.20241113150248-3aff91acf6f4/go.mod h1:QsDfVTmN1BCYl3OAZKMRqdloyXUQ6UOYjS1QZbB9aP4= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=