lighthouse/beacon_node/http_api/src
Michael Sproul 74eb267643 Remove double-locking deadlock from HTTP API (#4687)
## Issue Addressed

Fix a deadlock introduced in #4236 which was caught during the v4.4.0 release testing cycle (with thanks to @paulhauner and `gdb`).

## Proposed Changes

Avoid re-locking the fork choice read lock when querying a state by root in the HTTP API. This avoids a deadlock due to the lock already being held.

## Additional Info

The [RwLock docs](https://docs.rs/lock_api/latest/lock_api/struct.RwLock.html#method.read) explicitly advise against re-locking:

> Note that attempts to recursively acquire a read lock on a RwLock when the current thread already holds one may result in a deadlock.
2023-08-31 11:18:00 +00:00
..
attestation_performance.rs improve error message (#4141) 2023-03-28 22:07:05 +00:00
attester_duties.rs attester_duties: remove unnecessary case (#4614) 2023-08-17 02:37:30 +00:00
block_id.rs Add finalized to HTTP API responses (#3753) 2023-03-30 06:08:37 +00:00
block_packing_efficiency.rs Rust 1.71 lints (#4503) 2023-07-17 00:14:19 +00:00
block_rewards.rs Cache target attester balances for unrealized FFG progression calculation (#4362) 2023-06-30 01:13:06 +00:00
builder_states.rs Implement expected withdrawals endpoint (#4390) 2023-08-24 05:54:36 +00:00
database.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
lib.rs Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
metrics.rs Reduce false positive logging for late builder blocks (#4073) 2023-03-17 00:44:03 +00:00
proposer_duties.rs Shift networking configuration (#4426) 2023-08-03 01:51:47 +00:00
publish_blocks.rs Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
standard_block_rewards.rs Add finalized to HTTP API responses (#3753) 2023-03-30 06:08:37 +00:00
state_id.rs Remove double-locking deadlock from HTTP API (#4687) 2023-08-31 11:18:00 +00:00
sync_committee_rewards.rs Add finalized to HTTP API responses (#3753) 2023-03-30 06:08:37 +00:00
sync_committees.rs Shift networking configuration (#4426) 2023-08-03 01:51:47 +00:00
task_spawner.rs Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
test_utils.rs Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
ui.rs Split common crates out into their own repos (#3890) 2023-04-28 01:15:40 +00:00
validator_inclusion.rs Add finalized to HTTP API responses (#3753) 2023-03-30 06:08:37 +00:00
validator.rs Use BeaconProcessor for API requests (#4462) 2023-08-08 23:30:15 +00:00
version.rs Add finalized to HTTP API responses (#3753) 2023-03-30 06:08:37 +00:00