-
Notifications
You must be signed in to change notification settings - Fork 38
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(l1): implement EIP-2935 #1876
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.
LGTM 👍, let's wait for another review before merging.
crates/blockchain/payload.rs
Outdated
// This function applies system level operations: | ||
// - Call beacon root contract, and obtain the new state root | ||
// - Call block hash process contract, and store parent block hash | ||
pub fn apply_system_operations(context: &mut PayloadBuildContext) -> Result<(), EvmError> { | ||
#[cfg(feature = "levm")] |
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.
levm ff doesn't exist anymore, pls sync with main before merging
crates/blockchain/payload.rs
Outdated
@@ -270,6 +269,7 @@ pub fn apply_withdrawals(context: &mut PayloadBuildContext) -> Result<(), EvmErr | |||
.unwrap_or(EVMConfig::canonical_values(fork)); | |||
let config = EVMConfig::new(fork, blob_schedule); | |||
|
|||
let mut new_state: HashMap<_, _> = HashMap::new(); |
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.
nit: why specify the type at all if you are using underscores?
crates/blockchain/payload.rs
Outdated
|
||
context.block_cache.extend(new_state); | ||
new_state.extend(report.new_state.clone()); |
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.
seems we're doing a lot of cloning. Are all these cheap?
crates/vm/vm.rs
Outdated
@@ -153,6 +157,62 @@ cfg_if::cfg_if! { | |||
|
|||
} | |||
|
|||
/// Calls the EIP-2935 process block hashes history system call contract |
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.
There are two possibilities.
- Ideally, we can abstract the logic between levm/revm and implement
process_block_hash_history
, agnostic of the implementation of the vm (levm or revm). - If 1 is impossible, we should at least have a
levm
andrevm
folder or module were we specify these implementations.
Motivation
This EIP has to be implemented in order to support Prague update.
Description
This PR implements EIP-2935. Prague EF tests for this EIP have been enabled.
Closes #1786