From e4d83743ae4710e22630af87dcf90b8c59fffcc6 Mon Sep 17 00:00:00 2001 From: Philippe Schommers Date: Fri, 23 Feb 2024 20:25:20 +0100 Subject: [PATCH] feat: add Gnosis support --- go.mod | 4 ++++ go.sum | 8 ++++---- pkg/beacon/download.go | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index d81ff424..3df0c84d 100644 --- a/go.mod +++ b/go.mod @@ -73,3 +73,7 @@ require ( gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/attestantio/go-eth2-client v0.19.9 => github.com/gnosischain/go-eth2-client v0.0.0-20240223183427-f035b187e6d1 + +replace github.com/ethpandaops/beacon v0.35.0 => github.com/gnosischain/beacon v0.0.0-20240223190321-0dd001dcf505 diff --git a/go.sum b/go.sum index 0c6cdff4..02bcf1a0 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/attestantio/go-eth2-client v0.19.9 h1:g5LLX3X7cLC0KS0oai/MtxBOZz3U3QPIX5qryYMxgVE= -github.com/attestantio/go-eth2-client v0.19.9/go.mod h1:TTz7YF6w4z6ahvxKiHuGPn6DbQn7gH6HPuWm/DEQeGE= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -71,8 +69,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethpandaops/beacon v0.35.0 h1:ZkHfxm41N0wkv503Xdb6rFxLuEnIonClUQWUPFHS5VU= -github.com/ethpandaops/beacon v0.35.0/go.mod h1:B+SLxj1gnDd/Ia7cl/uuhzo1wyVf2p2puL6lmzPdPro= github.com/ethpandaops/ethwallclock v0.2.0 h1:EeFKtZ7v6TAdn/oAh0xaPujD7N4amjBxrWIByraUfLM= github.com/ethpandaops/ethwallclock v0.2.0/go.mod h1:y0Cu+mhGLlem19vnAV2x0hpFS5KZ7oOi2SWYayv9l24= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= @@ -86,6 +82,10 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gnosischain/beacon v0.0.0-20240223190321-0dd001dcf505 h1:SaikBXNDh/+3Ot/0Nl9DKfEHthxPmb1QsKXb7FrxX5w= +github.com/gnosischain/beacon v0.0.0-20240223190321-0dd001dcf505/go.mod h1:1PLt38XLNpqRdF6tILnFnxd3EBygO/EKIXsTY11ILOU= +github.com/gnosischain/go-eth2-client v0.0.0-20240223183427-f035b187e6d1 h1:tnNMsN9TYy0xDRuyudBo4y2lijmrIeHoziCU3z7CYz4= +github.com/gnosischain/go-eth2-client v0.0.0-20240223183427-f035b187e6d1/go.mod h1:TTz7YF6w4z6ahvxKiHuGPn6DbQn7gH6HPuWm/DEQeGE= github.com/go-co-op/gocron v1.16.2/go.mod h1:W/N9G7bntRo5fVQlmjncvqSt74jxCxHfjyHlgcB33T8= github.com/go-co-op/gocron v1.18.0 h1:SxTyJ5xnSN4byCq7b10LmmszFdxQlSQJod8s3gbnXxA= github.com/go-co-op/gocron v1.18.0/go.mod h1:sD/a0Aadtw5CpflUJ/lpP9Vfdk979Wl1Sg33HPHg0FY= diff --git a/pkg/beacon/download.go b/pkg/beacon/download.go index 7074c020..9269e59a 100644 --- a/pkg/beacon/download.go +++ b/pkg/beacon/download.go @@ -46,7 +46,7 @@ func (d *Default) downloadServingCheckpoint(ctx context.Context, checkpoint *v1. // For simplicity we'll hardcode SLOTS_PER_EPOCH to 32. // TODO(sam.calder-mason): Fetch this from a beacon node and store it in the instance. - const slotsPerEpoch = 32 + const slotsPerEpoch = 16 if blockSlot%slotsPerEpoch != 0 { return fmt.Errorf("block slot is not aligned from an epoch boundary: %d", blockSlot) }