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

Implement the /eth/v1/validator/prepare_beacon_proposer end-point #3901

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

zah
Copy link
Contributor

@zah zah commented Jul 22, 2022

No description provided.

@zah zah force-pushed the feature/eth/v1/validator/prepare_beacon_proposer branch from dd5143e to bb85f6f Compare July 22, 2022 17:43
@arnetheduck
Copy link
Member

needs a documentation update to highlight the new source of fee recipient

@github-actions
Copy link

Unit Test Results

       12 files  ±0       860 suites  ±0   1h 10m 32s ⏱️ + 4m 40s
  1 914 tests ±0    1 766 ✔️ ±0  148 💤 ±0  0 ±0 
10 373 runs  ±0  10 167 ✔️ ±0  206 💤 ±0  0 ±0 

Results for commit bb85f6f. ± Comparison against base commit 1a1553f.

@@ -239,6 +239,10 @@ type
epoch*: Epoch
active*: bool

PrepareBeaconProposerBody* = object
validator_index*: ValidatorIndex
Copy link
Member

Choose a reason for hiding this comment

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

RestValidatorIndex I believe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RestValidatorIndex was something that raised in prominence when we tried to introduce a wider ValidatorIndex reform (which wasn't merged). In the current code, it's used only for a single field and all other REST data types use the spec ValidatorIndex type.

Copy link
Member

@arnetheduck arnetheduck Aug 9, 2022

Choose a reason for hiding this comment

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

The wider VI is unrelated - RestValidatorIndex is used to differentiate between errors: a validator index that is larger than 2**32 but smaller than 2**41 (or something like that) is a valid but not yet assigned validator index - the ValidatorIndex parser is unable to distinguish these two cases, resulting in a poor error message, or in some requests, invalid responses (because some requests give an empty response for a not-yet-assigned validator index)

@@ -374,8 +378,11 @@ proc getExecutionPayload(
terminalBlockHash
latestFinalized =
node.dag.loadExecutionBlockRoot(node.dag.finalizedHead.blck)
feeRecipient = node.config.getSuggestedFeeRecipient(pubkey).valueOr:
node.config.defaultFeeRecipient
dynamicFeeRecipient = node.dynamicFeeRecipientsStore.getDynamicFeeRecipient(
Copy link
Member

Choose a reason for hiding this comment

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

fwiw, I think this can be written as gDFR() or gSFR() or Opt.some(default)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The valueOr construct effectively works as a right-associative operator while or is left-associative. For this particular purpose, right-associativity produces better code which is equivalent to a hand-written tree of if statements.

@zah
Copy link
Contributor Author

zah commented Jul 25, 2022

needs a documentation update to highlight the new source of fee recipient

Will be addressed with a separate PR against the unstable branch.

@zah zah merged commit cd04f27 into testing Jul 25, 2022
@zah zah deleted the feature/eth/v1/validator/prepare_beacon_proposer branch July 25, 2022 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants