Fix lints for Rust 1.81 (#6363)

* Fix lints for Rust 1.81
This commit is contained in:
Michael Sproul
2024-09-06 11:45:34 +10:00
committed by GitHub
parent df19b6220a
commit c824142a6d
7 changed files with 16 additions and 35 deletions

View File

@@ -2035,7 +2035,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let _timer =
metrics::start_timer(&metrics::UNAGGREGATED_ATTESTATION_GOSSIP_VERIFICATION_TIMES);
VerifiedUnaggregatedAttestation::verify(unaggregated_attestation, subnet_id, self).map(
VerifiedUnaggregatedAttestation::verify(unaggregated_attestation, subnet_id, self).inspect(
|v| {
// This method is called for API and gossip attestations, so this covers all unaggregated attestation events
if let Some(event_handler) = self.event_handler.as_ref() {
@@ -2046,7 +2046,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
metrics::inc_counter(&metrics::UNAGGREGATED_ATTESTATION_PROCESSING_SUCCESSES);
v
},
)
}
@@ -2074,7 +2073,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let _timer =
metrics::start_timer(&metrics::AGGREGATED_ATTESTATION_GOSSIP_VERIFICATION_TIMES);
VerifiedAggregatedAttestation::verify(signed_aggregate, self).map(|v| {
VerifiedAggregatedAttestation::verify(signed_aggregate, self).inspect(|v| {
// This method is called for API and gossip attestations, so this covers all aggregated attestation events
if let Some(event_handler) = self.event_handler.as_ref() {
if event_handler.has_attestation_subscribers() {
@@ -2084,7 +2083,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
metrics::inc_counter(&metrics::AGGREGATED_ATTESTATION_PROCESSING_SUCCESSES);
v
})
}
@@ -2098,9 +2096,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
metrics::inc_counter(&metrics::SYNC_MESSAGE_PROCESSING_REQUESTS);
let _timer = metrics::start_timer(&metrics::SYNC_MESSAGE_GOSSIP_VERIFICATION_TIMES);
VerifiedSyncCommitteeMessage::verify(sync_message, subnet_id, self).map(|v| {
VerifiedSyncCommitteeMessage::verify(sync_message, subnet_id, self).inspect(|_| {
metrics::inc_counter(&metrics::SYNC_MESSAGE_PROCESSING_SUCCESSES);
v
})
}
@@ -2112,7 +2109,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
) -> Result<VerifiedSyncContribution<T>, SyncCommitteeError> {
metrics::inc_counter(&metrics::SYNC_CONTRIBUTION_PROCESSING_REQUESTS);
let _timer = metrics::start_timer(&metrics::SYNC_CONTRIBUTION_GOSSIP_VERIFICATION_TIMES);
VerifiedSyncContribution::verify(sync_contribution, self).map(|v| {
VerifiedSyncContribution::verify(sync_contribution, self).inspect(|v| {
if let Some(event_handler) = self.event_handler.as_ref() {
if event_handler.has_contribution_subscribers() {
event_handler.register(EventKind::ContributionAndProof(Box::new(
@@ -2121,7 +2118,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
metrics::inc_counter(&metrics::SYNC_CONTRIBUTION_PROCESSING_SUCCESSES);
v
})
}
@@ -2136,9 +2132,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self,
seen_timestamp,
)
.map(|v| {
.inspect(|_| {
metrics::inc_counter(&metrics::FINALITY_UPDATE_PROCESSING_SUCCESSES);
v
})
}
@@ -2149,9 +2144,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
) -> Result<GossipVerifiedDataColumn<T>, GossipDataColumnError> {
metrics::inc_counter(&metrics::DATA_COLUMN_SIDECAR_PROCESSING_REQUESTS);
let _timer = metrics::start_timer(&metrics::DATA_COLUMN_SIDECAR_GOSSIP_VERIFICATION_TIMES);
GossipVerifiedDataColumn::new(data_column_sidecar, subnet_id, self).map(|v| {
GossipVerifiedDataColumn::new(data_column_sidecar, subnet_id, self).inspect(|_| {
metrics::inc_counter(&metrics::DATA_COLUMN_SIDECAR_PROCESSING_SUCCESSES);
v
})
}
@@ -2162,9 +2156,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
) -> Result<GossipVerifiedBlob<T>, GossipBlobError> {
metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_REQUESTS);
let _timer = metrics::start_timer(&metrics::BLOBS_SIDECAR_GOSSIP_VERIFICATION_TIMES);
GossipVerifiedBlob::new(blob_sidecar, subnet_id, self).map(|v| {
GossipVerifiedBlob::new(blob_sidecar, subnet_id, self).inspect(|_| {
metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_SUCCESSES);
v
})
}
@@ -2179,9 +2172,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self,
seen_timestamp,
)
.map(|v| {
.inspect(|_| {
metrics::inc_counter(&metrics::OPTIMISTIC_UPDATE_PROCESSING_SUCCESSES);
v
})
}
@@ -2485,7 +2477,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.observed_voluntary_exits
.lock()
.verify_and_observe_at(exit, wall_clock_epoch, head_state, &self.spec)
.map(|exit| {
.inspect(|exit| {
// this method is called for both API and gossip exits, so this covers all exit events
if let Some(event_handler) = self.event_handler.as_ref() {
if event_handler.has_exit_subscribers() {
@@ -2494,7 +2486,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
}
exit
})?)
}