lighthouse/consensus/types/Cargo.toml
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

65 lines
1.8 KiB
TOML

[package]
name = "types"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"]
edition = "2018"
[[bench]]
name = "benches"
harness = false
[dependencies]
bls = { path = "../../crypto/bls" }
compare_fields = { path = "../../common/compare_fields" }
compare_fields_derive = { path = "../../common/compare_fields_derive" }
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
ethereum-types = "0.9.2"
eth2_hashing = "0.1.0"
hex = "0.4.2"
int_to_bytes = { path = "../int_to_bytes" }
log = "0.4.11"
merkle_proof = { path = "../merkle_proof" }
rayon = "1.4.1"
rand = "0.7.3"
safe_arith = { path = "../safe_arith" }
serde = "1.0.116"
serde_derive = "1.0.116"
slog = "2.5.2"
eth2_ssz = "0.1.2"
eth2_ssz_derive = "0.1.0"
eth2_ssz_types = { path = "../ssz_types" }
swap_or_not_shuffle = { path = "../swap_or_not_shuffle" }
test_random_derive = { path = "../../common/test_random_derive" }
tree_hash = "0.1.1"
tree_hash_derive = "0.2.0"
rand_xorshift = "0.2.0"
cached_tree_hash = { path = "../cached_tree_hash" }
serde_yaml = "0.8.13"
tempfile = "3.1.0"
derivative = "2.1.1"
rusqlite = { version = "0.24.0", features = ["bundled"], optional = true }
arbitrary = { version = "0.4.6", features = ["derive"], optional = true }
serde_utils = { path = "../serde_utils" }
regex = "1.3.9"
lazy_static = "1.4.0"
[dev-dependencies]
serde_json = "1.0.58"
criterion = "0.3.3"
[features]
default = ["sqlite", "legacy-arith"]
# Allow saturating arithmetic on slots and epochs. Enabled by default, but deprecated.
legacy-arith = []
sqlite = ["rusqlite"]
arbitrary-fuzz = [
"arbitrary",
"ethereum-types/arbitrary",
"bls/arbitrary",
"eth2_ssz/arbitrary",
"eth2_ssz_types/arbitrary",
"merkle_proof/arbitrary",
"swap_or_not_shuffle/arbitrary",
"tree_hash/arbitrary",
]