Skip to content

Commit 1808448

Browse files
committed
lint fix
1 parent adba8ce commit 1808448

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4154,17 +4154,16 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
41544154
if let Some(proofs) = self
41554155
.data_availability_checker
41564156
.get_execution_proofs(&block_root)
4157+
&& !proofs.is_empty()
41574158
{
4158-
if !proofs.is_empty() {
4159-
let proofs_owned: Vec<_> = proofs.iter().map(|p| (**p).clone()).collect();
4160-
if let Err(e) = self.store.put_execution_proofs(&block_root, &proofs_owned) {
4161-
// Log but don't fail block import - proofs can still be served from cache
4162-
warn!(
4163-
%block_root,
4164-
error = ?e,
4165-
"Failed to persist execution proofs to database"
4166-
);
4167-
}
4159+
let proofs_owned: Vec<_> = proofs.iter().map(|p| (**p).clone()).collect();
4160+
if let Err(e) = self.store.put_execution_proofs(&block_root, &proofs_owned) {
4161+
// Log but don't fail block import - proofs can still be served from cache
4162+
warn!(
4163+
%block_root,
4164+
error = ?e,
4165+
"Failed to persist execution proofs to database"
4166+
);
41684167
}
41694168
}
41704169

beacon_node/lighthouse_network/src/rpc/codec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,9 @@ mod tests {
13071307
RequestType::ExecutionProofsByRoot(exec_proofs) => {
13081308
assert_eq!(decoded, RequestType::ExecutionProofsByRoot(exec_proofs))
13091309
}
1310+
RequestType::ExecutionProofsByRange(exec_proofs_range) => {
1311+
assert_eq!(decoded, RequestType::ExecutionProofsByRange(exec_proofs_range))
1312+
}
13101313
RequestType::Ping(ping) => {
13111314
assert_eq!(decoded, RequestType::Ping(ping))
13121315
}

beacon_node/store/src/hot_cold_store.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,11 +3730,12 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
37303730
self.blobs_db.do_atomically(db_ops)?;
37313731
}
37323732

3733-
if !removed_block_roots.is_empty() {
3734-
if let Some(mut block_cache) = self.block_cache.as_ref().map(|cache| cache.lock()) {
3735-
for block_root in removed_block_roots {
3736-
block_cache.delete_execution_proofs(&block_root);
3737-
}
3733+
// TODO(zkproofs): Fix this to make it more readable
3734+
if !removed_block_roots.is_empty()
3735+
&& let Some(mut block_cache) = self.block_cache.as_ref().map(|cache| cache.lock())
3736+
{
3737+
for block_root in removed_block_roots {
3738+
block_cache.delete_execution_proofs(&block_root);
37383739
}
37393740
}
37403741

0 commit comments

Comments
 (0)