Skip to content
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: extract rpc<>revm specifc code #1818

Closed
wants to merge 2 commits into from

Conversation

chirag-bgh
Copy link
Contributor

Closes #1689

@chirag-bgh chirag-bgh marked this pull request as ready for review March 17, 2023 16:02
@chirag-bgh chirag-bgh requested a review from gakonst as a code owner March 17, 2023 16:02
@mattsse mattsse self-assigned this Mar 17, 2023

#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
#[allow(missing_docs)]
pub enum RevmError {
Copy link
Member

@onbjerg onbjerg Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should rly be using the executor error enum instead of writing its own:

pub enum Error {

And the functions like create_txn_env are handled by the executor interface - if it is not good enough, it should be adjusted. Ideally the RPC would use an ExecutorFactory like the rest of the code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the RPC would use an ExecutorFactory like the rest of the code

RPC does not write to Disk and needs to configure the env directly depending on the RPC call.

The EvmEnvProvider trait is used by RPC to get block and cfg of the env and create_txn_env configures the txenv based on the request.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some discussion, we want the rpc types to be a completely independent crate so that it can be easily reused throughout the ecosystem and does not come with any additional feature, therefore the issue in question is no longer relevant and needs to be re-evaluated.

Very sorry for wasting your time on this...

crates/interfaces/src/error.rs Show resolved Hide resolved

#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
#[allow(missing_docs)]
pub enum RevmError {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the RPC would use an ExecutorFactory like the rest of the code

RPC does not write to Disk and needs to configure the env directly depending on the RPC call.

The EvmEnvProvider trait is used by RPC to get block and cfg of the env and create_txn_env configures the txenv based on the request.

@mattsse mattsse closed this Mar 20, 2023
@chirag-bgh chirag-bgh deleted the extract_rpc_revm_code branch March 20, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract rpc<->revm specific code from rpc
3 participants