Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
51ee759
AccountId and new state, changes to JournalInner
rakita Aug 6, 2025
fd57eeb
continue work on transition to address and id
rakita Aug 8, 2025
43232cb
continued transition work
rakita Aug 8, 2025
d70afcd
more transitions to account_id
rakita Aug 9, 2025
4f08180
journal entry, and integration
rakita Aug 11, 2025
48c8eff
Merge remote-tracking branch 'origin/main' into addressid
rakita Aug 11, 2025
569b4b7
make load inline never
rakita Aug 11, 2025
8ab1352
use new EvmState
rakita Aug 11, 2025
7a18695
inline never some functions
rakita Aug 11, 2025
3b804f3
Revert "inline never some functions"
rakita Aug 11, 2025
695d449
remove boxes over frame input
rakita Aug 11, 2025
c4bee08
use caller id for reimbursment
rakita Aug 11, 2025
28d7e9e
Revert "remove boxes over frame input"
rakita Aug 11, 2025
36ab3c9
simplify transfer of value
rakita Aug 12, 2025
626f3e8
load caller by id
rakita Aug 12, 2025
ad0eead
sstore bench, lower capacity
rakita Aug 12, 2025
abbbf3c
sload bench
rakita Aug 12, 2025
0823963
Merge remote-tracking branch 'origin/main' into addressid
rakita Aug 12, 2025
5fb09e6
default vec alloc
rakita Aug 12, 2025
0634375
try reserve
rakita Aug 12, 2025
ad765bf
account state in pages
rakita Aug 12, 2025
0e4861b
remove some of checks for AccountId gets
rakita Aug 12, 2025
93e7e61
add load caller/to/beneficiary at one place
rakita Aug 12, 2025
279491d
rename state_new to state
rakita Aug 12, 2025
6006a9c
check
rakita Aug 12, 2025
befdfe9
skip loading delegated code twice
rakita Aug 13, 2025
33537f6
local sload in sstore
rakita Aug 13, 2025
90f9419
sload
rakita Aug 13, 2025
64c0091
no_std support
rakita Aug 13, 2025
25ed180
clippy fmt
rakita Aug 14, 2025
1ef32b1
paging first page, tests
rakita Aug 14, 2025
71c91ca
some fixes
rakita Aug 14, 2025
fc75b6c
fix system call load
rakita Aug 14, 2025
49428ed
typo
rakita Aug 14, 2025
574e8db
fix problems
rakita Aug 14, 2025
b6ddff6
extcodehash does not need to load code
rakita Aug 14, 2025
c7e7ca1
fix eip7702
rakita Aug 14, 2025
4c03a04
skip loading caller account in create
rakita Aug 14, 2025
eeb6938
inline host functions
rakita Aug 14, 2025
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
493 changes: 0 additions & 493 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ members = [
"crates/ee-tests",

# examples
"examples/block_traces",
"examples/cheatcode_inspector",
"examples/contract_deployment",
"examples/database_components",
"examples/uniswap_get_reserves",
"examples/uniswap_v2_usdc_swap",
"examples/erc20_gas",
"examples/my_evm",
"examples/custom_opcodes",
"examples/custom_precompile_journal",
# "examples/block_traces",
# "examples/cheatcode_inspector",
# "examples/contract_deployment",
# "examples/database_components",
# "examples/uniswap_get_reserves",
# "examples/uniswap_v2_usdc_swap",
# "examples/erc20_gas",
# "examples/my_evm",
# "examples/custom_opcodes",
# "examples/custom_precompile_journal",
]
resolver = "2"
default-members = ["crates/revm"]
Expand Down
3 changes: 2 additions & 1 deletion bins/revme/src/cmd/bench/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ pub fn run(criterion: &mut Criterion) {

let balance = evm
.journal_mut()
.load_account(BENCH_TARGET)
.load_account(BENCH_TARGET.into())
.unwrap()
.data
.0
.info
.balance;

Expand Down
52 changes: 33 additions & 19 deletions crates/context/interface/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
journaled_state::AccountLoad,
};
use auto_impl::auto_impl;
use primitives::{Address, Bytes, Log, StorageKey, StorageValue, B256, U256};
use primitives::{Address, AddressOrId, Bytes, Log, StorageKey, StorageValue, B256, U256};

