Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement as_ref and as_static_ref to get a &str from PeerKind #91

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

blacktemplar
Copy link

No description provided.

@AgeManning AgeManning merged commit 2d1170b into gossipsub-v1.1 Nov 16, 2020
bors bot pushed a commit to sigp/lighthouse that referenced this pull request Nov 18, 2020
…ere 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 #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: sigp/rust-libp2p#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.
@AgeManning AgeManning deleted the peer-kind-to-str-api branch June 15, 2021 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants