Compare commits

...

12 Commits

Author SHA1 Message Date
james-prysm
b1b3cd11f5 Merge branch 'develop' into beacon-proposer-settings 2024-02-12 13:47:04 -06:00
james-prysm
fa1df7ee53 adding unit tests and more logs 2024-02-09 14:43:16 -06:00
james-prysm
48f0bef9bb Merge branch 'develop' into beacon-proposer-settings 2024-02-08 15:14:22 -06:00
james-prysm
3920cddb18 Merge branch 'develop' into beacon-proposer-settings 2024-02-08 10:31:33 -06:00
james-prysm
f102689c2c Merge branch 'develop' into beacon-proposer-settings 2024-02-05 10:25:03 -06:00
james-prysm
fd132103fd Merge branch 'develop' into beacon-proposer-settings 2024-02-05 09:08:44 -06:00
james-prysm
b71312f575 update the comments of auto generated proto 2024-01-26 14:49:01 -06:00
james-prysm
4540cd5cdc moving proposer settings outside of keymanager.proto 2024-01-26 14:47:12 -06:00
james-prysm
d33f1f2d98 fixing typo 2024-01-26 14:12:10 -06:00
james-prysm
3dc45c2041 adding flags to main.go 2024-01-26 14:10:47 -06:00
james-prysm
f7a04ab66d Merge branch 'develop' into beacon-proposer-settings 2024-01-26 14:06:13 -06:00
james-prysm
01eb14a0f0 poc on proposer settings for updating tracked cache 2024-01-26 13:58:14 -06:00
44 changed files with 1331 additions and 853 deletions

View File

