Fixes after rebasing Kintsugi onto unstable (#2799)

* Fix fork choice after rebase

* Remove paulhauner warp dep

* Fix fork choice test compile errors

* Assume fork choice payloads are valid

* Add comment

* Ignore new tests

* Fix error in test skipping
This commit is contained in:
Paul Hauner
2021-11-15 11:26:42 +11:00
parent eb35c64afd
commit cbd2201164
14 changed files with 55 additions and 15 deletions

View File

@@ -17,7 +17,7 @@ eth2_serde_utils = { path = "../../consensus/serde_utils" }
serde_json = "1.0.58"
serde = { version = "1.0.116", features = ["derive"] }
eth1 = { path = "../eth1" }
warp = { git = "https://github.com/paulhauner/warp ", branch = "cors-wildcard" }
warp = { git = "https://github.com/macladson/warp", rev ="dfa259e", features = ["tls"] }
environment = { path = "../../lighthouse/environment" }
bytes = "1.1.0"
task_executor = { path = "../../common/task_executor" }

View File

@@ -64,10 +64,15 @@ pub async fn handle_rpc<T: EthSpec>(
}
ENGINE_EXECUTE_PAYLOAD => {
let request: JsonExecutionPayload<T> = get_param_0(params)?;
let status = ctx
.execution_block_generator
.write()
.execute_payload(request.into());
.static_execute_payload_response
.lock()
.unwrap_or_else(|| {
ctx.execution_block_generator
.write()
.execute_payload(request.into())
});
Ok(serde_json::to_value(ExecutePayloadResponseWrapper { status }).unwrap())
}

View File

@@ -1,6 +1,7 @@
//! Provides a mock execution engine HTTP JSON-RPC API for use in testing.
use crate::engine_api::http::JSONRPC_VERSION;
use crate::engine_api::ExecutePayloadResponse;
use bytes::Bytes;
use environment::null_logger;
use handle_rpc::handle_rpc;
@@ -60,6 +61,7 @@ impl<T: EthSpec> MockServer<T> {
last_echo_request: last_echo_request.clone(),
execution_block_generator: RwLock::new(execution_block_generator),
preloaded_responses,
static_execute_payload_response: <_>::default(),
_phantom: PhantomData,
});
@@ -112,6 +114,10 @@ impl<T: EthSpec> MockServer<T> {
pub fn push_preloaded_response(&self, response: serde_json::Value) {
self.ctx.preloaded_responses.lock().push(response)
}
pub fn all_payloads_valid(&self) {
*self.ctx.static_execute_payload_response.lock() = Some(ExecutePayloadResponse::Valid)
}
}
#[derive(Debug)]
@@ -146,6 +152,7 @@ pub struct Context<T: EthSpec> {
pub last_echo_request: Arc<RwLock<Option<Bytes>>>,
pub execution_block_generator: RwLock<ExecutionBlockGenerator<T>>,
pub preloaded_responses: Arc<Mutex<Vec<serde_json::Value>>>,
pub static_execute_payload_response: Arc<Mutex<Option<ExecutePayloadResponse>>>,
pub _phantom: PhantomData<T>,
}