From ec7a3115d896e5e7d1e0e45a66f082566330e7b8 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 30 Mar 2024 07:39:59 +0100 Subject: [PATCH 01/11] use custom go-eth2-client branch for minimal preset support --- go.mod | 33 ++++++++++++++++++++----------- go.sum | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ rpc/beaconapi.go | 1 + 3 files changed, 74 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 83c42fb5..6e342330 100644 --- a/go.mod +++ b/go.mod @@ -22,13 +22,13 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/pressly/goose/v3 v3.13.4 github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 - github.com/rs/zerolog v1.29.1 + github.com/rs/zerolog v1.32.0 github.com/shopspring/decimal v1.3.1 github.com/sirupsen/logrus v1.9.3 github.com/tdewolff/minify v2.3.6+incompatible github.com/urfave/negroni v1.0.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/text v0.11.0 + golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -48,29 +48,38 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.5 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 // indirect github.com/aws/smithy-go v1.14.2 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/fatih/color v1.10.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/ferranbt/fastssz v0.1.3 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/goccy/go-yaml v1.9.2 // indirect - github.com/holiman/uint256 v1.2.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/go-clone v1.6.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.11.0 // indirect github.com/r3labs/sse/v2 v2.10.0 // indirect github.com/tdewolff/parse v2.3.4+incompatible // indirect github.com/tdewolff/test v1.0.9 // indirect go.opentelemetry.io/otel v1.16.0 // indirect go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) @@ -88,6 +97,8 @@ require ( github.com/jackc/pgtype v1.14.0 // indirect github.com/jackc/puddle v1.3.0 // indirect github.com/lib/pq v1.10.9 - golang.org/x/crypto v0.10.0 - golang.org/x/sys v0.12.0 // indirect + golang.org/x/crypto v0.20.0 + golang.org/x/sys v0.17.0 // indirect ) + +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 diff --git a/go.sum b/go.sum index ac4fd6d1..167c4cc1 100644 --- a/go.sum +++ b/go.sum @@ -49,6 +49,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvT github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= @@ -79,6 +81,8 @@ github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2 github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/ferranbt/fastssz v0.1.3 h1:ZI+z3JH05h4kgmFXdHuR1aWYsgrg7o+Fw7/NCzM16Mo= github.com/ferranbt/fastssz v0.1.3/go.mod h1:0Y9TEd/9XuFlh7mskMPfXiI2Dkw4Ddg9EyXt1W7MRvE= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -106,7 +110,13 @@ github.com/goccy/go-yaml v1.9.2/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3K github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +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/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -115,6 +125,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/go-clone v1.6.0 h1:HMo5uvg4wgfiy5FoGOqlFLQED/VGRm2D9Pi8g1FXPGc= @@ -184,6 +196,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -214,16 +228,24 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 h1:1Hlz9a4b74UvTYx9guKSx7mqJJVTpeGlqGT2ptqnI6s= +github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -231,6 +253,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pressly/goose/v3 v3.13.4 h1:9xRcg/hEU9HqeRNeKh69VLtPWCKAYTX6l2VsXWOX86A= github.com/pressly/goose/v3 v3.13.4/go.mod h1:Fo8rYaf9tYfQiDpo+ymrnZi8vvLkvguRl16nu7QnUT4= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= +github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0= @@ -240,10 +270,13 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -308,6 +341,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -325,8 +360,13 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -349,6 +389,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -363,6 +405,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -380,9 +424,16 @@ golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/rpc/beaconapi.go b/rpc/beaconapi.go index 5b25aa7d..41b1cccd 100644 --- a/rpc/beaconapi.go +++ b/rpc/beaconapi.go @@ -149,6 +149,7 @@ func (bc *BeaconClient) Initialize() error { http.WithTimeout(10 * time.Minute), // TODO (when upstream PR is merged) //http.WithConnectionCheck(false), + http.WithDynamicSSZ(true), } // set log level From 7bda585bd51bb24c32e056ec9c7c4f09796f9a56 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 30 Mar 2024 09:04:30 +0100 Subject: [PATCH 02/11] update go-eth2-client override --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6e342330..1f2d1743 100644 --- a/go.mod +++ b/go.mod @@ -101,4 +101,4 @@ require ( golang.org/x/sys v0.17.0 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd diff --git a/go.sum b/go.sum index 167c4cc1..2236e754 100644 --- a/go.sum +++ b/go.sum @@ -246,6 +246,8 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 h1:1Hlz9a4b74UvTYx9guKSx7mqJJVTpeGlqGT2ptqnI6s= github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= +github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd h1:xUmfyl0V2t6RQ6sc+KyUcpYQ4UmBRh90ZQOgmBduI2c= +github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From 4548b573035d9ef3128a2df4b0d6c9fda2f2ce03 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 30 Mar 2024 09:07:50 +0100 Subject: [PATCH 03/11] trigger build --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 1f2d1743..238e4852 100644 --- a/go.mod +++ b/go.mod @@ -102,3 +102,4 @@ require ( ) replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd + From 19be8a9606cd4767bfd6fc02f78a01518e24c54b Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 31 Mar 2024 03:59:24 +0200 Subject: [PATCH 04/11] update `go-eth2-client` override --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 238e4852..bdd12596 100644 --- a/go.mod +++ b/go.mod @@ -65,6 +65,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/sha256-simd v1.0.1 // indirect + github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -101,5 +102,4 @@ require ( golang.org/x/sys v0.17.0 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd - +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76 diff --git a/go.sum b/go.sum index 2236e754..784c180d 100644 --- a/go.sum +++ b/go.sum @@ -244,10 +244,14 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885 h1:7n5NaBz3f5Zb79C3zU8OVuTM0D0XAEwmhfn/Qvi1STU= +github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885/go.mod h1:boKvD5unVPTNvyETQV3gDNh0ga4AVCuZ+hJ+ja08QRc= github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 h1:1Hlz9a4b74UvTYx9guKSx7mqJJVTpeGlqGT2ptqnI6s= github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd h1:xUmfyl0V2t6RQ6sc+KyUcpYQ4UmBRh90ZQOgmBduI2c= github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= +github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76 h1:I8iBSF7dHL1I8S/NzUZ9GpphLIXioHxIr0zk+dZ10js= +github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76/go.mod h1:eu+OBo6ozf0AN4I4tVwirjeuM6A+aCKt4YhZeLZ7LDY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From 0393ddf0cab41a798d88d70a0badaba68eed97f6 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 31 Mar 2024 04:21:18 +0200 Subject: [PATCH 05/11] populate spec cache in go-eth2-client --- indexer/client.go | 6 ++++++ rpc/beaconapi.go | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/indexer/client.go b/indexer/client.go index 9f1875dd..929dab0c 100644 --- a/indexer/client.go +++ b/indexer/client.go @@ -209,6 +209,12 @@ func (client *IndexerClient) checkIndexerClient() error { } func (client *IndexerClient) runIndexerClient() error { + // get specs + _, err := client.rpcClient.GetSpecs() + if err != nil { + return fmt.Errorf("could not get specs: %v", err) + } + // get latest header latestHeader, err := client.rpcClient.GetLatestBlockHead() if err != nil { diff --git a/rpc/beaconapi.go b/rpc/beaconapi.go index 41b1cccd..c3cdb34d 100644 --- a/rpc/beaconapi.go +++ b/rpc/beaconapi.go @@ -180,6 +180,24 @@ func (bc *BeaconClient) Initialize() error { return nil } +func (bc *BeaconClient) GetSpecs() (map[string]any, error) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + provider, isProvider := bc.clientSvc.(eth2client.SpecProvider) + if !isProvider { + return nil, fmt.Errorf("get spec not supported") + } + result, err := provider.Spec(ctx, &api.SpecOpts{ + Common: api.CommonOpts{ + Timeout: 0, + }, + }) + if err != nil { + return nil, err + } + return result.Data, nil +} + func (bc *BeaconClient) GetGenesis() (*v1.Genesis, error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() From 2d616c5a5ef5da4ae41a56b0f2d051397ae3a890 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 1 Apr 2024 04:02:29 +0200 Subject: [PATCH 06/11] bump `go-eth2-client` version --- go.mod | 5 +++-- go.sum | 14 ++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index bdd12596..2c9cd333 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/sha256-simd v1.0.1 // indirect - github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885 // indirect + github.com/pk910/dynamic-ssz v0.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -81,6 +81,7 @@ require ( golang.org/x/sync v0.2.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) @@ -102,4 +103,4 @@ require ( golang.org/x/sys v0.17.0 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76 +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff diff --git a/go.sum b/go.sum index 784c180d..1e5994a6 100644 --- a/go.sum +++ b/go.sum @@ -244,14 +244,10 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885 h1:7n5NaBz3f5Zb79C3zU8OVuTM0D0XAEwmhfn/Qvi1STU= -github.com/pk910/dynamic-ssz v0.0.0-20240330223230-eced6836d885/go.mod h1:boKvD5unVPTNvyETQV3gDNh0ga4AVCuZ+hJ+ja08QRc= -github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691 h1:1Hlz9a4b74UvTYx9guKSx7mqJJVTpeGlqGT2ptqnI6s= -github.com/pk910/go-eth2-client v0.0.0-20240330062621-0350168c6691/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= -github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd h1:xUmfyl0V2t6RQ6sc+KyUcpYQ4UmBRh90ZQOgmBduI2c= -github.com/pk910/go-eth2-client v0.0.0-20240330075337-93f905e392bd/go.mod h1:Tb412NpzhsC0sbtpXS4D51y5se6nDkWAi6amsJrqX9c= -github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76 h1:I8iBSF7dHL1I8S/NzUZ9GpphLIXioHxIr0zk+dZ10js= -github.com/pk910/go-eth2-client v0.0.0-20240331015333-ece29db5ce76/go.mod h1:eu+OBo6ozf0AN4I4tVwirjeuM6A+aCKt4YhZeLZ7LDY= +github.com/pk910/dynamic-ssz v0.0.2 h1:W8PUqjcM7WeLABtQduqthqqaCK5n4g3VzBukI21tmyk= +github.com/pk910/dynamic-ssz v0.0.2/go.mod h1:PpHTmUfKQKTG5X8NJP9uo14eqmZ0akC9AitgrdjeJmY= +github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff h1:wylI0oIT4xShYGA5mvk6buO9oyWzslP3vxmMFQFqVWY= +github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff/go.mod h1:VdkMTum681ZufpSSYxCuui8KFiB7YOpXtiNJ5kTHosA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -440,6 +436,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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc= +gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E= gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From a82db5fbbd1a450806b02403666def733b910607 Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 2 Apr 2024 06:47:22 +0200 Subject: [PATCH 07/11] trigger ci --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 2c9cd333..32c88802 100644 --- a/go.mod +++ b/go.mod @@ -104,3 +104,4 @@ require ( ) replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff + From d03d231296cc7d26ae9ffbca7c4d9f65b911b928 Mon Sep 17 00:00:00 2001 From: pk910 Date: Fri, 3 May 2024 13:37:38 +0200 Subject: [PATCH 08/11] fix ssz encoding with minimal preset --- indexer/block_ssz.go | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/indexer/block_ssz.go b/indexer/block_ssz.go index 7dd25f71..4c787605 100644 --- a/indexer/block_ssz.go +++ b/indexer/block_ssz.go @@ -10,32 +10,50 @@ import ( "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethpandaops/dora/utils" + dynssz "github.com/pk910/dynamic-ssz" + "gopkg.in/yaml.v3" ) +var staticConfigSpec map[string]any var jsonVersionOffset uint64 = 0x70000000 +func getConfigSpec() map[string]any { + if staticConfigSpec != nil { + return staticConfigSpec + } + + staticConfigSpec = map[string]any{} + specYaml, err := yaml.Marshal(utils.Config.Chain.Config) + if err != nil { + yaml.Unmarshal(specYaml, staticConfigSpec) + } + return staticConfigSpec +} + func MarshalVersionedSignedBeaconBlockSSZ(block *spec.VersionedSignedBeaconBlock) (version uint64, ssz []byte, err error) { if utils.Config.KillSwitch.DisableSSZEncoding { // SSZ encoding disabled, use json instead return marshalVersionedSignedBeaconBlockJson(block) } + dynSsz := dynssz.NewDynSsz(getConfigSpec()) + switch block.Version { case spec.DataVersionPhase0: version = uint64(block.Version) - ssz, err = block.Phase0.MarshalSSZ() + ssz, err = dynSsz.MarshalSSZ(block.Phase0) case spec.DataVersionAltair: version = uint64(block.Version) - ssz, err = block.Altair.MarshalSSZ() + ssz, err = dynSsz.MarshalSSZ(block.Altair) case spec.DataVersionBellatrix: version = uint64(block.Version) - ssz, err = block.Bellatrix.MarshalSSZ() + ssz, err = dynSsz.MarshalSSZ(block.Bellatrix) case spec.DataVersionCapella: version = uint64(block.Version) - ssz, err = block.Capella.MarshalSSZ() + ssz, err = dynSsz.MarshalSSZ(block.Capella) case spec.DataVersionDeneb: version = uint64(block.Version) - ssz, err = block.Deneb.MarshalSSZ() + ssz, err = dynSsz.MarshalSSZ(block.Deneb) default: err = fmt.Errorf("unknown block version") } @@ -49,30 +67,32 @@ func UnmarshalVersionedSignedBeaconBlockSSZ(version uint64, ssz []byte) (*spec.V block := &spec.VersionedSignedBeaconBlock{ Version: spec.DataVersion(version), } + dynSsz := dynssz.NewDynSsz(getConfigSpec()) + switch block.Version { case spec.DataVersionPhase0: block.Phase0 = &phase0.SignedBeaconBlock{} - if err := block.Phase0.UnmarshalSSZ(ssz); err != nil { + if err := dynSsz.UnmarshalSSZ(block.Phase0, ssz); err != nil { return nil, fmt.Errorf("failed to decode phase0 signed beacon block: %v", err) } case spec.DataVersionAltair: block.Altair = &altair.SignedBeaconBlock{} - if err := block.Altair.UnmarshalSSZ(ssz); err != nil { + if err := dynSsz.UnmarshalSSZ(block.Altair, ssz); err != nil { return nil, fmt.Errorf("failed to decode altair signed beacon block: %v", err) } case spec.DataVersionBellatrix: block.Bellatrix = &bellatrix.SignedBeaconBlock{} - if err := block.Bellatrix.UnmarshalSSZ(ssz); err != nil { + if err := dynSsz.UnmarshalSSZ(block.Bellatrix, ssz); err != nil { return nil, fmt.Errorf("failed to decode bellatrix signed beacon block: %v", err) } case spec.DataVersionCapella: block.Capella = &capella.SignedBeaconBlock{} - if err := block.Capella.UnmarshalSSZ(ssz); err != nil { + if err := dynSsz.UnmarshalSSZ(block.Capella, ssz); err != nil { return nil, fmt.Errorf("failed to decode capella signed beacon block: %v", err) } case spec.DataVersionDeneb: block.Deneb = &deneb.SignedBeaconBlock{} - if err := block.Deneb.UnmarshalSSZ(ssz); err != nil { + if err := dynSsz.UnmarshalSSZ(block.Deneb, ssz); err != nil { return nil, fmt.Errorf("failed to decode deneb signed beacon block: %v", err) } default: From 735b32c931dbedee06fd206b9ea7c9b96ce6e46e Mon Sep 17 00:00:00 2001 From: pk910 Date: Fri, 3 May 2024 13:40:21 +0200 Subject: [PATCH 09/11] bump go-eth2-client --- go.mod | 11 ++++------- go.sum | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0fb263d3..d9a95aaf 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( dario.cat/mergo v1.0.0 - github.com/attestantio/go-eth2-client v0.21.3 + github.com/attestantio/go-eth2-client v1.15.2 github.com/aws/aws-sdk-go-v2 v1.26.1 github.com/aws/aws-sdk-go-v2/config v1.27.11 github.com/aws/aws-sdk-go-v2/credentials v1.17.11 @@ -21,6 +21,7 @@ require ( github.com/lib/pq v1.10.9 github.com/mattn/go-sqlite3 v1.14.22 github.com/mitchellh/mapstructure v1.5.0 + github.com/pk910/dynamic-ssz v0.0.3 github.com/pressly/goose/v3 v3.20.0 github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/rs/zerolog v1.32.0 @@ -35,11 +36,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) -require ( - github.com/pk910/dynamic-ssz v0.0.2 // indirect - gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect -) - require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect @@ -107,9 +103,10 @@ require ( golang.org/x/sys v0.19.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240503111248-b7b883e07eca diff --git a/go.sum b/go.sum index a6a42195..2d515cd0 100644 --- a/go.sum +++ b/go.sum @@ -288,10 +288,10 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/pk910/dynamic-ssz v0.0.2 h1:W8PUqjcM7WeLABtQduqthqqaCK5n4g3VzBukI21tmyk= -github.com/pk910/dynamic-ssz v0.0.2/go.mod h1:PpHTmUfKQKTG5X8NJP9uo14eqmZ0akC9AitgrdjeJmY= -github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff h1:wylI0oIT4xShYGA5mvk6buO9oyWzslP3vxmMFQFqVWY= -github.com/pk910/go-eth2-client v0.0.0-20240401010249-0a11cd0943ff/go.mod h1:VdkMTum681ZufpSSYxCuui8KFiB7YOpXtiNJ5kTHosA= +github.com/pk910/dynamic-ssz v0.0.3 h1:fCWzFowq9P6SYCc7NtJMkZcIHk+r5hSVD+32zVi6Aio= +github.com/pk910/dynamic-ssz v0.0.3/go.mod h1:b6CrLaB2X7pYA+OSEEbkgXDEcRnjLOZIxZTsMuO/Y9c= +github.com/pk910/go-eth2-client v0.0.0-20240503111248-b7b883e07eca h1:+SeQtXs6iJyVQX294Ci37a9F5gvlnhIKTj0XvKP1rEQ= +github.com/pk910/go-eth2-client v0.0.0-20240503111248-b7b883e07eca/go.mod h1:CilNSTpoxAEvYGi5fuWHpj+lN3GC552OtHUops1ctwg= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From fcba8df5c1b2d5d7e17b26194613941f4f2fd312 Mon Sep 17 00:00:00 2001 From: pk910 Date: Fri, 3 May 2024 13:43:30 +0200 Subject: [PATCH 10/11] fix --- rpc/beaconapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/beaconapi.go b/rpc/beaconapi.go index c3cdb34d..ce606b93 100644 --- a/rpc/beaconapi.go +++ b/rpc/beaconapi.go @@ -149,7 +149,7 @@ func (bc *BeaconClient) Initialize() error { http.WithTimeout(10 * time.Minute), // TODO (when upstream PR is merged) //http.WithConnectionCheck(false), - http.WithDynamicSSZ(true), + http.WithCustomSpecSupport(true), } // set log level From c1dc53b1b2a15ad4e0adb87499f683a5be0cfaee Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 7 May 2024 11:31:52 +0200 Subject: [PATCH 11/11] bump `go-eth2-client` & remove override --- go.mod | 4 +--- go.sum | 2 ++ indexer/client.go | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index d9a95aaf..aa26c346 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( dario.cat/mergo v1.0.0 - github.com/attestantio/go-eth2-client v1.15.2 + github.com/attestantio/go-eth2-client v0.0.0-20240507092336-27309754c54f github.com/aws/aws-sdk-go-v2 v1.26.1 github.com/aws/aws-sdk-go-v2/config v1.27.11 github.com/aws/aws-sdk-go-v2/credentials v1.17.11 @@ -108,5 +108,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) - -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240503111248-b7b883e07eca diff --git a/go.sum b/go.sum index 2d515cd0..525e58ae 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDO github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= +github.com/attestantio/go-eth2-client v0.0.0-20240507092336-27309754c54f h1:k4axih4fc/7Atb9eTsPsPFxlGGb501o+ryUt9q0stR8= +github.com/attestantio/go-eth2-client v0.0.0-20240507092336-27309754c54f/go.mod h1:Ht9tN0WlhpgIWWO7Hqfi3/nq2rUGQv/zCd/BMI93a84= 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/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= diff --git a/indexer/client.go b/indexer/client.go index 59be3d11..121a3450 100644 --- a/indexer/client.go +++ b/indexer/client.go @@ -209,12 +209,6 @@ func (client *IndexerClient) checkIndexerClient() error { } func (client *IndexerClient) runIndexerClient() error { - // get specs - _, err := client.rpcClient.GetSpecs() - if err != nil { - return fmt.Errorf("could not get specs: %v", err) - } - // get latest header latestHeader, err := client.rpcClient.GetLatestBlockHead() if err != nil {