8609cced0e
## Issue Addressed NA ## Proposed Changes This PR is motivated by a recent consensus failure in Geth where it returned `INVALID` for an `VALID` block. Without this PR, the only way to recover is by re-syncing Lighthouse. Whilst ELs "shouldn't have consensus failures", in reality it's something that we can expect from time to time due to the complex nature of Ethereum. Being able to recover easily will help the network recover and EL devs to troubleshoot. The risk introduced with this PR is that genuinely INVALID payloads get a "second chance" at being imported. I believe the DoS risk here is negligible since LH needs to be restarted in order to re-process the payload. Furthermore, there's no reason to think that a well-performing EL will accept a truly invalid payload the second-time-around. ## Additional Info This implementation has the following intricacies: 1. Instead of just resetting *invalid* payloads to optimistic, we'll also reset *valid* payloads. This is an artifact of our existing implementation. 1. We will only reset payload statuses when we detect an invalid payload present in `proto_array` - This helps save us from forgetting that all our blocks are valid in the "best case scenario" where there are no invalid blocks. 1. If we fail to revert the payload statuses we'll log a `CRIT` and just continue with a `proto_array` that *does not* have reverted payload statuses. - The code to revert statuses needs to deal with balances and proposer-boost, so it's a failure point. This is a defensive measure to avoid introducing new show-stopping bugs to LH.
21 lines
672 B
TOML
21 lines
672 B
TOML
[package]
|
|
name = "fork_choice"
|
|
version = "0.1.0"
|
|
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
|
edition = "2021"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[dependencies]
|
|
types = { path = "../types" }
|
|
state_processing = { path = "../state_processing" }
|
|
proto_array = { path = "../proto_array" }
|
|
eth2_ssz = "0.4.1"
|
|
eth2_ssz_derive = "0.3.0"
|
|
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
|
|
|
|
[dev-dependencies]
|
|
beacon_chain = { path = "../../beacon_node/beacon_chain" }
|
|
store = { path = "../../beacon_node/store" }
|
|
tokio = { version = "1.14.0", features = ["rt-multi-thread"] }
|