-
Notifications
You must be signed in to change notification settings - Fork 34
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
refactor(levm): replace specId with Fork #1762
base: main
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.
The PR looks good. It is aligned with what I had in mind. Left a couple of comments, suggestions and requested some changes.
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.
You should remove unused imports
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.
LGTM!
fork_summary_for_slack(reports, Fork::Byzantium), | ||
fork_summary_for_slack(reports, Fork::Berlin), | ||
fork_summary_for_slack(reports, Fork::Constantinople), | ||
fork_summary_for_slack(reports, Fork::Paris), |
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.
Move this between Shanghai
and Homestead
(it is an error for Paris to be this low in the list)
fork_summary_for_github(reports, Fork::Byzantium), | ||
fork_summary_for_github(reports, Fork::Berlin), | ||
fork_summary_for_github(reports, Fork::Constantinople), | ||
fork_summary_for_github(reports, Fork::Paris), |
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.
Ditto.
writeln!(f, "{}", fork_summary_shell(&self.0, Fork::Byzantium))?; | ||
writeln!(f, "{}", fork_summary_shell(&self.0, Fork::Berlin))?; | ||
writeln!(f, "{}", fork_summary_shell(&self.0, Fork::Constantinople))?; | ||
writeln!(f, "{}", fork_summary_shell(&self.0, Fork::Paris))?; |
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.
Ditto.
crates/common/types/genesis.rs
Outdated
"Shanghai" => Fork::Shanghai, | ||
"Cancun" => Fork::Cancun, | ||
"Prague" => Fork::Prague, | ||
_ => Fork::Cancun, |
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 is not correct. But implementing TryFrom<&str> for Fork
is not that worth. Let's roll back this change.
crates/vm/vm.rs
Outdated
@@ -220,12 +220,12 @@ cfg_if::cfg_if! { | |||
}); | |||
let mut block_cache: CacheDB = HashMap::new(); | |||
let block_header = &block.header; | |||
let spec_id = spec_id(&state.chain_config()?, block_header.timestamp); | |||
let fork=state.chain_config()?.fork(block_header.timestamp); |
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.
let fork=state.chain_config()?.fork(block_header.timestamp); | |
let fork = state.chain_config()?.fork(block_header.timestamp); |
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.
After addressing this final comments and solving the conflicts with main
, we'll be ready to merge
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 👍 , just some comments, would it be possible to integrate this changes with the latest changes in main?
For example this line
Also, based on the CI, a cargo fmt
is needed.
I'll get this done |
Hi @varun-doshi ! Just a heads up, this PR (#1782) got recently merged. It did use some the Thank you very much for your help ^_^ |
Should I switch that to Fork? |
Hi! I don't believe there's need for that. As soon as you update your branch with main, those changes will get pulled and you'll get compilation errors. Does that help? Don't doubt ask! Thanks in advance ^_^ |
Motivation
Ref #1741
Description
Replaces specId with Fork
crates/vm/levm/src/environment.rs
Closes #1741