From 4ef37388064d047b9f98ec39f8ab81d9acc2e1e5 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 12 Nov 2025 17:57:43 -0300 Subject: [PATCH 1/9] WIP: code_cache attribute in RocksDB Store --- crates/storage/store_db/rocksdb.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index a24298b4560..997d8149e8f 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -18,6 +18,7 @@ use rocksdb::{ BlockBasedOptions, BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, WriteBatch, checkpoint::Checkpoint, }; +use rustc_hash::FxHashMap; use std::{ collections::HashSet, path::Path, @@ -136,6 +137,8 @@ enum FKVGeneratorControlMessage { Continue, } +type CodeCache = FxHashMap; + #[derive(Debug, Clone)] pub struct Store { db: Arc>, @@ -143,6 +146,7 @@ pub struct Store { flatkeyvalue_control_tx: std::sync::mpsc::SyncSender, trie_update_worker_tx: TriedUpdateWorkerTx, last_computed_flatkeyvalue: Arc>>, + code_cache: Arc>, } impl Store { @@ -370,6 +374,7 @@ impl Store { flatkeyvalue_control_tx: fkv_tx, trie_update_worker_tx: trie_upd_tx, last_computed_flatkeyvalue: Arc::new(Mutex::new(last_written)), + code_cache: Arc::new(Mutex::new(FxHashMap::default())), }; let store_clone = store.clone(); std::thread::spawn(move || { From 1c79c02afc378fca51e0446a43839c1d3d8a8249 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 12 Nov 2025 19:01:28 -0300 Subject: [PATCH 2/9] implement caching for account codes --- crates/storage/store_db/rocksdb.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 997d8149e8f..0bd678e2e10 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -146,7 +146,7 @@ pub struct Store { flatkeyvalue_control_tx: std::sync::mpsc::SyncSender, trie_update_worker_tx: TriedUpdateWorkerTx, last_computed_flatkeyvalue: Arc>>, - code_cache: Arc>, + account_code_cache: Arc>, } impl Store { @@ -374,7 +374,7 @@ impl Store { flatkeyvalue_control_tx: fkv_tx, trie_update_worker_tx: trie_upd_tx, last_computed_flatkeyvalue: Arc::new(Mutex::new(last_written)), - code_cache: Arc::new(Mutex::new(FxHashMap::default())), + account_code_cache: Arc::new(Mutex::new(FxHashMap::default())), }; let store_clone = store.clone(); std::thread::spawn(move || { @@ -1310,7 +1310,21 @@ impl StoreEngine for Store { .map_err(|e| StoreError::Custom(format!("Task panicked: {}", e)))? } + /// Get account code by its hash. + /// + /// Check if the code exists in the cache (attribute `account_code_cache`), if not, + /// reads the database, and if it exists, decodes and returns it. fn get_account_code(&self, code_hash: H256) -> Result, StoreError> { + // check cache first + if let Some(code) = self + .account_code_cache + .lock() + .map_err(|_| StoreError::LockError)? + .get(&code_hash) + { + return Ok(Some(code.clone())); + } + let cf = self.cf_handle(CF_ACCOUNT_CODES)?; let Some(bytes) = self .db @@ -1325,6 +1339,12 @@ impl StoreEngine for Store { bytecode: Bytes::copy_from_slice(bytecode), jump_targets: >::decode(targets)?, }; + // insert into cache + self.account_code_cache + .lock() + .map_err(|_| StoreError::LockError)? + .insert(code_hash, code.clone()); + Ok(Some(code)) } From 795932405438a2671dec515f0358c343b30e2a3a Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 12 Nov 2025 21:07:14 -0300 Subject: [PATCH 3/9] size() method for Code --- crates/common/types/account.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/common/types/account.rs b/crates/common/types/account.rs index 0945039f93f..8449561c550 100644 --- a/crates/common/types/account.rs +++ b/crates/common/types/account.rs @@ -65,6 +65,21 @@ impl Code { } targets } + + /// Estimates the size of the Code struct in bytes + /// (including stack size and heap allocation). + /// + /// Note: This is an estimation and may not be exact. + /// + /// # Returns + /// + /// usize - Estimated size in bytes + pub fn size(&self) -> usize { + let hash_size = size_of::(); + let bytes_size = size_of::(); + let vec_size = size_of::>() + self.jump_targets.len() * size_of::(); + hash_size + bytes_size + vec_size + } } impl AsRef for Code { From dd4d61987c2d0d70994198ca298533ae72f91c58 Mon Sep 17 00:00:00 2001 From: Pablo Deymonnaz Date: Wed, 12 Nov 2025 21:09:02 -0300 Subject: [PATCH 4/9] inspect cache size while adding an element --- crates/storage/store_db/rocksdb.rs | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 0bd678e2e10..5264335b99e 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -24,6 +24,7 @@ use std::{ path::Path, sync::{ Arc, Mutex, + atomic::AtomicU64, mpsc::{SyncSender, sync_channel}, }, }; @@ -139,7 +140,7 @@ enum FKVGeneratorControlMessage { type CodeCache = FxHashMap; -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Store { db: Arc>, trie_cache: Arc>>, @@ -147,6 +148,24 @@ pub struct Store { trie_update_worker_tx: TriedUpdateWorkerTx, last_computed_flatkeyvalue: Arc>>, account_code_cache: Arc>, + account_code_cache_size: AtomicU64, +} + +impl Clone for Store { + fn clone(&self) -> Self { + Self { + db: self.db.clone(), + trie_cache: self.trie_cache.clone(), + flatkeyvalue_control_tx: self.flatkeyvalue_control_tx.clone(), + trie_update_worker_tx: self.trie_update_worker_tx.clone(), + last_computed_flatkeyvalue: self.last_computed_flatkeyvalue.clone(), + account_code_cache: self.account_code_cache.clone(), + account_code_cache_size: AtomicU64::new( + self.account_code_cache_size + .load(std::sync::atomic::Ordering::Relaxed), + ), + } + } } impl Store { @@ -375,6 +394,7 @@ impl Store { trie_update_worker_tx: trie_upd_tx, last_computed_flatkeyvalue: Arc::new(Mutex::new(last_written)), account_code_cache: Arc::new(Mutex::new(FxHashMap::default())), + account_code_cache_size: AtomicU64::new(0), }; let store_clone = store.clone(); std::thread::spawn(move || { @@ -1342,6 +1362,18 @@ impl StoreEngine for Store { // insert into cache self.account_code_cache .lock() + .inspect(|cache| { + let code_size = code.size(); + self.account_code_cache_size + .fetch_add(code_size as u64, std::sync::atomic::Ordering::SeqCst); + let cache_len = cache.len() + 1; + let current_size = self + .account_code_cache_size + .load(std::sync::atomic::Ordering::SeqCst); + info!( + "[ACCOUNT CODE CACHE] cache elements (): {cache_len}, total size: {current_size} bytes" + ); + }) .map_err(|_| StoreError::LockError)? .insert(code_hash, code.clone()); From 9f2a84d8947311b516d04dd864de0bfeb83682be Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Mon, 17 Nov 2025 16:49:15 +0100 Subject: [PATCH 5/9] add lru cache --- Cargo.lock | 16 +++++++-- crates/storage/Cargo.toml | 1 + crates/storage/store_db/rocksdb.rs | 56 +++++++++++++++++++----------- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a726f63aa7..4d6f599a22f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3774,6 +3774,7 @@ dependencies = [ "ethrex-trie", "hex", "hex-literal", + "lru 0.16.2", "qfilter", "rayon", "rocksdb", @@ -4567,6 +4568,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", "serde", ] @@ -5912,6 +5915,15 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "lru" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +dependencies = [ + "hashbrown 0.16.0", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -7961,7 +7973,7 @@ dependencies = [ "indoc", "instability", "itertools 0.13.0", - "lru", + "lru 0.12.5", "paste", "strum 0.26.3", "unicode-segmentation", @@ -9868,7 +9880,7 @@ dependencies = [ "hashbrown 0.14.5", "hex", "itertools 0.13.0", - "lru", + "lru 0.12.5", "num-bigint 0.4.6", "p3-baby-bear", "p3-bn254-fr", diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index 307f4f869a3..c42f18229fb 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -28,6 +28,7 @@ tokio = { workspace = true, optional = true, features = ["rt"] } bincode = "1.3.3" qfilter = "0.2.5" rayon.workspace = true +lru = "0.16.2" [features] default = [] diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 5a053f4877c..83fa9caa9a1 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -14,11 +14,12 @@ use ethrex_common::{ }, }; use ethrex_trie::{Nibbles, Node, Trie}; +use lru::LruCache; use rocksdb::{ BlockBasedOptions, BoundColumnFamily, ColumnFamilyDescriptor, DBWithThreadMode, MultiThreaded, Options, WriteBatch, checkpoint::Checkpoint, }; -use rustc_hash::FxHashMap; +use rustc_hash::FxBuildHasher; use std::{ collections::HashSet, path::{Path, PathBuf}, @@ -151,7 +152,9 @@ enum FKVGeneratorControlMessage { Continue, } -type CodeCache = FxHashMap; +// 64mb +const CODE_CACHE_MAX_SIZE: u64 = 64 * 1024 * 1024; +type CodeCache = LruCache; #[derive(Debug)] pub struct Store { @@ -422,7 +425,9 @@ impl Store { flatkeyvalue_control_tx: fkv_tx, trie_update_worker_tx: trie_upd_tx, last_computed_flatkeyvalue: Arc::new(Mutex::new(last_written)), - account_code_cache: Arc::new(Mutex::new(FxHashMap::default())), + account_code_cache: Arc::new(Mutex::new(LruCache::unbounded_with_hasher( + FxBuildHasher, + ))), account_code_cache_size: AtomicU64::new(0), }; let store_clone = store.clone(); @@ -1417,23 +1422,34 @@ impl StoreEngine for Store { bytecode: Bytes::copy_from_slice(bytecode), jump_targets: >::decode(targets)?, }; - // insert into cache - self.account_code_cache - .lock() - .inspect(|cache| { - let code_size = code.size(); - self.account_code_cache_size - .fetch_add(code_size as u64, std::sync::atomic::Ordering::SeqCst); - let cache_len = cache.len() + 1; - let current_size = self - .account_code_cache_size - .load(std::sync::atomic::Ordering::SeqCst); - info!( - "[ACCOUNT CODE CACHE] cache elements (): {cache_len}, total size: {current_size} bytes" - ); - }) - .map_err(|_| StoreError::LockError)? - .insert(code_hash, code.clone()); + + // insert into cache and evict if needed + { + let mut cache = self + .account_code_cache + .lock() + .map_err(|_| StoreError::LockError)?; + let code_size = code.size(); + self.account_code_cache_size + .fetch_add(code_size as u64, std::sync::atomic::Ordering::SeqCst); + let cache_len = cache.len() + 1; + let mut current_size = self + .account_code_cache_size + .load(std::sync::atomic::Ordering::SeqCst); + info!( + "[ACCOUNT CODE CACHE] cache elements (): {cache_len}, total size: {current_size} bytes" + ); + + while current_size > CODE_CACHE_MAX_SIZE { + if let Some(popped) = cache.pop_lru() { + current_size -= popped.1.bytecode.len() as u64; + } else { + break; + } + } + + cache.get_or_insert(code_hash, || code.clone()); + } Ok(Some(code)) } From c576b6cb9bb8f3b3ef87f7d87242b80f0bf0f7bc Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Mon, 17 Nov 2025 16:53:16 +0100 Subject: [PATCH 6/9] fix --- crates/storage/store_db/rocksdb.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 83fa9caa9a1..2f13550e170 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -1441,8 +1441,12 @@ impl StoreEngine for Store { ); while current_size > CODE_CACHE_MAX_SIZE { - if let Some(popped) = cache.pop_lru() { - current_size -= popped.1.bytecode.len() as u64; + if let Some((_, code)) = cache.pop_lru() { + self.account_code_cache_size + .fetch_sub(code.size() as u64, std::sync::atomic::Ordering::SeqCst); + current_size = self + .account_code_cache_size + .load(std::sync::atomic::Ordering::SeqCst); } else { break; } From 81f5f2d08e0b5c51fcd87b1b22e9540a2d5cd06f Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 18 Nov 2025 11:50:35 +0100 Subject: [PATCH 7/9] lockfiles --- .../src/guest_program/src/risc0/Cargo.lock | 23 +++++++++++++- .../src/guest_program/src/sp1/Cargo.lock | 23 +++++++++++++- crates/l2/tee/quote-gen/Cargo.lock | 31 +++++++++++++++++-- 3 files changed, 73 insertions(+), 4 deletions(-) diff --git a/crates/l2/prover/src/guest_program/src/risc0/Cargo.lock b/crates/l2/prover/src/guest_program/src/risc0/Cargo.lock index 2c0a84ecc94..9abb8e41a31 100644 --- a/crates/l2/prover/src/guest_program/src/risc0/Cargo.lock +++ b/crates/l2/prover/src/guest_program/src/risc0/Cargo.lock @@ -1301,6 +1301,7 @@ dependencies = [ "ethrex-rlp", "ethrex-trie", "hex", + "lru", "qfilter", "rayon", "rustc-hash", @@ -1430,6 +1431,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.5.0" @@ -1608,7 +1615,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -1616,6 +1623,11 @@ name = "hashbrown" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] [[package]] name = "heck" @@ -2019,6 +2031,15 @@ version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +[[package]] +name = "lru" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +dependencies = [ + "hashbrown 0.16.0", +] + [[package]] name = "malachite" version = "0.6.1" diff --git a/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock b/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock index be8d0c50620..9bb35b34770 100644 --- a/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock +++ b/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock @@ -1073,6 +1073,7 @@ dependencies = [ "ethrex-rlp", "ethrex-trie", "hex", + "lru", "qfilter", "rayon", "rustc-hash", @@ -1202,6 +1203,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1347,7 +1354,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -1355,6 +1362,11 @@ name = "hashbrown" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] [[package]] name = "heck" @@ -1755,6 +1767,15 @@ version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +[[package]] +name = "lru" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +dependencies = [ + "hashbrown 0.16.0", +] + [[package]] name = "malachite" version = "0.6.1" diff --git a/crates/l2/tee/quote-gen/Cargo.lock b/crates/l2/tee/quote-gen/Cargo.lock index ebcb465c136..d220ca04174 100644 --- a/crates/l2/tee/quote-gen/Cargo.lock +++ b/crates/l2/tee/quote-gen/Cargo.lock @@ -2451,6 +2451,7 @@ dependencies = [ "ethrex-rlp", "ethrex-trie", "hex", + "lru 0.16.2", "qfilter", "rayon", "rustc-hash", @@ -2631,6 +2632,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "font8x8" version = "0.3.1" @@ -2968,7 +2975,18 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", ] [[package]] @@ -3873,6 +3891,15 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "lru" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +dependencies = [ + "hashbrown 0.16.0", +] + [[package]] name = "malachite" version = "0.6.1" @@ -4964,7 +4991,7 @@ dependencies = [ "indoc", "instability", "itertools 0.13.0", - "lru", + "lru 0.12.5", "paste", "strum 0.26.3", "unicode-segmentation", From 627e54240a96a346f9fe296aace2f95f510400be Mon Sep 17 00:00:00 2001 From: Javier Chatruc Date: Wed, 19 Nov 2025 10:43:47 -0300 Subject: [PATCH 8/9] Move code cache length log to debug! --- crates/storage/store_db/rocksdb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index 2f13550e170..e36fcb94786 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -1436,7 +1436,7 @@ impl StoreEngine for Store { let mut current_size = self .account_code_cache_size .load(std::sync::atomic::Ordering::SeqCst); - info!( + debug!( "[ACCOUNT CODE CACHE] cache elements (): {cache_len}, total size: {current_size} bytes" ); From 476ce999659cf2f6df86f17f57fa73ec257d8c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:02:40 -0300 Subject: [PATCH 9/9] docs: document why the cache doesn't need invalidation on removals --- crates/storage/store_db/rocksdb.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/storage/store_db/rocksdb.rs b/crates/storage/store_db/rocksdb.rs index e36fcb94786..d59dfbc3c38 100644 --- a/crates/storage/store_db/rocksdb.rs +++ b/crates/storage/store_db/rocksdb.rs @@ -163,6 +163,10 @@ pub struct Store { flatkeyvalue_control_tx: std::sync::mpsc::SyncSender, trie_update_worker_tx: TriedUpdateWorkerTx, last_computed_flatkeyvalue: Arc>>, + /// Cache for account bytecodes, keyed by the bytecode hash. + /// Note that we don't remove entries on account code changes, since + /// those changes already affect the code hash stored in the account, and only + /// may result in this cache having useless data. account_code_cache: Arc>, account_code_cache_size: AtomicU64, }