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

Safe block hash uses unrealized justification #13343

Closed
michaelsproul opened this issue Dec 14, 2023 · 5 comments
Closed

Safe block hash uses unrealized justification #13343

michaelsproul opened this issue Dec 14, 2023 · 5 comments
Labels
Bug Something isn't working

Comments

@michaelsproul
Copy link

Describe the bug

According to the spec, the safe block hash sent in fcU should be set to the block hash of the justified block: https://github.com/ethereum/consensus-specs/blob/dev/fork_choice/safe-block.md#get_safe_beacon_block_root

Prysm uses the unrealized justified block:

finalizedHash := s.cfg.ForkChoiceStore.FinalizedPayloadBlockHash()
justifiedHash := s.cfg.ForkChoiceStore.UnrealizedJustifiedPayloadBlockHash()
fcs := &enginev1.ForkchoiceState{
HeadBlockHash: headPayload.BlockHash(),
SafeBlockHash: justifiedHash[:],
FinalizedBlockHash: finalizedHash[:],
}

I noticed this while working on Eleel's fcU matching algorithm and didn't think anything of it, but @parithosh and @barnabasbusa recently raised this as a potential client interop issue. In some sense it would be nice to be able to poll a collection of nodes and get a consistent answer as to what the safe head is.

Personally I think Prysm's behaviour is actually better than the spec's, because it gives a more recent view of justification that is almost-as-good. I'm opening this issue to track it on Prysm's side, but if you would prefer we change the spec I would be supportive. Changing the definition of "safe" may interact with confirmation rule work (ethereum/consensus-specs#3339), but I get the feeling that most clients aren't close to having that implemented, and that PR doesn't currently change the definition of safe used by fcU anyway.

Has this worked before in a previous version?

Prior to the introduction of unrealized justification.

🔬 Minimal Reproduction

Run Prysm and observe fcU compared to another client (e.g. Lighthouse).

Error

No response

Platform(s)

Linux (x86), Linux (ARM)

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

v4.4.1

Anything else relevant (validator index / public key)?

No response

@michaelsproul michaelsproul added the Bug Something isn't working label Dec 14, 2023
@parithosh
Copy link

cc @bsamuels453 (found the initial discrepancy), in case you wanna track the progress here :)

@potuz
Copy link
Contributor

potuz commented Dec 14, 2023

Discussed it in Discord R&D for a while (mostly with @mkhalinin) and it seemed to have no opposition and be a clearly better option. We didn't really advertise it since unrealized justification wasn't public at the time

@potuz
Copy link
Contributor

potuz commented Dec 14, 2023

For completeness, the consensus spec says that it's a stopgag to use justification, and the engine spec explicitly is lose in regards to what one is allowed to send:

safeBlockHash: DATA, 32 Bytes - the "safe" block hash of the canonical chain under certain synchrony and honesty assumptions. This value MUST be either equal to or an ancestor of headBlockHash

I'll open the CL spec PR when I get home

@michaelsproul
Copy link
Author

michaelsproul commented Dec 15, 2023

Linking to latest discussion on Eth R&D to keep everyone in the loop. Current thinking suggests we don't update the spec to require unrealized justification, and either allow clients to continue doing different things, or define new (explicit) justified/confirmed labels in place of "safe".

https://discord.com/channels/595666850260713488/598292067260825641/1184977086214053939

@prestonvanloon
Copy link
Member

Closing old issues. It sounds like this one resolved in agreement without any action items to complete. If that isn't the case, please reply here or create a new issue.

@prestonvanloon prestonvanloon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
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

No branches or pull requests

4 participants