From a42d07592c76724f507a44ec80203ed30696a58a Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 7 Feb 2023 12:33:29 -0500 Subject: [PATCH] fix compilation issues after merge --- beacon_node/beacon_chain/src/test_utils.rs | 5 --- .../execution_layer/src/engine_api/http.rs | 9 +++- beacon_node/execution_layer/src/lib.rs | 11 ++++- .../src/test_utils/handle_rpc.rs | 45 ++++++++++++------- .../execution_layer/src/test_utils/mod.rs | 2 + beacon_node/http_api/src/lib.rs | 1 - .../network/src/beacon_processor/mod.rs | 19 -------- .../work_reprocessing_queue.rs | 3 +- 8 files changed, 48 insertions(+), 47 deletions(-) diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 93f42a4c5..77863a556 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -331,11 +331,6 @@ where ) } - pub fn withdrawal_keypairs(mut self, withdrawal_keypairs: Vec>) -> Self { - self.withdrawal_keypairs = withdrawal_keypairs; - self - } - pub fn default_spec(self) -> Self { self.spec_or_default(None) } diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index b49ce51c6..8763ffd4d 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -73,13 +73,16 @@ pub static LIGHTHOUSE_CAPABILITIES: &[&str] = &[ /// This is necessary because a user might run a capella-enabled version of /// lighthouse before they update to a capella-enabled execution engine. // TODO (mark): rip this out once we are post-capella on mainnet +// TODO (sean): do we similarly need something like this for 4844? pub static PRE_CAPELLA_ENGINE_CAPABILITIES: EngineCapabilities = EngineCapabilities { new_payload_v1: true, new_payload_v2: false, + new_payload_v3: false, forkchoice_updated_v1: true, forkchoice_updated_v2: false, get_payload_v1: true, get_payload_v2: false, + get_payload_v3: false, exchange_transition_configuration_v1: true, }; @@ -1019,10 +1022,12 @@ impl HttpJsonRpc { Ok(capabilities) => Ok(EngineCapabilities { new_payload_v1: capabilities.contains(ENGINE_NEW_PAYLOAD_V1), new_payload_v2: capabilities.contains(ENGINE_NEW_PAYLOAD_V2), + new_payload_v3: capabilities.contains(ENGINE_NEW_PAYLOAD_V3), forkchoice_updated_v1: capabilities.contains(ENGINE_FORKCHOICE_UPDATED_V1), forkchoice_updated_v2: capabilities.contains(ENGINE_FORKCHOICE_UPDATED_V2), get_payload_v1: capabilities.contains(ENGINE_GET_PAYLOAD_V1), get_payload_v2: capabilities.contains(ENGINE_GET_PAYLOAD_V2), + get_payload_v3: capabilities.contains(ENGINE_GET_PAYLOAD_V3), exchange_transition_configuration_v1: capabilities .contains(ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_V1), }), @@ -1070,7 +1075,7 @@ impl HttpJsonRpc { let engine_capabilities = self.get_engine_capabilities(None).await?; if engine_capabilities.new_payload_v3 { self.new_payload_v3(execution_payload).await - }else if engine_capabilities.new_payload_v2 { + } else if engine_capabilities.new_payload_v2 { self.new_payload_v2(execution_payload).await } else if engine_capabilities.new_payload_v1 { self.new_payload_v1(execution_payload).await @@ -1089,7 +1094,7 @@ impl HttpJsonRpc { let engine_capabilities = self.get_engine_capabilities(None).await?; if engine_capabilities.get_payload_v3 { self.get_payload_v3(fork_name, payload_id).await - } else if engine_capabilities.get_payload_v2 { + } else if engine_capabilities.get_payload_v2 { self.get_payload_v2(fork_name, payload_id).await } else if engine_capabilities.new_payload_v1 { self.get_payload_v1(payload_id).await diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index b55e9a0c0..3a1365db8 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -145,9 +145,13 @@ impl> BlockProposalContents, T::MaxBlobsPerBlock>>, ) { match self { - Self::Payload(payload) => (payload, None, None), + Self::Payload { + payload, + block_value: _, + } => (payload, None, None), Self::PayloadAndBlobs { payload, + block_value: _, kzg_commitments, blobs, } => (payload, Some(kzg_commitments), Some(blobs)), @@ -2128,7 +2132,10 @@ fn ethers_tx_to_bytes( VariableList::new(tx).map_err(Into::into) } -fn noop(_: &ExecutionLayer, _: &ExecutionPayload) -> Option> { +fn noop( + _: &ExecutionLayer, + _: ExecutionPayloadRef, +) -> Option> { None } diff --git a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs index fb0cf66a3..f5180c9a6 100644 --- a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs +++ b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs @@ -110,7 +110,8 @@ pub async fn handle_rpc( get_param::>(params, 0) .map(|jep| JsonExecutionPayload::V1(jep)) }) - })?, + }) + .map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?, _ => unreachable!(), }; @@ -150,18 +151,27 @@ pub async fn handle_rpc( } ForkName::Eip4844 => { if method == ENGINE_NEW_PAYLOAD_V1 || method == ENGINE_NEW_PAYLOAD_V2 { - return Err((format!("{} called after capella fork!", method), GENERIC_ERROR_CODE)); + return Err(( + format!("{} called after capella fork!", method), + GENERIC_ERROR_CODE, + )); } if matches!(request, JsonExecutionPayload::V1(_)) { - return Err((format!( - "{} called with `ExecutionPayloadV1` after eip4844 fork!", - method - ), GENERIC_ERROR_CODE)); + return Err(( + format!( + "{} called with `ExecutionPayloadV1` after eip4844 fork!", + method + ), + GENERIC_ERROR_CODE, + )); } if matches!(request, JsonExecutionPayload::V2(_)) { - return Err((format!( - "{} called with `ExecutionPayloadV2` after eip4844 fork!", - method), GENERIC_ERROR_CODE + return Err(( + format!( + "{} called with `ExecutionPayloadV2` after eip4844 fork!", + method + ), + GENERIC_ERROR_CODE, )); } } @@ -235,7 +245,10 @@ pub async fn handle_rpc( == ForkName::Eip4844 && (method == ENGINE_GET_PAYLOAD_V1 || method == ENGINE_GET_PAYLOAD_V2) { - return Err((format!("{} called after eip4844 fork!", method), FORK_REQUEST_MISMATCH_ERROR_CODE)); + return Err(( + format!("{} called after eip4844 fork!", method), + FORK_REQUEST_MISMATCH_ERROR_CODE, + )); } match method { @@ -263,23 +276,23 @@ pub async fn handle_rpc( JsonExecutionPayload::V1(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV1 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into() + block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), }) - .unwrap() + .unwrap() } JsonExecutionPayload::V2(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV2 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into() + block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), }) - .unwrap() + .unwrap() } JsonExecutionPayload::V3(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV3 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into() + block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), }) - .unwrap() + .unwrap() } }), _ => unreachable!(), diff --git a/beacon_node/execution_layer/src/test_utils/mod.rs b/beacon_node/execution_layer/src/test_utils/mod.rs index 077d29575..52a794ba1 100644 --- a/beacon_node/execution_layer/src/test_utils/mod.rs +++ b/beacon_node/execution_layer/src/test_utils/mod.rs @@ -37,10 +37,12 @@ pub const DEFAULT_BUILDER_PAYLOAD_VALUE_WEI: u128 = 20_000_000_000_000_000; pub const DEFAULT_ENGINE_CAPABILITIES: EngineCapabilities = EngineCapabilities { new_payload_v1: true, new_payload_v2: true, + new_payload_v3: true, forkchoice_updated_v1: true, forkchoice_updated_v2: true, get_payload_v1: true, get_payload_v2: true, + get_payload_v3: true, exchange_transition_configuration_v1: true, }; diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 6f72bcf2c..71e8a7242 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -3569,7 +3569,6 @@ pub fn serve( .or(post_beacon_pool_proposer_slashings.boxed()) .or(post_beacon_pool_voluntary_exits.boxed()) .or(post_beacon_pool_sync_committees.boxed()) - .or(post_beacon_rewards_sync_committee.boxed()) .or(post_beacon_pool_bls_to_execution_changes.boxed()) .or(post_beacon_rewards_sync_committee.boxed()) .or(post_validator_duties_attester.boxed()) diff --git a/beacon_node/network/src/beacon_processor/mod.rs b/beacon_node/network/src/beacon_processor/mod.rs index b08c127af..25f2830b0 100644 --- a/beacon_node/network/src/beacon_processor/mod.rs +++ b/beacon_node/network/src/beacon_processor/mod.rs @@ -802,21 +802,6 @@ impl std::convert::From> for WorkEvent { seen_timestamp, }, }, - ReadyWork::LightClientUpdate(QueuedLightClientUpdate { - peer_id, - message_id, - light_client_optimistic_update, - seen_timestamp, - .. - }) => Self { - drop_during_sync: true, - work: Work::UnknownLightClientOptimisticUpdate { - message_id, - peer_id, - light_client_optimistic_update, - seen_timestamp, - }, - }, } } } @@ -1001,7 +986,6 @@ impl Work { Work::UnknownBlockAggregate { .. } => UNKNOWN_BLOCK_AGGREGATE, Work::UnknownLightClientOptimisticUpdate { .. } => UNKNOWN_LIGHT_CLIENT_UPDATE, Work::GossipBlsToExecutionChange { .. } => GOSSIP_BLS_TO_EXECUTION_CHANGE, - Work::UnknownLightClientOptimisticUpdate { .. } => UNKNOWN_LIGHT_CLIENT_UPDATE, } } } @@ -1529,9 +1513,6 @@ impl BeaconProcessor { Work::UnknownBlockAggregate { .. } => { unknown_block_aggregate_queue.push(work) } - Work::UnknownLightClientOptimisticUpdate { .. } => { - unknown_light_client_update_queue.push(work, work_id, &self.log) - } Work::GossipBlsToExecutionChange { .. } => { gossip_bls_to_execution_change_queue.push(work, work_id, &self.log) } diff --git a/beacon_node/network/src/beacon_processor/work_reprocessing_queue.rs b/beacon_node/network/src/beacon_processor/work_reprocessing_queue.rs index debfaa478..4d0bdc002 100644 --- a/beacon_node/network/src/beacon_processor/work_reprocessing_queue.rs +++ b/beacon_node/network/src/beacon_processor/work_reprocessing_queue.rs @@ -31,8 +31,7 @@ use tokio::sync::mpsc::{self, Receiver, Sender}; use tokio::time::error::Error as TimeError; use tokio_util::time::delay_queue::{DelayQueue, Key as DelayKey}; use types::{ - Attestation, EthSpec, Hash256, LightClientOptimisticUpdate, SignedAggregateAndProof, - SignedBeaconBlock, SubnetId, + Attestation, EthSpec, Hash256, LightClientOptimisticUpdate, SignedAggregateAndProof, SubnetId, }; const TASK_NAME: &str = "beacon_processor_reprocess_queue";