lighthouse/beacon_node
Michael Sproul ae47a93c42 Don't panic in forkchoiceUpdated handler (#3165)
## Issue Addressed

Fix a panic due to misuse of the Tokio executor when processing a forkchoiceUpdated response. We were previously calling `process_invalid_execution_payload` from the async function `update_execution_engine_forkchoice_async`, which resulted in a panic because `process_invalid_execution_payload` contains a call to fork choice, which ultimately calls `block_on`.

An example backtrace can be found here: https://gist.github.com/michaelsproul/ac5da03e203d6ffac672423eaf52fb20

## Proposed Changes

Wrap the call to `process_invalid_execution_payload` in a `spawn_blocking` so that `block_on` is no longer called from an async context.

## Additional Info

- I've been thinking about how to catch bugs like this with static analysis (a new Clippy lint).
- The payload validation tests have been re-worked to support distinct responses from the mock EE for newPayload and forkchoiceUpdated. Three new tests have been added covering the `Invalid`, `InvalidBlockHash` and `InvalidTerminalBlock` cases.
- I think we need a bunch more tests of different legal and illegal variations
2022-05-04 23:30:34 +00:00
..
beacon_chain Don't panic in forkchoiceUpdated handler (#3165) 2022-05-04 23:30:34 +00:00
client Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
eth1 v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00
execution_layer Don't panic in forkchoiceUpdated handler (#3165) 2022-05-04 23:30:34 +00:00
genesis Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
http_api Disallow attesting to optimistic head (#3140) 2022-04-13 03:54:42 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network Poll shutdown timeout in rpc handler (#3153) 2022-04-13 03:54:44 +00:00
network keep failed finalized chains to avoid retries (#3142) 2022-04-13 01:10:55 +00:00
operation_pool Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
src Fix SPRP default value in cli (#3145) 2022-04-07 04:04:11 +00:00
store Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
Cargo.toml v2.2.1 (#3149) 2022-04-12 02:52:12 +00:00