-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(rpc): initial work in eth_call+estimate #1514
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1514 +/- ##
==========================================
- Coverage 76.07% 75.92% -0.15%
==========================================
Files 358 359 +1
Lines 42759 42805 +46
==========================================
- Hits 32528 32501 -27
- Misses 10231 10304 +73
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
use reth_primitives::{BlockId, U256}; | ||
use reth_provider::{BlockProvider, StateProvider, StateProviderFactory}; | ||
use reth_rpc_types::CallRequest; | ||
use revm::primitives::{BlockEnv, Env, ResultAndState}; |
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.
let's re-export these from reth_executor
let mut db = SubState::new(State::new(state)); | ||
let mut evm = revm::EVM::new(); | ||
evm.env = self.build_call_env(request, block_env); | ||
evm.database(db); | ||
// TODO error conversion from EMVError to EthApiErr | ||
let res = evm.transact_ref().unwrap(); |
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'll probably want to push these helpers to the executor, and have the API maybe own an executor/reference to one?
initial scaffolding for eth_call+estimate ref #1504
I will come up with something along the way and would like to make the changes incrementally rather than submitting them as a whole. because this will become quite large.
for now, this just outlines some functions for eth_call and estimate.
next step is figuring out how to actually create the
Env
, then porting some logic from anvil.