diff --git a/.gitignore b/.gitignore index 5a41425ea8..07d5efeddf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target/ **/*.rs.bk +**/.DS_Store target .vscode diff --git a/crates/revm/src/context.rs b/crates/revm/src/context.rs index e58699a766..aba8f27d53 100644 --- a/crates/revm/src/context.rs +++ b/crates/revm/src/context.rs @@ -17,7 +17,7 @@ use std::boxed::Box; /// Main Context structure that contains both EvmContext and External context. pub struct Context { - /// Evm Context. + /// Evm Context (internal context). pub evm: EvmContext, /// External contexts. pub external: EXT, diff --git a/crates/revm/src/evm.rs b/crates/revm/src/evm.rs index f6a1a692d8..d9307cccba 100644 --- a/crates/revm/src/evm.rs +++ b/crates/revm/src/evm.rs @@ -25,7 +25,7 @@ pub const CALL_STACK_LIMIT: u64 = 1024; pub struct Evm<'a, EXT, DB: Database> { /// Context of execution, containing both EVM and external context. pub context: Context, - /// Handler of EVM that contains all the logic. Handler contains specification id + /// Handler is a component of the of EVM that contains all the logic. Handler contains specification id /// and it different depending on the specified fork. pub handler: Handler<'a, Self, EXT, DB>, } diff --git a/documentation/src/SUMMARY.md b/documentation/src/SUMMARY.md index a4c9db1a25..05a9255851 100644 --- a/documentation/src/SUMMARY.md +++ b/documentation/src/SUMMARY.md @@ -27,6 +27,7 @@ - [precompile](./crates/primitives/precompile.md) - [state](./crates/primitives/state.md) - [utils](./crates/primitives/utils.md) + - [kzg](./crates/primitives/kzg.md) - [Precompile](./crates/precompile.md) - [blake2](./crates/precompile/blake2.md) - [bn128 curve](./crates/precompile/bn128.md) diff --git a/documentation/src/crates/primitives.md b/documentation/src/crates/primitives.md index 013458daa0..bc058e5a1d 100644 --- a/documentation/src/crates/primitives.md +++ b/documentation/src/crates/primitives.md @@ -17,6 +17,7 @@ It is set up to be compatible with environments that do not include Rust's stand - [specification](./primitives/specifications.md): This module defines types related to Ethereum specifications (also known as hard forks). - [state](./primitives/state.md): This module provides types and functions for managing Ethereum state, including accounts and storage. - [utilities](./primitives/utils.md): This module provides utility functions used in multiple places across the EVM implementation. +- [kzg](./primitives/kzg.md): This module provides types and functions related to KZG commitment, it is empolyed visibly in the Point Evalution Precompile. ### External Crates: @@ -27,6 +28,7 @@ It is set up to be compatible with environments that do not include Rust's stand - `hex_literal`: The hex_literal crate provides a macro for including hexadecimal data directly in the source code. - `hashbrown`: The hashbrown crate provides high-performance hash map and hash set data structures. - `ruint`: The ruint crate provides types and functions for big unsigned integer arithmetic. +- `c-kzg`: A minimal implementation of the Polynomial Commitments API for EIP-4844, written in C. (With rust bindings) ### Type Aliases: @@ -40,5 +42,5 @@ It is set up to be compatible with environments that do not include Rust's stand - `U256`: A 256-bit unsigned integer type from the `ruint` crate. - `HashMap` and `HashSet`: High-performance hash map and hash set data structures from the hashbrown crate. -### Re-exported Modules: -All types, constants, and functions from the `bytecode`, `constants`, `env`, `log`, `precompile`, `result`, `specification`, `state`, and `utilities` modules are re-exported, allowing users to import these items directly from the `primitives` crate. +Re-exported Modules: +All types, constants, and functions from the `bytecode`, `constants`, `env`, `log`, `precompile`, `result`, `specification`, `state`, `utilities`, `KzgSettings`, `EnvKzgSettings`, `trusted_setup_points` types and methods were all re-exported, allowing users to import these items directly from the `primitives` crate. diff --git a/documentation/src/crates/primitives/kzg.md b/documentation/src/crates/primitives/kzg.md new file mode 100644 index 0000000000..7e7e6316d3 --- /dev/null +++ b/documentation/src/crates/primitives/kzg.md @@ -0,0 +1,12 @@ +# KZG + +With the introduction of [EIP4844](https://eips.ethereum.org/EIPS/eip-4844), this use of blobs for a more efficent short term storage is employed, the validity of this blob stored in the consensus layer is verified using the `Point Evaluation` pre-compile, a fancy way of verifing that and evaluation at a given point of a commited polynomial is vaild, in a much more bigger scale, implies that `Data is Available`. + +This module houses; + +1. `KzgSettings`: Stores the setup and parameters needed for computing and verify KZG proofs. + + The `KZG` premitive provides a default `KZGSettings` obtained from [this]( https://ceremony.ethereum.org/) trusted setup ceremony, a provision is also made for using a custom `KZGSettings` if need be, this is available in the `env.cfg`. + + +2. `trusted_setup_points`: This module contains functions and types used for parsing and utilizing the [Trusted Setup]( https://ceremony.ethereum.org/) for the `KzgSettings`. \ No newline at end of file