lighthouse/beacon_node
Peter b14d1493cc Always log the value of relay and local blocks for comparison (#4352)
## Issue Addressed

N/A

## Proposed Changes

This change will log the value of the relay block and the local block when the relay block is more profitable.

## Additional Info

This change will help validators understand the block selection (as it looks like the execution reward sometimes is higher that the MEV-reward).

The rationale for this change is to aid operators to better understand why a relay-block was chosen over a local block.
Looking at produced blocks (at beaconcha.in for example) it sometimes looks like the builder is making a profit just from the execution reward vs the MEV-reward, and creates the nagging question: "Could i have built this block and made that extra profit?"... The answer is probably "No, not without the extra transactions included by the relay", but by logging the value of the local block-candidate, this will no longer be an issue.. 


### Example (Mainnet)
https://beaconcha.in/block/17370329
MEV Block Reward: 0.17122 Ether to 0xE35bBaFa0266089f95d745d348b468622805D82B
Execution Reward: 0.17528 Ether to 0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326
Difference: 0.00406 Ether

### Examples (Goerli)

https://goerli.beaconcha.in/block/9040065
MEV Block Reward: 0.56423 Ether to 0xF5794543CF6055Ae710E9c8E99E31343Cea004a8
Execution Reward: 0.56488 Ether to 0xfC0157aA4F5DB7177830ACddB3D5a9BB5BE9cc5e
Difference: 0.00065 Ether

https://goerli.beaconcha.in/block/9019921
MEV Block Reward: 1.39440 Ether to 0xF5794543CF6055Ae710E9c8E99E31343Cea004a8
Execution Reward: 1.39469 Ether to 0xfC0157aA4F5DB7177830ACddB3D5a9BB5BE9cc5e
Difference: 0.00029 Ether

https://goerli.beaconcha.in/block/9015583
MEV Block Reward: 1.04356 Ether to 0xF5794543CF6055Ae710E9c8E99E31343Cea004a8
Execution Reward: 1.04896 Ether to 0xfC0157aA4F5DB7177830ACddB3D5a9BB5BE9cc5e
Difference: 0.0054 Ether
2023-06-07 01:50:31 +00:00
..
beacon_chain swap unnecessary write lock to read lock in block_verification (#4340) 2023-05-30 01:38:49 +00:00
builder_client Set user agent on requests to builder (#4199) 2023-04-18 02:47:36 +00:00
client Appease clippy in Rust 1.70 (#4365) 2023-06-02 03:17:40 +00:00
eth1 Replace ganache-cli with anvil (#3555) 2023-05-15 07:22:02 +00:00
execution_layer Always log the value of relay and local blocks for comparison (#4352) 2023-06-07 01:50:31 +00:00
genesis Replace ganache-cli with anvil (#3555) 2023-05-15 07:22:02 +00:00
http_api Logging via the HTTP API (#4074) 2023-05-22 05:57:08 +00:00
http_metrics Appease clippy in Rust 1.70 (#4365) 2023-06-02 03:17:40 +00:00
lighthouse_network Appease clippy in Rust 1.70 (#4365) 2023-06-02 03:17:40 +00:00
network Shift subnet backbone structure (attnets revamp) (#4304) 2023-05-30 06:15:56 +00:00
operation_pool Split common crates out into their own repos (#3890) 2023-04-28 01:15:40 +00:00
src Add an option to disable inbound rate limiter (#4327) 2023-06-02 03:17:38 +00:00
store DB migration for fork choice cleanup (#4265) 2023-05-15 02:10:42 +00:00
tests Appease Clippy 1.68 and refactor http_api (#4068) 2023-03-13 01:40:03 +00:00
timer Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
Cargo.toml v4.2.0 (#4309) 2023-05-23 00:17:10 +00:00