/// Host trait with all methods that are needed by the Interpreter.
///
Expand Down Expand Up @@ -59,7 +59,7 @@ pub trait Host {
/// Selfdestruct account, calls `ContextTr::journal_mut().selfdestruct(address, target)`
fn selfdestruct(
&mut self,
address: Address,
address_or_id: AddressOrId,
target: Address,
) -> Option<StateLoad<SelfDestructResult>>;

Expand All @@ -68,25 +68,32 @@ pub trait Host {
/// Sstore, calls `ContextTr::journal_mut().sstore(address, key, value)`
fn sstore(
&mut self,
address: Address,
address_or_id: AddressOrId,
key: StorageKey,
value: StorageValue,
) -> Option<StateLoad<SStoreResult>>;

/// Sload, calls `ContextTr::journal_mut().sload(address, key)`
fn sload(&mut self, address: Address, key: StorageKey) -> Option<StateLoad<StorageValue>>;
fn sload(
&mut self,
address_or_id: AddressOrId,
key: StorageKey,
) -> Option<StateLoad<StorageValue>>;
/// Tstore, calls `ContextTr::journal_mut().tstore(address, key, value)`
fn tstore(&mut self, address: Address, key: StorageKey, value: StorageValue);
fn tstore(&mut self, address_or_id: AddressOrId, key: StorageKey, value: StorageValue);
/// Tload, calls `ContextTr::journal_mut().tload(address, key)`
fn tload(&mut self, address: Address, key: StorageKey) -> StorageValue;
fn tload(&mut self, address_or_id: AddressOrId, key: StorageKey) -> StorageValue;
/// Balance, calls `ContextTr::journal_mut().load_account(address)`
fn balance(&mut self, address: Address) -> Option<StateLoad<U256>>;
fn balance(&mut self, address_or_id: AddressOrId) -> Option<StateLoad<U256>>;
/// Load account delegated, calls `ContextTr::journal_mut().load_account_delegated(address)`
fn load_account_delegated(&mut self, address: Address) -> Option<StateLoad<AccountLoad>>;
fn load_account_delegated(
&mut self,
address_or_id: AddressOrId,
) -> Option<StateLoad<AccountLoad>>;
/// Load account code, calls `ContextTr::journal_mut().load_account_code(address)`
fn load_account_code(&mut self, address: Address) -> Option<StateLoad<Bytes>>;
fn load_account_code(&mut self, address_or_id: AddressOrId) -> Option<StateLoad<Bytes>>;
/// Load account code hash, calls `ContextTr::journal_mut().code_hash(address)`
fn load_account_code_hash(&mut self, address: Address) -> Option<StateLoad<B256>>;
fn load_account_code_hash(&mut self, address_or_id: AddressOrId) -> Option<StateLoad<B256>>;
}

/// Dummy host that implements [`Host`] trait and returns all default values.
Expand Down Expand Up @@ -152,7 +159,7 @@ impl Host for DummyHost {

fn selfdestruct(
&mut self,
_address: Address,
_address_or_id: AddressOrId,
_target: Address,
) -> Option<StateLoad<SelfDestructResult>> {
None
Expand All @@ -162,36 +169,43 @@ impl Host for DummyHost {

fn sstore(
&mut self,
_address: Address,
_address_or_id: AddressOrId,
_key: StorageKey,
_value: StorageValue,
) -> Option<StateLoad<SStoreResult>> {
None
}

fn sload(&mut self, _address: Address, _key: StorageKey) -> Option<StateLoad<StorageValue>> {
fn sload(
&mut self,
_address_or_id: AddressOrId,
_key: StorageKey,
) -> Option<StateLoad<StorageValue>> {
None
}

fn tstore(&mut self, _address: Address, _key: StorageKey, _value: StorageValue) {}
fn tstore(&mut self, _address_or_id: AddressOrId, _key: StorageKey, _value: StorageValue) {}

fn tload(&mut self, _address: Address, _key: StorageKey) -> StorageValue {
fn tload(&mut self, _address_or_id: AddressOrId, _key: StorageKey) -> StorageValue {
StorageValue::ZERO
}

fn balance(&mut self, _address: Address) -> Option<StateLoad<U256>> {
fn balance(&mut self, _address_or_id: AddressOrId) -> Option<StateLoad<U256>> {
None
}

fn load_account_delegated(&mut self, _address: Address) -> Option<StateLoad<AccountLoad>> {
fn load_account_delegated(
&mut self,
_address_or_id: AddressOrId,
) -> Option<StateLoad<AccountLoad>> {
None
}

fn load_account_code(&mut self, _address: Address) -> Option<StateLoad<Bytes>> {
fn load_account_code(&mut self, _address_or_id: AddressOrId) -> Option<StateLoad<Bytes>> {
None
}

fn load_account_code_hash(&mut self, _address: Address) -> Option<StateLoad<B256>> {
fn load_account_code_hash(&mut self, _address_or_id: AddressOrId) -> Option<StateLoad<B256>> {
None
}
}
Loading
Loading