Skip to content
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

fix(l1): change the fork check for greater or equal rather than equal on beacon call #1864

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/blockchain/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub fn build_payload(
pub fn apply_withdrawals(context: &mut PayloadBuildContext) -> Result<(), EvmError> {
// Apply withdrawals & call beacon root contract, and obtain the new state root
let spec_id = spec_id(&context.chain_config()?, context.payload.header.timestamp);
if context.payload.header.parent_beacon_block_root.is_some() && spec_id == SpecId::CANCUN {
if context.payload.header.parent_beacon_block_root.is_some() && spec_id >= SpecId::CANCUN {
beacon_root_contract_call(context.evm_state, &context.payload.header, spec_id)?;
}
let withdrawals = context.payload.body.withdrawals.clone().unwrap_or_default();
Expand Down
4 changes: 2 additions & 2 deletions crates/vm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ cfg_if::cfg_if! {
//eip 4788: execute beacon_root_contract_call before block transactions
cfg_if::cfg_if! {
if #[cfg(not(feature = "l2"))] {
if block_header.parent_beacon_block_root.is_some() && fork == Fork::Cancun {
if block_header.parent_beacon_block_root.is_some() && fork >= Fork::Cancun {
let report = beacon_root_contract_call_levm(store_wrapper.clone(), block_header, fork)?;
block_cache.extend(report.new_state);
}
Expand Down Expand Up @@ -342,7 +342,7 @@ cfg_if::cfg_if! {
cfg_if::cfg_if! {
if #[cfg(not(feature = "l2"))] {
//eip 4788: execute beacon_root_contract_call before block transactions
if block_header.parent_beacon_block_root.is_some() && spec_id == SpecId::CANCUN {
if block_header.parent_beacon_block_root.is_some() && spec_id >= SpecId::CANCUN {
beacon_root_contract_call(state, block_header, spec_id)?;
}
}
Expand Down