mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Remove reprocess channel (#7437)
Partially https://github.com/sigp/lighthouse/issues/6291 This PR removes the reprocess event channel from being externally exposed. All work events are now sent through the single `BeaconProcessorSend` channel. I've introduced a new `Work::Reprocess` enum variant which we then use to schedule jobs for reprocess. I've also created a new scheduler module which will eventually house the different scheduler impls. This is all needed as an initial step to generalize the beacon processor A "full" implementation for the generalized beacon processor can be found here https://github.com/sigp/lighthouse/pull/6448 I'm going to try to break up the full implementation into smaller PR's so it can actually be reviewed
This commit is contained in:
@@ -40,7 +40,7 @@ use beacon_chain::{
|
||||
validator_monitor::timestamp_now, AttestationError as AttnError, BeaconChain, BeaconChainError,
|
||||
BeaconChainTypes, WhenSlotSkipped,
|
||||
};
|
||||
use beacon_processor::{work_reprocessing_queue::ReprocessQueueMessage, BeaconProcessorSend};
|
||||
use beacon_processor::BeaconProcessorSend;
|
||||
pub use block_id::BlockId;
|
||||
use builder_states::get_next_withdrawals;
|
||||
use bytes::Bytes;
|
||||
@@ -130,7 +130,6 @@ pub struct Context<T: BeaconChainTypes> {
|
||||
pub network_senders: Option<NetworkSenders<T::EthSpec>>,
|
||||
pub network_globals: Option<Arc<NetworkGlobals<T::EthSpec>>>,
|
||||
pub beacon_processor_send: Option<BeaconProcessorSend<T::EthSpec>>,
|
||||
pub beacon_processor_reprocess_send: Option<Sender<ReprocessQueueMessage>>,
|
||||
pub eth1_service: Option<eth1::Service>,
|
||||
pub sse_logging_components: Option<SSELoggingComponents>,
|
||||
}
|
||||
@@ -554,11 +553,6 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.filter(|_| config.enable_beacon_processor);
|
||||
let task_spawner_filter =
|
||||
warp::any().map(move || TaskSpawner::new(beacon_processor_send.clone()));
|
||||
let beacon_processor_reprocess_send = ctx
|
||||
.beacon_processor_reprocess_send
|
||||
.clone()
|
||||
.filter(|_| config.enable_beacon_processor);
|
||||
let reprocess_send_filter = warp::any().map(move || beacon_processor_reprocess_send.clone());
|
||||
|
||||
let duplicate_block_status_code = ctx.config.duplicate_block_status_code;
|
||||
|
||||
@@ -1986,20 +1980,18 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.and(warp_utils::json::json::<Vec<SingleAttestation>>())
|
||||
.and(optional_consensus_version_header_filter)
|
||||
.and(network_tx_filter.clone())
|
||||
.and(reprocess_send_filter.clone())
|
||||
.then(
|
||||
|task_spawner: TaskSpawner<T::EthSpec>,
|
||||
chain: Arc<BeaconChain<T>>,
|
||||
attestations: Vec<SingleAttestation>,
|
||||
_fork_name: Option<ForkName>,
|
||||
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>,
|
||||
reprocess_tx: Option<Sender<ReprocessQueueMessage>>| async move {
|
||||
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>| async move {
|
||||
let result = crate::publish_attestations::publish_attestations(
|
||||
task_spawner,
|
||||
chain,
|
||||
attestations,
|
||||
network_tx,
|
||||
reprocess_tx,
|
||||
true,
|
||||
)
|
||||
.await
|
||||
.map(|()| warp::reply::json(&()));
|
||||
|
||||
Reference in New Issue
Block a user