Skip to content

Commit

Permalink
Ensure L1Block is in the cache (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Feb 22, 2024
1 parent 6ea36c1 commit 02ff4d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/revm/src/optimism/l1block.rs
Expand Up @@ -64,6 +64,12 @@ pub struct L1BlockInfo {
impl L1BlockInfo {
/// Try to fetch the L1 block info from the database.
pub fn try_fetch<DB: Database>(db: &mut DB, spec_id: SpecId) -> Result<L1BlockInfo, DB::Error> {
// Ensure the L1 Block account is loaded into the cache after Ecotone. With EIP-4788, it is no longer the case
// that the L1 block account is loaded into the cache prior to the first inquiry for the L1 block info.
if spec_id.is_enabled_in(SpecId::CANCUN) {
let _ = db.basic(L1_BLOCK_CONTRACT)?;
}

let l1_base_fee = db.storage(L1_BLOCK_CONTRACT, L1_BASE_FEE_SLOT)?;

if !spec_id.is_enabled_in(SpecId::ECOTONE) {
Expand Down

0 comments on commit 02ff4d8

Please sign in to comment.