mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Kiln mev boost (#3062)
## Issue Addressed MEV boost compatibility ## Proposed Changes See #2987 ## Additional Info This is blocked on the stabilization of a couple specs, [here](https://github.com/ethereum/beacon-APIs/pull/194) and [here](https://github.com/flashbots/mev-boost/pull/20). Additional TODO's and outstanding questions - [ ] MEV boost JWT Auth - [ ] Will `builder_proposeBlindedBlock` return the revealed payload for the BN to propogate - [ ] Should we remove `private-tx-proposals` flag and communicate BN <> VC with blinded blocks by default once these endpoints enter the beacon-API's repo? This simplifies merge transition logic. Co-authored-by: realbigsean <seananderson33@gmail.com> Co-authored-by: realbigsean <sean@sigmaprime.io>
This commit is contained in:
@@ -12,6 +12,7 @@ use state_processing::{
|
||||
per_block_processing::{per_block_processing, BlockSignatureStrategy},
|
||||
per_slot_processing, BlockProcessingError, VerifyBlockRoot,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::Arc;
|
||||
use tempfile::tempdir;
|
||||
use types::{test_utils::generate_deterministic_keypair, *};
|
||||
@@ -962,6 +963,7 @@ fn add_base_block_to_altair_chain() {
|
||||
attestations: altair_body.attestations.clone(),
|
||||
deposits: altair_body.deposits.clone(),
|
||||
voluntary_exits: altair_body.voluntary_exits.clone(),
|
||||
_phantom: PhantomData,
|
||||
},
|
||||
},
|
||||
signature: Signature::empty(),
|
||||
@@ -1082,6 +1084,7 @@ fn add_altair_block_to_base_chain() {
|
||||
deposits: base_body.deposits.clone(),
|
||||
voluntary_exits: base_body.voluntary_exits.clone(),
|
||||
sync_aggregate: SyncAggregate::empty(),
|
||||
_phantom: PhantomData,
|
||||
},
|
||||
},
|
||||
signature: Signature::empty(),
|
||||
|
||||
@@ -8,17 +8,20 @@ const VALIDATOR_COUNT: usize = 32;
|
||||
|
||||
type E = MainnetEthSpec;
|
||||
|
||||
fn verify_execution_payload_chain<T: EthSpec>(chain: &[ExecutionPayload<T>]) {
|
||||
let mut prev_ep: Option<ExecutionPayload<T>> = None;
|
||||
fn verify_execution_payload_chain<T: EthSpec>(chain: &[FullPayload<T>]) {
|
||||
let mut prev_ep: Option<FullPayload<T>> = None;
|
||||
|
||||
for ep in chain {
|
||||
assert!(*ep != ExecutionPayload::default());
|
||||
assert!(ep.block_hash != ExecutionBlockHash::zero());
|
||||
assert!(*ep != FullPayload::default());
|
||||
assert!(ep.block_hash() != ExecutionBlockHash::zero());
|
||||
|
||||
// Check against previous `ExecutionPayload`.
|
||||
if let Some(prev_ep) = prev_ep {
|
||||
assert_eq!(prev_ep.block_hash, ep.parent_hash);
|
||||
assert_eq!(prev_ep.block_number + 1, ep.block_number);
|
||||
assert_eq!(prev_ep.block_hash(), ep.execution_payload.parent_hash);
|
||||
assert_eq!(
|
||||
prev_ep.execution_payload.block_number + 1,
|
||||
ep.execution_payload.block_number
|
||||
);
|
||||
}
|
||||
prev_ep = Some(ep.clone());
|
||||
}
|
||||
@@ -83,12 +86,12 @@ fn merge_with_terminal_block_hash_override() {
|
||||
|
||||
let execution_payload = block.message().body().execution_payload().unwrap().clone();
|
||||
if i == 0 {
|
||||
assert_eq!(execution_payload.block_hash, genesis_pow_block_hash);
|
||||
assert_eq!(execution_payload.block_hash(), genesis_pow_block_hash);
|
||||
}
|
||||
execution_payloads.push(execution_payload);
|
||||
}
|
||||
|
||||
verify_execution_payload_chain(&execution_payloads);
|
||||
verify_execution_payload_chain(execution_payloads.as_slice());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -138,7 +141,7 @@ fn base_altair_merge_with_terminal_block_after_fork() {
|
||||
assert_eq!(merge_head.slot(), merge_fork_slot);
|
||||
assert_eq!(
|
||||
*merge_head.message().body().execution_payload().unwrap(),
|
||||
ExecutionPayload::default()
|
||||
FullPayload::default()
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -154,7 +157,7 @@ fn base_altair_merge_with_terminal_block_after_fork() {
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap(),
|
||||
ExecutionPayload::default()
|
||||
FullPayload::default()
|
||||
);
|
||||
assert_eq!(one_after_merge_head.slot(), merge_fork_slot + 1);
|
||||
|
||||
@@ -178,5 +181,5 @@ fn base_altair_merge_with_terminal_block_after_fork() {
|
||||
execution_payloads.push(block.message().body().execution_payload().unwrap().clone());
|
||||
}
|
||||
|
||||
verify_execution_payload_chain(&execution_payloads);
|
||||
verify_execution_payload_chain(execution_payloads.as_slice());
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ impl InvalidPayloadRig {
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.block_hash
|
||||
.block_hash()
|
||||
}
|
||||
|
||||
fn execution_status(&self, block_root: Hash256) -> ExecutionStatus {
|
||||
|
||||
Reference in New Issue
Block a user