get it to compile

This commit is contained in:
Diva M
2022-11-21 14:53:33 -05:00
parent e7ee79185b
commit 7ed2d35424
9 changed files with 106 additions and 62 deletions

View File

@@ -1034,6 +1034,8 @@ pub fn serve<T: BeaconChainTypes>(
*/
// POST beacon/blocks
// TODO: THIS IS NOT THE RIGHT CODE
let post_beacon_blocks = eth_v1
.and(warp::path("beacon"))
.and(warp::path("blocks"))
@@ -1047,12 +1049,11 @@ pub fn serve<T: BeaconChainTypes>(
chain: Arc<BeaconChain<T>>,
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>,
log: Logger| async move {
publish_blocks::publish_block(None, block, None, chain, &network_tx, log)
publish_blocks::publish_block(None, block, chain, &network_tx, log)
.await
.map(|()| warp::reply())
},
);
/*
* beacon/blocks
*/

View File

@@ -1,7 +1,7 @@
use crate::metrics;
use beacon_chain::validator_monitor::{get_block_delay_ms, timestamp_now};
use beacon_chain::{BeaconChain, BeaconChainTypes, BlockError, CountUnrealized};
use lighthouse_network::{PubsubMessage, SignedBeaconBlockAndBlobsSidecar};
use lighthouse_network::PubsubMessage;
use network::NetworkMessage;
use slog::{crit, error, info, warn, Logger};
use slot_clock::SlotClock;
@@ -31,6 +31,8 @@ pub async fn publish_block<T: BeaconChainTypes>(
// Send the block, regardless of whether or not it is valid. The API
// specification is very clear that this is the desired behaviour.
let message = todo!("");
/*
let message = if matches!(block, SignedBeaconBlock::Eip4844(_)) {
if let Some(sidecar) = chain.blob_cache.pop(&block_root) {
PubsubMessage::BeaconBlockAndBlobsSidecars(Arc::new(SignedBeaconBlockAndBlobsSidecar {
@@ -44,6 +46,7 @@ pub async fn publish_block<T: BeaconChainTypes>(
} else {
PubsubMessage::BeaconBlock(block.clone())
};
*/
crate::publish_pubsub_message(network_tx, message)?;
// Determine the delay after the start of the slot, register it with metrics.