Add bls event

This commit is contained in:
chonghe
2024-05-15 08:22:58 +08:00
parent f37ffe4b8d
commit ab9951481e
2 changed files with 11 additions and 0 deletions

View File

@@ -2515,6 +2515,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.observed_bls_to_execution_changes .observed_bls_to_execution_changes
.lock() .lock()
.verify_and_observe(bls_to_execution_change, head_state, &self.spec)?) .verify_and_observe(bls_to_execution_change, head_state, &self.spec)?)
if let Some(event_handler) = self.event_handler.as_ref() {
if event_handler.has_bls_to_execution_change_subscribers() {
event_handler.register(EventKind::BlsToExecutionChange(Box::new(
Blt_To_Execution_Change.clone().into_inner(),
)));
}
}
} }
/// Verify a signed BLS to execution change before allowing it to propagate on the gossip network. /// Verify a signed BLS to execution change before allowing it to propagate on the gossip network.

View File

@@ -4364,6 +4364,9 @@ pub fn serve<T: BeaconChainTypes>(
api_types::EventTopic::ProposerSlashing => { api_types::EventTopic::ProposerSlashing => {
event_handler.subscribe_proposer_slashing() event_handler.subscribe_proposer_slashing()
} }
api_types::EventTopic::BlsToExecutionChange => {
event_handler.subscribe_bls_to_execution_change()
}
}; };
receivers.push( receivers.push(