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

Panic with EIP-2935 #1388

Closed
impactdni2 opened this issue May 8, 2024 · 4 comments
Closed

Panic with EIP-2935 #1388

impactdni2 opened this issue May 8, 2024 · 4 comments
Labels
bug Something isn't working hf-prague Prague related EIPs

Comments

@impactdni2
Copy link
Contributor

Was playing around with following revm's recent updates today, and looks like this commit breaks something: 3e089f3 .

One of my tests (not all oddly enough) breaks when upgrading from the previous revision to the EIP-2395 revision addition. It might have something to do with this issue as well? #1382

Specifically crashes with the following (snipped to relevant) stack trace:

4: core::option::Option<T>::unwrap
             at /rustc/b11fbfbf351b94c7eecf9e6749a4544a6d4717fa/library/core/src/option.rs:931:21
   5: revm::journaled_state::JournaledState::sload
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/journaled_state.rs:641:52
   6: revm::context::inner_evm_context::InnerEvmContext<DB>::sload
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/context/inner_evm_context.rs:188:9
   7: <revm::evm::Evm<EXT,DB> as revm_interpreter::host::Host>::sload
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/evm.rs:465:14
   8: revm_interpreter::instructions::host::blockhash
             at /home/impact/workspace/revm_bluealloy/crates/interpreter/src/instructions/host.rs:118:29
   9: core::ops::function::Fn::call
             at /rustc/b11fbfbf351b94c7eecf9e6749a4544a6d4717fa/library/core/src/ops/function.rs:79:5
  10: revm_interpreter::interpreter::Interpreter::step
             at /home/impact/workspace/revm_bluealloy/crates/interpreter/src/interpreter.rs:343:9
  11: revm_interpreter::interpreter::Interpreter::run
             at /home/impact/workspace/revm_bluealloy/crates/interpreter/src/interpreter.rs:365:18
  12: revm::evm::Evm<EXT,DB>::run_the_loop
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/evm.rs:283:31
  13: revm::evm::Evm<EXT,DB>::start_the_loop
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/evm.rs:246:48
  14: revm::evm::Evm<EXT,DB>::transact_preverified_inner
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/evm.rs:392:50
  15: revm::evm::Evm<EXT,DB>::transact
             at /home/impact/workspace/revm_bluealloy/crates/revm/src/evm.rs:144:22

Specifically on these lines (journaled_state.rs):

        // assume acc is warm
        let account = self.state.get_mut(&address).unwrap();

Where address = 0x25a219378dad9b3503c8268c9ca836a52427a4fb, which looks to be added in that commit. This is specifically on Arbitrum (non-standard use case I know), but figured I'd bring it up in case it was possible to fix.

Thanks!

@impactdni2
Copy link
Contributor Author

Looks like this is only happening when using the default spec (Evm::builder()....), when forcing to Cancun, continues working fine. Sorry for the confusion

@DaniPopes
Copy link
Collaborator

DaniPopes commented May 10, 2024

cc @onbjerg maybe we need to pre-load the account before execution?
Anyway yeah you should pin SpecId when possible since Latest will always go to the latest implemented rather than latest live (cancun on mainnet)

@rakita
Copy link
Member

rakita commented May 11, 2024

@impactdni2 thanks for reporting this!

preloading account before execution would make it warm loaded and gas would be decremented if it is accessed. We need to ask for clarification, as this is an edge case. Maybe there will be a change in JournalState sload

@rakita rakita added bug Something isn't working hf-prague Prague related EIPs labels May 11, 2024
@rakita
Copy link
Member

rakita commented May 11, 2024

Made PR that preloads the account and fixes the panic

@rakita rakita closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hf-prague Prague related EIPs
Projects
None yet
Development

No branches or pull requests

3 participants