-
Notifications
You must be signed in to change notification settings - Fork 808
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
base: release-v7.0.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM!
6f2b7ef
to
f5b4e4a
Compare
I've cherry-picked all the block ban related changes to this PR and rebased on |
I reverted the |
--invalid-block-roots
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
ParentExecutionPayloadInvalid { | ||
parent_root: Hash256, | ||
}, | ||
KnownInvalidExecutionPayload(Hash256), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment on top of this variant to have same format
@@ -1326,6 +1343,19 @@ impl<T: BeaconChainTypes> ExecutionPendingBlock<T> { | |||
chain: &Arc<BeaconChain<T>>, | |||
notify_execution_layer: NotifyExecutionLayer, | |||
) -> Result<Self, BlockError> { | |||
let invalid_holesky_block = { | |||
if let Ok(invalid_block_root) = Hash256::from_str( | |||
"2db899881ed8546476d0b92c6aa9110bea9a4cd0dbeb5519eb0ea69575f1f359", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional to hardcode a block here? You can add this block root in the default value of the CLI flag invalid_block_roots
false | ||
} | ||
}; | ||
if chain.config.invalid_block_roots.contains(&block_root) || invalid_holesky_block { |
There was a problem hiding this comment.
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
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