From e2bce0e6d04e218cb88cb41166d5a2e10c5fc5a6 Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Tue, 14 Oct 2025 08:44:13 +0100 Subject: [PATCH 1/4] Fix for fulu support. --- CHANGELOG.md | 3 +++ services/blocks/standard/handler.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef43428..3149de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +0.10.1: + - fix fulu support + 0.10.0: - support fulu - use updated event handlers from go-eth2-client diff --git a/services/blocks/standard/handler.go b/services/blocks/standard/handler.go index 8863060..3a41478 100644 --- a/services/blocks/standard/handler.go +++ b/services/blocks/standard/handler.go @@ -43,7 +43,7 @@ func (s *Service) OnBeaconChainHeadUpdated( slot phase0.Slot, blockRoot phase0.Root, stateRoot phase0.Root, - // skipcq: RVV-A0005 +// skipcq: RVV-A0005 epochTransition bool, ) { ctx, span := otel.Tracer("wealdtech.chaind.services.blocks.standard").Start(ctx, "OnBeaconChainHeadUpdated", @@ -194,6 +194,8 @@ func (s *Service) OnBlock(ctx context.Context, signedBlock *spec.VersionedSigned return s.onBlockDeneb(ctx, signedBlock.Deneb, dbBlock) case spec.DataVersionElectra: return s.onBlockElectra(ctx, signedBlock.Electra, dbBlock) + case spec.DataVersionFulu: + return s.onBlockElectra(ctx, signedBlock.Fulu, dbBlock) case spec.DataVersionUnknown: return errors.New("unknown block version") default: @@ -757,6 +759,8 @@ func (s *Service) dbBlock( return s.dbBlockDeneb(ctx, block.Deneb.Message) case spec.DataVersionElectra: return s.dbBlockElectra(ctx, block.Electra.Message) + case spec.DataVersionFulu: + return s.dbBlockElectra(ctx, block.Fulu.Message) case spec.DataVersionUnknown: return nil, errors.New("unknown block version") default: From bace8f180c0a404e15c1bce1cd2bdbeb88039df9 Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Tue, 14 Oct 2025 08:49:57 +0100 Subject: [PATCH 2/4] Fix lint. --- services/blocks/standard/handler.go | 1 - 1 file changed, 1 deletion(-) diff --git a/services/blocks/standard/handler.go b/services/blocks/standard/handler.go index 3a41478..c3bc730 100644 --- a/services/blocks/standard/handler.go +++ b/services/blocks/standard/handler.go @@ -43,7 +43,6 @@ func (s *Service) OnBeaconChainHeadUpdated( slot phase0.Slot, blockRoot phase0.Root, stateRoot phase0.Root, -// skipcq: RVV-A0005 epochTransition bool, ) { ctx, span := otel.Tracer("wealdtech.chaind.services.blocks.standard").Start(ctx, "OnBeaconChainHeadUpdated", From a9c06e48c0a2e91b8ca240ad2d084a852210d85b Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Tue, 14 Oct 2025 08:58:20 +0100 Subject: [PATCH 3/4] Fix typos. --- main.go | 2 +- metrics.go | 4 ++-- services/chaindb/postgresql/validators.go | 8 ++++---- services/chaindb/types.go | 2 +- util/calendarduration_test.go | 2 +- util/logging.go | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 7232f5e..e66b9fa 100644 --- a/main.go +++ b/main.go @@ -152,7 +152,7 @@ func main2() int { func fetchConfig() error { pflag.String("base-dir", "", "base directory for configuration files") pflag.Bool("version", false, "show version and exit") - pflag.String("log-level", "info", "minimum level of messsages to log") + pflag.String("log-level", "info", "minimum level of messages to log") pflag.String("log-file", "", "redirect log output to a file") pflag.String("profile-address", "", "Address on which to run Go profile server") pflag.String("tracing-address", "", "Address to which to send tracing data") diff --git a/metrics.go b/metrics.go index 5711202..b0c69a4 100644 --- a/metrics.go +++ b/metrics.go @@ -53,7 +53,7 @@ func registerPrometheusMetrics() error { Help: "The timestamp at which this instance started.", }) if err := prometheus.Register(startTime); err != nil { - return errors.Wrap(err, "failed to regsiter start_time_secs") + return errors.Wrap(err, "failed to register start_time_secs") } startTime.SetToCurrentTime() @@ -72,7 +72,7 @@ func registerPrometheusMetrics() error { Help: "1 if ready to serve requests, otherwise 0.", }) if err := prometheus.Register(readyMetric); err != nil { - return errors.Wrap(err, "failed to regsiter ready") + return errors.Wrap(err, "failed to register ready") } return nil diff --git a/services/chaindb/postgresql/validators.go b/services/chaindb/postgresql/validators.go index b9df30a..fa55980 100644 --- a/services/chaindb/postgresql/validators.go +++ b/services/chaindb/postgresql/validators.go @@ -524,8 +524,8 @@ func (s *Service) ValidatorBalancesByIndexAndEpochRange( return validatorIndices[i] < validatorIndices[j] }) - // Create a matrix of the values we require. This allows the database to fill in the blanks when it doesn't have a balance for - // the required (index,epoch) tuple (for exmple when the balance is 0). + // Create a matrix of the values we require. This allows the database to fill in the blanks when it doesn't have a balance for + // the required (index,epoch) tuple (for example when the balance is 0). values := make([]string, 0) for _, validatorIndex := range validatorIndices { for epoch := startEpoch; epoch < endEpoch; epoch++ { @@ -599,8 +599,8 @@ func (s *Service) ValidatorBalancesByIndexAndEpochs( return validatorIndices[i] < validatorIndices[j] }) - // Create a matrix of the values we require. This allows the database to fill in the blanks when it doesn't have a balance for - // the required (index,epoch) tuple (for exmple when the balance is 0). + // Create a matrix of the values we require. This allows the database to fill in the blanks when it doesn't have a balance for + // the required (index,epoch) tuple (for example when the balance is 0). values := make([]string, 0) for _, validatorIndex := range validatorIndices { for _, epoch := range epochs { diff --git a/services/chaindb/types.go b/services/chaindb/types.go index 05272ed..2c5efc4 100644 --- a/services/chaindb/types.go +++ b/services/chaindb/types.go @@ -70,7 +70,7 @@ type ValidatorBalance struct { EffectiveBalance phase0.Gwei } -// AggregateValidatorBalance holds aggreated information about validators' balances at a given epoch. +// AggregateValidatorBalance holds aggregated information about validators' balances at a given epoch. type AggregateValidatorBalance struct { Epoch phase0.Epoch Balance phase0.Gwei diff --git a/util/calendarduration_test.go b/util/calendarduration_test.go index 379c44b..15511cb 100644 --- a/util/calendarduration_test.go +++ b/util/calendarduration_test.go @@ -287,7 +287,7 @@ func TestCalendarDuration(t *testing.T) { // Because Go normalises dates, months addition can be counter-intuitive. // Please refer to for details. // We reimplement months addition following the logic in https://lubridate.tidyverse.org/reference/mplus.html - // which matches implemenation of Moment.js and Java + // which matches implementation of Moment.js and Java { name: "EndMonths", duration: "P1M", diff --git a/util/logging.go b/util/logging.go index 594c88b..cca785b 100644 --- a/util/logging.go +++ b/util/logging.go @@ -40,7 +40,7 @@ func LogLevel(path string) zerolog.Level { return LogLevel(path[0:lastPeriod]) } -// stringtoLevel converts a string to a log level. +// stringToLevel converts a string to a log level. // It returns the user-supplied level by default. func stringToLevel(input string) zerolog.Level { switch strings.ToLower(input) { From f0349e4113146f6580417df038bdd4146abbc413 Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Tue, 14 Oct 2025 09:50:31 +0100 Subject: [PATCH 4/4] Apply suggestion from @Bez625 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3149de6..c2b8686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ 0.10.1: - - fix fulu support + - fix block handlers for fulu block event 0.10.0: - support fulu