-
Notifications
You must be signed in to change notification settings - Fork 977
feat: introducing EvmWiring, a chain-specific configuration #1672
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
f8fcaa7
refactor: allow chain-specific configuration of Evm
Wodann 6145d39
refactor: rename Transaction::transact_to and clarify docs
Wodann 7b950c7
refactor: remove trait bounds on Transaction super trait
Wodann caaf05d
refactor: remove trait bounds from Block supertrait
Wodann 72272c9
fix: clippy warnings
Wodann 0723ff0
fix: cargo doc
Wodann f5ccf54
refactor: limit trait bounds on HaltReason
Wodann 6a881fa
refactor: allow moving of kind
Wodann dab9e20
refactor: rename Transaction::nonce to nonce_opt to signal that it's …
Wodann 214c1d5
refactor: replace AccessList with alloy version
Wodann 7303587
refactor: rename gas_priority_fee to max_priority_fee_per_gas
Wodann a8227c0
refactor: correct trait bound on ExecutionResult::clone
Wodann fe1ab43
Clone
Wodann 373e197
refactor: only allow optional nonce check via CfgEnv
Wodann 689be7f
fix: revme
Wodann f53a2a9
refactor: derive DummyHost
Wodann dbe9e3a
refactor: derive Clone for ExecutionResult
Wodann 77e19ce
refactor: remove EVMErrorForChain
Wodann 6c16bef
refactor: derive Clone for CfgEnvWithChainSpec
Wodann 145a4ce
refactor: use EVMResultGeneric
Wodann 3f29a23
refactor: add convenience EVMErrorForChain type alias
Wodann 3c6c4d3
feat: export OptimismBlock
Wodann 4856bea
refactor: add handler constructor and Context to revm::ChainSpec
Wodann 93089c3
refactor: generalise optimism implementation using traits
Wodann da8175a
fix: no-default-features
Wodann 0f052b5
fix: CI
Wodann 69e7304
chore: Add default fn to Tx/Block traits
rakita 946d404
Chore: rename ChainSpec to EvmWiring
rakita 57a3feb
chore: clippy comments fix
rakita b6e90b6
chore: rename EthEvmWiring to EthereumWiring
rakita 69890ae
chore: re add serde, restring HaltReasonTrait
rakita 9a6d2e6
chore: move custom opcode to examples
rakita da81d97
chore: remove op feature from test wiring
rakita 1ad97fd
nit use Self::EvmWiringT
rakita 6d479da
nit indents
rakita 1bce037
feat(Wiring): Add Database and EXT to EvmWiring
rakita 1c660da
some fixes
rakita ed99ce9
temp
rakita 45c07c5
feat: make builder compile. EnvWiring and Result Halt
rakita d73f96c
chore: cleanup rename
rakita 763ba26
nit
rakita b96b397
fix: make string conversion complete
Wodann 62b45b7
Merge remote-tracking branch 'origin/main' into wiring
rakita 65d4f26
fix compile
rakita 83a0803
Merge remote-tracking branch 'wodann/refactor/opt-spec-id' into wiring
rakita 917a753
compiles
rakita 28ac623
Merge remote-tracking branch 'origin/main' into wiring
rakita 897f8ed
wip builder
rakita 6528d3b
wip
rakita 321972c
Merge remote-tracking branch 'origin/main' into wiring
rakita 0462c5b
fix compile
rakita c1c57ab
wip
rakita c4845c2
fix optimism test
rakita de4e89c
fix docs ci
rakita 492c27a
cleanup
rakita f1faa47
cleanup
rakita f97ce47
use core::error::Error
rakita d64f624
cleanup
rakita 4a7e6e3
use core error
rakita d51cc59
fix builer
rakita e7d78ca
fix docs
rakita 763592a
final doc fix
rakita 5fef8e2
rm alloy provider
rakita 1383df7
Merge remote-tracking branch 'origin/main' into wiring
rakita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: add handler constructor and Context to revm::ChainSpec
- Loading branch information
commit 4856bea758dbd2d154b29857f2c56a3e045e7c6b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| use crate::{ | ||
| handler::{ExecutionHandler, PostExecutionHandler, PreExecutionHandler, ValidationHandler}, | ||
| interpreter::opcode::InstructionTables, | ||
| primitives::{db::Database, spec_to_generic, EthChainSpec}, | ||
| EvmHandler, | ||
| }; | ||
|
|
||
| pub trait ChainSpec: crate::primitives::ChainSpec { | ||
| /// The type that contains all context information for the chain's EVM execution. | ||
| type Context: Default; | ||
rakita marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| /// Creates a new handler with the given hardfork. | ||
| fn handler<'evm, EXT, DB>(hardfork: Self::Hardfork) -> EvmHandler<'evm, Self, EXT, DB> | ||
| where | ||
| DB: Database; | ||
| } | ||
|
|
||
| impl ChainSpec for EthChainSpec { | ||
| type Context = (); | ||
|
|
||
| fn handler<'evm, EXT, DB>(hardfork: Self::Hardfork) -> EvmHandler<'evm, Self, EXT, DB> | ||
| where | ||
| DB: Database, | ||
| { | ||
| spec_to_generic!( | ||
| hardfork, | ||
| EvmHandler { | ||
| spec_id: hardfork, | ||
| instruction_table: InstructionTables::new_plain::<SPEC>(), | ||
| registers: Vec::new(), | ||
| validation: ValidationHandler::new::<SPEC>(), | ||
| pre_execution: PreExecutionHandler::new::<SPEC>(), | ||
| post_execution: PostExecutionHandler::mainnet::<SPEC>(), | ||
| execution: ExecutionHandler::new::<SPEC>(), | ||
| } | ||
| ) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.