Skip to content
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

Error on finalized flag for /eth/v2/beacon/blocks/{block_id} #13408

Closed
ignaciofd opened this issue Jan 3, 2024 · 4 comments · Fixed by #13486
Closed

Error on finalized flag for /eth/v2/beacon/blocks/{block_id} #13408

ignaciofd opened this issue Jan 3, 2024 · 4 comments · Fixed by #13486
Assignees
Labels
Bug Something isn't working

Comments

@ignaciofd
Copy link

Describe the bug

I run several nodes behind a node balancer. I query for the checkpoint and when I receive a new one I query /eth/v1/beacon/headers/{block_id} with the block_id = finalized_root from the checkpoint payload. Then, I query for all the slots between the previous finalized slot and the current finalized slot.

When I queried slot 8118490 (endpoint = /eth/v2/beacon/blocks/8118490) after having seen a new checkpoint (not necessarily from the node that I was quering), I received the payload for the block with the flag finalized: true which is not what I was expecting since the slot has been forked/uncled.

I was expecting either a 404 (block not found) or finalized: false.

Is this an expected behaviour?

Here is the payload that I received for slot 8118490 that shows the finalized flag = true.

Has this worked before in a previous version?

Not sure

🔬 Minimal Reproduction

Below are the prism flags and environment used for all of the nodes behind the node balancer.

[Service]

Environment=USE_PRYSM_MODERN=true
Environment=USE_PRYSM_VERSION=v4.0.8

ExecStart=/data/prysm/prysm.sh beacon-chain \
--slots-per-archive-point 2048 \
--execution-endpoint=http://localhost:8551/ \
--mainnet \
--jwt-secret=/path/to/jwt.hex \
--datadir /path/to/datadir \
--monitoring-host 0.0.0.0 \
--grpc-gateway-host 0.0.0.0 \
--grpc-gateway-corsdomain 127.0.0.1 \
--accept-terms-of-use \
--enable-debug-rpc-endpoints

Error

No response

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

4.0.8

Anything else relevant (validator index / public key)?

No response

@ignaciofd ignaciofd added the Bug Something isn't working label Jan 3, 2024
@rkapka
Copy link
Contributor

rkapka commented Jan 12, 2024

Hi @ignaciofd , I did some digging into our codebase and this behavior is expected if the block is from the last finalized epoch.

Note: beacon blocks from the latest finalized epoch return true, whether or not they are considered canonical in the "head view" of the beacon node.

After the next epoch finalizes, you should get a 404.

@ignaciofd
Copy link
Author

Thank you very much for the reply. However, this does not seem to be good behaviour since the finalized field is not telling if a slot is final or not which I assumed was the intention of the field. Now I know that I should not take into account that flag and I need to reconstruct the chain to filter out the forks.

@rkapka
Copy link
Contributor

rkapka commented Jan 16, 2024

Hi @ignaciofd , I am currently working on a solution for this because I agree it shouldn't work like this.

@ignaciofd
Copy link
Author

Thank you @rkapka !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants