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

Retrospective transition block checking #2983

Closed
paulhauner opened this issue Feb 1, 2022 · 4 comments
Closed

Retrospective transition block checking #2983

paulhauner opened this issue Feb 1, 2022 · 4 comments
Assignees
Labels
bellatrix Required to support the Bellatrix Upgrade v2.5.0 Required for Goerli merge release

Comments

@paulhauner
Copy link
Member

Description

The "transition block" is the first block in a chain that includes a non-empty ExecutionPayload. This is effectively the first merging of the proof-of-work chain into the proof-of-stake chain.

This block requires some additional verification when compared to pre- and post-transition blocks; the consensus client must check that the PoW chain has reached the terminal total difficulty and/or some other criteria.

These additional verifications are challenging during optimistic sync. We can't perform them during sync, since the execution client might not be synced enough to respond to the requests. So, we optimistically accept the transition block and promise to come back later and check it once the execution client is synced.

Presently, Lighthouse happily optimistically accepts the transition block, but it fulfills the promise to verify it. Therefore, Lighthouse needs:

@paulhauner paulhauner added the bellatrix Required to support the Bellatrix Upgrade label Feb 1, 2022
@ethDreamer
Copy link
Member

I ran into some related stuff when working on the engine-api upgrade so I'm going to put all the block conditions here:

You'll notice there's a new status INVALID_TERMINAL_BLOCK in the response to newPayloadV1 (formally executePayloadV1) from the execution engine.. not sure how that changes what you've discussed here @paulhauner

@paulhauner
Copy link
Member Author

You'll notice there's a new status INVALID_TERMINAL_BLOCK in the response to newPayloadV1 (formally executePayloadV1) from the execution engine.. not sure how that changes what you've discussed here @paulhauner

I don't think that changes anything here, thanks for pointing it out though.

@paulhauner
Copy link
Member Author

paulhauner commented Mar 9, 2022

I'm thinking that perhaps we want logic along the lines of this:

  1. Whenever a transition block is optimistically imported, insert it into an "optimistic transition blocks" (OTB) column in the database.
  2. Periodically run a routine that:
    1. Loads all blocks roots from the OTB column.
    2. Removes any blocks from the OTB column that conflict with the finalized checkpoint.
    3. For remaining OTB block roots that are finalized, check them against the EL and kill the client if they're invalid.
    4. For remaining OTB blocks that are not-yet-finalized, run BeaconChain::process_invalid_execution_payload for any invalid blocks.
    5. For any blocks that are found to be valid, remove them from the OTB table.

@ethDreamer ethDreamer self-assigned this Jun 17, 2022
@paulhauner paulhauner added the v2.5.0 Required for Goerli merge release label Jul 20, 2022
bors bot pushed a commit that referenced this issue Jul 29, 2022
## Issue Addressed

* #2983 

## Proposed Changes

Basically followed the [instructions laid out here](#2983 (comment))


Co-authored-by: Paul Hauner <[email protected]>
Co-authored-by: ethDreamer <[email protected]>
bors bot pushed a commit that referenced this issue Jul 30, 2022
## Issue Addressed

* #2983 

## Proposed Changes

Basically followed the [instructions laid out here](#2983 (comment))


Co-authored-by: Paul Hauner <[email protected]>
Co-authored-by: ethDreamer <[email protected]>
@paulhauner
Copy link
Member Author

Resolved via #3372 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bellatrix Required to support the Bellatrix Upgrade v2.5.0 Required for Goerli merge release
Projects
None yet
Development

No branches or pull requests

2 participants