@@ -55,6 +55,7 @@ go_library(
"//beacon-chain/verification:go_default_library",
"//cmd:go_default_library",
"//cmd/beacon-chain/flags:go_default_library",
"//config:go_default_library",
"//config/features:go_default_library",
"//config/params:go_default_library",
"//consensus-types/primitives:go_default_library",
@@ -62,6 +63,7 @@ go_library(
"//encoding/bytesutil:go_default_library",
"//monitoring/prometheus:go_default_library",
"//monitoring/tracing:go_default_library",
"//proto/prysm/config:go_default_library",
"//runtime:go_default_library",
"//runtime/debug:go_default_library",
"//runtime/prereqs:go_default_library",

View File

@@ -57,12 +57,14 @@ import (
"github.com/prysmaticlabs/prysm/v4/beacon-chain/verification"
"github.com/prysmaticlabs/prysm/v4/cmd"
"github.com/prysmaticlabs/prysm/v4/cmd/beacon-chain/flags"
"github.com/prysmaticlabs/prysm/v4/config"
"github.com/prysmaticlabs/prysm/v4/config/features"
"github.com/prysmaticlabs/prysm/v4/config/params"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/container/slice"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v4/monitoring/prometheus"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
"github.com/prysmaticlabs/prysm/v4/runtime"
"github.com/prysmaticlabs/prysm/v4/runtime/debug"
"github.com/prysmaticlabs/prysm/v4/runtime/prereqs"
@@ -816,6 +818,21 @@ func (b *BeaconNode) registerSlasherService() error {
return b.services.RegisterService(slasherSrv)
}
func proposerSettings(cliCtx *cli.Context) (*proposersettings.ProposerSettingsPayload, error) {
var fileConfig *proposersettings.ProposerSettingsPayload
if cliCtx.IsSet(flags.ProposerSettingsFlag.Name) {
if err := config.UnmarshalFromFile(cliCtx.Context, cliCtx.String(flags.ProposerSettingsFlag.Name), &fileConfig); err != nil {
return nil, err
}
}
if cliCtx.IsSet(flags.ProposerSettingsURLFlag.Name) {
if err := config.UnmarshalFromURL(cliCtx.Context, cliCtx.String(flags.ProposerSettingsURLFlag.Name), &fileConfig); err != nil {
return nil, err
}
}
return fileConfig, nil
}
func (b *BeaconNode) registerRPCService(router *mux.Router) error {
var chainService *blockchain.Service
if err := b.services.FetchService(&chainService); err != nil {
@@ -865,6 +882,11 @@ func (b *BeaconNode) registerRPCService(router *mux.Router) error {
maxMsgSize := b.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name)
enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name)
psettings, err := proposerSettings(b.cliCtx)
if err != nil {
return err
}
p2pService := b.fetchP2P()
rpcService := rpc.NewService(b.ctx, &rpc.Config{
ExecutionEngineCaller: web3Service,
@@ -916,8 +938,8 @@ func (b *BeaconNode) registerRPCService(router *mux.Router) error {
BlobStorage: b.BlobStorage,
TrackedValidatorsCache: b.trackedValidatorsCache,
PayloadIDCache: b.payloadIDCache,
ProposerSettings: psettings,
})
return b.services.RegisterService(rpcService)
}
@@ -1046,7 +1068,7 @@ func (b *BeaconNode) registerBuilderService(cliCtx *cli.Context) error {
if err := b.services.FetchService(&chainService); err != nil {
return err
}
// update here based on proposer settings
opts := append(b.serviceFlagOpts.builderOpts,
builder.WithHeadFetcher(chainService),
builder.WithDatabase(b.db))

View File

@@ -48,10 +48,17 @@ go_library(
"//beacon-chain/state/stategen:go_default_library",
"//beacon-chain/sync:go_default_library",
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/logs:go_default_library",
"//monitoring/tracing:go_default_library",
"//proto/prysm/config:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_gorilla_mux//:go_default_library",
"@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library",
"@com_github_grpc_ecosystem_go_grpc_middleware//recovery:go_default_library",

View File

@@ -9,6 +9,8 @@ import (
"net/http"
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/gorilla/mux"
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
@@ -21,6 +23,11 @@ import (
beaconprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/beacon"
nodeprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/node"
validatorprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/validator"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
"github.com/sirupsen/logrus"
"go.opencensus.io/plugin/ocgrpc"
"google.golang.org/grpc"
@@ -133,6 +140,7 @@ type Config struct {
BlobStorage *filesystem.BlobStorage
TrackedValidatorsCache *cache.TrackedValidatorsCache
PayloadIDCache *cache.PayloadIDCache
ProposerSettings *proposersettings.ProposerSettingsPayload
}
// NewService instantiates a new RPC service instance that will
@@ -373,6 +381,11 @@ func (s *Service) Start() {
OptimisticModeFetcher: s.cfg.OptimisticModeFetcher,
}
// update the tracked validator cache before starting servers
if err := updateTrackValidatorCacheWithProposerSettings(s.ctx, s.cfg.SyncService, s.cfg.ChainInfoFetcher, s.cfg.ProposerSettings, s.cfg.TrackedValidatorsCache); err != nil {
log.WithError(err).Errorf("Could NOT update tracked validator cache with proposer settings")
}
validatorServer := &validatorv1alpha1.Server{
Ctx: s.ctx,
AttPool: s.cfg.AttestationsPool,
@@ -599,6 +612,67 @@ func (s *Service) Start() {
}()
}
func updateTrackValidatorCacheWithProposerSettings(ctx context.Context, syncChecker chainSync.Checker, chain blockchain.ChainInfoFetcher, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache) error {
if settings == nil {
return nil
}
if !syncChecker.Synced() {
log.Warning("proposer cache is updating while the chain is not fully synced, using head state for validator information")
}
if settings.ProposerConfig != nil {
st, err := chain.HeadState(ctx)
if err != nil {
return err
}
builderSettingsProvided := false
for key, option := range settings.ProposerConfig {
decodedKey, err := hexutil.Decode(key)
if err != nil {
return errors.Wrapf(err, "could not decode public key %s", key)
}
if len(decodedKey) != fieldparams.BLSPubkeyLength {
return fmt.Errorf("%v is not a bls public key", key)
}
if err := proposer.VerifyOption(key, option); err != nil {
return err
}
validatorIndex, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(decodedKey))
if !ok {
continue
}
tackedValidatorCache.Set(cache.TrackedValidator{
Active: true, // TODO: either check or add the field in the request
Index: validatorIndex,
FeeRecipient: primitives.ExecutionAddress(common.HexToAddress(option.FeeRecipient).Bytes()),
})
if option.Builder != nil {
builderSettingsProvided = true
}
}
if builderSettingsProvided {
log.Warning("builder settings will be ignored. please provide proposer settings in the validator client to register validators")
}
return nil
}
if settings.DefaultConfig != nil {
if settings.DefaultConfig.FeeRecipient == "" {
return errors.New("default fee recipient cannot be empty")
}
if !common.IsHexAddress(settings.DefaultConfig.FeeRecipient) {
return errors.New("fee recipient is not a valid eth1 address")
}
if err := proposer.WarnNonChecksummedAddress(settings.DefaultConfig.FeeRecipient); err != nil {
return err
}
if settings.DefaultConfig.Builder != nil {
log.Warning("builder settings will be ignored. please provide proposer settings in the validator client to register validators")
}
log.Warning("no public keys provided, proposer cache is not updated from proposer settings file")
params.BeaconConfig().DefaultFeeRecipient = common.HexToAddress(settings.DefaultConfig.FeeRecipient)
}
return nil
}
// Stop the service.
func (s *Service) Stop() error {
s.cancel()

View File

@@ -5,11 +5,15 @@ import (
"errors"
"io"
"net/http"
"strings"
"testing"
"time"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/gorilla/mux"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
mock "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/cache"
mockExecution "github.com/prysmaticlabs/prysm/v4/beacon-chain/execution/testing"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/beacon"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/blob"
@@ -24,9 +28,15 @@ import (
nodeprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/node"
validatorprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/validator"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/startup"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/sync"
mockSync "github.com/prysmaticlabs/prysm/v4/beacon-chain/sync/initial-sync/testing"
"github.com/prysmaticlabs/prysm/v4/config/params"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/testing/assert"
"github.com/prysmaticlabs/prysm/v4/testing/require"
"github.com/prysmaticlabs/prysm/v4/testing/util"
"github.com/sirupsen/logrus"
logTest "github.com/sirupsen/logrus/hooks/test"
)
@@ -254,3 +264,167 @@ func TestRPC_InsecureEndpoint(t *testing.T) {
require.LogsContain(t, hook, "You are using an insecure gRPC server")
assert.NoError(t, rpcService.Stop())
}
func Test_updateTrackValidatorCacheWithProposerSettings(t *testing.T) {
tests := []struct {
name string
setup func() (sync.Checker, blockchain.ChainInfoFetcher, *proposersettings.ProposerSettingsPayload)
verify func(t *testing.T, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache, err error)
}{
{
name: "proposer settings empty",
setup: func() (sync.Checker, blockchain.ChainInfoFetcher, *proposersettings.ProposerSettingsPayload) {
key := "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c"
pubkey1decoded, err := hexutil.Decode(key)
require.NoError(t, err)
st, err := util.NewBeaconStateDeneb(util.FillRootsNaturalOptDeneb, func(state *ethpbalpha.BeaconStateDeneb) error {
state.Validators = []*ethpbalpha.Validator{{
PublicKey: pubkey1decoded,
WithdrawalCredentials: bytesutil.PadTo([]byte("withdrawalcredentials"), 32),
EffectiveBalance: 9,
Slashed: true,
ActivationEligibilityEpoch: 10,
ActivationEpoch: 11,
ExitEpoch: 12,
WithdrawableEpoch: 13,
}}
return nil
})
require.NoError(t, err)
return &mockSync.Sync{IsSynced: true},
&mock.ChainService{
State: st,
}, nil
},
verify: func(t *testing.T, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache, err error) {
require.NoError(t, err)
_, ok := tackedValidatorCache.Validator(0)
require.Equal(t, ok, false)
},
},
{
name: "proposer settings filled and chain is synced",
setup: func() (sync.Checker, blockchain.ChainInfoFetcher, *proposersettings.ProposerSettingsPayload) {
key := "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c"
pubkey1decoded, err := hexutil.Decode(key)
require.NoError(t, err)
st, err := util.NewBeaconStateDeneb(util.FillRootsNaturalOptDeneb, func(state *ethpbalpha.BeaconStateDeneb) error {
state.Validators = []*ethpbalpha.Validator{{
PublicKey: pubkey1decoded,
WithdrawalCredentials: bytesutil.PadTo([]byte("withdrawalcredentials"), 32),
EffectiveBalance: 9,
Slashed: true,
ActivationEligibilityEpoch: 10,
ActivationEpoch: 11,
ExitEpoch: 12,
WithdrawableEpoch: 13,
}}
return nil
})
require.NoError(t, err)
return &mockSync.Sync{IsSynced: true},
&mock.ChainService{
State: st,
},
&proposersettings.ProposerSettingsPayload{
ProposerConfig: map[string]*proposersettings.ProposerOptionPayload{
key: {
FeeRecipient: "0x967646dCD8d34F4E02204faeDcbAe0cC96fB9245",
},
},
}
},
verify: func(t *testing.T, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache, err error) {
require.NoError(t, err)
tr, ok := tackedValidatorCache.Validator(0)
require.Equal(t, ok, true)
require.StringContains(t, strings.ToLower(hexutil.Encode(tr.FeeRecipient[:])), strings.ToLower("0x967646dCD8d34F4E02204faeDcbAe0cC96fB9245"))
},
},
{
name: "proposer settings filled with non active or non matching key and chain is synced",
setup: func() (sync.Checker, blockchain.ChainInfoFetcher, *proposersettings.ProposerSettingsPayload) {
key := "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c"
key2 := "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44b"
pubkey2decoded, err := hexutil.Decode(key2)
require.NoError(t, err)
st, err := util.NewBeaconStateDeneb(util.FillRootsNaturalOptDeneb, func(state *ethpbalpha.BeaconStateDeneb) error {
state.Validators = []*ethpbalpha.Validator{{
PublicKey: pubkey2decoded,
WithdrawalCredentials: bytesutil.PadTo([]byte("withdrawalcredentials"), 32),
EffectiveBalance: 9,
Slashed: true,
ActivationEligibilityEpoch: 10,
ActivationEpoch: 11,
ExitEpoch: 12,
WithdrawableEpoch: 13,
}}
return nil
})
require.NoError(t, err)
return &mockSync.Sync{IsSynced: true},
&mock.ChainService{
State: st,
},
&proposersettings.ProposerSettingsPayload{
ProposerConfig: map[string]*proposersettings.ProposerOptionPayload{
key: {
FeeRecipient: "0x967646dCD8d34F4E02204faeDcbAe0cC96fB9245",
},
},
}
},
verify: func(t *testing.T, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache, err error) {
require.NoError(t, err)
_, ok := tackedValidatorCache.Validator(0)
require.Equal(t, ok, false)
},
},
{
name: "default proposer settings filled and chain is synced",
setup: func() (sync.Checker, blockchain.ChainInfoFetcher, *proposersettings.ProposerSettingsPayload) {
key := "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c"
pubkey1decoded, err := hexutil.Decode(key)
require.NoError(t, err)
st, err := util.NewBeaconStateDeneb(util.FillRootsNaturalOptDeneb, func(state *ethpbalpha.BeaconStateDeneb) error {
state.Validators = []*ethpbalpha.Validator{{
PublicKey: pubkey1decoded,
WithdrawalCredentials: bytesutil.PadTo([]byte("withdrawalcredentials"), 32),
EffectiveBalance: 9,
Slashed: true,
ActivationEligibilityEpoch: 10,
ActivationEpoch: 11,
ExitEpoch: 12,
WithdrawableEpoch: 13,
}}
return nil
})
require.NoError(t, err)
return &mockSync.Sync{IsSynced: true},
&mock.ChainService{
State: st,
},
&proposersettings.ProposerSettingsPayload{
DefaultConfig: &proposersettings.ProposerOptionPayload{
FeeRecipient: "0x967646dCD8d34F4E02204faeDcbAe0cC96fB9245",
},
}
},
verify: func(t *testing.T, settings *proposersettings.ProposerSettingsPayload, tackedValidatorCache *cache.TrackedValidatorsCache, err error) {
require.NoError(t, err)
_, ok := tackedValidatorCache.Validator(0)
require.Equal(t, ok, false)
require.Equal(t, params.BeaconConfig().DefaultFeeRecipient.String(), "0x967646dCD8d34F4E02204faeDcbAe0cC96fB9245")
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := cache.NewTrackedValidatorsCache()
syncChecker, chain, settings := tt.setup()
err := updateTrackValidatorCacheWithProposerSettings(context.Background(), syncChecker, chain, settings, c)
tt.verify(t, settings, c, err)
})
}
}

View File

@@ -232,12 +232,28 @@ var (
Usage: "Sets the minimum number of peers that a node will attempt to peer with that are subscribed to a subnet.",
Value: 6,
}
// SuggestedFeeRecipient specifies the fee recipient for the transaction fees.
SuggestedFeeRecipient = &cli.StringFlag{
Name: "suggested-fee-recipient",
Usage: "Post bellatrix, this address will receive the transaction fees produced by any blocks from this node. Default to junk whilst bellatrix is in development state. Validator client can override this value through the preparebeaconproposer api.",
Value: params.BeaconConfig().EthBurnAddressHex,
}
// ProposerSettingsFlag defines the path or URL to a file with proposer config.
ProposerSettingsFlag = &cli.StringFlag{
Name: "proposer-settings-file",
Usage: `Sets path to a YAML or JSON file containing validator settings used when proposing blocks such as
fee recipient and gas limit. File format found in docs.`,
Value: "",
}
// ProposerSettingsURLFlag defines the path or URL to a file with proposer config.
ProposerSettingsURLFlag = &cli.StringFlag{
Name: "proposer-settings-url",
Usage: `Sets URL to a REST endpoint containing validator settings used when proposing blocks such as
fee recipient and gas limit. File format found in docs`,
Value: "",
}
// TerminalTotalDifficultyOverride specifies the total difficulty to manual overrides the `TERMINAL_TOTAL_DIFFICULTY` parameter.
TerminalTotalDifficultyOverride = &cli.StringFlag{
Name: "terminal-total-difficulty-override",

View File

@@ -72,6 +72,8 @@ var appFlags = []cli.Flag{
flags.Eth1HeaderReqLimit,
flags.MinPeersPerSubnet,
flags.SuggestedFeeRecipient,
flags.ProposerSettingsFlag,
flags.ProposerSettingsURLFlag,
flags.TerminalTotalDifficultyOverride,
flags.TerminalBlockHashOverride,
flags.TerminalBlockHashActivationEpochOverride,

View File

@@ -130,6 +130,9 @@ var appHelpFlagGroups = []flagGroup{
flags.SlasherDirFlag,
flags.LocalBlockValueBoost,
flags.JwtId,
flags.SuggestedFeeRecipient,
flags.ProposerSettingsFlag,
flags.ProposerSettingsURLFlag,
checkpoint.BlockPath,
checkpoint.StatePath,
checkpoint.RemoteURL,
@@ -145,7 +148,6 @@ var appHelpFlagGroups = []flagGroup{
{
Name: "merge",
Flags: []cli.Flag{
flags.SuggestedFeeRecipient,
flags.TerminalTotalDifficultyOverride,
flags.TerminalBlockHashOverride,
flags.TerminalBlockHashActivationEpochOverride,

View File

@@ -26,7 +26,7 @@ go_library(
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",
"//io/prompt:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"//proto/prysm/config:go_default_library",
"//runtime/tos:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_logrusorgru_aurora//:go_default_library",

View File

@@ -14,7 +14,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v4/io/file"
"github.com/prysmaticlabs/prysm/v4/io/prompt"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"go.opencensus.io/trace"
@@ -68,25 +68,25 @@ func getProposerSettings(c *cli.Context, r io.Reader) error {
if c.IsSet(ProposerSettingsOutputFlag.Name) {
log.Infof("The default fee recipient is set to %s", defaultFeeRecipient)
var builderSettings *validatorpb.BuilderConfig
var builderSettings *proposersettings.BuilderConfig
if c.Bool(WithBuilderFlag.Name) {
builderSettings = &validatorpb.BuilderConfig{
builderSettings = &proposersettings.BuilderConfig{
Enabled: true,
GasLimit: validatorType.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
}
} else {
log.Infof("Default builder settings can be included with the `--%s` flag", WithBuilderFlag.Name)
}
proposerConfig := make(map[string]*validatorpb.ProposerOptionPayload)
proposerConfig := make(map[string]*proposersettings.ProposerOptionPayload)
for index, val := range validators {
proposerConfig[val] = &validatorpb.ProposerOptionPayload{
proposerConfig[val] = &proposersettings.ProposerOptionPayload{
FeeRecipient: feeRecipients[index],
Builder: builderSettings,
}
}
fileConfig := &validatorpb.ProposerSettingsPayload{
fileConfig := &proposersettings.ProposerSettingsPayload{
ProposerConfig: proposerConfig,
DefaultConfig: &validatorpb.ProposerOptionPayload{
DefaultConfig: &proposersettings.ProposerOptionPayload{
FeeRecipient: defaultFeeRecipient,
Builder: builderSettings,
},

View File

@@ -1,3 +1,5 @@
load("@prysm//tools/go:def.bzl", "go_library")
config_setting(
name = "mainnet",
flag_values = {
@@ -11,3 +13,15 @@ config_setting(
"//proto:network": "minimal",
},
)
go_library(
name = "go_default_library",
srcs = ["util.go"],
importpath = "github.com/prysmaticlabs/prysm/v4/config",
visibility = ["//visibility:public"],
deps = [
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_k8s_apimachinery//pkg/util/yaml:go_default_library",
],
)

View File

@@ -3,16 +3,17 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["proposer_settings.go"],
importpath = "github.com/prysmaticlabs/prysm/v4/config/validator/service",
importpath = "github.com/prysmaticlabs/prysm/v4/config/proposer",
visibility = ["//visibility:public"],
deps = [
"//config/fieldparams:go_default_library",
"//consensus-types/validator:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"//proto/prysm/config:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
],
)

View File

@@ -1,4 +1,4 @@
package validator_service_config
package proposer
import (
"fmt"
@@ -9,11 +9,12 @@ import (
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
log "github.com/sirupsen/logrus"
)
// ToSettings converts struct to ProposerSettings
func ToSettings(ps *validatorpb.ProposerSettingsPayload) (*ProposerSettings, error) {
func ToSettings(ps *proposersettings.ProposerSettingsPayload) (*ProposerSettings, error) {
settings := &ProposerSettings{}
if ps.ProposerConfig != nil {
settings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*ProposerOption)
@@ -60,7 +61,7 @@ type BuilderConfig struct {
}
// ToBuilderConfig converts protobuf to a builder config used in inmemory storage
func ToBuilderConfig(from *validatorpb.BuilderConfig) *BuilderConfig {
func ToBuilderConfig(from *proposersettings.BuilderConfig) *BuilderConfig {
if from == nil {
return nil
}
@@ -78,7 +79,7 @@ func ToBuilderConfig(from *validatorpb.BuilderConfig) *BuilderConfig {
}
// ProposerSettings is a Prysm internal representation of the fee recipient config on the validator client.
// validatorpb.ProposerSettingsPayload maps to ProposerSettings on import through the CLI.
// proposersettings.ProposerSettingsPayload maps to ProposerSettings on import through the CLI.
type ProposerSettings struct {
ProposeConfig map[[fieldparams.BLSPubkeyLength]byte]*ProposerOption
DefaultConfig *ProposerOption
@@ -94,15 +95,15 @@ func (settings *ProposerSettings) ShouldBeSaved() bool {
}
// ToPayload converts struct to ProposerSettingsPayload
func (ps *ProposerSettings) ToPayload() *validatorpb.ProposerSettingsPayload {
func (ps *ProposerSettings) ToPayload() *proposersettings.ProposerSettingsPayload {
if ps == nil {
return nil
}
payload := &validatorpb.ProposerSettingsPayload{}
payload := &proposersettings.ProposerSettingsPayload{}
if ps.ProposeConfig != nil {
payload.ProposerConfig = make(map[string]*validatorpb.ProposerOptionPayload)
payload.ProposerConfig = make(map[string]*proposersettings.ProposerOptionPayload)
for key, option := range ps.ProposeConfig {
p := &validatorpb.ProposerOptionPayload{}
p := &proposersettings.ProposerOptionPayload{}
if option.FeeRecipientConfig != nil {
p.FeeRecipient = option.FeeRecipientConfig.FeeRecipient.Hex()
}
@@ -113,7 +114,7 @@ func (ps *ProposerSettings) ToPayload() *validatorpb.ProposerSettingsPayload {
}
}
if ps.DefaultConfig != nil {
p := &validatorpb.ProposerOptionPayload{}
p := &proposersettings.ProposerOptionPayload{}
if ps.DefaultConfig.FeeRecipientConfig != nil {
p.FeeRecipient = ps.DefaultConfig.FeeRecipientConfig.FeeRecipient.Hex()
}
@@ -183,11 +184,11 @@ func (bc *BuilderConfig) Clone() *BuilderConfig {
}
// ToPayload converts Builder Config to the protobuf object
func (bc *BuilderConfig) ToPayload() *validatorpb.BuilderConfig {
func (bc *BuilderConfig) ToPayload() *proposersettings.BuilderConfig {
if bc == nil {
return nil
}
config := &validatorpb.BuilderConfig{}
config := &proposersettings.BuilderConfig{}
config.Enabled = bc.Enabled
var relays []string
if bc.Relays != nil {
@@ -213,3 +214,30 @@ func (po *ProposerOption) Clone() *ProposerOption {
}
return p
}
func VerifyOption(key string, option *proposersettings.ProposerOptionPayload) error {
if option == nil {
return fmt.Errorf("fee recipient is required for proposer %s", key)
}
if !common.IsHexAddress(option.FeeRecipient) {
return errors.New("fee recipient is not a valid eth1 address")
}
if err := WarnNonChecksummedAddress(option.FeeRecipient); err != nil {
return err
}
return nil
}
func WarnNonChecksummedAddress(feeRecipient string) error {
mixedcaseAddress, err := common.NewMixedcaseAddressFromString(feeRecipient)
if err != nil {
return errors.Wrapf(err, "could not decode fee recipient %s", feeRecipient)
}
if !mixedcaseAddress.ValidChecksum() {
log.Warnf("Fee recipient %s is not a checksum Ethereum address. "+
"The checksummed address is %s and will be used as the fee recipient. "+
"We recommend using a mixed-case address (checksum) "+
"to prevent spelling mistakes in your fee recipient Ethereum address", feeRecipient, mixedcaseAddress.Address().Hex())
}
return nil
}

View File

@@ -1,4 +1,4 @@
package validator_service_config
package proposer
import (
"testing"

65
config/util.go Normal file
View File

@@ -0,0 +1,65 @@
package config
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path/filepath"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/yaml"
)
func UnmarshalFromURL(ctx context.Context, from string, to interface{}) error {
u, err := url.ParseRequestURI(from)
if err != nil {
return err
}
if u.Scheme == "" || u.Host == "" {
return fmt.Errorf("invalid URL: %s", from)
}
req, reqerr := http.NewRequestWithContext(ctx, http.MethodGet, from, nil)
if reqerr != nil {
return errors.Wrap(reqerr, "failed to create http request")
}
req.Header.Set("Content-Type", "application/json")
resp, resperr := http.DefaultClient.Do(req)
if resperr != nil {
return errors.Wrap(resperr, "failed to send http request")
}
defer func(Body io.ReadCloser) {
err = Body.Close()
if err != nil {
log.WithError(err).Error("failed to close response body")
}
}(resp.Body)
if resp.StatusCode != http.StatusOK {
return errors.Errorf("http request to %v failed with status code %d", from, resp.StatusCode)
}
if decodeerr := json.NewDecoder(resp.Body).Decode(&to); decodeerr != nil {
return errors.Wrap(decodeerr, "failed to decode http response")
}
return nil
}
func UnmarshalFromFile(ctx context.Context, from string, to interface{}) error {
if ctx == nil {
return errors.New("node: nil context passed to unmarshalFromFile")
}
cleanpath := filepath.Clean(from)
b, err := os.ReadFile(cleanpath)
if err != nil {
return errors.Wrap(err, "failed to open file")
}
if err := yaml.Unmarshal(b, to); err != nil {
return errors.Wrap(err, "failed to unmarshal yaml file")
}
return nil
}

View File

@@ -0,0 +1,48 @@
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
##############################################################################
# Go
##############################################################################
# gazelle:ignore
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "proposersettings_proto",
srcs = ["proposer_settings.proto"],
visibility = ["//visibility:public"],
deps = [
"//proto/eth/ext:proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@googleapis//google/api:annotations_proto",
],
)
go_proto_library(
name = "proposersettings_go_proto",
compilers = [
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/prysm/config",
proto = ":proposersettings_proto",
visibility = ["//visibility:public"],
deps = [
"//consensus-types/primitives:go_default_library",
"//consensus-types/validator:go_default_library",
"//proto/eth/ext:go_default_library",
],
)
go_library(
name = "go_default_library",
embed = [":proposersettings_go_proto"],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/prysm/config",
visibility = ["//visibility:public"],
)

350
proto/prysm/config/proposer_settings.pb.go generated Executable file
View File

@@ -0,0 +1,350 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.25.1
// source: proto/prysm/config/proposer_settings.proto
package proposersettings
import (
reflect "reflect"
sync "sync"
github_com_prysmaticlabs_prysm_v4_consensus_types_validator "github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
_ "github.com/prysmaticlabs/prysm/v4/proto/eth/ext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ProposerOptionPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FeeRecipient string `protobuf:"bytes,1,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty"`
Builder *BuilderConfig `protobuf:"bytes,2,opt,name=builder,proto3" json:"builder,omitempty"`
}
func (x *ProposerOptionPayload) Reset() {
*x = ProposerOptionPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProposerOptionPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProposerOptionPayload) ProtoMessage() {}
func (x *ProposerOptionPayload) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProposerOptionPayload.ProtoReflect.Descriptor instead.
func (*ProposerOptionPayload) Descriptor() ([]byte, []int) {
return file_proto_prysm_config_proposer_settings_proto_rawDescGZIP(), []int{0}
}
func (x *ProposerOptionPayload) GetFeeRecipient() string {
if x != nil {
return x.FeeRecipient
}
return ""
}
func (x *ProposerOptionPayload) GetBuilder() *BuilderConfig {
if x != nil {
return x.Builder
}
return nil
}
type BuilderConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
GasLimit github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/validator.Uint64"`
Relays []string `protobuf:"bytes,3,rep,name=relays,proto3" json:"relays,omitempty"`
}
func (x *BuilderConfig) Reset() {
*x = BuilderConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BuilderConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BuilderConfig) ProtoMessage() {}
func (x *BuilderConfig) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BuilderConfig.ProtoReflect.Descriptor instead.
func (*BuilderConfig) Descriptor() ([]byte, []int) {
return file_proto_prysm_config_proposer_settings_proto_rawDescGZIP(), []int{1}
}
func (x *BuilderConfig) GetEnabled() bool {
if x != nil {
return x.Enabled
}
return false
}
func (x *BuilderConfig) GetGasLimit() github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64 {
if x != nil {
return x.GasLimit
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64(0)
}
func (x *BuilderConfig) GetRelays() []string {
if x != nil {
return x.Relays
}
return nil
}
type ProposerSettingsPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProposerConfig map[string]*ProposerOptionPayload `protobuf:"bytes,1,rep,name=proposer_config,json=proposerConfig,proto3" json:"proposer_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
DefaultConfig *ProposerOptionPayload `protobuf:"bytes,2,opt,name=default_config,json=defaultConfig,proto3" json:"default_config,omitempty"`
}
func (x *ProposerSettingsPayload) Reset() {
*x = ProposerSettingsPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProposerSettingsPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProposerSettingsPayload) ProtoMessage() {}
func (x *ProposerSettingsPayload) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_config_proposer_settings_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProposerSettingsPayload.ProtoReflect.Descriptor instead.
func (*ProposerSettingsPayload) Descriptor() ([]byte, []int) {
return file_proto_prysm_config_proposer_settings_proto_rawDescGZIP(), []int{2}
}
func (x *ProposerSettingsPayload) GetProposerConfig() map[string]*ProposerOptionPayload {
if x != nil {
return x.ProposerConfig
}
return nil
}
func (x *ProposerSettingsPayload) GetDefaultConfig() *ProposerOptionPayload {
if x != nil {
return x.DefaultConfig
}
return nil
}
var File_proto_prysm_config_proposer_settings_proto protoreflect.FileDescriptor
var file_proto_prysm_config_proposer_settings_proto_rawDesc = []byte{
0x0a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65, 0x74,
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x1b, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x15, 0x50, 0x72,
0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c,
0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70,
0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52,
0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c,
0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65,
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x42, 0x75, 0x69, 0x6c,
0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64,
0x65, 0x72, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63,
0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f,
0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69,
0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xba, 0x02, 0x0a, 0x17,
0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x65, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f,
0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x3c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f,
0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e,
0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4d,
0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65,
0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d,
0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x69, 0x0a,
0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x99, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67,
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x42, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
0x67, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c,
0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3b,
0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_prysm_config_proposer_settings_proto_rawDescOnce sync.Once
file_proto_prysm_config_proposer_settings_proto_rawDescData = file_proto_prysm_config_proposer_settings_proto_rawDesc
)
func file_proto_prysm_config_proposer_settings_proto_rawDescGZIP() []byte {
file_proto_prysm_config_proposer_settings_proto_rawDescOnce.Do(func() {
file_proto_prysm_config_proposer_settings_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_config_proposer_settings_proto_rawDescData)
})
return file_proto_prysm_config_proposer_settings_proto_rawDescData
}
var file_proto_prysm_config_proposer_settings_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_proto_prysm_config_proposer_settings_proto_goTypes = []interface{}{
(*ProposerOptionPayload)(nil), // 0: ethereum.config.ProposerOptionPayload
(*BuilderConfig)(nil), // 1: ethereum.config.BuilderConfig
(*ProposerSettingsPayload)(nil), // 2: ethereum.config.ProposerSettingsPayload
nil, // 3: ethereum.config.ProposerSettingsPayload.ProposerConfigEntry
}
var file_proto_prysm_config_proposer_settings_proto_depIdxs = []int32{
1, // 0: ethereum.config.ProposerOptionPayload.builder:type_name -> ethereum.config.BuilderConfig
3, // 1: ethereum.config.ProposerSettingsPayload.proposer_config:type_name -> ethereum.config.ProposerSettingsPayload.ProposerConfigEntry
0, // 2: ethereum.config.ProposerSettingsPayload.default_config:type_name -> ethereum.config.ProposerOptionPayload
0, // 3: ethereum.config.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.config.ProposerOptionPayload
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_proto_prysm_config_proposer_settings_proto_init() }
func file_proto_prysm_config_proposer_settings_proto_init() {
if File_proto_prysm_config_proposer_settings_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_prysm_config_proposer_settings_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProposerOptionPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_config_proposer_settings_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BuilderConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_config_proposer_settings_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProposerSettingsPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_prysm_config_proposer_settings_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_prysm_config_proposer_settings_proto_goTypes,
DependencyIndexes: file_proto_prysm_config_proposer_settings_proto_depIdxs,
MessageInfos: file_proto_prysm_config_proposer_settings_proto_msgTypes,
}.Build()
File_proto_prysm_config_proposer_settings_proto = out.File
file_proto_prysm_config_proposer_settings_proto_rawDesc = nil
file_proto_prysm_config_proposer_settings_proto_goTypes = nil
file_proto_prysm_config_proposer_settings_proto_depIdxs = nil
}

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
package ethereum.config;
import "proto/eth/ext/options.proto";
option csharp_namespace = "Ethereum.Config";
option go_package = "github.com/prysmaticlabs/prysm/v4/proto/prysm/config;proposersettings";
option java_multiple_files = true;
option java_outer_classname = "ProposerSettingsProto";
option java_package = "org.ethereum.config";
option php_namespace = "Ethereum\\config";
// ProposerOptionPayload is a property of ProposerSettingsPayload
message ProposerOptionPayload {
string fee_recipient = 1;
BuilderConfig builder = 2;
}
// BuilderConfig is a property of ProposerOptionPayload
message BuilderConfig {
bool enabled = 1;
uint64 gas_limit = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/validator.Uint64"];
repeated string relays = 3;
}
// ProposerSettingsPayload is used to unmarshal files sent from the validator flag as well as safe to bolt db bucket
message ProposerSettingsPayload {
map<string, ProposerOptionPayload> proposer_config = 1;
ProposerOptionPayload default_config = 2;
}

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.23.3
// protoc v4.25.1
// source: proto/prysm/v1alpha1/validator-client/keymanager.proto
package validatorpb
@@ -11,7 +11,6 @@ import (
sync "sync"
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
github_com_prysmaticlabs_prysm_v4_consensus_types_validator "github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
_ "github.com/prysmaticlabs/prysm/v4/proto/eth/ext"
v1alpha1 "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -455,179 +454,6 @@ func (x *SignResponse) GetStatus() SignResponse_Status {
return SignResponse_UNKNOWN
}
type ProposerOptionPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FeeRecipient string `protobuf:"bytes,1,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty"`
Builder *BuilderConfig `protobuf:"bytes,2,opt,name=builder,proto3" json:"builder,omitempty"`
}
func (x *ProposerOptionPayload) Reset() {
*x = ProposerOptionPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProposerOptionPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProposerOptionPayload) ProtoMessage() {}
func (x *ProposerOptionPayload) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProposerOptionPayload.ProtoReflect.Descriptor instead.
func (*ProposerOptionPayload) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDescGZIP(), []int{2}
}
func (x *ProposerOptionPayload) GetFeeRecipient() string {
if x != nil {
return x.FeeRecipient
}
return ""
}
func (x *ProposerOptionPayload) GetBuilder() *BuilderConfig {
if x != nil {
return x.Builder
}
return nil
}
type BuilderConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
GasLimit github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/validator.Uint64"`
Relays []string `protobuf:"bytes,3,rep,name=relays,proto3" json:"relays,omitempty"`
}
func (x *BuilderConfig) Reset() {
*x = BuilderConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BuilderConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BuilderConfig) ProtoMessage() {}
func (x *BuilderConfig) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BuilderConfig.ProtoReflect.Descriptor instead.
func (*BuilderConfig) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDescGZIP(), []int{3}
}
func (x *BuilderConfig) GetEnabled() bool {
if x != nil {
return x.Enabled
}
return false
}
func (x *BuilderConfig) GetGasLimit() github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64 {
if x != nil {
return x.GasLimit
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_validator.Uint64(0)
}
func (x *BuilderConfig) GetRelays() []string {
if x != nil {
return x.Relays
}
return nil
}
type ProposerSettingsPayload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProposerConfig map[string]*ProposerOptionPayload `protobuf:"bytes,1,rep,name=proposer_config,json=proposerConfig,proto3" json:"proposer_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
DefaultConfig *ProposerOptionPayload `protobuf:"bytes,2,opt,name=default_config,json=defaultConfig,proto3" json:"default_config,omitempty"`
}
func (x *ProposerSettingsPayload) Reset() {
*x = ProposerSettingsPayload{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProposerSettingsPayload) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProposerSettingsPayload) ProtoMessage() {}
func (x *ProposerSettingsPayload) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProposerSettingsPayload.ProtoReflect.Descriptor instead.
func (*ProposerSettingsPayload) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDescGZIP(), []int{4}
}
func (x *ProposerSettingsPayload) GetProposerConfig() map[string]*ProposerOptionPayload {
if x != nil {
return x.ProposerConfig
}
return nil
}
func (x *ProposerSettingsPayload) GetDefaultConfig() *ProposerOptionPayload {
if x != nil {
return x.DefaultConfig
}
return nil
}
var File_proto_prysm_v1alpha1_validator_client_keymanager_proto protoreflect.FileDescriptor
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte{
@@ -771,62 +597,20 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte
0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d,
0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a,
0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49,
0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0x85, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73,
0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12,
0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70,
0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xa6, 0x01,
0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73,
0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5,
0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79,
0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69,
0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06,
0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f,
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f,
0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74,
0x4c, 0x45, 0x44, 0x10, 0x03, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74,
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f,
0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79,
0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73,
0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61,
0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76,
0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73,
0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35,
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63,
0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68,
0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa,
0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32,
0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56,
0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65,
0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f,
0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -842,55 +626,47 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDescGZIP() [
}
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_goTypes = []interface{}{
(SignResponse_Status)(0), // 0: ethereum.validator.accounts.v2.SignResponse.Status
(*SignRequest)(nil), // 1: ethereum.validator.accounts.v2.SignRequest
(*SignResponse)(nil), // 2: ethereum.validator.accounts.v2.SignResponse
(*ProposerOptionPayload)(nil), // 3: ethereum.validator.accounts.v2.ProposerOptionPayload
(*BuilderConfig)(nil), // 4: ethereum.validator.accounts.v2.BuilderConfig
(*ProposerSettingsPayload)(nil), // 5: ethereum.validator.accounts.v2.ProposerSettingsPayload
nil, // 6: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry
(*v1alpha1.BeaconBlock)(nil), // 7: ethereum.eth.v1alpha1.BeaconBlock
(*v1alpha1.AttestationData)(nil), // 8: ethereum.eth.v1alpha1.AttestationData
(*v1alpha1.AggregateAttestationAndProof)(nil), // 9: ethereum.eth.v1alpha1.AggregateAttestationAndProof
(*v1alpha1.VoluntaryExit)(nil), // 10: ethereum.eth.v1alpha1.VoluntaryExit
(*v1alpha1.BeaconBlockAltair)(nil), // 11: ethereum.eth.v1alpha1.BeaconBlockAltair
(*v1alpha1.SyncAggregatorSelectionData)(nil), // 12: ethereum.eth.v1alpha1.SyncAggregatorSelectionData
(*v1alpha1.ContributionAndProof)(nil), // 13: ethereum.eth.v1alpha1.ContributionAndProof
(*v1alpha1.BeaconBlockBellatrix)(nil), // 14: ethereum.eth.v1alpha1.BeaconBlockBellatrix
(*v1alpha1.BlindedBeaconBlockBellatrix)(nil), // 15: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix
(*v1alpha1.ValidatorRegistrationV1)(nil), // 16: ethereum.eth.v1alpha1.ValidatorRegistrationV1
(*v1alpha1.BeaconBlockCapella)(nil), // 17: ethereum.eth.v1alpha1.BeaconBlockCapella
(*v1alpha1.BlindedBeaconBlockCapella)(nil), // 18: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
(*v1alpha1.BeaconBlockDeneb)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockDeneb
(*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
(*v1alpha1.BeaconBlock)(nil), // 3: ethereum.eth.v1alpha1.BeaconBlock
(*v1alpha1.AttestationData)(nil), // 4: ethereum.eth.v1alpha1.AttestationData
(*v1alpha1.AggregateAttestationAndProof)(nil), // 5: ethereum.eth.v1alpha1.AggregateAttestationAndProof
(*v1alpha1.VoluntaryExit)(nil), // 6: ethereum.eth.v1alpha1.VoluntaryExit
(*v1alpha1.BeaconBlockAltair)(nil), // 7: ethereum.eth.v1alpha1.BeaconBlockAltair
(*v1alpha1.SyncAggregatorSelectionData)(nil), // 8: ethereum.eth.v1alpha1.SyncAggregatorSelectionData
(*v1alpha1.ContributionAndProof)(nil), // 9: ethereum.eth.v1alpha1.ContributionAndProof
(*v1alpha1.BeaconBlockBellatrix)(nil), // 10: ethereum.eth.v1alpha1.BeaconBlockBellatrix
(*v1alpha1.BlindedBeaconBlockBellatrix)(nil), // 11: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix
(*v1alpha1.ValidatorRegistrationV1)(nil), // 12: ethereum.eth.v1alpha1.ValidatorRegistrationV1
(*v1alpha1.BeaconBlockCapella)(nil), // 13: ethereum.eth.v1alpha1.BeaconBlockCapella
(*v1alpha1.BlindedBeaconBlockCapella)(nil), // 14: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
(*v1alpha1.BeaconBlockDeneb)(nil), // 15: ethereum.eth.v1alpha1.BeaconBlockDeneb
(*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 16: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
}
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int32{
7, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock
8, // 1: ethereum.validator.accounts.v2.SignRequest.attestation_data:type_name -> ethereum.eth.v1alpha1.AttestationData
9, // 2: ethereum.validator.accounts.v2.SignRequest.aggregate_attestation_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof
10, // 3: ethereum.validator.accounts.v2.SignRequest.exit:type_name -> ethereum.eth.v1alpha1.VoluntaryExit
11, // 4: ethereum.validator.accounts.v2.SignRequest.block_altair:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair
12, // 5: ethereum.validator.accounts.v2.SignRequest.sync_aggregator_selection_data:type_name -> ethereum.eth.v1alpha1.SyncAggregatorSelectionData
13, // 6: ethereum.validator.accounts.v2.SignRequest.contribution_and_proof:type_name -> ethereum.eth.v1alpha1.ContributionAndProof
14, // 7: ethereum.validator.accounts.v2.SignRequest.block_bellatrix:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix
15, // 8: ethereum.validator.accounts.v2.SignRequest.blinded_block_bellatrix:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix
16, // 9: ethereum.validator.accounts.v2.SignRequest.registration:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1
17, // 10: ethereum.validator.accounts.v2.SignRequest.block_capella:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella
18, // 11: ethereum.validator.accounts.v2.SignRequest.blinded_block_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
19, // 12: ethereum.validator.accounts.v2.SignRequest.block_deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb
20, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
3, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock
4, // 1: ethereum.validator.accounts.v2.SignRequest.attestation_data:type_name -> ethereum.eth.v1alpha1.AttestationData
5, // 2: ethereum.validator.accounts.v2.SignRequest.aggregate_attestation_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof
6, // 3: ethereum.validator.accounts.v2.SignRequest.exit:type_name -> ethereum.eth.v1alpha1.VoluntaryExit
7, // 4: ethereum.validator.accounts.v2.SignRequest.block_altair:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair
8, // 5: ethereum.validator.accounts.v2.SignRequest.sync_aggregator_selection_data:type_name -> ethereum.eth.v1alpha1.SyncAggregatorSelectionData
9, // 6: ethereum.validator.accounts.v2.SignRequest.contribution_and_proof:type_name -> ethereum.eth.v1alpha1.ContributionAndProof
10, // 7: ethereum.validator.accounts.v2.SignRequest.block_bellatrix:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix
11, // 8: ethereum.validator.accounts.v2.SignRequest.blinded_block_bellatrix:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix
12, // 9: ethereum.validator.accounts.v2.SignRequest.registration:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1
13, // 10: ethereum.validator.accounts.v2.SignRequest.block_capella:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella
14, // 11: ethereum.validator.accounts.v2.SignRequest.blinded_block_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
15, // 12: ethereum.validator.accounts.v2.SignRequest.block_deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb
16, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
0, // 14: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status
4, // 15: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig
6, // 16: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry
3, // 17: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
3, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
19, // [19:19] is the sub-list for method output_type
19, // [19:19] is the sub-list for method input_type
19, // [19:19] is the sub-list for extension type_name
19, // [19:19] is the sub-list for extension extendee
0, // [0:19] is the sub-list for field type_name
15, // [15:15] is the sub-list for method output_type
15, // [15:15] is the sub-list for method input_type
15, // [15:15] is the sub-list for extension type_name
15, // [15:15] is the sub-list for extension extendee
0, // [0:15] is the sub-list for field type_name
}
func init() { file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() }
@@ -923,42 +699,6 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() {
return nil
}
}
file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProposerOptionPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BuilderConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProposerSettingsPayload); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[0].OneofWrappers = []interface{}{
(*SignRequest_Block)(nil),
@@ -985,7 +725,7 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -81,23 +81,4 @@ message SignResponse {
// to ensure different remote signing servers follow the
// same conventions.
Status status = 2;
}
// ProposerOptionPayload is a property of ProposerSettingsPayload
message ProposerOptionPayload {
string fee_recipient = 1;
BuilderConfig builder = 2;
}
// BuilderConfig is a property of ProposerOptionPayload
message BuilderConfig {
bool enabled = 1;
uint64 gas_limit = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/validator.Uint64"];
repeated string relays = 3;
}
// ProposerSettingsPayload is used to unmarshal files sent from the validator flag as well as safe to bolt db bucket
message ProposerSettingsPayload {
map<string, ProposerOptionPayload> proposer_config = 1;
ProposerOptionPayload default_config = 2;
}

View File

@@ -31,7 +31,7 @@ go_library(
"//config/params:go_default_library",
"//crypto/bls:go_default_library",
"//io/file:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"//proto/prysm/config:go_default_library",
"//runtime/interop:go_default_library",
"//testing/endtoend/helpers:go_default_library",
"//testing/endtoend/params:go_default_library",

View File

@@ -21,7 +21,7 @@ import (
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
"github.com/prysmaticlabs/prysm/v4/io/file"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
"github.com/prysmaticlabs/prysm/v4/runtime/interop"
"github.com/prysmaticlabs/prysm/v4/testing/endtoend/helpers"
e2e "github.com/prysmaticlabs/prysm/v4/testing/endtoend/params"
@@ -340,16 +340,16 @@ func createProposerSettingsPath(pubkeys []string, nodeIdx int) (string, error) {
if len(pubkeys) == 0 {
return "", errors.New("number of validators must be greater than 0")
}
config := make(map[string]*validatorpb.ProposerOptionPayload)
config := make(map[string]*proposersettings.ProposerOptionPayload)
for i, pubkey := range pubkeys {
config[pubkeys[i]] = &validatorpb.ProposerOptionPayload{
config[pubkeys[i]] = &proposersettings.ProposerOptionPayload{
FeeRecipient: FeeRecipientFromPubkey(pubkey),
}
}
proposerSettingsPayload := &validatorpb.ProposerSettingsPayload{
proposerSettingsPayload := &proposersettings.ProposerSettingsPayload{
ProposerConfig: config,
DefaultConfig: &validatorpb.ProposerOptionPayload{
DefaultConfig: &proposersettings.ProposerOptionPayload{
FeeRecipient: DefaultFeeRecipientAddress,
},
}

View File

@@ -10,7 +10,7 @@ go_library(
"//validator:__subpackages__",
],
deps = [
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//validator/accounts/iface:go_default_library",

View File

@@ -7,7 +7,7 @@ import (
"sync"
"time"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/validator/accounts/iface"
@@ -89,7 +89,7 @@ func (_ *Wallet) InitializeKeymanager(_ context.Context, _ iface.InitKeymanagerC
type Validator struct {
Km keymanager.IKeymanager
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
}
func (_ *Validator) LogSubmittedSyncCommitteeMessages() {}
@@ -203,12 +203,12 @@ func (_ *Validator) SignValidatorRegistrationRequest(_ context.Context, _ iface2
}
// ProposerSettings for mocking
func (m *Validator) ProposerSettings() *validatorserviceconfig.ProposerSettings {
func (m *Validator) ProposerSettings() *proposer.ProposerSettings {
return m.proposerSettings
}
// SetProposerSettings for mocking
func (m *Validator) SetProposerSettings(_ context.Context, settings *validatorserviceconfig.ProposerSettings) error {
func (m *Validator) SetProposerSettings(_ context.Context, settings *proposer.ProposerSettings) error {
m.proposerSettings = settings
return nil
}

View File

@@ -36,7 +36,7 @@ go_library(
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
@@ -126,7 +126,7 @@ go_test(
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/blocks/testing:go_default_library",
"//consensus-types/interfaces:go_default_library",

View File

@@ -13,7 +13,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//config/fieldparams:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//consensus-types/validator:go_default_library",
"//crypto/bls:go_default_library",

View File

@@ -6,7 +6,7 @@ import (
"time"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/crypto/bls"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
@@ -62,8 +62,8 @@ type Validator interface {
CheckDoppelGanger(ctx context.Context) error
PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error
SignValidatorRegistrationRequest(ctx context.Context, signer SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error)
ProposerSettings() *validatorserviceconfig.ProposerSettings
SetProposerSettings(context.Context, *validatorserviceconfig.ProposerSettings) error
ProposerSettings() *proposer.ProposerSettings
SetProposerSettings(context.Context, *proposer.ProposerSettings) error
StartEventStream(ctx context.Context) error
EventStreamIsRunning() bool
NodeIsHealthy(ctx context.Context) bool

View File

@@ -11,7 +11,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/async/event"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/testing/assert"
"github.com/prysmaticlabs/prysm/v4/testing/require"
@@ -225,9 +225,9 @@ func notActive(t *testing.T) [fieldparams.BLSPubkeyLength]byte {
func TestUpdateProposerSettingsAt_EpochStart(t *testing.T) {
v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}}
err := v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
err := v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},
@@ -250,9 +250,9 @@ func TestUpdateProposerSettingsAt_EpochStart(t *testing.T) {
func TestUpdateProposerSettingsAt_EpochEndOk(t *testing.T) {
v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, ProposerSettingWait: time.Duration(params.BeaconConfig().SecondsPerSlot-1) * time.Second}
err := v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
err := v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},
@@ -279,9 +279,9 @@ func TestUpdateProposerSettings_ContinuesAfterValidatorRegistrationFails(t *test
ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeotherError.Error()),
Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}},
}
err := v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
err := v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},

View File

@@ -17,7 +17,7 @@ import (
lruwrpr "github.com/prysmaticlabs/prysm/v4/cache/lru"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/validator/accounts/wallet"
@@ -75,7 +75,7 @@ type ValidatorService struct {
grpcHeaders []string
graffiti []byte
Web3SignerConfig *remoteweb3signer.SetupConfig
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
validatorsRegBatchSize int
}
@@ -100,7 +100,7 @@ type Config struct {
GraffitiFlag string
Endpoint string
Web3SignerConfig *remoteweb3signer.SetupConfig
ProposerSettings *validatorserviceconfig.ProposerSettings
ProposerSettings *proposer.ProposerSettings
BeaconApiEndpoint string
BeaconApiTimeout time.Duration
ValidatorsRegBatchSize int
@@ -271,7 +271,7 @@ func (v *ValidatorService) Keymanager() (keymanager.IKeymanager, error) {
}
// ProposerSettings returns a deep copy of the underlying proposer settings in the validator
func (v *ValidatorService) ProposerSettings() *validatorserviceconfig.ProposerSettings {
func (v *ValidatorService) ProposerSettings() *proposer.ProposerSettings {
settings := v.validator.ProposerSettings()
if settings != nil {
return settings.Clone()
@@ -280,7 +280,7 @@ func (v *ValidatorService) ProposerSettings() *validatorserviceconfig.ProposerSe
}
// SetProposerSettings sets the proposer settings on the validator service as well as the underlying validator
func (v *ValidatorService) SetProposerSettings(ctx context.Context, settings *validatorserviceconfig.ProposerSettings) error {
func (v *ValidatorService) SetProposerSettings(ctx context.Context, settings *proposer.ProposerSettings) error {
// validator service proposer settings is only used for pass through from node -> validator service -> validator.
// in memory use of proposer settings happens on validator.
v.proposerSettings = settings

View File

@@ -11,7 +11,7 @@ go_library(
visibility = ["//validator:__subpackages__"],
deps = [
"//config/fieldparams:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",

View File

@@ -6,7 +6,7 @@ import (
"time"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
prysmTime "github.com/prysmaticlabs/prysm/v4/time"
@@ -52,7 +52,7 @@ type FakeValidator struct {
IndexToPubkeyMap map[uint64][fieldparams.BLSPubkeyLength]byte
PubkeyToIndexMap map[[fieldparams.BLSPubkeyLength]byte]uint64
PubkeysToStatusesMap map[[fieldparams.BLSPubkeyLength]byte]ethpb.ValidatorStatus
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
ProposerSettingWait time.Duration
Km keymanager.IKeymanager
}
@@ -276,12 +276,12 @@ func (*FakeValidator) SignValidatorRegistrationRequest(_ context.Context, _ ifac
}
// ProposerSettings for mocking
func (fv *FakeValidator) ProposerSettings() *validatorserviceconfig.ProposerSettings {
func (fv *FakeValidator) ProposerSettings() *proposer.ProposerSettings {
return fv.proposerSettings
}
// SetProposerSettings for mocking
func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *validatorserviceconfig.ProposerSettings) error {
func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *proposer.ProposerSettings) error {
fv.proposerSettings = settings
return nil
}

View File

@@ -26,7 +26,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/config/features"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/crypto/hash"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
@@ -106,7 +106,7 @@ type validator struct {
voteStats voteStats
syncCommitteeStats syncCommitteeStats
Web3SignerConfig *remoteweb3signer.SetupConfig
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
walletInitializedChannel chan *wallet.Wallet
validatorsRegBatchSize int
}
@@ -1009,12 +1009,12 @@ func (v *validator) logDuties(slot primitives.Slot, currentEpochDuties []*ethpb.
}
// ProposerSettings gets the current proposer settings saved in memory validator
func (v *validator) ProposerSettings() *validatorserviceconfig.ProposerSettings {
func (v *validator) ProposerSettings() *proposer.ProposerSettings {
return v.proposerSettings
}
// SetProposerSettings sets and saves the passed in proposer settings overriding the in memory one
func (v *validator) SetProposerSettings(ctx context.Context, settings *validatorserviceconfig.ProposerSettings) error {
func (v *validator) SetProposerSettings(ctx context.Context, settings *proposer.ProposerSettings) error {
if v.db == nil {
return errors.New("db is not set")
}

View File

@@ -19,7 +19,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/config/features"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
validatorType "github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/crypto/bls"
@@ -1402,7 +1402,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1422,22 +1422,22 @@ func TestValidator_PushProposerSettings(t *testing.T) {
{FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2},
},
}).Return(nil, nil)
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 35000000,
},
@@ -1484,7 +1484,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1504,22 +1504,22 @@ func TestValidator_PushProposerSettings(t *testing.T) {
{FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2},
},
}).Return(nil, nil)
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: 35000000,
},
@@ -1562,7 +1562,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1582,15 +1582,15 @@ func TestValidator_PushProposerSettings(t *testing.T) {
{FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2},
},
}).Return(nil, nil)
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9"),
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
},
@@ -1630,13 +1630,13 @@ func TestValidator_PushProposerSettings(t *testing.T) {
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
require.NoError(t, err)
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validatorType.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -1691,13 +1691,13 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
@@ -1755,7 +1755,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1773,15 +1773,15 @@ func TestValidator_PushProposerSettings(t *testing.T) {
{FeeRecipient: common.HexToAddress("0x0").Bytes(), ValidatorIndex: 1},
},
}).Return(nil, nil)
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.Address{},
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
},
@@ -1807,7 +1807,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1816,15 +1816,15 @@ func TestValidator_PushProposerSettings(t *testing.T) {
gomock.Any(), // ctx
&ethpb.ValidatorIndexRequest{PublicKey: keys[0][:]},
).Return(nil, errors.New("could not find validator index for public key"))
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"),
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
},
@@ -1850,7 +1850,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
}
err := v.WaitForKeymanagerInitialization(ctx)
require.NoError(t, err)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption)
config := make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
km, err := v.Keymanager()
require.NoError(t, err)
keys, err := km.FetchValidatingPublicKeys(ctx)
@@ -1864,22 +1864,22 @@ func TestValidator_PushProposerSettings(t *testing.T) {
PublicKeys: [][]byte{keys[0][:]},
}, nil)
config[keys[0]] = &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
config[keys[0]] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.Address{},
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
}
err = v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{
err = v.SetProposerSettings(context.Background(), &proposer.ProposerSettings{
ProposeConfig: config,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(defaultFeeHex),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
@@ -2015,26 +2015,26 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) {
}, nil)
v := validator{
validatorClient: client,
proposerSettings: &validatorserviceconfig.ProposerSettings{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: nil,
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
pubkey1: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient1,
},
},
pubkey2: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient2,
},
},
pubkey3: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient3,
},
},
pubkey4: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient4,
},
},
@@ -2158,30 +2158,30 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) {
v := validator{
validatorClient: client,
proposerSettings: &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: defaultFeeRecipient,
},
},
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
pubkey1: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient1,
},
},
pubkey2: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient2,
},
},
pubkey3: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient3,
},
},
pubkey8: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient8,
},
},
@@ -2265,38 +2265,38 @@ func TestValidator_buildSignedRegReqs_DefaultConfigDisabled(t *testing.T) {
v := validator{
signedValidatorRegistrations: map[[48]byte]*ethpb.SignedValidatorRegistrationV1{},
validatorClient: client,
proposerSettings: &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: defaultFeeRecipient,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: 9999,
},
},
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
pubkey1: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient1,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 1111,
},
},
pubkey2: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient2,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: 2222,
},
},
pubkey3: {
FeeRecipientConfig: nil,
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 3333,
},
@@ -2350,38 +2350,38 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) {
v := validator{
signedValidatorRegistrations: map[[48]byte]*ethpb.SignedValidatorRegistrationV1{},
validatorClient: client,
proposerSettings: &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: defaultFeeRecipient,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 9999,
},
},
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
pubkey1: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient1,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 1111,
},
},
pubkey2: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient2,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: 2222,
},
},
pubkey3: {
FeeRecipientConfig: nil,
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 3333,
},
@@ -2428,12 +2428,12 @@ func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) {
v := validator{
signedValidatorRegistrations: map[[48]byte]*ethpb.SignedValidatorRegistrationV1{},
validatorClient: client,
proposerSettings: &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: defaultFeeRecipient,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 9999,
},
@@ -2472,22 +2472,22 @@ func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) {
signedValidatorRegistrations: map[[48]byte]*ethpb.SignedValidatorRegistrationV1{},
validatorClient: client,
genesisTime: uint64(time.Now().UTC().Unix() + 1000),
proposerSettings: &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
proposerSettings: &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: defaultFeeRecipient,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 9999,
},
},
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
pubkey1: {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient1,
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 1111,
},

View File

@@ -8,7 +8,7 @@ go_library(
visibility = ["//validator:__subpackages__"],
deps = [
"//config/fieldparams:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//monitoring/backup:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",

View File

@@ -6,7 +6,7 @@ import (
"io"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
validatorServiceConfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/monitoring/backup"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
@@ -65,9 +65,9 @@ type ValidatorDB interface {
GraffitiOrderedIndex(ctx context.Context, fileHash [32]byte) (uint64, error)
// ProposerSettings related methods
ProposerSettings(context.Context) (*validatorServiceConfig.ProposerSettings, error)
ProposerSettings(context.Context) (*proposer.ProposerSettings, error)
ProposerSettingsExists(ctx context.Context) (bool, error)
UpdateProposerSettingsDefault(context.Context, *validatorServiceConfig.ProposerOption) error
UpdateProposerSettingsForPubkey(context.Context, [fieldparams.BLSPubkeyLength]byte, *validatorServiceConfig.ProposerOption) error
SaveProposerSettings(ctx context.Context, settings *validatorServiceConfig.ProposerSettings) error
UpdateProposerSettingsDefault(context.Context, *proposer.ProposerOption) error
UpdateProposerSettingsForPubkey(context.Context, [fieldparams.BLSPubkeyLength]byte, *proposer.ProposerOption) error
SaveProposerSettings(ctx context.Context, settings *proposer.ProposerSettings) error
}

View File

@@ -30,15 +30,15 @@ go_library(
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",
"//monitoring/progress:go_default_library",
"//monitoring/tracing:go_default_library",
"//proto/prysm/config:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/slashings:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"//time/slots:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
@@ -70,7 +70,7 @@ go_test(
deps = [
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//consensus-types/validator:go_default_library",
"//crypto/hash:go_default_library",

View File

@@ -6,8 +6,8 @@ import (
"github.com/pkg/errors"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
validatorServiceConfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
bolt "go.etcd.io/bbolt"
"go.opencensus.io/trace"
"google.golang.org/protobuf/proto"
@@ -17,7 +17,7 @@ import (
var ErrNoProposerSettingsFound = errors.New("no proposer settings found in bucket")
// UpdateProposerSettingsForPubkey updates the existing settings for an internal representation of the proposers settings file at a particular public key
func (s *Store) UpdateProposerSettingsForPubkey(ctx context.Context, pubkey [fieldparams.BLSPubkeyLength]byte, options *validatorServiceConfig.ProposerOption) error {
func (s *Store) UpdateProposerSettingsForPubkey(ctx context.Context, pubkey [fieldparams.BLSPubkeyLength]byte, options *proposer.ProposerOption) error {
_, span := trace.StartSpan(ctx, "validator.db.UpdateProposerSettingsForPubkey")
defer span.End()
err := s.db.Update(func(tx *bolt.Tx) error {
@@ -26,16 +26,16 @@ func (s *Store) UpdateProposerSettingsForPubkey(ctx context.Context, pubkey [fie
if len(b) == 0 {
return fmt.Errorf("no proposer settings found in bucket")
}
to := &validatorpb.ProposerSettingsPayload{}
to := &proposersettings.ProposerSettingsPayload{}
if err := proto.Unmarshal(b, to); err != nil {
return errors.Wrap(err, "failed to unmarshal proposer settings")
}
settings, err := validatorServiceConfig.ToSettings(to)
settings, err := proposer.ToSettings(to)
if err != nil {
return errors.Wrap(err, "failed to convert payload to proposer settings")
}
if settings.ProposeConfig == nil {
settings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption)
settings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
}
settings.ProposeConfig[pubkey] = options
m, err := proto.Marshal(settings.ToPayload())
@@ -48,7 +48,7 @@ func (s *Store) UpdateProposerSettingsForPubkey(ctx context.Context, pubkey [fie
}
// UpdateProposerSettingsDefault updates the existing default settings for proposer settings
func (s *Store) UpdateProposerSettingsDefault(ctx context.Context, options *validatorServiceConfig.ProposerOption) error {
func (s *Store) UpdateProposerSettingsDefault(ctx context.Context, options *proposer.ProposerOption) error {
_, span := trace.StartSpan(ctx, "validator.db.UpdateProposerSettingsDefault")
defer span.End()
if options == nil {
@@ -63,11 +63,11 @@ func (s *Store) UpdateProposerSettingsDefault(ctx context.Context, options *vali
if len(b) == 0 {
return ErrNoProposerSettingsFound
}
to := &validatorpb.ProposerSettingsPayload{}
to := &proposersettings.ProposerSettingsPayload{}
if err := proto.Unmarshal(b, to); err != nil {
return errors.Wrap(err, "failed to unmarshal proposer settings")
}
settings, err := validatorServiceConfig.ToSettings(to)
settings, err := proposer.ToSettings(to)
if err != nil {
return errors.Wrap(err, "failed to convert payload to proposer settings")
}
@@ -82,10 +82,10 @@ func (s *Store) UpdateProposerSettingsDefault(ctx context.Context, options *vali
}
// ProposerSettings gets the current proposer settings
func (s *Store) ProposerSettings(ctx context.Context) (*validatorServiceConfig.ProposerSettings, error) {
func (s *Store) ProposerSettings(ctx context.Context) (*proposer.ProposerSettings, error) {
_, span := trace.StartSpan(ctx, "validator.db.ProposerSettings")
defer span.End()
to := &validatorpb.ProposerSettingsPayload{}
to := &proposersettings.ProposerSettingsPayload{}
if err := s.db.View(func(tx *bolt.Tx) error {
bkt := tx.Bucket(proposerSettingsBucket)
b := bkt.Get(proposerSettingsKey)
@@ -99,7 +99,7 @@ func (s *Store) ProposerSettings(ctx context.Context) (*validatorServiceConfig.P
}); err != nil {
return nil, err
}
return validatorServiceConfig.ToSettings(to)
return proposer.ToSettings(to)
}
// ProposerSettingsExists returns true or false if the settings exist or not
@@ -118,7 +118,7 @@ func (s *Store) ProposerSettingsExists(ctx context.Context) (bool, error) {
}
// SaveProposerSettings saves the entire proposer setting overriding the existing settings
func (s *Store) SaveProposerSettings(ctx context.Context, settings *validatorServiceConfig.ProposerSettings) error {
func (s *Store) SaveProposerSettings(ctx context.Context, settings *proposer.ProposerSettings) error {
_, span := trace.StartSpan(ctx, "validator.db.SaveProposerSettings")
defer span.End()
// nothing to save

View File

@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorServiceConfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v4/testing/require"
@@ -20,23 +20,23 @@ func TestStore_ProposerSettings_ReadAndWrite(t *testing.T) {
db := setupDB(t, [][fieldparams.BLSPubkeyLength]byte{})
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
settings := &validatorServiceConfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption{
settings := &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorServiceConfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(40000000),
},
},
},
DefaultConfig: &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorServiceConfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -54,12 +54,12 @@ func TestStore_ProposerSettings_ReadAndWrite(t *testing.T) {
db := setupDB(t, [][fieldparams.BLSPubkeyLength]byte{})
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
settings := &validatorServiceConfig.ProposerSettings{
DefaultConfig: &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
settings := &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorServiceConfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -67,11 +67,11 @@ func TestStore_ProposerSettings_ReadAndWrite(t *testing.T) {
}
err = db.SaveProposerSettings(ctx, settings)
require.NoError(t, err)
upatedDefault := &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
upatedDefault := &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x9995733c5af9B61374A128e6F85f553aF09ff89B"),
},
BuilderConfig: &validatorServiceConfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -83,11 +83,11 @@ func TestStore_ProposerSettings_ReadAndWrite(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, dbSettings)
require.DeepEqual(t, dbSettings.DefaultConfig, upatedDefault)
option := &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
option := &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorServiceConfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(40000000),
},

View File

@@ -11,7 +11,7 @@ go_test(
"//cmd/validator/flags:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/validator:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",
@@ -49,10 +49,11 @@ go_library(
"//async/event:go_default_library",
"//cmd:go_default_library",
"//cmd/validator/flags:go_default_library",
"//config:go_default_library",
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/validator:go_default_library",
"//container/slice:go_default_library",
"//encoding/bytesutil:go_default_library",
@@ -60,8 +61,8 @@ go_library(
"//monitoring/backup:go_default_library",
"//monitoring/prometheus:go_default_library",
"//monitoring/tracing:go_default_library",
"//proto/prysm/config:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"//runtime:go_default_library",
"//runtime/debug:go_default_library",
"//runtime/prereqs:go_default_library",
@@ -83,7 +84,6 @@ go_library(
"@com_github_prysmaticlabs_fastssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_urfave_cli_v2//:go_default_library",
"@io_k8s_apimachinery//pkg/util/yaml:go_default_library",
"@org_golang_google_protobuf//encoding/protojson:go_default_library",
],
)

View File

@@ -5,9 +5,7 @@ package node
import (
"context"
"encoding/json"
"fmt"
"io"
"net"
"net/http"
"net/url"
@@ -32,10 +30,11 @@ import (
"github.com/prysmaticlabs/prysm/v4/async/event"
"github.com/prysmaticlabs/prysm/v4/cmd"
"github.com/prysmaticlabs/prysm/v4/cmd/validator/flags"
"github.com/prysmaticlabs/prysm/v4/config"
"github.com/prysmaticlabs/prysm/v4/config/features"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorServiceConfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/container/slice"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
@@ -43,8 +42,8 @@ import (
"github.com/prysmaticlabs/prysm/v4/monitoring/backup"
"github.com/prysmaticlabs/prysm/v4/monitoring/prometheus"
tracing2 "github.com/prysmaticlabs/prysm/v4/monitoring/tracing"
proposersettings "github.com/prysmaticlabs/prysm/v4/proto/prysm/config"
pb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
"github.com/prysmaticlabs/prysm/v4/runtime"
"github.com/prysmaticlabs/prysm/v4/runtime/debug"
"github.com/prysmaticlabs/prysm/v4/runtime/prereqs"
@@ -61,7 +60,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"google.golang.org/protobuf/encoding/protojson"
"k8s.io/apimachinery/pkg/util/yaml"
)
// ValidatorClient defines an instance of an Ethereum validator that manages
@@ -554,8 +552,8 @@ func Web3SignerConfig(cliCtx *cli.Context) (*remoteweb3signer.SetupConfig, error
return web3signerConfig, nil
}
func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServiceConfig.ProposerSettings, error) {
var fileConfig *validatorpb.ProposerSettingsPayload
func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*proposer.ProposerSettings, error) {
var fileConfig *proposersettings.ProposerSettingsPayload
if cliCtx.IsSet(flags.ProposerSettingsFlag.Name) && cliCtx.IsSet(flags.ProposerSettingsURLFlag.Name) {
return nil, errors.New("cannot specify both " + flags.ProposerSettingsFlag.Name + " and " + flags.ProposerSettingsURLFlag.Name)
@@ -569,9 +567,9 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
!cliCtx.IsSet(flags.ProposerSettingsFlag.Name) &&
!cliCtx.IsSet(flags.ProposerSettingsURLFlag.Name) {
suggestedFee := cliCtx.String(flags.SuggestedFeeRecipientFlag.Name)
fileConfig = &validatorpb.ProposerSettingsPayload{
fileConfig = &proposersettings.ProposerSettingsPayload{
ProposerConfig: nil,
DefaultConfig: &validatorpb.ProposerOptionPayload{
DefaultConfig: &proposersettings.ProposerOptionPayload{
FeeRecipient: suggestedFee,
Builder: builderConfigFromFlag.ToPayload(),
},
@@ -579,12 +577,12 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
}
if cliCtx.IsSet(flags.ProposerSettingsFlag.Name) {
if err := unmarshalFromFile(cliCtx.Context, cliCtx.String(flags.ProposerSettingsFlag.Name), &fileConfig); err != nil {
if err := config.UnmarshalFromFile(cliCtx.Context, cliCtx.String(flags.ProposerSettingsFlag.Name), &fileConfig); err != nil {
return nil, err
}
}
if cliCtx.IsSet(flags.ProposerSettingsURLFlag.Name) {
if err := unmarshalFromURL(cliCtx.Context, cliCtx.String(flags.ProposerSettingsURLFlag.Name), &fileConfig); err != nil {
if err := config.UnmarshalFromURL(cliCtx.Context, cliCtx.String(flags.ProposerSettingsURLFlag.Name), &fileConfig); err != nil {
return nil, err
}
}
@@ -597,7 +595,7 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
}
// convert file config to proposer config for internal use
vpSettings := &validatorServiceConfig.ProposerSettings{}
vpSettings := &proposer.ProposerSettings{}
// default fileConfig is mandatory
if fileConfig.DefaultConfig == nil {
@@ -610,14 +608,14 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
if err != nil {
return nil, err
}
if err := warnNonChecksummedAddress(fileConfig.DefaultConfig.FeeRecipient); err != nil {
if err := proposer.WarnNonChecksummedAddress(fileConfig.DefaultConfig.FeeRecipient); err != nil {
return nil, err
}
vpSettings.DefaultConfig = &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
vpSettings.DefaultConfig = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(fileConfig.DefaultConfig.FeeRecipient),
},
BuilderConfig: validatorServiceConfig.ToBuilderConfig(fileConfig.DefaultConfig.Builder),
BuilderConfig: proposer.ToBuilderConfig(fileConfig.DefaultConfig.Builder),
}
if builderConfigFromFlag != nil {
@@ -638,7 +636,7 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
}
if fileConfig.ProposerConfig != nil && len(fileConfig.ProposerConfig) != 0 {
vpSettings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption)
vpSettings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
for key, option := range fileConfig.ProposerConfig {
decodedKey, err := hexutil.Decode(key)
if err != nil {
@@ -647,10 +645,10 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
if len(decodedKey) != fieldparams.BLSPubkeyLength {
return nil, fmt.Errorf("%v is not a bls public key", key)
}
if err := verifyOption(key, option); err != nil {
if err := proposer.VerifyOption(key, option); err != nil {
return nil, err
}
currentBuilderConfig := validatorServiceConfig.ToBuilderConfig(option.Builder)
currentBuilderConfig := proposer.ToBuilderConfig(option.Builder)
if builderConfigFromFlag != nil {
config := builderConfigFromFlag.Clone()
if config.GasLimit == validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit) && currentBuilderConfig != nil {
@@ -660,8 +658,8 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
} else if currentBuilderConfig != nil {
currentBuilderConfig.GasLimit = reviewGasLimit(currentBuilderConfig.GasLimit)
}
o := &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
o := &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress(option.FeeRecipient),
},
BuilderConfig: currentBuilderConfig,
@@ -685,22 +683,9 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*validatorServ
return vpSettings, nil
}
func verifyOption(key string, option *validatorpb.ProposerOptionPayload) error {
if option == nil {
return fmt.Errorf("fee recipient is required for proposer %s", key)
}
if !common.IsHexAddress(option.FeeRecipient) {
return errors.New("fee recipient is not a valid eth1 address")
}
if err := warnNonChecksummedAddress(option.FeeRecipient); err != nil {
return err
}
return nil
}
func handleNoProposerSettingsFlagsProvided(cliCtx *cli.Context,
db iface.ValidatorDB,
builderConfigFromFlag *validatorServiceConfig.BuilderConfig) (*validatorServiceConfig.ProposerSettings, error) {
builderConfigFromFlag *proposer.BuilderConfig) (*proposer.ProposerSettings, error) {
log.Info("no proposer settings files have been provided, attempting to load from db.")
// checks db if proposer settings exist if none is provided.
settings, err := db.ProposerSettings(cliCtx.Context)
@@ -717,8 +702,8 @@ func handleNoProposerSettingsFlagsProvided(cliCtx *cli.Context,
if cliCtx.Bool(flags.EnableBuilderFlag.Name) {
// if there are no proposer settings provided, create a default where fee recipient is not populated, this will be skipped for validator registration on validators that don't have a fee recipient set.
// skip saving to DB if only builder settings are provided until a trigger like keymanager API updates with fee recipient values
return &validatorServiceConfig.ProposerSettings{
DefaultConfig: &validatorServiceConfig.ProposerOption{
return &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: builderConfigFromFlag,
},
}, nil
@@ -726,7 +711,7 @@ func handleNoProposerSettingsFlagsProvided(cliCtx *cli.Context,
return nil, nil
}
func overrideBuilderSettings(settings *validatorServiceConfig.ProposerSettings, builderConfigFromFlag *validatorServiceConfig.BuilderConfig) {
func overrideBuilderSettings(settings *proposer.ProposerSettings, builderConfigFromFlag *proposer.BuilderConfig) {
// override the db settings with the results based on whether the --enable-builder flag is provided.
if builderConfigFromFlag == nil {
log.Infof("proposer settings loaded from db. validator registration to builder is not enabled, please use the --%s flag if you wish to use a builder.", flags.EnableBuilderFlag.Name)
@@ -741,7 +726,7 @@ func overrideBuilderSettings(settings *validatorServiceConfig.ProposerSettings,
}
}
func BuilderSettingsFromFlags(cliCtx *cli.Context) (*validatorServiceConfig.BuilderConfig, error) {
func BuilderSettingsFromFlags(cliCtx *cli.Context) (*proposer.BuilderConfig, error) {
if cliCtx.Bool(flags.EnableBuilderFlag.Name) {
gasLimit := validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit)
sgl := cliCtx.String(flags.BuilderGasLimitFlag.Name)
@@ -753,7 +738,7 @@ func BuilderSettingsFromFlags(cliCtx *cli.Context) (*validatorServiceConfig.Buil
}
gasLimit = reviewGasLimit(validator.Uint64(gl))
}
return &validatorServiceConfig.BuilderConfig{
return &proposer.BuilderConfig{
Enabled: true,
GasLimit: gasLimit,
}, nil
@@ -761,20 +746,6 @@ func BuilderSettingsFromFlags(cliCtx *cli.Context) (*validatorServiceConfig.Buil
return nil, nil
}
func warnNonChecksummedAddress(feeRecipient string) error {
mixedcaseAddress, err := common.NewMixedcaseAddressFromString(feeRecipient)
if err != nil {
return errors.Wrapf(err, "could not decode fee recipient %s", feeRecipient)
}
if !mixedcaseAddress.ValidChecksum() {
log.Warnf("Fee recipient %s is not a checksum Ethereum address. "+
"The checksummed address is %s and will be used as the fee recipient. "+
"We recommend using a mixed-case address (checksum) "+
"to prevent spelling mistakes in your fee recipient Ethereum address", feeRecipient, mixedcaseAddress.Address().Hex())
}
return nil
}
func reviewGasLimit(gasLimit validator.Uint64) validator.Uint64 {
// sets gas limit to default if not defined or set to 0
if gasLimit == 0 {
@@ -961,55 +932,6 @@ func clearDB(ctx context.Context, dataDir string, force bool) error {
return nil
}
func unmarshalFromURL(ctx context.Context, from string, to interface{}) error {
u, err := url.ParseRequestURI(from)
if err != nil {
return err
}
if u.Scheme == "" || u.Host == "" {
return fmt.Errorf("invalid URL: %s", from)
}
req, reqerr := http.NewRequestWithContext(ctx, http.MethodGet, from, nil)
if reqerr != nil {
return errors.Wrap(reqerr, "failed to create http request")
}
req.Header.Set("Content-Type", "application/json")
resp, resperr := http.DefaultClient.Do(req)
if resperr != nil {
return errors.Wrap(resperr, "failed to send http request")
}
defer func(Body io.ReadCloser) {
err = Body.Close()
if err != nil {
log.WithError(err).Error("failed to close response body")
}
}(resp.Body)
if resp.StatusCode != http.StatusOK {
return errors.Errorf("http request to %v failed with status code %d", from, resp.StatusCode)
}
if decodeerr := json.NewDecoder(resp.Body).Decode(&to); decodeerr != nil {
return errors.Wrap(decodeerr, "failed to decode http response")
}
return nil
}
func unmarshalFromFile(ctx context.Context, from string, to interface{}) error {
if ctx == nil {
return errors.New("node: nil context passed to unmarshalFromFile")
}
cleanpath := filepath.Clean(from)
b, err := os.ReadFile(cleanpath)
if err != nil {
return errors.Wrap(err, "failed to open file")
}
if err := yaml.Unmarshal(b, to); err != nil {
return errors.Wrap(err, "failed to unmarshal yaml file")
}
return nil
}
func configureFastSSZHashingAlgorithm() {
fastssz.EnableVectorizedHTR = true
}

View File

@@ -17,7 +17,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/cmd/validator/flags"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v4/io/file"
@@ -361,7 +361,7 @@ func TestProposerSettings(t *testing.T) {
tests := []struct {
name string
args args
want func() *validatorserviceconfig.ProposerSettings
want func() *proposer.ProposerSettings
urlResponse string
wantErr string
wantLog string
@@ -377,13 +377,13 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0xae967917c465db8578ca9024c205720b1a3651A9"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -400,19 +400,19 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0xae967917c465db8578ca9024c205720b1a3651A9"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0xae967917c465db8578ca9024c205720b1a3651A9"),
},
},
@@ -430,37 +430,37 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
key2, err := hexutil.Decode("0xb057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7b")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
},
bytesutil.ToBytes48(key2): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x60155530FCE8a85ec7055A5F8b2bE214B3DaeFd4"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(35000000),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(40000000),
},
@@ -478,19 +478,19 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -507,26 +507,26 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 40000000,
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: false,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -544,11 +544,11 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "0x6e35733c5af9B61374A128e6F85f553aF09ff89A",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -565,14 +565,14 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "0x6e35733c5af9B61374A128e6F85f553aF09ff89A",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -592,14 +592,14 @@ func TestProposerSettings(t *testing.T) {
defaultgas: "50000000",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 50000000,
},
@@ -618,19 +618,19 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "0x6e35733c5af9B61374A128e6F85f553aF09ff89B",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -647,26 +647,26 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "0x6e35733c5af9B61374A128e6F85f553aF09ff89B",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -685,26 +685,26 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -722,26 +722,26 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(40000000),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -759,10 +759,10 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -780,19 +780,19 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -801,23 +801,23 @@ func TestProposerSettings(t *testing.T) {
withdb: func(db iface.ValidatorDB) error {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
settings := &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
settings := &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(40000000),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -835,26 +835,26 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
},
@@ -864,16 +864,16 @@ func TestProposerSettings(t *testing.T) {
withdb: func(db iface.ValidatorDB) error {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
settings := &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
settings := &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -891,19 +891,19 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
return &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
return &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -912,16 +912,16 @@ func TestProposerSettings(t *testing.T) {
withdb: func(db iface.ValidatorDB) error {
key1, err := hexutil.Decode("0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a")
require.NoError(t, err)
settings := &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorserviceconfig.ProposerOption{
settings := &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(key1): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"),
},
},
@@ -938,7 +938,7 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
return nil
},
wantErr: "",
@@ -952,7 +952,7 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
return nil
},
wantErr: "failed to unmarshal yaml file",
@@ -966,8 +966,8 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
return &validatorserviceconfig.ProposerSettings{}
want: func() *proposer.ProposerSettings {
return &proposer.ProposerSettings{}
},
wantErr: "cannot specify both",
},
@@ -980,7 +980,7 @@ func TestProposerSettings(t *testing.T) {
defaultfee: "",
},
},
want: func() *validatorserviceconfig.ProposerSettings {
want: func() *proposer.ProposerSettings {
return nil
},
wantErr: "failed to unmarshal yaml file",
@@ -1052,9 +1052,9 @@ func Test_ProposerSettingsWithOnlyBuilder_DoesNotSaveInDB(t *testing.T) {
require.NoError(t, err)
_, err = validatorDB.ProposerSettings(cliCtx.Context)
require.ErrorContains(t, "no proposer settings found in bucket", err)
want := &validatorserviceconfig.ProposerSettings{
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{
want := &proposer.ProposerSettings{
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: validator.Uint64(params.BeaconConfig().DefaultBuilderGasLimit),
Relays: nil,

View File

@@ -33,7 +33,7 @@ go_library(
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//consensus-types/validator:go_default_library",
"//crypto/bls:go_default_library",
@@ -112,7 +112,7 @@ go_test(
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//config/validator/service:go_default_library",
"//config/proposer:go_default_library",
"//consensus-types/primitives:go_default_library",
"//consensus-types/validator:go_default_library",
"//crypto/bls:go_default_library",

View File

@@ -15,7 +15,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorServiceConfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
@@ -611,10 +611,10 @@ func (s *Server) SetFeeRecipientByPubkey(w http.ResponseWriter, r *http.Request)
settings := s.validatorService.ProposerSettings()
switch {
case settings == nil:
settings = &validatorServiceConfig.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption{
settings = &proposer.ProposerSettings{
ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey): {
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient,
},
BuilderConfig: nil,
@@ -623,13 +623,13 @@ func (s *Server) SetFeeRecipientByPubkey(w http.ResponseWriter, r *http.Request)
DefaultConfig: nil,
}
case settings.ProposeConfig == nil:
var builderConfig *validatorServiceConfig.BuilderConfig
var builderConfig *proposer.BuilderConfig
if settings.DefaultConfig != nil && settings.DefaultConfig.BuilderConfig != nil {
builderConfig = settings.DefaultConfig.BuilderConfig.Clone()
}
settings.ProposeConfig = map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption{
settings.ProposeConfig = map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey): {
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient,
},
BuilderConfig: builderConfig,
@@ -638,16 +638,16 @@ func (s *Server) SetFeeRecipientByPubkey(w http.ResponseWriter, r *http.Request)
default:
proposerOption, found := settings.ProposeConfig[bytesutil.ToBytes48(pubkey)]
if found && proposerOption != nil {
proposerOption.FeeRecipientConfig = &validatorServiceConfig.FeeRecipientConfig{
proposerOption.FeeRecipientConfig = &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient,
}
} else {
var builderConfig = &validatorServiceConfig.BuilderConfig{}
var builderConfig = &proposer.BuilderConfig{}
if settings.DefaultConfig != nil && settings.DefaultConfig.BuilderConfig != nil {
builderConfig = settings.DefaultConfig.BuilderConfig.Clone()
}
settings.ProposeConfig[bytesutil.ToBytes48(pubkey)] = &validatorServiceConfig.ProposerOption{
FeeRecipientConfig: &validatorServiceConfig.FeeRecipientConfig{
settings.ProposeConfig[bytesutil.ToBytes48(pubkey)] = &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: feeRecipient,
},
BuilderConfig: builderConfig,
@@ -769,7 +769,7 @@ func (s *Server) SetGasLimit(w http.ResponseWriter, r *http.Request) {
httputil.HandleError(w, "Gas limit changes only apply when builder is enabled", http.StatusInternalServerError)
return
}
settings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption)
settings.ProposeConfig = make(map[[fieldparams.BLSPubkeyLength]byte]*proposer.ProposerOption)
option := settings.DefaultConfig.Clone()
option.BuilderConfig.GasLimit = validator.Uint64(gasLimit)
settings.ProposeConfig[bytesutil.ToBytes48(pubkey)] = option

View File

@@ -17,7 +17,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/config/params"
validatorserviceconfig "github.com/prysmaticlabs/prysm/v4/config/validator/service"
"github.com/prysmaticlabs/prysm/v4/config/proposer"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/consensus-types/validator"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
@@ -849,20 +849,20 @@ func TestServer_GetGasLimit(t *testing.T) {
tests := []struct {
name string
args *validatorserviceconfig.ProposerSettings
args *proposer.ProposerSettings
pubkey [48]byte
want uint64
}{
{
name: "ProposerSetting for specific pubkey exists",
args: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
args: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: 123456789},
BuilderConfig: &proposer.BuilderConfig{GasLimit: 123456789},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: 987654321},
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{GasLimit: 987654321},
},
},
pubkey: bytesutil.ToBytes48(byteval),
@@ -870,14 +870,14 @@ func TestServer_GetGasLimit(t *testing.T) {
},
{
name: "ProposerSetting for specific pubkey does not exist",
args: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
args: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: 123456789},
BuilderConfig: &proposer.BuilderConfig{GasLimit: 123456789},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: 987654321},
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{GasLimit: 987654321},
},
},
// no settings for the following validator, so the gaslimit returned is the default value.
@@ -941,7 +941,7 @@ func TestServer_SetGasLimit(t *testing.T) {
name string
pubkey []byte
newGasLimit uint64
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
w []*want
beaconReturn *beaconResp
wantErr string
@@ -957,7 +957,7 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is nil AND ProposerSettings.DefaultConfig is nil",
pubkey: pubkey1,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: nil,
},
@@ -967,9 +967,9 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is nil AND ProposerSettings.DefaultConfig.BuilderConfig is nil",
pubkey: pubkey1,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: nil,
},
},
@@ -979,8 +979,8 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is defined for pubkey, BuilderConfig is nil AND ProposerSettings.DefaultConfig is nil",
pubkey: pubkey1,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey1): {
BuilderConfig: nil,
},
@@ -993,10 +993,10 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is defined for pubkey, BuilderConfig is defined AND ProposerSettings.DefaultConfig is nil",
pubkey: pubkey1,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey1): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{},
BuilderConfig: &proposer.BuilderConfig{},
},
},
DefaultConfig: nil,
@@ -1007,10 +1007,10 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is NOT defined for pubkey, BuilderConfig is defined AND ProposerSettings.DefaultConfig is nil",
pubkey: pubkey2,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey2): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
GasLimit: 12345,
},
@@ -1028,14 +1028,14 @@ func TestServer_SetGasLimit(t *testing.T) {
name: "ProposerSettings.ProposeConfig is defined for pubkey, BuilderConfig is nil AND ProposerSettings.DefaultConfig.BuilderConfig is defined",
pubkey: pubkey1,
newGasLimit: 9999,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey2): {
BuilderConfig: nil,
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{
Enabled: true,
},
},
@@ -1149,24 +1149,24 @@ func TestServer_DeleteGasLimit(t *testing.T) {
tests := []struct {
name string
pubkey []byte
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
wantError error
w []want
}{
{
name: "delete existing gas limit with default config",
pubkey: pubkey1,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey1): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(987654321)},
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(987654321)},
},
bytesutil.ToBytes48(pubkey2): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(123456789)},
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(123456789)},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(5555)},
DefaultConfig: &proposer.ProposerOption{
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(5555)},
},
},
wantError: nil,
@@ -1185,13 +1185,13 @@ func TestServer_DeleteGasLimit(t *testing.T) {
{
name: "delete existing gas limit with no default config",
pubkey: pubkey1,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey1): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(987654321)},
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(987654321)},
},
bytesutil.ToBytes48(pubkey2): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(123456789)},
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(123456789)},
},
},
},
@@ -1211,10 +1211,10 @@ func TestServer_DeleteGasLimit(t *testing.T) {
{
name: "delete nonexist gas limit",
pubkey: pubkey2,
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(pubkey1): {
BuilderConfig: &validatorserviceconfig.BuilderConfig{GasLimit: validator.Uint64(987654321)},
BuilderConfig: &proposer.BuilderConfig{GasLimit: validator.Uint64(987654321)},
},
},
},
@@ -1444,22 +1444,22 @@ func TestServer_ListFeeRecipientByPubkey(t *testing.T) {
tests := []struct {
name string
args *validatorserviceconfig.ProposerSettings
args *proposer.ProposerSettings
want *want
cached *eth.FeeRecipientByPubKeyResponse
}{
{
name: "ProposerSettings.ProposeConfig.FeeRecipientConfig defined for pubkey (and ProposerSettings.DefaultConfig.FeeRecipientConfig defined)",
args: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
args: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
},
},
@@ -1470,10 +1470,10 @@ func TestServer_ListFeeRecipientByPubkey(t *testing.T) {
},
{
name: "ProposerSettings.ProposeConfig.FeeRecipientConfig NOT defined for pubkey and ProposerSettings.DefaultConfig.FeeRecipientConfig defined",
args: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
args: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{},
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},
@@ -1576,7 +1576,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
tests := []struct {
name string
args string
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
want *want
wantErr bool
beaconReturn *beaconResp
@@ -1597,7 +1597,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig is nil",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: nil,
},
want: &want{
@@ -1612,9 +1612,9 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig is nil AND ProposerSetting.Defaultconfig is defined",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: nil,
DefaultConfig: &validatorserviceconfig.ProposerOption{},
DefaultConfig: &proposer.ProposerOption{},
},
want: &want{
valEthAddress: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
@@ -1628,8 +1628,8 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig is defined for pubkey",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): {},
},
},
@@ -1645,8 +1645,8 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig not defined for pubkey",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{},
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{},
},
want: &want{
valEthAddress: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
@@ -1660,8 +1660,8 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig is nil for pubkey",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): nil,
},
},
@@ -1677,11 +1677,11 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
{
name: "ProposerSetting.ProposeConfig is nil for pubkey AND DefaultConfig is not nil",
args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): nil,
},
DefaultConfig: &validatorserviceconfig.ProposerOption{},
DefaultConfig: &proposer.ProposerOption{},
},
want: &want{
valEthAddress: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9",
@@ -1777,22 +1777,22 @@ func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) {
}
tests := []struct {
name string
proposerSettings *validatorserviceconfig.ProposerSettings
proposerSettings *proposer.ProposerSettings
want *want
wantErr bool
}{
{
name: "Happy Path Test",
proposerSettings: &validatorserviceconfig.ProposerSettings{
ProposeConfig: map[[48]byte]*validatorserviceconfig.ProposerOption{
proposerSettings: &proposer.ProposerSettings{
ProposeConfig: map[[48]byte]*proposer.ProposerOption{
bytesutil.ToBytes48(byteval): {
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455012BFEBf6177F1D2e9738D5"),
},
},
},
DefaultConfig: &validatorserviceconfig.ProposerOption{
FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{
DefaultConfig: &proposer.ProposerOption{
FeeRecipientConfig: &proposer.FeeRecipientConfig{
FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"),
},
},