From 601987faf26f5cf42b18d2c1b4a79598356cd4b6 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 22 Mar 2022 14:13:59 -0400 Subject: [PATCH] Fee Recipient : ux log fixes and prevent validator from calling beacon node if flags are not provided. (#10406) * initial commit * improving logs --- validator/accounts/testing/mock.go | 2 +- validator/client/service.go | 132 +++++++++---------- validator/client/testutil/mock_validator.go | 2 +- validator/client/validator.go | 12 +- validator/client/validator_test.go | 33 ++++- validator/client/wait_for_activation.go | 4 +- validator/client/wait_for_activation_test.go | 18 +-- validator/node/node.go | 49 +++---- validator/node/node_test.go | 9 +- 9 files changed, 136 insertions(+), 125 deletions(-) diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index 66622792a871..b9b51cd10bd4 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -179,7 +179,7 @@ func (_ MockValidator) CheckDoppelGanger(_ context.Context) error { panic("implement me") } -// PrepareBeaconProposer for mocking +// UpdateFeeRecipient for mocking func (_ MockValidator) UpdateFeeRecipient(_ context.Context, _ keymanager.IKeymanager) error { panic("implement me") } diff --git a/validator/client/service.go b/validator/client/service.go index 21bce05b5123..8533a468b1ee 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -48,53 +48,53 @@ type GenesisFetcher interface { // ValidatorService represents a service to manage the validator client // routine. type ValidatorService struct { - useWeb bool - emitAccountMetrics bool - logValidatorBalances bool - logDutyCountDown bool - interopKeysConfig *local.InteropKeymanagerConfig - conn *grpc.ClientConn - grpcRetryDelay time.Duration - grpcRetries uint - maxCallRecvMsgSize int - cancel context.CancelFunc - walletInitializedFeed *event.Feed - wallet *wallet.Wallet - graffitiStruct *graffiti.Graffiti - dataDir string - withCert string - endpoint string - ctx context.Context - validator iface.Validator - db db.Database - grpcHeaders []string - graffiti []byte - web3SignerConfig *remote_web3signer.SetupConfig - prepareBeaconProposalConfig *validator_service_config.FeeRecipientConfig + useWeb bool + emitAccountMetrics bool + logValidatorBalances bool + logDutyCountDown bool + interopKeysConfig *local.InteropKeymanagerConfig + conn *grpc.ClientConn + grpcRetryDelay time.Duration + grpcRetries uint + maxCallRecvMsgSize int + cancel context.CancelFunc + walletInitializedFeed *event.Feed + wallet *wallet.Wallet + graffitiStruct *graffiti.Graffiti + dataDir string + withCert string + endpoint string + ctx context.Context + validator iface.Validator + db db.Database + grpcHeaders []string + graffiti []byte + web3SignerConfig *remote_web3signer.SetupConfig + feeRecipientConfig *validator_service_config.FeeRecipientConfig } // Config for the validator service. type Config struct { - UseWeb bool - LogValidatorBalances bool - EmitAccountMetrics bool - LogDutyCountDown bool - InteropKeysConfig *local.InteropKeymanagerConfig - Wallet *wallet.Wallet - WalletInitializedFeed *event.Feed - GrpcRetriesFlag uint - GrpcMaxCallRecvMsgSizeFlag int - GrpcRetryDelay time.Duration - GraffitiStruct *graffiti.Graffiti - Validator iface.Validator - ValDB db.Database - CertFlag string - DataDir string - GrpcHeadersFlag string - GraffitiFlag string - Endpoint string - Web3SignerConfig *remote_web3signer.SetupConfig - PrepareBeaconProposalConfig *validator_service_config.FeeRecipientConfig + UseWeb bool + LogValidatorBalances bool + EmitAccountMetrics bool + LogDutyCountDown bool + InteropKeysConfig *local.InteropKeymanagerConfig + Wallet *wallet.Wallet + WalletInitializedFeed *event.Feed + GrpcRetriesFlag uint + GrpcMaxCallRecvMsgSizeFlag int + GrpcRetryDelay time.Duration + GraffitiStruct *graffiti.Graffiti + Validator iface.Validator + ValDB db.Database + CertFlag string + DataDir string + GrpcHeadersFlag string + GraffitiFlag string + Endpoint string + Web3SignerConfig *remote_web3signer.SetupConfig + FeeRecipientConfig *validator_service_config.FeeRecipientConfig } // NewValidatorService creates a new validator service for the service @@ -102,28 +102,28 @@ type Config struct { func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, error) { ctx, cancel := context.WithCancel(ctx) return &ValidatorService{ - ctx: ctx, - cancel: cancel, - endpoint: cfg.Endpoint, - withCert: cfg.CertFlag, - dataDir: cfg.DataDir, - graffiti: []byte(cfg.GraffitiFlag), - logValidatorBalances: cfg.LogValidatorBalances, - emitAccountMetrics: cfg.EmitAccountMetrics, - maxCallRecvMsgSize: cfg.GrpcMaxCallRecvMsgSizeFlag, - grpcRetries: cfg.GrpcRetriesFlag, - grpcRetryDelay: cfg.GrpcRetryDelay, - grpcHeaders: strings.Split(cfg.GrpcHeadersFlag, ","), - validator: cfg.Validator, - db: cfg.ValDB, - wallet: cfg.Wallet, - walletInitializedFeed: cfg.WalletInitializedFeed, - useWeb: cfg.UseWeb, - interopKeysConfig: cfg.InteropKeysConfig, - graffitiStruct: cfg.GraffitiStruct, - logDutyCountDown: cfg.LogDutyCountDown, - web3SignerConfig: cfg.Web3SignerConfig, - prepareBeaconProposalConfig: cfg.PrepareBeaconProposalConfig, + ctx: ctx, + cancel: cancel, + endpoint: cfg.Endpoint, + withCert: cfg.CertFlag, + dataDir: cfg.DataDir, + graffiti: []byte(cfg.GraffitiFlag), + logValidatorBalances: cfg.LogValidatorBalances, + emitAccountMetrics: cfg.EmitAccountMetrics, + maxCallRecvMsgSize: cfg.GrpcMaxCallRecvMsgSizeFlag, + grpcRetries: cfg.GrpcRetriesFlag, + grpcRetryDelay: cfg.GrpcRetryDelay, + grpcHeaders: strings.Split(cfg.GrpcHeadersFlag, ","), + validator: cfg.Validator, + db: cfg.ValDB, + wallet: cfg.Wallet, + walletInitializedFeed: cfg.WalletInitializedFeed, + useWeb: cfg.UseWeb, + interopKeysConfig: cfg.InteropKeysConfig, + graffitiStruct: cfg.GraffitiStruct, + logDutyCountDown: cfg.LogDutyCountDown, + web3SignerConfig: cfg.Web3SignerConfig, + feeRecipientConfig: cfg.FeeRecipientConfig, }, nil } @@ -205,7 +205,7 @@ func (v *ValidatorService) Start() { eipImportBlacklistedPublicKeys: slashablePublicKeys, logDutyCountDown: v.logDutyCountDown, Web3SignerConfig: v.web3SignerConfig, - prepareBeaconProposalConfig: v.prepareBeaconProposalConfig, + feeRecipientConfig: v.feeRecipientConfig, walletIntializedChannel: make(chan *wallet.Wallet, 1), } // To resolve a race condition at startup due to the interface diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index c92c8b5a29f8..0a5a47fa3653 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -247,7 +247,7 @@ func (fv *FakeValidator) HandleKeyReload(_ context.Context, newKeys [][fieldpara func (_ *FakeValidator) SubmitSignedContributionAndProof(_ context.Context, _ types.Slot, _ [fieldparams.BLSPubkeyLength]byte) { } -// PrepareBeaconProposer for mocking +// UpdateFeeRecipient for mocking func (_ *FakeValidator) UpdateFeeRecipient(_ context.Context, _ keymanager.IKeymanager) error { return nil } diff --git a/validator/client/validator.go b/validator/client/validator.go index f14f2255db4a..0b91fa63a8db 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -94,7 +94,7 @@ type validator struct { graffiti []byte voteStats voteStats Web3SignerConfig *remote_web3signer.SetupConfig - prepareBeaconProposalConfig *validator_service_config.FeeRecipientConfig + feeRecipientConfig *validator_service_config.FeeRecipientConfig walletIntializedChannel chan *wallet.Wallet } @@ -938,6 +938,10 @@ func (v *validator) logDuties(slot types.Slot, duties []*ethpb.DutiesResponse_Du // UpdateFeeRecipient calls the prepareBeaconProposer RPC to set the fee recipient. func (v *validator) UpdateFeeRecipient(ctx context.Context, km keymanager.IKeymanager) error { + if v.feeRecipientConfig == nil { + log.Warnln("Fee recipient config not set, skipping fee recipient update. Validator will continue proposing using beacon node specified fee recipient.") + return nil + } if km == nil { return errors.New("keymanager is nil when calling PrepareBeaconProposer") } @@ -981,12 +985,12 @@ func (v *validator) feeRecipients(ctx context.Context, pubkeys [][fieldparams.BL validatorIndex = ind v.pubkeyToValidatorIndex[key] = validatorIndex } - if v.prepareBeaconProposalConfig.ProposeConfig != nil { - option, ok := v.prepareBeaconProposalConfig.ProposeConfig[key] + if v.feeRecipientConfig.ProposeConfig != nil { + option, ok := v.feeRecipientConfig.ProposeConfig[key] if option != nil && ok { feeRecipient = option.FeeRecipient } else { - feeRecipient = v.prepareBeaconProposalConfig.DefaultConfig.FeeRecipient + feeRecipient = v.feeRecipientConfig.DefaultConfig.FeeRecipient } } validatorToFeeRecipientArray = append(validatorToFeeRecipientArray, ðpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index a438ff426cfb..c2cfc0ad7eb7 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -364,7 +364,7 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex{pubKey: 1}, - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"), @@ -408,7 +408,7 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex{pubKey: 1}, - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x6e35733c5af9B61374A128e6F85f553aF09ff89A"), @@ -1477,7 +1477,7 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.prepareBeaconProposalConfig = &validator_service_config.FeeRecipientConfig{ + v.feeRecipientConfig = &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -1493,6 +1493,25 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { return &v }, }, + { + name: " Skip if no config", + validatorSetter: func(t *testing.T) *validator { + + v := validator{ + validatorClient: client, + db: db, + pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), + useWeb: false, + interopKeysConfig: &local.InteropKeymanagerConfig{ + NumValidatorKeys: 1, + Offset: 1, + }, + } + err := v.WaitForKeymanagerInitialization(ctx) + require.NoError(t, err) + return &v + }, + }, { name: " Happy Path validator index not found in cache", validatorSetter: func(t *testing.T) *validator { @@ -1509,7 +1528,7 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { } err := v.WaitForKeymanagerInitialization(ctx) require.NoError(t, err) - v.prepareBeaconProposalConfig = &validator_service_config.FeeRecipientConfig{ + v.feeRecipientConfig = &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -1558,7 +1577,7 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { config[keys[0]] = &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), } - v.prepareBeaconProposalConfig = &validator_service_config.FeeRecipientConfig{ + v.feeRecipientConfig = &validator_service_config.FeeRecipientConfig{ ProposeConfig: config, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -1597,7 +1616,7 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { config[keys[0]] = &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.Address{}, } - v.prepareBeaconProposalConfig = &validator_service_config.FeeRecipientConfig{ + v.feeRecipientConfig = &validator_service_config.FeeRecipientConfig{ ProposeConfig: config, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -1634,7 +1653,7 @@ func TestValidator_UdpateFeeRecipient(t *testing.T) { config[keys[0]] = &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), } - v.prepareBeaconProposalConfig = &validator_service_config.FeeRecipientConfig{ + v.feeRecipientConfig = &validator_service_config.FeeRecipientConfig{ ProposeConfig: config, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index a16041e0f83c..6b069af93de1 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -131,11 +131,11 @@ func (v *validator) waitForActivation(ctx context.Context, accountsChangedChan < valActivated := v.checkAndLogValidatorStatus(statuses) if valActivated { + logActiveValidatorStatus(statuses) // Set properties on the beacon node like the fee recipient for validators that are being used & active. if err := v.UpdateFeeRecipient(ctx, remoteKm); err != nil { return err } - logActiveValidatorStatus(statuses) } else { continue } @@ -179,11 +179,11 @@ func (v *validator) waitForActivation(ctx context.Context, accountsChangedChan < valActivated := v.checkAndLogValidatorStatus(statuses) if valActivated { + logActiveValidatorStatus(statuses) // Set properties on the beacon node like the fee recipient for validators that are being used & active. if err := v.UpdateFeeRecipient(ctx, v.keyManager); err != nil { return err } - logActiveValidatorStatus(statuses) } else { continue } diff --git a/validator/client/wait_for_activation_test.go b/validator/client/wait_for_activation_test.go index 2edcf6f77d6b..d2fef1635d47 100644 --- a/validator/client/wait_for_activation_test.go +++ b/validator/client/wait_for_activation_test.go @@ -80,7 +80,7 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) { validatorClient: client, keyManager: km, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -119,7 +119,7 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin validatorClient: client, keyManager: km, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -163,7 +163,7 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -206,7 +206,7 @@ func TestWaitForActivation_Exiting(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -256,7 +256,7 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -308,7 +308,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -389,7 +389,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { keyManager: km, genesisTime: 1, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -477,7 +477,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) { keyManager: &km, ticker: ticker, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), @@ -544,7 +544,7 @@ func TestWaitForActivation_RemoteKeymanager(t *testing.T) { keyManager: &remoteKm, ticker: ticker, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]types.ValidatorIndex), - prepareBeaconProposalConfig: &validator_service_config.FeeRecipientConfig{ + feeRecipientConfig: &validator_service_config.FeeRecipientConfig{ ProposeConfig: nil, DefaultConfig: &validator_service_config.FeeRecipientOptions{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), diff --git a/validator/node/node.go b/validator/node/node.go index d056579af22b..4a14bc2413cd 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -410,25 +410,25 @@ func (c *ValidatorClient) registerValidatorService(cliCtx *cli.Context) error { } v, err := client.NewValidatorService(c.cliCtx.Context, &client.Config{ - Endpoint: endpoint, - DataDir: dataDir, - LogValidatorBalances: logValidatorBalances, - EmitAccountMetrics: emitAccountMetrics, - CertFlag: cert, - GraffitiFlag: g.ParseHexGraffiti(graffiti), - GrpcMaxCallRecvMsgSizeFlag: maxCallRecvMsgSize, - GrpcRetriesFlag: grpcRetries, - GrpcRetryDelay: grpcRetryDelay, - GrpcHeadersFlag: c.cliCtx.String(flags.GrpcHeadersFlag.Name), - ValDB: c.db, - UseWeb: c.cliCtx.Bool(flags.EnableWebFlag.Name), - InteropKeysConfig: interopKeysConfig, - Wallet: c.wallet, - WalletInitializedFeed: c.walletInitialized, - GraffitiStruct: gStruct, - LogDutyCountDown: c.cliCtx.Bool(flags.EnableDutyCountDown.Name), - Web3SignerConfig: wsc, - PrepareBeaconProposalConfig: bpc, + Endpoint: endpoint, + DataDir: dataDir, + LogValidatorBalances: logValidatorBalances, + EmitAccountMetrics: emitAccountMetrics, + CertFlag: cert, + GraffitiFlag: g.ParseHexGraffiti(graffiti), + GrpcMaxCallRecvMsgSizeFlag: maxCallRecvMsgSize, + GrpcRetriesFlag: grpcRetries, + GrpcRetryDelay: grpcRetryDelay, + GrpcHeadersFlag: c.cliCtx.String(flags.GrpcHeadersFlag.Name), + ValDB: c.db, + UseWeb: c.cliCtx.Bool(flags.EnableWebFlag.Name), + InteropKeysConfig: interopKeysConfig, + Wallet: c.wallet, + WalletInitializedFeed: c.walletInitialized, + GraffitiStruct: gStruct, + LogDutyCountDown: c.cliCtx.Bool(flags.EnableDutyCountDown.Name), + Web3SignerConfig: wsc, + FeeRecipientConfig: bpc, }) if err != nil { return errors.Wrap(err, "could not initialize validator service") @@ -496,16 +496,9 @@ func feeRecipientConfig(cliCtx *cli.Context) (*validatorServiceConfig.FeeRecipie }, } } - + // nothing is set, so just return nil if fileConfig == nil { - // if no flags were set, use the burn address - log.Warnf("No validator proposer fileConfig or default fee specified!! validators will continue to propose with burn address") - fileConfig = &validatorServiceConfig.FeeRecipientFileConfig{ - ProposeConfig: nil, - DefaultConfig: &validatorServiceConfig.FeeRecipientFileOptions{ - FeeRecipient: fieldparams.EthBurnAddressHex, - }, - } + return nil, nil } //convert file config to proposer config for internal use frConfig := &validatorServiceConfig.FeeRecipientConfig{} diff --git a/validator/node/node_test.go b/validator/node/node_test.go index 0a5a38bd4b65..3a9df932438a 100644 --- a/validator/node/node_test.go +++ b/validator/node/node_test.go @@ -447,7 +447,7 @@ func TestFeeRecipientConfig(t *testing.T) { wantErr: "", }, { - name: "Default Fee Recipient", + name: "No flags set means empty config", args: args{ feeRecipientFlagValues: &feeRecipientFlag{ dir: "", @@ -456,12 +456,7 @@ func TestFeeRecipientConfig(t *testing.T) { }, }, want: func() *validator_service_config.FeeRecipientConfig { - return &validator_service_config.FeeRecipientConfig{ - ProposeConfig: nil, - DefaultConfig: &validator_service_config.FeeRecipientOptions{ - FeeRecipient: common.HexToAddress("0x0000000000000000000000000000000000000000"), - }, - } + return nil }, wantErr: "", },