-
Notifications
You must be signed in to change notification settings - Fork 50
chore(l1): standarize revm/levm behaviour when importing blocks. #2452
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
base: main
Are you sure you want to change the base?
Conversation
Lines of code reportTotal lines added: Detailed view
|
|
||
if let Some(last_block) = blocks.last() { | ||
let hash = last_block.hash(); | ||
if let Err(error) = apply_fork_choice(&store, hash, hash, hash).await { |
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.
applying forkchoice should set all the blocks as canonical, you don't need to do it explicitly
@@ -306,5 +307,32 @@ pub async fn import_blocks(path: &str, data_dir: &str, network: &str, evm: EvmEn | |||
info!("Importing blocks from chain file: {path}"); | |||
utils::read_chain_file(path) | |||
}; | |||
blockchain.import_blocks(&blocks).await; |
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.
Why remove the method instead of refactoring it?
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.
I don't see the point of having such a function. It is ambiguous with add_block
(s). What is the point of having a function that adds blocks + calls forkchoice instead of calling the two function separately?
Description