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

update doc about interpreter action #1419

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [gas](./crates/interpreter/gas.md)
- [memory](./crates/interpreter/memory.md)
- [host](./crates/interpreter/host.md)
- [inner_models](./crates/interpreter/inner_models.md)
- [interpreter_action](./crates/interpreter/interpreter_action.md)
- [instruction_result](./crates/interpreter/instruction_result.md)
- [instructions](./crates/interpreter/instructions.md)
- [Primitives](./crates/primitives.md)
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/crates/interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is structured as follows:

- [gas](./interpreter/gas.md): Handles gas mechanics in the EVM, such as calculating gas costs for operations.
- [host](./interpreter/host.md): Defines the EVM context `Host` trait.
- [inner_models](./interpreter/inner_models.md): Contains inner data structures used in the EVM implementation.
- [interpreter_action](./interpreter/interpreter_action.md): Contains data structures used in the EVM implementation.
- [instruction_result](./interpreter/instruction_result.md): Defines results of instruction execution.
- [instructions](./interpreter/instructions.md): Defines the EVM opcodes (i.e. instructions).

Expand Down
29 changes: 0 additions & 29 deletions documentation/src/crates/interpreter/inner_models.md

This file was deleted.

39 changes: 39 additions & 0 deletions documentation/src/crates/interpreter/interpreter_action.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# The `interpreter_action.rs` Module in the Rust Ethereum Virtual Machine (EVM)

The `interpreter_action.rs` module within this Rust EVM implementation encompasses a collection of datastructures used as internal models within the EVM. These models represent various aspects of EVM operations such as call and create inputs, call context, value transfers, and the result of self-destruction operations.

## Data Structures

- `CallInputs` Struct

The `CallInputs` struct is used to encapsulate the inputs to a smart contract call in the EVM. This struct includes the target contract address, the value to be transferred (if any), the input data, the gas limit for the call, the call context, and a boolean indicating if the call is a static call (a read-only operation).

- `CallScheme` Enum

The `CallScheme` enum represents the type of call being made to a smart contract. The different types of calls (`CALL`, `CALLCODE`, `DELEGATECALL`, `STATICCALL`) represent different modes of interaction with a smart contract, each with its own semantics concerning the treatment of the message sender, value transfer, and the context in which the called code executes.

- `CallValue` Enum

The `CallValue` Enum represents a value transfer between two accounts.

- `CallOutcome`

Represents the outcome of a call operation in a virtual machine. This struct encapsulates the result of executing an instruction by an interpreter, including the result itself, gas usage information, and the memory offset where output data is stored.

- `CreateInputs` Struct

The `CreateInputs` struct encapsulates the inputs for creating a new smart contract. This includes the address of the creator, the creation scheme, the value to be transferred, the initialization code for the new contract, and the gas limit for the creation operation.

- `CreateOutcome` Struct

Represents the outcome of a create operation in an interpreter. This struct holds the result of the operation along with an optional address. It provides methods to determine the next action based on the result of the operation.

- `EOFCreateInput` Struct

Inputs for EOF create call.

- `EOFCreateOutcome` Struct

Represents the outcome of a create operation in an interpreter.

In summary, the `interpreter_action.rs` module provides several crucial data structures that facilitate the representation and handling of various EVM operations and their associated data within this Rust EVM implementation.
Loading