lighthouse/beacon_node/http_api/src
Paul Hauner fa6ad1a11a Deduplicate block root computation (#3590)
## Issue Addressed

NA

## Proposed Changes

This PR removes duplicated block root computation.

Computing the `SignedBeaconBlock::canonical_root` has become more expensive since the merge as we need to compute the merke root of each transaction inside an `ExecutionPayload`.

Computing the root for [a mainnet block](https://beaconcha.in/slot/4704236) is taking ~10ms on my i7-8700K CPU @ 3.70GHz (no sha extensions). Given that our median seen-to-imported time for blocks is presently 300-400ms, removing a few duplicated block roots (~30ms) could represent an easy 10% improvement. When we consider that the seen-to-imported times include operations *after* the block has been placed in the early attester cache, we could expect the 30ms to be more significant WRT our seen-to-attestable times.

## Additional Info

NA
2022-09-23 03:52:42 +00:00
..
attestation_performance.rs Fix attestation performance API InvalidValidatorIndex error (#3503) 2022-09-05 04:50:45 +00:00
attester_duties.rs Indicate that invalid blocks are optimistic (#3383) 2022-07-30 05:08:57 +00:00
block_id.rs Fix lints for Rust 1.63 (#3459) 2022-08-12 00:56:39 +00:00
block_packing_efficiency.rs Separate execution payloads in the DB (#3157) 2022-05-12 00:42:17 +00:00
block_rewards.rs Implement skip_randao_verification and blinded block rewards API (#3540) 2022-09-19 07:58:48 +00:00
database.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
lib.rs Deduplicate block root computation (#3590) 2022-09-23 03:52:42 +00:00
metrics.rs Metrics and DEBG log for late gossip blocks (#2533) 2021-08-23 00:59:14 +00:00
proposer_duties.rs Indicate that invalid blocks are optimistic (#3383) 2022-07-30 05:08:57 +00:00
publish_blocks.rs Deduplicate block root computation (#3590) 2022-09-23 03:52:42 +00:00
state_id.rs Indicate that invalid blocks are optimistic (#3383) 2022-07-30 05:08:57 +00:00
sync_committees.rs Don't return errors on HTTP API for already-known messages (#3341) 2022-08-10 07:52:57 +00:00
validator_inclusion.rs Add execution_optimistic flag to HTTP responses (#3070) 2022-07-25 08:23:00 +00:00
version.rs Add execution_optimistic flag to HTTP responses (#3070) 2022-07-25 08:23:00 +00:00