Skip to content

Commit

Permalink
chore: comments and link to issue #2021
Browse files Browse the repository at this point in the history
  • Loading branch information
fborello-lambda committed Feb 20, 2025
1 parent e7466d3 commit 5af45ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions crates/vm/backends/levm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ impl LEVM {

pub fn get_state_transitions(
// Warning only pass the fork if running the ef-tests.
// ISSUE #2021: https://github.com/lambdaclass/ethrex/issues/2021
ef_tests: Option<Fork>,
initial_state: &EvmState,
block_hash: H256,
Expand Down Expand Up @@ -277,11 +278,8 @@ impl LEVM {
.get_block_header_by_hash(block_hash)?
.ok_or(StoreError::MissingStore)?;
let fork_from_config = initial_state.chain_config()?.fork(block_header.timestamp);
// Weird, getting two different forks
dbg!(fork_from_config);
// Here we take the passed fork through the ef_tests variable, or we set fork to the fork based on the timestamp.
// Here we take the passed fork through the ef_tests variable, or we set it to the fork based on the timestamp.
let fork = ef_tests.unwrap_or(fork_from_config);
dbg!(fork);
if let Some(old_info) =
current_db.get_account_info_by_hash(block_hash, account_update.address)?
{
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use std::sync::OnceLock;
// Then, we can retrieve the evm with:
// EVM_BACKEND.get(); -> returns Option<EVM>
pub static EVM_BACKEND: OnceLock<EVM> = OnceLock::new();

/// Function used to access the global variable holding the chosen backend.
pub fn get_evm_backend_or_default() -> EVM {
EVM_BACKEND.get().unwrap_or(&EVM::default()).clone()
}
Expand Down

0 comments on commit 5af45ce

Please sign in to comment.