-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: display warning for op-mainnet launch without pre-Bedrock state #11765
feat: display warning for op-mainnet launch without pre-Bedrock state #11765
Conversation
crates/optimism/chainspec/src/lib.rs
Outdated
let is_bedrock_active = OP_MAINNET.is_bedrock_active_at_block(105235063); | ||
|
||
if !is_bedrock_active { | ||
warn!( | ||
"Warning: Op-mainnet has been launched without importing the pre-Bedrock state. \ | ||
The chain will not progress without this import. \ | ||
Please ensure that the pre-Bedrock state is imported to avoid synchronization issues and ensure proper chain operation." | ||
); |
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 isn't quite right, because the chainspec only tracks static activation.
but we need checks this against the local database when the chain is op-mainnet
I believe the best location to do this would be somewhere here
reth/crates/node/builder/src/launch/common.rs
Line 829 in 78415ff
pub fn check_pipeline_consistency(&self) -> ProviderResult<Option<B256>> { |
we could introduce a helper function that is something like
fn chain_specific_db_checks
which would only check if the chain id is op-mainnet for example
wdyt @joshieDo
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.
yeah i think it could work
crates/node/builder/src/lib.rs
Outdated
@@ -5,7 +5,6 @@ | |||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", | |||
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" | |||
)] | |||
#![cfg_attr(not(test), warn(unused_crate_dependencies))] |
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.
undo please
chain_spec.fork(OptimismHardfork::Bedrock).active_at_block(105235063); | ||
|
||
if db_checks_passed && !is_bedrock_active { | ||
warn!("Op-mainnet has been launched without importing the pre-Bedrock state. The chain won't progress without this."); |
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.
We should just error if we dont pass the check
Resolves #11632