lighthouse-pulse/consensus
Michael Sproul 2dc6163043 Add API version headers and map_fork_name! (#2745)
## Proposed Changes

* Add the `Eth-Consensus-Version` header to the HTTP API for the block and state endpoints. This is part of the v2.1.0 API that was recently released: https://github.com/ethereum/beacon-APIs/pull/170
* Add tests for the above. I refactored the `eth2` crate's helper functions to make this more straight-forward, and introduced some new mixin traits that I think greatly improve readability and flexibility.
* Add a new `map_with_fork!` macro which is useful for decoding a superstruct type without naming all its variants. It is now used for SSZ-decoding `BeaconBlock` and `BeaconState`, and for JSON-decoding `SignedBeaconBlock` in the API.

## Additional Info

The `map_with_fork!` changes will conflict with the Merge changes, but when resolving the conflict the changes from this branch should be preferred (it is no longer necessary to enumerate every fork). The merge fork _will_  need to be added to `map_fork_name_with`.
2021-10-28 01:18:04 +00:00
..
cached_tree_hash Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
fork_choice Fix test warnings on Rust 1.56.0 (#2743) 2021-10-22 04:49:51 +00:00
int_to_bytes Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
merkle_proof Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
proto_array Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Updates to make crates publishable (#2472) 2021-09-03 01:10:25 +00:00
ssz Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
ssz_derive Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
ssz_types Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
state_processing Update to consensus-spec-tests v1.1.3 (#2722) 2021-10-16 05:07:21 +00:00
swap_or_not_shuffle Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
tree_hash Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
tree_hash_derive Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
types Add API version headers and map_fork_name! (#2745) 2021-10-28 01:18:04 +00:00