mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Clean up network logging and code (#643)
* Apply clippy lints to beacon node * Remove unnecessary logging and correct formatting * Apply reviewers suggestions
This commit is contained in:
@@ -664,7 +664,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
});
|
||||
}
|
||||
other => {
|
||||
warn!(
|
||||
trace!(
|
||||
self.log,
|
||||
"Beacon attestation rejected";
|
||||
"reason" => format!("{:?}", other),
|
||||
@@ -1019,7 +1019,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
});
|
||||
}
|
||||
other => {
|
||||
warn!(
|
||||
trace!(
|
||||
self.log,
|
||||
"Beacon block rejected";
|
||||
"reason" => format!("{:?}", other),
|
||||
|
||||
@@ -290,11 +290,11 @@ fn eth1_block_hash_at_start_of_voting_period<T: EthSpec, S: Store>(
|
||||
let slot = (state.slot / period) * period;
|
||||
let prev_state_root = state
|
||||
.get_state_root(slot)
|
||||
.map_err(|e| Error::UnableToGetPreviousStateRoot(e))?;
|
||||
.map_err(Error::UnableToGetPreviousStateRoot)?;
|
||||
|
||||
store
|
||||
.get_state::<T>(&prev_state_root, Some(slot))
|
||||
.map_err(|e| Error::StoreError(e))?
|
||||
.map_err(Error::StoreError)?
|
||||
.map(|state| state.eth1_data.block_hash)
|
||||
.ok_or_else(|| Error::PreviousStateNotInDB)
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
|
||||
// Fast-forward the state to the start slot of the epoch where it was justified.
|
||||
for _ in block.slot.as_u64()..block_justified_slot.as_u64() {
|
||||
per_slot_processing(&mut state, &chain.spec)
|
||||
.map_err(|e| BeaconChainError::SlotProcessingError(e))?
|
||||
.map_err(BeaconChainError::SlotProcessingError)?
|
||||
}
|
||||
|
||||
(state, block_root, block_justified_slot)
|
||||
|
||||
Reference in New Issue
Block a user