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

[Merged by Bors] - Remove builder redundancy #3294

Closed

Conversation

realbigsean
Copy link
Member

Issue Addressed

This PR is a subset of the changes in #3134. Unstable will still not function correctly with the new builder spec once this is merged, #3134 should be used on testnets

Proposed Changes

  • Removes redundancy in "builders" (servers implementing the builder spec)
  • Renames payload-builder flag to builder
  • Moves from old builder RPC API to new HTTP API, but does not implement the validator registration API (implemented in [Merged by Bors] - Register validator api #3194)

realbigsean and others added 6 commits June 22, 2022 22:42
…move-builder-redundancy

� Conflicts:
�	Cargo.lock
�	beacon_node/execution_layer/src/engine_api.rs
�	beacon_node/execution_layer/src/engine_api/http.rs
�	beacon_node/execution_layer/src/lib.rs
�	beacon_node/src/cli.rs
�	beacon_node/src/config.rs
@realbigsean realbigsean added ready-for-review The code is ready for review bellatrix Required to support the Bellatrix Upgrade labels Jun 29, 2022
@realbigsean realbigsean mentioned this pull request Jun 29, 2022
14 tasks
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Looking good! Only a few minor requests 🙏

@@ -3218,6 +3218,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let slot = state.slot();
let proposer_index = state.get_beacon_proposer_index(state.slot(), &self.spec)? as u64;

let pubkey_opt = match self.validator_pubkey_bytes(proposer_index as usize) {
Copy link
Member

Choose a reason for hiding this comment

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

Since you have a BeaconState in scope here, I'd suggest doing state.validators().get(proposer_index as usize).map(|v| v.pubkey) rather than hitting the pubkey cache.

There can be some lock contention on the validator pubkey cache at times. There's also something very definite about saying "this validator doesn't exist in the state of the block they're proposing". You could even return an error in that case, I don't see how any block could be valid if the proposer index isn't in the validator registry. I would only do that if there's a benefit in dropping the Option around the pubkey, otherwise we might as well just leave it a warning and have one less way that block proposal can fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok used this state to get the pubkey here: ac15207

I've left the Option because dropping it doesn't gain us anything, but that's a good point, if the validator isn't in the state I too have no idea how it could propose. Seemed more like a possibility when I was using the cache 😂

prev_randao: Hash256,
finalized_block_hash: ExecutionBlockHash,
suggested_fee_recipient: Address,
f: fn(&ExecutionLayer<T>, &ExecutionPayload<T>) -> Option<ExecutionPayload<T>>,
Copy link
Member

Choose a reason for hiding this comment

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

From what I can see this function is always a noop. Is it here for future use?

Copy link
Member Author

@realbigsean realbigsean Jun 30, 2022

Choose a reason for hiding this comment

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

Yes! In the fallback functionality in #3134, this populates a cache

Copy link
Member Author

Choose a reason for hiding this comment

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

So it'll either noop when getting a blinded block from a relay (no way to cache the payload) or it will cache when falling back to a local EE (have to cache the fully payload and return a blinded payload becaues the VC expects a blinded payload from this endpoint)

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jun 29, 2022
@realbigsean
Copy link
Member Author

Ok, I've addressed comment!

@realbigsean realbigsean added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jun 30, 2022
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Feel free to bors at will.

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jun 30, 2022
@realbigsean
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Jul 1, 2022
## Issue Addressed

This PR is a subset of the changes in #3134. Unstable will still not function correctly with the new builder spec once this is merged, #3134 should be used on testnets

## Proposed Changes

- Removes redundancy in "builders" (servers implementing the builder spec)
- Renames `payload-builder` flag to `builder`
- Moves from old builder RPC API to new HTTP API, but does not implement the validator registration API (implemented in #3194)



Co-authored-by: sean <[email protected]>
Co-authored-by: realbigsean <[email protected]>
@bors bors bot changed the title Remove builder redundancy [Merged by Bors] - Remove builder redundancy Jul 1, 2022
@bors bors bot closed this Jul 1, 2022
@realbigsean realbigsean deleted the remove-builder-redundancy branch November 21, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bellatrix Required to support the Bellatrix Upgrade ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants