Remove builder redundancy (#3294)

## 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 https://github.com/sigp/lighthouse/pull/3194)



Co-authored-by: sean <seananderson33@gmail.com>
Co-authored-by: realbigsean <sean@sigmaprime.io>
This commit is contained in:
realbigsean
2022-07-01 01:15:19 +00:00
parent d40c76e667
commit a7da0677d5
25 changed files with 564 additions and 374 deletions

View File

@@ -11,9 +11,9 @@ use types::{
const EXECUTION_ENGINE_START_TIMEOUT: Duration = Duration::from_secs(20);
struct ExecutionPair<E> {
struct ExecutionPair<E, T: EthSpec> {
/// The Lighthouse `ExecutionLayer` struct, connected to the `execution_engine` via HTTP.
execution_layer: ExecutionLayer,
execution_layer: ExecutionLayer<T>,
/// A handle to external EE process, once this is dropped the process will be killed.
#[allow(dead_code)]
execution_engine: ExecutionEngine<E>,
@@ -23,11 +23,11 @@ struct ExecutionPair<E> {
///
/// There are two EEs held here so that we can test out-of-order application of payloads, and other
/// edge-cases.
pub struct TestRig<E> {
pub struct TestRig<E, T: EthSpec = MainnetEthSpec> {
#[allow(dead_code)]
runtime: Arc<tokio::runtime::Runtime>,
ee_a: ExecutionPair<E>,
ee_b: ExecutionPair<E>,
ee_a: ExecutionPair<E, T>,
ee_b: ExecutionPair<E, T>,
spec: ChainSpec,
_runtime_shutdown: exit_future::Signal,
}
@@ -172,12 +172,14 @@ impl<E: GenericExecutionEngine> TestRig<E> {
let valid_payload = self
.ee_a
.execution_layer
.get_payload::<MainnetEthSpec, FullPayload<MainnetEthSpec>>(
.get_payload::<FullPayload<MainnetEthSpec>>(
parent_hash,
timestamp,
prev_randao,
finalized_block_hash,
proposer_index,
None,
Slot::new(0),
)
.await
.unwrap()
@@ -265,12 +267,14 @@ impl<E: GenericExecutionEngine> TestRig<E> {
let second_payload = self
.ee_a
.execution_layer
.get_payload::<MainnetEthSpec, FullPayload<MainnetEthSpec>>(
.get_payload::<FullPayload<MainnetEthSpec>>(
parent_hash,
timestamp,
prev_randao,
finalized_block_hash,
proposer_index,
None,
Slot::new(0),
)
.await
.unwrap()
@@ -400,7 +404,7 @@ impl<E: GenericExecutionEngine> TestRig<E> {
///
/// Panic if payload reconstruction fails.
async fn check_payload_reconstruction<E: GenericExecutionEngine>(
ee: &ExecutionPair<E>,
ee: &ExecutionPair<E, MainnetEthSpec>,
payload: &ExecutionPayload<MainnetEthSpec>,
) {
let reconstructed = ee