Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy-ups for beta 1. #167

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
44 changes: 41 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -80,6 +80,7 @@
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"

Check failure on line 83 in main.go

View workflow job for this annotation

GitHub Actions / test

no required module provides package github.com/attestantio/vouch/strategies/attestationdata/majority; to add it:
bestbeaconblockproposalstrategy "github.com/attestantio/vouch/strategies/beaconblockproposal/best"
firstbeaconblockproposalstrategy "github.com/attestantio/vouch/strategies/beaconblockproposal/first"
firstbeaconblockrootstrategy "github.com/attestantio/vouch/strategies/beaconblockroot/first"
Expand All @@ -88,6 +89,7 @@
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"

Check failure on line 92 in main.go

View workflow job for this annotation

GitHub Actions / test

no required module provides package github.com/attestantio/vouch/strategies/builderbid/deadline; to add it:
bestsynccommitteecontributionstrategy "github.com/attestantio/vouch/strategies/synccommitteecontribution/best"
firstsynccommitteecontributionstrategy "github.com/attestantio/vouch/strategies/synccommitteecontribution/first"
"github.com/attestantio/vouch/util"
Expand All @@ -107,7 +109,7 @@
)

// 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()
Expand Down Expand Up @@ -237,7 +239,9 @@
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 {
Expand Down Expand Up @@ -1082,6 +1086,28 @@
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)
Expand Down Expand Up @@ -1702,6 +1728,18 @@
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,
Expand Down
4 changes: 2 additions & 2 deletions services/signer/standard/signrandaoreveal.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions services/signer/standard/signslotselection.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,15 +43,15 @@ 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
binary.LittleEndian.PutUint64(slotBytes[:], uint64(slot))

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
Expand Down
Loading