lighthouse/consensus/state_processing/Cargo.toml
Michael Sproul 3412a3ec54 Remove saturating arith from state_processing (#1644)
## Issue Addressed

Resolves #1100

## Proposed Changes

* Implement the `SafeArith` trait for `Slot` and `Epoch`, so that methods like `safe_add` become available.
* Tweak the `SafeArith` trait to allow a different `Rhs` type (analagous to `std::ops::Add`, etc).
* Add a `legacy-arith` feature to `types` and `state_processing` that conditionally enables implementations of
  the `std` ops with saturating semantics.
* Check compilation of `types` and `state_processing` _without_ `legacy-arith` on CI,
  thus guaranteeing that they only use the `SafeArith` primitives 🎉

## Additional Info

The `legacy-arith` feature gets turned on by all higher-level crates that depend on `state_processing` or `types`, thus allowing the beacon chain, networking, and other components to continue to rely on the availability of ops like `+`, `-`, `*`, etc.

**This is a consensus-breaking change**, but brings us in line with the spec, and our incompatibilities shouldn't have been reachable with any valid configuration of Eth2 parameters.
2020-09-25 05:18:21 +00:00

49 lines
1.1 KiB
TOML

[package]
name = "state_processing"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Michael Sproul <michael@sigmaprime.io>"]
edition = "2018"
[[bench]]
name = "benches"
harness = false
[dev-dependencies]
criterion = "0.3.2"
env_logger = "0.7.1"
serde = "1.0.110"
serde_derive = "1.0.110"
lazy_static = "1.4.0"
serde_yaml = "0.8.11"
[dependencies]
bls = { path = "../../crypto/bls" }
integer-sqrt = "0.1.3"
itertools = "0.9.0"
eth2_ssz = "0.1.2"
eth2_ssz_types = { path = "../ssz_types" }
merkle_proof = { path = "../merkle_proof" }
log = "0.4.8"
safe_arith = { path = "../safe_arith" }
tree_hash = "0.1.0"
tree_hash_derive = "0.2.0"
types = { path = "../types", default-features = false }
rayon = "1.3.0"
eth2_hashing = "0.1.0"
int_to_bytes = { path = "../int_to_bytes" }
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[features]
default = ["legacy-arith"]
fake_crypto = ["bls/fake_crypto"]
legacy-arith = ["types/legacy-arith"]
arbitrary-fuzz = [
"arbitrary",
"types/arbitrary-fuzz",
"bls/arbitrary",
"merkle_proof/arbitrary",
"eth2_ssz/arbitrary",
"eth2_ssz_types/arbitrary",
"tree_hash/arbitrary",
]