-
Notifications
You must be signed in to change notification settings - Fork 936
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
Revm example #6855
Revm example #6855
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
only doc nit, and perhaps a few more docs about the what's going on, like
convert the pool transaction
configure the evm with the custom inspector
execute the transaction on a blocking task and await the inspector result
#[derive(Default, Debug, Clone)] | ||
struct DummyInspector { | ||
ret_val: Vec<String>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add a smol doc here what this inspector does, listing opcodes at the program counter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do in tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
use reth::{ | ||
cli::{ | ||
components::{RethNodeComponents, RethRpcComponents, RethRpcServerHandles}, | ||
config::RethRpcConfig, | ||
ext::{RethCliExt, RethNodeCommandConfig}, | ||
Cli, | ||
}, | ||
primitives::{Address, BlockId, IntoRecoveredTransaction}, | ||
revm::{ | ||
inspector_handle_register, interpreter::Interpreter, revm, Database, EvmContext, Inspector, | ||
}, | ||
rpc::{ | ||
compat::transaction::transaction_to_call_request, | ||
eth::{revm_utils::EvmOverrides, EthTransactions}, | ||
}, | ||
tasks::TaskSpawner, | ||
transaction_pool::TransactionPool, | ||
}; | ||
use reth_revm::interpreter::OpCode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make this way less verbose. Prelude or otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are already the reexports -.-
but can def make this nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
close #6145
Add an example of how to use a custom inspector to trace new pending transactions
How to test:
and in another contracts project created by
forge
, and then run the following command to deploy a transaction:forge create --mnemonic "test test test test test test test test test test test junk" src/Counter.sol:Counter
here is the running result from
node
: