Repository navigation
Conversation
Signed-off-by: kediyalua <kediyalua@outlook.com>
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Addressed
Closes #10295
Also relates to #3822, which introduced the endpoint with this behaviour.
Proposed Changes
POST /eth/v1/beacon/rewards/attestations/{epoch}no longer discards errors fromBeaconChain::is_optimistic_or_invalid_head. The handler now propagates them withmap_err(warp_utils::reject::unhandled_error)?, so a head whose execution status cannot bedetermined produces a server error instead of a response asserting
execution_optimistic: false.is_optimistic_or_invalid_headinbeacon_node/http_api(state_id.rs,block_id.rs,proposer_duties.rs,sync_committees.rs, and theeth/v1/node/syncing-style handler inlib.rs). The attestation rewards handler was the only one usingunwrap_or_default().Additional Info
is_optimistic_or_invalid_head()returnsOk(_): the endpoint stillreturns HTTP 200 with the same
execution_optimisticvalue. The existing integration testtest_beacon_attestation_rewards_fulu, which assertsexecution_optimistic == Some(false), isunaffected.
is_optimistic_or_invalid_headdoc comment (head block root pruned while syncing), which thetest harness cannot easily force. I did not add a test rather than add one that does not exercise
the path.
cargo check -p http_api --lockedpasses, andrustfmt --edition 2024 --check beacon_node/http_api/src/lib.rsreports no diff.against the surrounding call sites.