chore: reduce number of Evm monomorphizations (#8030)

This commit is contained in:
DaniPopes
2024-05-01 19:32:25 +02:00
committed by GitHub
parent 399afd802c
commit 0938504f4a
9 changed files with 138 additions and 105 deletions

View File

@ -61,10 +61,13 @@ impl CachedReads {
}
}
/// A [Database] that caches reads inside [CachedReads].
#[derive(Debug)]
struct CachedReadsDbMut<'a, DB> {
cached: &'a mut CachedReads,
db: DB,
pub struct CachedReadsDbMut<'a, DB> {
/// The cache of reads.
pub cached: &'a mut CachedReads,
/// The underlying database.
pub db: DB,
}
impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
@ -126,7 +129,8 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
/// `revm::db::State` for repeated payload build jobs.
#[derive(Debug)]
pub struct CachedReadsDBRef<'a, DB> {
inner: RefCell<CachedReadsDbMut<'a, DB>>,
/// The inner cache reads db mut.
pub inner: RefCell<CachedReadsDbMut<'a, DB>>,
}
impl<'a, DB: DatabaseRef> DatabaseRef for CachedReadsDBRef<'a, DB> {