-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// Some actions on top of context with just Getter traits would require borrowing the context | ||
/// with a both mutable and immutable reference. | ||
/// | ||
/// To allow doing this action more efficiently, we introduce a new trait that does this directly. | ||
/// | ||
/// Used for loading access list and applying EIP-7702 authorization list. | ||
pub trait PerformantContextAccess { | ||
type Error; | ||
|
||
/// Load access list | ||
fn load_access_list(&mut self) -> Result<(), Self::Error>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use super::Context; | ||
use context_interface::{Block, Cfg, Database, Journal, PerformantContextAccess, Transaction}; | ||
use primitives::U256; | ||
|
||
impl< | ||
BLOCK: Block, | ||
TX: Transaction, | ||
CFG: Cfg, | ||
DB: Database, | ||
JOURNAL: Journal<Database = DB>, | ||
CHAIN, | ||
> PerformantContextAccess for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> | ||
{ | ||
type Error = <DB as Database>::Error; | ||
|
||
fn load_access_list(&mut self) -> Result<(), Self::Error> { | ||
let Some(access_list) = self.tx.access_list() else { | ||
return Ok(()); | ||
}; | ||
for access_list in access_list { | ||
self.journaled_state.warm_account_and_storage( | ||
*access_list.0, | ||
access_list.1.iter().map(|i| U256::from_be_bytes(i.0)), | ||
)?; | ||
} | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
use std::u64; | ||
|
||
use revm::{ | ||
context_interface::transaction::AuthorizationItem, | ||
primitives::{Address, U256}, | ||
|