diff --git a/clients.go b/clients.go index d719d332..c0d9ae42 100644 --- a/clients.go +++ b/clients.go @@ -90,6 +90,8 @@ func fetchMultiClient(ctx context.Context, monitor metrics.Service, addresses [] var err error client, err = multiclient.New(ctx, + multiclient.WithMonitor(monitor), + multiclient.WithLogLevel(util.LogLevel("eth2client.multi")), multiclient.WithClients(clients), ) if err != nil { diff --git a/main.go b/main.go index 550614c5..124ee270 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -// Copyright © 2020 - 2023 Attestant Limited. +// Copyright © 2020 - 2024 Attestant Limited. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -80,6 +80,7 @@ import ( firstaggregateattestationstrategy "github.com/attestantio/vouch/strategies/aggregateattestation/first" bestattestationdatastrategy "github.com/attestantio/vouch/strategies/attestationdata/best" firstattestationdatastrategy "github.com/attestantio/vouch/strategies/attestationdata/first" + majorityattestationdatastrategy "github.com/attestantio/vouch/strategies/attestationdata/majority" bestbeaconblockproposalstrategy "github.com/attestantio/vouch/strategies/beaconblockproposal/best" firstbeaconblockproposalstrategy "github.com/attestantio/vouch/strategies/beaconblockproposal/first" firstbeaconblockrootstrategy "github.com/attestantio/vouch/strategies/beaconblockroot/first" @@ -88,6 +89,7 @@ import ( firstblindedbeaconblockproposalstrategy "github.com/attestantio/vouch/strategies/blindedbeaconblockproposal/first" "github.com/attestantio/vouch/strategies/builderbid" bestbuilderbidstrategy "github.com/attestantio/vouch/strategies/builderbid/best" + deadlinebuilderbidstrategy "github.com/attestantio/vouch/strategies/builderbid/deadline" bestsynccommitteecontributionstrategy "github.com/attestantio/vouch/strategies/synccommitteecontribution/best" firstsynccommitteecontributionstrategy "github.com/attestantio/vouch/strategies/synccommitteecontribution/first" "github.com/attestantio/vouch/util" @@ -107,7 +109,7 @@ import ( ) // ReleaseVersion is the release version for the code. -var ReleaseVersion = "1.8.0-dev" +var ReleaseVersion = "1.8.0-beta.1" func main() { exitCode := main2() @@ -237,7 +239,9 @@ func fetchConfig() error { viper.SetDefault("blockrelay.listen-address", "0.0.0.0:18550") viper.SetDefault("blockrelay.fallback-gas-limit", uint64(30000000)) viper.SetDefault("accountmanager.dirk.timeout", 30*time.Second) - viper.SetDefault("strategies.beaconblockproposal.best.execution-payload-factor", float64(0.000005)) + viper.SetDefault("strategies.beaconblockproposal.best.execution-payload-factor", float64(0.0005)) + viper.SetDefault("strategies.builderbid.deadline.deadline", time.Second) + viper.SetDefault("strategies.builderbid.deadline.bid-gap", 100*time.Millisecond) if err := viper.ReadInConfig(); err != nil { switch { @@ -1082,6 +1086,28 @@ func selectAttestationDataProvider(ctx context.Context, if err != nil { return nil, errors.Wrap(err, "failed to start best attestation data strategy") } + case "majority": + log.Info().Msg("Starting majority attestation data strategy") + attestationDataProviders := make(map[string]eth2client.AttestationDataProvider) + for _, address := range util.BeaconNodeAddresses("strategies.attestationdata.majority") { + client, err := fetchClient(ctx, monitor, address) + if err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("failed to fetch client %s for attestation data strategy", address)) + } + attestationDataProviders[address] = client.(eth2client.AttestationDataProvider) + } + attestationDataProvider, err = majorityattestationdatastrategy.New(ctx, + majorityattestationdatastrategy.WithClientMonitor(monitor.(metrics.ClientMonitor)), + majorityattestationdatastrategy.WithProcessConcurrency(util.ProcessConcurrency("strategies.attestationdata.majority")), + majorityattestationdatastrategy.WithLogLevel(util.LogLevel("strategies.attestationdata.majority")), + majorityattestationdatastrategy.WithAttestationDataProviders(attestationDataProviders), + majorityattestationdatastrategy.WithTimeout(util.Timeout("strategies.attestationdata.majority")), + majorityattestationdatastrategy.WithChainTime(chainTime), + majorityattestationdatastrategy.WithBlockRootToSlotCache(cacheSvc.(cache.BlockRootToSlotProvider)), + ) + if err != nil { + return nil, errors.Wrap(err, "failed to start majority attestation data strategy") + } case "first": log.Info().Msg("Starting first attestation data strategy") attestationDataProviders := make(map[string]eth2client.AttestationDataProvider) @@ -1702,6 +1728,18 @@ func selectBuilderBidProvider(ctx context.Context, var err error switch viper.GetString("strategies.builderbid.style") { + case "deadline": + log.Info().Msg("Starting deadline builder bid strategy") + provider, err = deadlinebuilderbidstrategy.New(ctx, + deadlinebuilderbidstrategy.WithLogLevel(util.LogLevel("strategies.builderbid.deadline")), + deadlinebuilderbidstrategy.WithMonitor(monitor), + deadlinebuilderbidstrategy.WithSpecProvider(eth2Client.(eth2client.SpecProvider)), + deadlinebuilderbidstrategy.WithDomainProvider(eth2Client.(eth2client.DomainProvider)), + deadlinebuilderbidstrategy.WithChainTime(chainTime), + deadlinebuilderbidstrategy.WithDeadline(viper.GetDuration("strategies.builderbid.deadline.deadline")), + deadlinebuilderbidstrategy.WithBidGap(viper.GetDuration("strategies.builderbid.deadline.bid-gap")), + deadlinebuilderbidstrategy.WithReleaseVersion(ReleaseVersion), + ) case "best", "": log.Info().Msg("Starting best builder bid strategy") provider, err = bestbuilderbidstrategy.New(ctx, diff --git a/services/signer/standard/signrandaoreveal.go b/services/signer/standard/signrandaoreveal.go index 94f1a6ac..4a5a29f6 100644 --- a/services/signer/standard/signrandaoreveal.go +++ b/services/signer/standard/signrandaoreveal.go @@ -1,4 +1,4 @@ -// Copyright © 2020 Attestant Limited. +// Copyright © 2020, 2024 Attestant Limited. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -52,7 +52,7 @@ func (s *Service) SignRANDAOReveal(ctx context.Context, sig, err := s.sign(ctx, account, epochBytes, domain) if err != nil { - return phase0.BLSSignature{}, errors.Wrap(err, "failed to sign RANDO reveal") + return phase0.BLSSignature{}, errors.Wrap(err, "failed to sign RANDAO reveal") } return sig, nil diff --git a/services/signer/standard/signslotselection.go b/services/signer/standard/signslotselection.go index 0ea016af..84d16e75 100644 --- a/services/signer/standard/signslotselection.go +++ b/services/signer/standard/signslotselection.go @@ -1,4 +1,4 @@ -// Copyright © 2020 Attestant Limited. +// Copyright © 2020 - 2024 Attestant Limited. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -43,7 +43,7 @@ func (s *Service) SignSlotSelection(ctx context.Context, s.selectionProofDomainType, phase0.Epoch(slot/s.slotsPerEpoch)) if err != nil { - return phase0.BLSSignature{}, errors.Wrap(err, "failed to obtain signature domain for selection proof") + return phase0.BLSSignature{}, errors.Wrap(err, "failed to obtain signature domain for slot selection proof") } var slotBytes phase0.Root @@ -51,7 +51,7 @@ func (s *Service) SignSlotSelection(ctx context.Context, sig, err := s.sign(ctx, account, slotBytes, domain) if err != nil { - return phase0.BLSSignature{}, errors.Wrap(err, "failed to sign RANDO reveal") + return phase0.BLSSignature{}, errors.Wrap(err, "failed to sign slot selection proof") } return sig, nil