lighthouse-pulse/consensus
blacktemplar 3408de8151 Avoid string initialization in network metrics and replace by &str where possible (#1898)
## Issue Addressed

NA

## Proposed Changes

Removes most of the temporary string initializations in network metrics and replaces them by directly using `&str`. This further improves on PR https://github.com/sigp/lighthouse/pull/1895.

For the subnet id handling the current approach uses a build script to create a static map. This has the disadvantage that the build script hardcodes the number of subnets. If we want to use more than 64 subnets we need to adjust this in the build script.

## Additional Info

We still have some string initializations for the enum `PeerKind`. To also replace that by `&str` I created a PR in the libp2p dependency: https://github.com/sigp/rust-libp2p/pull/91. Either we wait with merging until this dependency PR is merged (and all conflicts with the newest libp2p version are resolved) or we just merge as is and I will create another PR when the dependency is ready.
2020-11-18 23:31:37 +00:00
..
cached_tree_hash Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
fork_choice Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
int_to_bytes Update external deps (#1711) 2020-10-05 08:22:19 +00:00
merkle_proof Implement matches! macro (#1777) 2020-10-15 21:42:43 +00:00
proto_array Update external deps (#1711) 2020-10-05 08:22:19 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Update external deps (#1711) 2020-10-05 08:22:19 +00:00
ssz Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
ssz_derive Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
ssz_types Avoid allocations on VariableList (#1921) 2020-11-17 04:28:40 +00:00
state_processing Avoid some allocations in BlockSignatureVerifier (#1922) 2020-11-17 06:31:01 +00:00
swap_or_not_shuffle Update external deps (#1711) 2020-10-05 08:22:19 +00:00
tree_hash Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
tree_hash_derive Update external deps (#1711) 2020-10-05 08:22:19 +00:00
types Avoid string initialization in network metrics and replace by &str where possible (#1898) 2020-11-18 23:31:37 +00:00