From 77653476bc2e9de696f93ae9de9bd1e97f55fe9a Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 6 May 2024 14:08:28 +0200 Subject: [PATCH 1/7] add `eip7594` support (`PeerDAS`) --- go.mod | 2 ++ go.sum | 2 ++ handlers/index.go | 8 ++++++++ types/chain.go | 2 ++ 4 files changed, 14 insertions(+) diff --git a/go.mod b/go.mod index ca7af9bb..d371a118 100644 --- a/go.mod +++ b/go.mod @@ -106,3 +106,5 @@ 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-20240506115829-c6fafe3ee362 diff --git a/go.sum b/go.sum index 38cee377..ff913023 100644 --- a/go.sum +++ b/go.sum @@ -290,6 +290,8 @@ 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/go-eth2-client v0.0.0-20240506115829-c6fafe3ee362 h1:qieL2StoAe3NsDcv+W3VIQ4QBnO50QLG68fD37G1O9k= +github.com/pk910/go-eth2-client v0.0.0-20240506115829-c6fafe3ee362/go.mod h1:vhb0ZoQ6bz0kkoyxVbHDRrZTOJbwlY6udFkwfwrJZTE= 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= diff --git a/handlers/index.go b/handlers/index.go index 83aab1e4..2311d8d7 100644 --- a/handlers/index.go +++ b/handlers/index.go @@ -198,6 +198,14 @@ func buildIndexPageData() (*models.IndexPageData, time.Duration) { Active: uint64(currentEpoch) >= utils.Config.Chain.Config.DenebForkEpoch, }) } + if utils.Config.Chain.Config.Eip7594ForkEpoch < uint64(18446744073709551615) && utils.Config.Chain.Config.Eip7594ForkVersion != "" { + pageData.NetworkForks = append(pageData.NetworkForks, &models.IndexPageDataForks{ + Name: "PeerDAS", + Epoch: utils.Config.Chain.Config.Eip7594ForkEpoch, + Version: utils.MustParseHex(utils.Config.Chain.Config.Eip7594ForkVersion), + Active: uint64(currentEpoch) >= utils.Config.Chain.Config.Eip7594ForkEpoch, + }) + } // load recent epochs buildIndexPageRecentEpochsData(pageData, uint64(currentEpoch), finalizedEpoch, justifiedEpoch, recentEpochCount) diff --git a/types/chain.go b/types/chain.go index b8baed1e..a4ea3d99 100644 --- a/types/chain.go +++ b/types/chain.go @@ -27,6 +27,8 @@ type ChainConfig struct { DenebForkEpoch uint64 `yaml:"DENEB_FORK_EPOCH"` ShardingForkVersion string `yaml:"SHARDING_FORK_VERSION"` ShardingForkEpoch uint64 `yaml:"SHARDING_FORK_EPOCH"` + Eip7594ForkVersion string `yaml:"EIP7594_FORK_VERSION"` + Eip7594ForkEpoch uint64 `yaml:"EIP7594_FORK_EPOCH"` SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT"` SecondsPerEth1Block uint64 `yaml:"SECONDS_PER_ETH1_BLOCK"` MinValidatorWithdrawabilityDelay uint64 `yaml:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY"` From c9124ae5361e1a4e224bdbc46f340921b68c79c8 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 6 May 2024 14:10:08 +0200 Subject: [PATCH 2/7] trigger ci --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c11ea7ee..6364c5d9 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,4 @@ This explorer is heavily based on the code from [gobitfly/eth2-beaconchain-explo # License [![License: GPL-3.0](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) + From ee943bcd38c2ec114d3ed170d06c22fa0ef9edd3 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 6 May 2024 14:37:20 +0200 Subject: [PATCH 3/7] rename peerdas label to `eip7594` --- README.md | 1 - handlers/index.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 6364c5d9..c11ea7ee 100644 --- a/README.md +++ b/README.md @@ -47,4 +47,3 @@ This explorer is heavily based on the code from [gobitfly/eth2-beaconchain-explo # License [![License: GPL-3.0](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) - diff --git a/handlers/index.go b/handlers/index.go index 2311d8d7..8c203d3c 100644 --- a/handlers/index.go +++ b/handlers/index.go @@ -200,7 +200,7 @@ func buildIndexPageData() (*models.IndexPageData, time.Duration) { } if utils.Config.Chain.Config.Eip7594ForkEpoch < uint64(18446744073709551615) && utils.Config.Chain.Config.Eip7594ForkVersion != "" { pageData.NetworkForks = append(pageData.NetworkForks, &models.IndexPageDataForks{ - Name: "PeerDAS", + Name: "eip7594", Epoch: utils.Config.Chain.Config.Eip7594ForkEpoch, Version: utils.MustParseHex(utils.Config.Chain.Config.Eip7594ForkVersion), Active: uint64(currentEpoch) >= utils.Config.Chain.Config.Eip7594ForkEpoch, From f6ff760a4954ff85f9d9b906085ad4ccbeccbc8f Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 7 May 2024 11:45:51 +0200 Subject: [PATCH 4/7] bump `go-eth2-client` override --- go.mod | 7 ++++++- go.sum | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d371a118..dc29abbc 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,11 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) +require ( + github.com/pk910/dynamic-ssz v0.0.3 // 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,4 +112,4 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240506115829-c6fafe3ee362 +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85 diff --git a/go.sum b/go.sum index ff913023..9e2e34ab 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,12 @@ 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.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-20240506115829-c6fafe3ee362 h1:qieL2StoAe3NsDcv+W3VIQ4QBnO50QLG68fD37G1O9k= github.com/pk910/go-eth2-client v0.0.0-20240506115829-c6fafe3ee362/go.mod h1:vhb0ZoQ6bz0kkoyxVbHDRrZTOJbwlY6udFkwfwrJZTE= +github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85 h1:x5G1mttllfYwE9IYDP5a+cL8MgogD5VzbJ1h9zlab00= +github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85/go.mod h1:Ht9tN0WlhpgIWWO7Hqfi3/nq2rUGQv/zCd/BMI93a84= 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= @@ -492,6 +496,8 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= 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/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 bb5d61b1a4035277a2f1c2fd02187c685960abb5 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 15 Jul 2024 11:21:26 +0200 Subject: [PATCH 5/7] bump `go-eth2-client` override --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2d025f05..ac7e719a 100644 --- a/go.mod +++ b/go.mod @@ -142,4 +142,4 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85 +replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033 diff --git a/go.sum b/go.sum index d69a5382..f4314b95 100644 --- a/go.sum +++ b/go.sum @@ -344,8 +344,8 @@ 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.4 h1:DT29+1055tCEPCaR4V/ez+MOKW7BzBsmjyFvBRqx0ME= github.com/pk910/dynamic-ssz v0.0.4/go.mod h1:b6CrLaB2X7pYA+OSEEbkgXDEcRnjLOZIxZTsMuO/Y9c= -github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85 h1:x5G1mttllfYwE9IYDP5a+cL8MgogD5VzbJ1h9zlab00= -github.com/pk910/go-eth2-client v0.0.0-20240507094306-c18359522d85/go.mod h1:Ht9tN0WlhpgIWWO7Hqfi3/nq2rUGQv/zCd/BMI93a84= +github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033 h1:B+9G8ZW54Vix9xIevn8/f4a1nXwnL5H/UI8/XQlBtqM= +github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033/go.mod h1:d7ZPNrMX8jLfIgML5u7QZxFo2AukLM+5m08iMaLdqb8= 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 db42824c05e0fcef7c82b32721453858e40113d5 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 15 Aug 2024 13:28:28 +0200 Subject: [PATCH 6/7] remove `go-eth2-client` override --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 1784c301..dbe521e4 100644 --- a/go.mod +++ b/go.mod @@ -144,5 +144,3 @@ require ( modernc.org/sqlite v1.30.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) - -replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033 From f5d44b59168a446ef223182100485bb4651564da Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 15 Aug 2024 13:29:28 +0200 Subject: [PATCH 7/7] fix go.sum --- go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index 91c60347..e731192b 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= +github.com/attestantio/go-eth2-client v0.21.10 h1:1DWn42WKjk8mR8jKkjbaDCGNMVnh2IfAWRUmt7iemRo= +github.com/attestantio/go-eth2-client v0.21.10/go.mod h1:d7ZPNrMX8jLfIgML5u7QZxFo2AukLM+5m08iMaLdqb8= github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg= @@ -360,8 +362,6 @@ 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.5 h1:VP9heGYUwzlpyhk28P2nCAzhvGsePJOOOO5vQMDh2qQ= github.com/pk910/dynamic-ssz v0.0.5/go.mod h1:b6CrLaB2X7pYA+OSEEbkgXDEcRnjLOZIxZTsMuO/Y9c= -github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033 h1:B+9G8ZW54Vix9xIevn8/f4a1nXwnL5H/UI8/XQlBtqM= -github.com/pk910/go-eth2-client v0.0.0-20240715091951-3613ae531033/go.mod h1:d7ZPNrMX8jLfIgML5u7QZxFo2AukLM+5m08iMaLdqb8= 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=