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

Add block ban flag --invalid-block-roots #7042

Open
wants to merge 6 commits into
base: release-v7.0.0
Choose a base branch
from

Conversation

eserilev
Copy link
Collaborator

Add a new flag that allows users to ban block roots listed in a file. Also make sure the hardcoded invalid block root is only considered on holesky

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@michaelsproul michaelsproul changed the base branch from holesky-rescue to release-v7.0.0 February 26, 2025 07:06
@michaelsproul michaelsproul requested a review from jxs as a code owner February 26, 2025 07:06
@michaelsproul
Copy link
Member

I've cherry-picked all the block ban related changes to this PR and rebased on release-v7.0.0 so we can have a clean history with each feature in its own PR.

@michaelsproul
Copy link
Member

michaelsproul commented Feb 26, 2025

I reverted the ignore for the tests, because they were caused by the fork choice invalidation changes, which we do not want to keep.

@michaelsproul michaelsproul changed the title Add Block ban flag Add block ban flag --invalid-block-roots Feb 26, 2025
@michaelsproul michaelsproul added the ready-for-review The code is ready for review label Feb 26, 2025
Copy link
Member

@jimmygchen jimmygchen 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 👍

false
}
};
if chain.config.invalid_block_roots.contains(&block_root) || invalid_holesky_block {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This flag can be exploited for censoring, you should restrict usage to a specific network

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ive constrained this flag to holesky only

Copy link
Member

Choose a reason for hiding this comment

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

I disagree with both of Lion's suggested changes, sorry 😅

I think we need the flag to be not limited to Holesky so that we can potentially use it to get out of trouble on other catastrophically failing networks (without having to patch). We don't have another solution for preventing optimistic sync of the wrong chain at the moment.

I think this also means we should keep the hardcoded Holesky block as a separate check. It doesn't make sense as the flag default if the flag works on multiple networks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it, I had assumed that this was strictly a holesky thing. If the plan is to keep this flag until we have a better solution for optimistic sync of the wrong chain, I'm cool with that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i've reverted the changes back to what they were originally

Copy link
Member

Choose a reason for hiding this comment

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

We can get rid of this when we implement checkpoint sync from an unfinalized checkpoint

Copy link
Member

Choose a reason for hiding this comment

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

@realbigsean would that prevent us from importing an invalid block though? wouldn't sync still attempt to sync with the invalid chain?

Copy link
Member

Choose a reason for hiding this comment

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

you’d have to use a checkpoint ahead of the invalid block, and since we’d backfill from there we’d avoid it. Part of the complexity of unfinalized checkpoint sync would be making sure you ignore chain tips older than the checkpoint

Copy link

mergify bot commented Feb 26, 2025

This pull request has merge conflicts. Could you please resolve them @eserilev? 🙏

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

Re-reviewed, looks good!

@jimmygchen
Copy link
Member

I'm going to move the invalid block check so it happens sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review The code is ready for review v7.0.0-beta.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants