No string in slog (#2017)

## Issue Addressed

Following slog's documentation, this should help a bit with string allocations. I left it run for two days and mem usage is lower. This is of course anecdotal, but shouldn't harm anyway 

## Proposed Changes

remove `String` creation in logs when possible
This commit is contained in:
divma
2020-11-30 10:33:00 +00:00
parent 3f036fd193
commit 8fcd22992c
22 changed files with 160 additions and 158 deletions

View File

@@ -225,14 +225,14 @@ impl<T: BeaconChainTypes> Router<T> {
self.processor.on_block_gossip(id, peer_id, block);
}
PubsubMessage::VoluntaryExit(exit) => {
debug!(self.log, "Received a voluntary exit"; "peer_id" => format!("{}", peer_id));
debug!(self.log, "Received a voluntary exit"; "peer_id" => %peer_id);
self.processor.on_voluntary_exit_gossip(id, peer_id, exit);
}
PubsubMessage::ProposerSlashing(proposer_slashing) => {
debug!(
self.log,
"Received a proposer slashing";
"peer_id" => format!("{}", peer_id)
"peer_id" => %peer_id
);
self.processor
.on_proposer_slashing_gossip(id, peer_id, proposer_slashing);
@@ -241,7 +241,7 @@ impl<T: BeaconChainTypes> Router<T> {
debug!(
self.log,
"Received a attester slashing";
"peer_id" => format!("{}", peer_id)
"peer_id" => %peer_id
);
self.processor
.on_attester_slashing_gossip(id, peer_id, attester_slashing);