You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/evm/src/executor/backend/in_memory_db.rs
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -81,24 +81,28 @@ impl DatabaseCommit for MemDb {
81
81
///
82
82
/// This will also _always_ return `Some(AccountInfo)`:
83
83
///
84
-
/// The [`Database`](revm::Database) implementation for `CacheDB` manages an `AccountState` for the `DbAccount`, this will be set to `AccountState::NotExisting` if the account does not exist yet. This is because there's a distinction between "non-existing" and "empty", See <https://github.com/bluealloy/revm/blob/8f4348dc93022cffb3730d9db5d3ab1aad77676a/crates/revm/src/db/in_memory_db.rs#L81-L83>
84
+
/// The [`Database`](revm::Database) implementation for `CacheDB` manages an `AccountState` for the
85
+
/// `DbAccount`, this will be set to `AccountState::NotExisting` if the account does not exist yet.
86
+
/// This is because there's a distinction between "non-existing" and "empty",
87
+
/// see <https://github.com/bluealloy/revm/blob/8f4348dc93022cffb3730d9db5d3ab1aad77676a/crates/revm/src/db/in_memory_db.rs#L81-L83>.
85
88
/// If an account is `NotExisting`, `Database(Ref)::basic` will always return `None` for the
86
-
/// requested `AccountInfo`. To prevent
87
-
///
88
-
/// This will ensure that a missing account is never marked as `NotExisting`
89
+
/// requested `AccountInfo`. To prevent this, we ensure that a missing account is never marked as
90
+
/// `NotExisting` by always returning `Some` with this type.
// when fetching again, the `AccountInfo` is still `None` because the state of the account is `AccountState::NotExisting`, See <https://github.com/bluealloy/revm/blob/8f4348dc93022cffb3730d9db5d3ab1aad77676a/crates/revm/src/db/in_memory_db.rs#L217-L226>
135
+
// when fetching again, the `AccountInfo` is still `None` because the state of the account
136
+
// is `AccountState::NotExisting`, see <https://github.com/bluealloy/revm/blob/8f4348dc93022cffb3730d9db5d3ab1aad77676a/crates/revm/src/db/in_memory_db.rs#L217-L226>
132
137
let info = Database::basic(&mut db, address).unwrap();
0 commit comments