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

[Merged by Bors] - Initial Commit of Retrospective OTB Verification #3372

Closed

Conversation

ethDreamer
Copy link
Member

@ethDreamer ethDreamer commented Jul 25, 2022

Issue Addressed

Proposed Changes

Basically followed the instructions laid out here

@paulhauner paulhauner added work-in-progress PR is a work-in-progress bellatrix Required to support the Bellatrix Upgrade v2.5.0 Required for Goerli merge release labels Jul 27, 2022
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

This is super clean, it was a pleasure to read! 🎉

This was a fiddly task done in a short time and you've done really well IMO! I've made a few suggestions, you'll see each suggestion is accompanied by a commit in this branch: https://github.com/paulhauner/lighthouse/tree/rOTBv-2

You can just merge rOTBv-2 into this branch, if you're happy with my suggestions. There's a couple of extra commits on that branch that don't show up in comments:

beacon_node/beacon_chain/src/otb_verification_service.rs Outdated Show resolved Hide resolved
beacon_node/beacon_chain/src/otb_verification_service.rs Outdated Show resolved Hide resolved
for otb in unfinalized_canonical_otbs {
match chain.get_block(otb.root()).await {
Ok(Some(block)) => {
match validate_merge_block(chain, block.message()).await {
Copy link
Member

Choose a reason for hiding this comment

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

validate_merge_block will return Ok(()) when it's past SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY and the EL is still syncing. In this scenario we're declare that the OTB is fully valid, when we actually just optimistically verified it again. It would be an OOTB!

I've suggest a fix and regression test for this in paulhauner@a030175.

Copy link
Member Author

@ethDreamer ethDreamer Jul 29, 2022

Choose a reason for hiding this comment

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

Great catch! 🙏
I knew this would be called recursively, which was why I added this check but somehow just didn't realize that it returns Ok(()) after attempting to re-insert 🤦‍♂️

I've merged your fix in. I wonder if we should remove the double insert check? I'm not even sure if leveldb returns an error if the entry already exists but that actually would've been better in this case.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should remove the double insert check? I'm not even sure if leveldb returns an error if the entry already exists but that actually would've been better in this case.

I don't think the check is strictly necessary, but I don't mind leaving it there. I don't think it'll have any functional impact.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed work-in-progress PR is a work-in-progress labels Jul 29, 2022
@ethDreamer ethDreamer added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 29, 2022
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀 🚀

I'll merge it in a batch shortly!

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jul 29, 2022
@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request 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
Copy link

bors bot commented Jul 30, 2022

This PR was included in a batch that timed out, it will be automatically retried

@paulhauner
Copy link
Member

bors r-

@bors
Copy link

bors bot commented Jul 30, 2022

Canceled.

@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request 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]>
@bors bors bot changed the title Initial Commit of Retrospective OTB Verification [Merged by Bors] - Initial Commit of Retrospective OTB Verification Jul 30, 2022
@bors bors bot closed this Jul 30, 2022
@ethDreamer ethDreamer deleted the retrospective_OTB_verification branch December 19, 2022 21:22
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 ready-for-merge This PR is ready to merge. v2.5.0 Required for Goerli merge release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants