Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Insert stored fee recipient for ForkchoiceUpdated call #10349

Merged
merged 9 commits into from
Mar 14, 2022

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Mar 11, 2022

This PR uses the stored fee recipient in DB to construct PayloadAttributes and to make a ForkchoiceUpdated call. If the fee recipient is in DB then it uses the default fee recipient

related to #10292

@terencechain terencechain added Ready For Review Merge PRs related to the great milestone the merge labels Mar 11, 2022
@terencechain terencechain self-assigned this Mar 11, 2022
@terencechain terencechain requested a review from a team as a code owner March 11, 2022 17:07
@@ -24,7 +25,7 @@ import (

// This returns the execution payload of a given slot. The function has full awareness of pre and post merge.
// The payload is computed given the respected time of merge.
func (vs *Server) getExecutionPayload(ctx context.Context, slot types.Slot) (*enginev1.ExecutionPayload, error) {
func (vs *Server) getExecutionPayload(ctx context.Context, slot types.Slot, vIdx types.ValidatorIndex) (*enginev1.ExecutionPayload, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense now

case true:
feeRecipient = recipient
case errors.As(err, kv.ErrNotFoundFeeRecipient): // If fee recipient is not found, use the default fee recipient.
logrus.WithError(err).WithField("validatorIndex", vIdx).Error("Fee recipient not found. Using default fee recipient.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if you should print what the default fee recipient address is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@@ -108,7 +108,7 @@ func configureInteropConfig(cliCtx *cli.Context) {
func configureExecutionSetting(cliCtx *cli.Context) {
if cliCtx.IsSet(flags.FeeRecipient.Name) {
c := params.BeaconConfig()
c.FeeRecipient = common.HexToAddress(cliCtx.String(flags.FeeRecipient.Name))
c.DefaultFeeRecipient = common.HexToAddress(cliCtx.String(flags.FeeRecipient.Name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I called my flag SuggestedFeeRecipient similar to lighthouse, wondering if i should change it to default as well.

@@ -108,7 +108,7 @@ func configureInteropConfig(cliCtx *cli.Context) {
func configureExecutionSetting(cliCtx *cli.Context) {
if cliCtx.IsSet(flags.FeeRecipient.Name) {
c := params.BeaconConfig()
c.FeeRecipient = common.HexToAddress(cliCtx.String(flags.FeeRecipient.Name))
c.DefaultFeeRecipient = common.HexToAddress(cliCtx.String(flags.FeeRecipient.Name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should validate here using ^0x[0-9a-fA-F]{40}$ for the hex

params.OverrideBeaconConfig(c)
func configureExecutionSetting(cliCtx *cli.Context) error {
if !cliCtx.IsSet(flags.FeeRecipient.Name) {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add a log here to inform the user that the validator will be sending the address or else it defaults to burn address.

Copy link
Contributor

@james-prysm james-prysm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides the items discussed in discord for a later PR

@prylabs-bulldozer prylabs-bulldozer bot merged commit 5461c5b into develop Mar 14, 2022
@delete-merged-branch delete-merged-branch bot deleted the use-fee-recipient branch March 14, 2022 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merge PRs related to the great milestone the merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants