-
Notifications
You must be signed in to change notification settings - Fork 1k
[pallet-revive] revm refactor #9818
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
base: master
Are you sure you want to change the base?
Conversation
aa09128
to
630c1ad
Compare
table: &revm::interpreter::InstructionTable<EVMInterpreter<'a, E>, DummyHost>, | ||
) -> InterpreterResult { | ||
let host = &mut DummyHost {}; | ||
fn run_plain<E: Ext>(interpreter: &mut Interpreter<E>) -> ControlFlow<Halt, Infallible> { |
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.
note I will re-introduce the tracing version in a follow up PR that will add opcode tracing and let you compare opcode / stack and memory executed on revive vs revm eth 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.
Missing license statement
Refactor REVM implementation in
pallet-revive
This PR removes technical debt and eliminates tight coupling to specific REVM versions, facilitating integration with other projects (e.g., Foundry). After this refactoring, we primarily depend only on REVM's
Bytecode
struct.Background
Most of REVM's generic type system and trait abstractions are unused or had to be ignored to prevent bugs. Interactions with the host in pallet-revive are handled through the
Ext
trait, making REVM's other abstractions unnecessary or potentially harmful.Unused REVM abstractions included:
DummyHost
default mocked implementationInputsTr
: Unused most methods had panic implementations since they couldn't be relied uponChanges
This refactor introduces:
sp_core::U256
instead ofalloy_core::primitives::U256
for better integration with the rest of the palletFn(&mut interpreter) -> ControlFlow<Halt>
EVMGas
that implementsToken<T>
to provide the associated weightInterpreterAction
, this simplify the interpreter loop to:Halt(HaltReason)
error variant to theError<T>
enum, most error inError<T>
should probably redefined asHalt(HaltReason)
variant to unify error handling between PVM & EVM in a future PR