mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Reduce calls to network channel (#4863)
## Issue Addressed N/A ## Proposed Changes Sends blocks and blobs from http_api to the network channel for publishing in a single network channel send. This is to avoid overhead of multiple calls. Also adds a metric for rpc blob retrieval duration.
This commit is contained in:
@@ -4705,6 +4705,14 @@ fn publish_pubsub_message<T: EthSpec>(
|
||||
)
|
||||
}
|
||||
|
||||
/// Publish a message to the libp2p pubsub network.
|
||||
fn publish_pubsub_messages<T: EthSpec>(
|
||||
network_tx: &UnboundedSender<NetworkMessage<T>>,
|
||||
messages: Vec<PubsubMessage<T>>,
|
||||
) -> Result<(), warp::Rejection> {
|
||||
publish_network_message(network_tx, NetworkMessage::Publish { messages })
|
||||
}
|
||||
|
||||
/// Publish a message to the libp2p network.
|
||||
fn publish_network_message<T: EthSpec>(
|
||||
network_tx: &UnboundedSender<NetworkMessage<T>>,
|
||||
|
||||
Reference in New Issue
Block a user