Skip to content

Commit 8edc501

Browse files
authored
Merge pull request #116 from wealdtech/updateFuluAgain
Fix for fulu support.
2 parents ca2ec32 + f0349e4 commit 8edc501

8 files changed

Lines changed: 17 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
0.10.1:
2+
- fix block handlers for fulu block event
3+
14
0.10.0:
25
- support fulu
36
- use updated event handlers from go-eth2-client

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func main2() int {
152152
func fetchConfig() error {
153153
pflag.String("base-dir", "", "base directory for configuration files")
154154
pflag.Bool("version", false, "show version and exit")
155-
pflag.String("log-level", "info", "minimum level of messsages to log")
155+
pflag.String("log-level", "info", "minimum level of messages to log")
156156
pflag.String("log-file", "", "redirect log output to a file")
157157
pflag.String("profile-address", "", "Address on which to run Go profile server")
158158
pflag.String("tracing-address", "", "Address to which to send tracing data")

metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func registerPrometheusMetrics() error {
5353
Help: "The timestamp at which this instance started.",
5454
})
5555
if err := prometheus.Register(startTime); err != nil {
56-
return errors.Wrap(err, "failed to regsiter start_time_secs")
56+
return errors.Wrap(err, "failed to register start_time_secs")
5757
}
5858
startTime.SetToCurrentTime()
5959

@@ -72,7 +72,7 @@ func registerPrometheusMetrics() error {
7272
Help: "1 if ready to serve requests, otherwise 0.",
7373
})
7474
if err := prometheus.Register(readyMetric); err != nil {
75-
return errors.Wrap(err, "failed to regsiter ready")
75+
return errors.Wrap(err, "failed to register ready")
7676
}
7777

7878
return nil

services/blocks/standard/handler.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func (s *Service) OnBeaconChainHeadUpdated(
4343
slot phase0.Slot,
4444
blockRoot phase0.Root,
4545
stateRoot phase0.Root,
46-
// skipcq: RVV-A0005
4746
epochTransition bool,
4847
) {
4948
ctx, span := otel.Tracer("wealdtech.chaind.services.blocks.standard").Start(ctx, "OnBeaconChainHeadUpdated",
@@ -194,6 +193,8 @@ func (s *Service) OnBlock(ctx context.Context, signedBlock *spec.VersionedSigned
194193
return s.onBlockDeneb(ctx, signedBlock.Deneb, dbBlock)
195194
case spec.DataVersionElectra:
196195
return s.onBlockElectra(ctx, signedBlock.Electra, dbBlock)
196+
case spec.DataVersionFulu:
197+
return s.onBlockElectra(ctx, signedBlock.Fulu, dbBlock)
197198
case spec.DataVersionUnknown:
198199
return errors.New("unknown block version")
199200
default:
@@ -757,6 +758,8 @@ func (s *Service) dbBlock(
757758
return s.dbBlockDeneb(ctx, block.Deneb.Message)
758759
case spec.DataVersionElectra:
759760
return s.dbBlockElectra(ctx, block.Electra.Message)
761+
case spec.DataVersionFulu:
762+
return s.dbBlockElectra(ctx, block.Fulu.Message)
760763
case spec.DataVersionUnknown:
761764
return nil, errors.New("unknown block version")
762765
default:

services/chaindb/postgresql/validators.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ func (s *Service) ValidatorBalancesByIndexAndEpochRange(
524524
return validatorIndices[i] < validatorIndices[j]
525525
})
526526

527-
// 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
528-
// the required (index,epoch) tuple (for exmple when the balance is 0).
527+
// 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
528+
// the required (index,epoch) tuple (for example when the balance is 0).
529529
values := make([]string, 0)
530530
for _, validatorIndex := range validatorIndices {
531531
for epoch := startEpoch; epoch < endEpoch; epoch++ {
@@ -599,8 +599,8 @@ func (s *Service) ValidatorBalancesByIndexAndEpochs(
599599
return validatorIndices[i] < validatorIndices[j]
600600
})
601601

602-
// 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
603-
// the required (index,epoch) tuple (for exmple when the balance is 0).
602+
// 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
603+
// the required (index,epoch) tuple (for example when the balance is 0).
604604
values := make([]string, 0)
605605
for _, validatorIndex := range validatorIndices {
606606
for _, epoch := range epochs {

services/chaindb/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type ValidatorBalance struct {
7070
EffectiveBalance phase0.Gwei
7171
}
7272

73-
// AggregateValidatorBalance holds aggreated information about validators' balances at a given epoch.
73+
// AggregateValidatorBalance holds aggregated information about validators' balances at a given epoch.
7474
type AggregateValidatorBalance struct {
7575
Epoch phase0.Epoch
7676
Balance phase0.Gwei

util/calendarduration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func TestCalendarDuration(t *testing.T) {
287287
// Because Go normalises dates, months addition can be counter-intuitive.
288288
// Please refer to for details.
289289
// We reimplement months addition following the logic in https://lubridate.tidyverse.org/reference/mplus.html
290-
// which matches implemenation of Moment.js and Java
290+
// which matches implementation of Moment.js and Java
291291
{
292292
name: "EndMonths",
293293
duration: "P1M",

util/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func LogLevel(path string) zerolog.Level {
4040
return LogLevel(path[0:lastPeriod])
4141
}
4242

43-
// stringtoLevel converts a string to a log level.
43+
// stringToLevel converts a string to a log level.
4444
// It returns the user-supplied level by default.
4545
func stringToLevel(input string) zerolog.Level {
4646
switch strings.ToLower(input) {

0 commit comments

Comments
 (0)