Skip to content

Fix Post Submit E2E: change getblockroot REST api optimistic check #15015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Mar 5, 2025

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

#14997 happened to break E2E post submit for REST API tests. upon investigation the issue was caused by validator_sync_participation_0 failing from level=error msg="Could not get sync committee contribution" error="failed to get sync message block root: the node is currently optimistic and cannot serve validators" This is caused by a difference between gRPC and REST optimistic checks, and for some reason PR14997 changed this.

gRPC implementation : https://github.com/prysmaticlabs/prysm/blob/014dbd5c3af3dde8de6dafab9d2e15e523e97167/beacon-chain/rpc/prysm/v1alpha1/validator/sync_committee.go#L16

REST implementation:
https://github.com/prysmaticlabs/prysm/blob/6b84f8c6b1e73254d23cca9ac31a567723b0bddc/beacon-chain/rpc/eth/beacon/handlers.go#L1163

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

@james-prysm james-prysm added Bug Something isn't working API Api related tasks E2E Tests End-To-End testing labels Mar 5, 2025
@james-prysm james-prysm requested a review from a team as a code owner March 5, 2025 19:44
b32Root := bytesutil.ToBytes32(root)
isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, b32Root)
isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming here that the gRPC implementation is correct in this case. if not then the evaluator may not be correct either

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am missing something. The input request is a root. When we query optimistic status, without specifying it, how do you know if the root is optimistic?

Copy link
Contributor

@rkapka rkapka Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@terencechain The response is a root, the request can be any of "head" (canonical head in node's view), "genesis", "finalized", , <hex encoded blockRoot with 0x prefix>. and b32Root is the root that was calculated from the input (by fetching the head block from the DB, or the block at the passed in slot etc)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. All I am saying is say I am syncing two branches. Branch A is optimistic and branch B is non-optimistic
Given the input, I could select branch A or branch B. But without IsOptimisticForRoot the ForRoot, how do you know if it needs to select branch A or B?

@james-prysm james-prysm requested a review from potuz March 5, 2025 20:37
@james-prysm james-prysm changed the title fix E2E: change getblockroot REST api optimistic check Fix Post Submit E2E: change getblockroot REST api optimistic check Mar 6, 2025
@@ -0,0 +1,3 @@
### Fixed

- fixes e2e introduced by PR#14997 by changing the optimistic check in getblockroot for rest APIs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this as this actually fixes two existing bugs. The failing test must be wrong or have a bad assumption on head. The Sync committee production is a bad bug as well, needs to be commented here with the fix.

@james-prysm
Copy link
Contributor Author

Discussed on huddle, change to block root API is incorrect, @potuz will fix in a followup PR, I'll open a new one to add the optimistic check to the beacon endpoint.

@james-prysm james-prysm closed this Mar 6, 2025
@prestonvanloon
Copy link
Member

Follow up is done in #15021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Bug Something isn't working E2E Tests End-To-End testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants