-
Notifications
You must be signed in to change notification settings - Fork 464
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
refactor: allow chain-specific configuration of Evm #1378
base: main
Are you sure you want to change the base?
Conversation
0e87f0b
to
45c9517
Compare
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.
I have started reviewing this last weeks, but didnt have time to finish it whole and getter better grasp on it.
I general like it, change is needed but would like to minimise renames to get smaller PR.
As this is potentially a breaking change will need look at reth code and think how this impacts them as we are in the middle of devnet for Prague.
EvmBuilder { | ||
context: self.context, | ||
handler: EvmBuilder::<'_, SetGenericStage, NewChainSpecT, _, _>::handler( | ||
NewChainSpecT::Hardfork::default(), |
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 interesting to note, we now have ChainSpec and Hardfork as two separate entities. ChainSpec is here to define potential hardforks and hardfork type is here so it can be checked against ChainSpec.
We could have a trait Hardfork
that will have a fn is_enabling()
function. Would come back to this, those two should be split as ChainSpec is something that is going to grow.
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.
Is this something you want this PR to cover or a separate one?
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 can do that later. PR direction in general looks great!
@@ -0,0 +1,253 @@ | |||
use revm_interpreter::{ |
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 file merely serves to illustrate that we can support custom opcodes. It should be removed before merging.
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 can move it to examples later, fine with leaving it here for now.
Given that the general approach seemed to be the right direction, I removed the last instances of Please let me know what you think. You should be able to review those changes commit-by-commit |
I'll hold off on resolving merge conflicts until we're happy with the full design, if that's okay. |
There are still some That way we could use chain-specific errors static errors instead of strings. Alternatively, we could also add a custom error type to the That would allow us to remove the WDYT, @rakita ? |
I really like this path. For organizational purposes, lets merge this into chain_spec branch so we can work on it and make PR there, and after we are fine with the design, we can think about rebasing it on the main.
This is perfectly fine.
I would leave it as |
I made a PR that refactors few things #1528 I couldn't make it in nomicfoundation/revm didn't get the option for target repo to make a PR on. I am still in investigation phase, but this looks great! |
Awesome! Is there anything you'd like me to do? I added your commits to this PR, squashed, and rebased on |
637c088
to
f9b2d03
Compare
I dont have any action items rn, but I will ping you if something comes up.
Great! |
f9b2d03
to
f9f9de6
Compare
1744639
to
4bb0f27
Compare
@@ -16,7 +16,6 @@ pub type EVMResultGeneric<T, ChainSpecT, DBError> = core::result::Result< | |||
>; | |||
|
|||
#[derive(Debug, Clone, PartialEq, Eq)] | |||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] |
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.
Removing serde (de)serialisation allowed the removal of the serde-related trait bounds from the HaltReasonTrait
. As the ExecutionResult
and ResultAndState
aren't part of the JSON-RPC of Ethereum, I think it should be safe to remove this.
WDYT?
Experiment to see whether it would be possible to separate optimism and mainnet
SpecId
s and other types, such asHaltReason
.I'm curious to hear whether any of this is in line with #918