You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,6 @@ Part of the links point to the code documentation or the book. code docs are the
58
58
* Release procedure and changelogs explanation. [book](https://bluealloy.github.io/revm/release_procedure.html)
59
59
* How to use revme (Revm binary with few commands) can be found here. [code](https://github.com/bluealloy/revm/tree/main/bins/revme)
60
60
* How to run Ethereum test can be found here: [book](https://bluealloy.github.io/revm/dev.html#running-eth-tests)
61
-
* How to run examples and benchmark with `samply` to check performance. (book)
62
61
* If there is more explanations please open PR request for it.
63
62
64
63
### Community:
@@ -71,4 +70,4 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
71
70
72
71
### Security
73
72
74
-
For any security questions or findings, please reach out to me directly via email at [email protected] or contact me on Keybase under the username [draganrakita](https://keybase.io/draganrakita/).
73
+
For any security questions or findings, please reach out to me directly via email at [email protected] or contact me on Keybase under the username @draganrakita.
Copy file name to clipboardexpand all lines: book/src/architecture.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -9,38 +9,38 @@ You can use REVM in two main ways:
9
9
10
10
To see usage examples you can check the [examples folder](https://github.com/bluealloy/revm/tree/main/examples). Other than documentation, examples are main resource to see and learn about Revm.
11
11
12
-
The main `revm` library combines all crates into one package and reexports them, standalone library are useful if there is need to import functionality with smaller scope. You can see overview of revm crates in [crates folder](https://github.com/bluealloy/revm/tree/main/crates).
12
+
The main [`revm`](https://crates.io/crates/revm) library combines all crates into one package and reexports them, standalone library are useful if there is need to import functionality with smaller scope. You can see overview of revm crates in [crates folder](https://github.com/bluealloy/revm/tree/main/crates).
13
13
14
14
REVM works in `no_std` environments which means it can be used in zero-knowledge virtual machines (zkVMs) and it is the standard library in that use case. It also has very few external dependencies.
15
15
16
16
# Execution API
17
17
18
-
`Evm` the main structure for executing mainnet ethereum transaction is built with a `Context` and a builder, code for it looks like this:
18
+
[`Evm`](https://docs.rs/revm-context/1.0.0/revm_context/evm/struct.Evm.html) the main structure for executing mainnet ethereum transaction is built with a [`Context`](https://docs.rs/revm-context/latest/revm_context/context/struct.Context.html) and a builder, code for it looks like this:
19
19
20
20
```rust,ignore
21
21
let mut evm = Context::mainnet().with_block(block).build_mainnet();
*[`Inspector`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.Inspector.html) - Used for tracing.
30
30
31
-
And `Context` contains data used in execution:
32
-
* Environment data, the data that is known before execution starts are `Transaction`, `Block`, `Cfg`.
33
-
*`Journal` is place where internal state is stored. Internal state is returned after execution ends.
34
-
* And `Database` is a interface that allows fetching external data that is needed in runtime. That data are account, storage and bytecode. When loaded they are stored in `Journal`
31
+
And [`Context`](https://docs.rs/revm-context/latest/revm_context/context/struct.Context.html) contains data used in execution:
32
+
* Environment data, the data that is known before execution starts are [`Transaction`](https://docs.rs/revm-context-interface/latest/revm_context_interface/transaction/trait.Transaction.html), [`Block`](https://docs.rs/revm-context-interface/latest/revm_context_interface/block/trait.Block.html), [`Cfg`](https://docs.rs/revm-context-interface/latest/revm_context_interface/cfg/trait.Cfg.html).
33
+
*[`Journal`](https://docs.rs/revm-context-interface/latest/revm_context_interface/journaled_state/trait.JournalTr.html) is place where internal state is stored. Internal state is returned after execution ends.
34
+
* And `Database` is a interface that allows fetching external data that is needed in runtime. That data are account, storage and bytecode. When loaded they are stored in [`Journal`](https://docs.rs/revm-context-interface/latest/revm_context_interface/journaled_state/trait.JournalTr.html)
35
35
36
36
REVM provides four ways to execute transactions through traits (API):
37
37
38
-
*`transact(tx)` and `replay()` are function of `ExecuteEvm` trait that allow execution transactions. They return the status of execution with reason, changed state and in case of failed execution an error.
39
-
*`transact_commit(tx)` and `replay_commit()` are part of `ExecuteCommitEvm` that internally commits the state diff to the database and returns status of execution. Database is required to support `DatabaseCommit` trait.
40
-
*`inspect()`, `inspect_replay(tx)` and a few others are part of `InspectEvm` trait that allow execution with inspection. This is how tracers are called.
41
-
*`inspect_commit()`,`inspect_replay_commit(tx)` are part of the `InspectCommitEvm` trait that extends `InspectEvm` to allow committing state diff after tracing.
38
+
*`transact(tx)` and `replay()` are function of [`ExecuteEvm`](https://docs.rs/revm-handler/latest/revm_handler/evm/trait.ExecuteEvm.html) trait that allow execution transactions. They return the status of execution with reason, changed state and in case of failed execution an error.
39
+
*`transact_commit(tx)` and `replay_commit()` are part of [`ExecuteCommitEvm`](https://docs.rs/revm-handler/latest/revm_handler/evm/trait.ExecuteCommitEvm.html) that internally commits the state diff to the database and returns status of execution. Database is required to support `DatabaseCommit` trait.
40
+
*`inspect()`, `inspect_replay(tx)` and a few others are part of [`InspectEvm`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.InspectEvm.html) trait that allow execution with inspection. This is how tracers are called.
41
+
*`inspect_commit()`,`inspect_replay_commit(tx)` are part of the [`InspectCommitEvm`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.InspectCommitEvm.html) trait that extends `InspectEvm` to allow committing state diff after tracing.
42
42
43
-
For inspection API to be enabled, `Evm` needs to be created with inspector.
43
+
For inspection API to be enabled, [`Evm`](https://docs.rs/revm-context/1.0.0/revm_context/evm/struct.Evm.html) needs to be created with inspector.
44
44
45
45
```rust,ignore
46
46
let mut evm = Context::mainnet().with_block(block).build_mainnet().with_inspector(inspector);
@@ -57,12 +57,12 @@ Each trait needed to build custom EVM has detailed documentation explaining how
57
57
58
58
In summary, REVM is built around several key traits that enable customizable EVM functionality. The core traits include:
59
59
60
-
***EvmTr**: The core EVM trait that provides access to `Context`, `Instruction`, `Precompiles`:
61
-
***ContextTr**: Accessed through EvmTr, defines the execution environment including Tx/Block/Journal/Db.
62
-
***Handler**: Implements the core execution logic, taking an EvmTr implementation. The default implementation follows Ethereum consensus.
60
+
*[`EvmTr`](https://docs.rs/revm-handler/latest/revm_handler/evm/trait.EvmTr.html): The core EVM trait that provides access to `Context`, `Instruction`, `Precompiles`:
61
+
*[`ContextTr`](https://docs.rs/revm-context-interface/latest/revm_context_interface/context/trait.ContextTr.html): Accessed through EvmTr, defines the execution environment including Tx/Block/Journal/Db.
62
+
*[`Handler`](https://docs.rs/revm-handler/latest/revm_handler/handler/trait.Handler.html): Implements the core execution logic, taking an EvmTr implementation. The default implementation follows Ethereum consensus.
63
63
64
64
And traits that provide support for inspection and tracing:
65
65
66
-
***InspectorEvmTr**: Extends EvmTr to enable inspection mode execution with an associated `Inspector` type
67
-
***InspectorHandler**: Extends Handler with inspection-enabled execution paths that make `Inspector` callbacks
68
-
***Inspector**: User-implementable trait for EVM inspection/tracing
66
+
*[`InspectorEvmTr`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.InspectorEvmTr.html): Extends EvmTr to enable inspection mode execution with an associated [`Inspector`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.Inspector.html) type
67
+
*[`InspectorHandler`](https://docs.rs/revm-inspector/latest/revm_inspector/handler/trait.InspectorHandler.html): Extends Handler with inspection-enabled execution paths that make [`Inspector`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.Inspector.html) callbacks
68
+
*[`Inspector`](https://docs.rs/revm-inspector/latest/revm_inspector/trait.Inspector.html): User-implementable trait for EVM inspection/tracing
0 commit comments