-
Notifications
You must be signed in to change notification settings - Fork 2.4k
generic Executor and EvmEventLogger #5640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -164,6 +164,7 @@ pub struct Backend { | |||||
| /// keeps track of active snapshots at a specific block | ||||||
| active_snapshots: Arc<Mutex<HashMap<U256, (u64, H256)>>>, | ||||||
| enable_steps_tracing: bool, | ||||||
| inline_logs: bool, | ||||||
| /// How to keep history state | ||||||
| prune_state_history_config: PruneStateHistoryConfig, | ||||||
| /// max number of blocks with transactions in memory | ||||||
|
|
@@ -180,6 +181,7 @@ impl Backend { | |||||
| fees: FeeManager, | ||||||
| fork: Option<ClientFork>, | ||||||
| enable_steps_tracing: bool, | ||||||
| inline_logs: bool, | ||||||
| prune_state_history_config: PruneStateHistoryConfig, | ||||||
| transaction_block_keeper: Option<usize>, | ||||||
| automine_block_time: Option<Duration>, | ||||||
|
|
@@ -223,6 +225,7 @@ impl Backend { | |||||
| genesis, | ||||||
| active_snapshots: Arc::new(Mutex::new(Default::default())), | ||||||
| enable_steps_tracing, | ||||||
| inline_logs, | ||||||
| prune_state_history_config, | ||||||
| transaction_block_keeper, | ||||||
| }; | ||||||
|
|
@@ -703,6 +706,10 @@ impl Backend { | |||||
| let db = self.db.read().await; | ||||||
| let mut inspector = Inspector::default(); | ||||||
|
|
||||||
| if self.inline_logs { | ||||||
| inspector = inspector.with_inline_logs(); | ||||||
| } | ||||||
|
|
||||||
| let mut evm = revm::EVM::new(); | ||||||
| evm.env = env; | ||||||
| evm.database(&*db); | ||||||
|
|
@@ -764,6 +771,7 @@ impl Backend { | |||||
| parent_hash: storage.best_hash, | ||||||
| gas_used: U256::zero(), | ||||||
| enable_steps_tracing: self.enable_steps_tracing, | ||||||
| inline_logs: self.inline_logs, | ||||||
| }; | ||||||
|
|
||||||
| // create a new pending block | ||||||
|
|
@@ -823,6 +831,7 @@ impl Backend { | |||||
| parent_hash: best_hash, | ||||||
| gas_used: U256::zero(), | ||||||
| enable_steps_tracing: self.enable_steps_tracing, | ||||||
| inline_logs: self.inline_logs, | ||||||
| }; | ||||||
| let executed_tx = executor.execute(); | ||||||
|
|
||||||
|
|
@@ -889,13 +898,13 @@ impl Backend { | |||||
| // assuming max 5 args | ||||||
| Some(token) => { | ||||||
| node_info!( | ||||||
| " Error: reverted with custom error: {:?}", | ||||||
| " Error: reverted with custom error (1): {:?}", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI the point of this is to differentiate the source of the error. anvil's errors are sometimes formatted exactly the same but originate in different places. |
||||||
| token | ||||||
| ); | ||||||
| } | ||||||
| None => { | ||||||
| node_info!( | ||||||
| " Error: reverted with custom error: {}", | ||||||
| " Error: reverted with custom error (2): {}", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI the point of this is to differentiate the source of the error. anvil's errors are sometimes formatted exactly the same but originate in different places. |
||||||
| hex::encode(r) | ||||||
| ); | ||||||
| } | ||||||
|
|
@@ -1057,6 +1066,11 @@ impl Backend { | |||||
| D: DatabaseRef<Error = DatabaseError>, | ||||||
| { | ||||||
| let mut inspector = Inspector::default(); | ||||||
|
|
||||||
| if self.inline_logs { | ||||||
| inspector = inspector.with_inline_logs(); | ||||||
| } | ||||||
|
|
||||||
| let mut evm = revm::EVM::new(); | ||||||
| evm.env = self.build_call_env(request, fee_details, block_env); | ||||||
| evm.database(state); | ||||||
|
|
@@ -1097,6 +1111,9 @@ impl Backend { | |||||
| ) -> Result<DefaultFrame, BlockchainError> { | ||||||
| self.with_database_at(block_request, |state, block| { | ||||||
| let mut inspector = Inspector::default().with_steps_tracing(); | ||||||
| if self.inline_logs { | ||||||
| inspector = inspector.with_inline_logs(); | ||||||
| } | ||||||
| let block_number = block.number; | ||||||
| let mut evm = revm::EVM::new(); | ||||||
| evm.env = self.build_call_env(request, fee_details, block); | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.