lighthouse/beacon_node
Michael Sproul 8e95b69a1a Send success code for duplicate blocks on HTTP (#4655)
## Issue Addressed

Closes #4473 (take 3)

## Proposed Changes

- Send a 202 status code by default for duplicate blocks, instead of 400. This conveys to the caller that the block was published, but makes no guarantees about its validity. Block relays can count this as a success or a failure as they wish.
- For users wanting finer-grained control over which status is returned for duplicates, a flag `--http-duplicate-block-status` can be used to adjust the behaviour. A 400 status can be supplied to restore the old (spec-compliant) behaviour, or a 200 status can be used to silence VCs that warn loudly for non-200 codes (e.g. Lighthouse prior to v4.4.0).
- Update the Lighthouse VC to gracefully handle success codes other than 200. The info message isn't the nicest thing to read, but it covers all bases and isn't a nasty `ERRO`/`CRIT` that will wake anyone up.

## Additional Info

I'm planning to raise a PR to `beacon-APIs` to specify that clients may return 202 for duplicate blocks. Really it would be nice to use some 2xx code that _isn't_ the same as the code for "published but invalid". I think unfortunately there aren't any suitable codes, and maybe the best fit is `409 CONFLICT`. Given that we need to fix this promptly for our release, I think using the 202 code temporarily with configuration strikes a nice compromise.
2023-08-28 00:55:31 +00:00
..
beacon_chain rust 1.72 lints (#4659) 2023-08-24 14:33:24 -04:00
beacon_processor Fix beacon-processor-max-workers (#4636) 2023-08-21 05:02:34 +00:00
builder_client Tidy formatting of Reqwest errors (#4336) 2023-06-27 01:06:50 +00:00
client Fix beacon-processor-max-workers (#4636) 2023-08-21 05:02:34 +00:00
eth1 Replace ganache-cli with anvil (#3555) 2023-05-15 07:22:02 +00:00
execution_layer update dependencies (#4639) 2023-08-28 00:55:28 +00:00
genesis rust 1.72 lints (#4659) 2023-08-24 14:33:24 -04:00
http_api Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
http_metrics upgrade to libp2p 0.52 (#4431) 2023-08-02 00:59:34 +00:00
lighthouse_network rust 1.72 lints (#4659) 2023-08-24 14:33:24 -04:00
network Fix beacon-processor-max-workers (#4636) 2023-08-21 05:02:34 +00:00
operation_pool Fix some typos (#4565) 2023-08-14 00:29:43 +00:00
src Send success code for duplicate blocks on HTTP (#4655) 2023-08-28 00:55:31 +00:00
store rust 1.72 lints (#4659) 2023-08-24 14:33:24 -04: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 Move the BeaconProcessor into a new crate (#4435) 2023-07-10 07:45:54 +00:00