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

docs: Add EIP Links to Documentation #1999

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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/crates/primitives/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Holds constant values used throughout the system. This module defines important

The module also defines `MAX_CODE_SIZE`, which is set according to [EIP-170](https://eips.ethereum.org/EIPS/eip-170)'s specification. [EIP-170](https://eips.ethereum.org/EIPS/eip-170) imposes a maximum limit on the contract code size to mitigate potential vulnerabilities and inefficiencies in Ethereum. Without this cap, the act of calling a contract can trigger costly operations that scale with the size of the contract's code. These operations include reading the code from disk, preprocessing the code for VM execution, and adding data to the block's proof-of-validity. By implementing `MAX_CODE_SIZE` (set to `0x6000` or ~25kb), the EVM ensures that the cost of these operations remains manageable, even under high gas levels that could be encountered in the future. [EIP-170](https://eips.ethereum.org/EIPS/eip-170)'s implementation thus offers crucial protection against potential DoS attacks and maintains efficiency, especially for future light clients verifying proofs of validity or invalidity.

Another constant defined here is `MAX_INITCODE_SIZE`, set in accordance with [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860). [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) extends EIP-170 by introducing a maximum size limit for initialization code (initcode) and enforcing a gas charge for every 32-byte chunk of initcode, to account for the cost of jump destination analysis. Before [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860), initcode analysis during contract creation wasn't metered, nor was there an upper limit for its size, resulting in potential inefficiencies and vulnerabilities. By setting `MAX_INITCODE_SIZE` to 2 \* `MAX_CODE_SIZE` and introducing the said gas charge, [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) ensures that the cost of initcode analysis scales proportionately with its size. This constant, therefore, facilitates fair charging, simplifies EVM engines by setting explicit limits, and helps to create an extendable cost system for the future.
Another constant defined here is `MAX_INITCODE_SIZE`, set in accordance with [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860). [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) extends [EIP-170](https://eips.ethereum.org/EIPS/eip-170) by introducing a maximum size limit for initialization code (initcode) and enforcing a gas charge for every 32-byte chunk of initcode, to account for the cost of jump destination analysis. Before [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860), initcode analysis during contract creation wasn't metered, nor was there an upper limit for its size, resulting in potential inefficiencies and vulnerabilities. By setting `MAX_INITCODE_SIZE` to 2 \* `MAX_CODE_SIZE` and introducing the said gas charge, [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) ensures that the cost of initcode analysis scales proportionately with its size. This constant, therefore, facilitates fair charging, simplifies EVM engines by setting explicit limits, and helps to create an extendable cost system for the future.
6 changes: 3 additions & 3 deletions documentation/src/crates/revm/handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ They are called in the following order:
Retrieves the precompiles for the given spec ID. More info: [precompile](../precompile.md).

* `apply_eip7702_auth_list`
Applies the EIP-7702 authorization list to the accounts. Return gas refund of already created accounts.
Applies the [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) authorization list to the accounts. Return gas refund of already created accounts.

* `deduct_caller`:
Deducts values from the caller to calculate the maximum amount of gas that can be spent on the transaction.
Expand Down Expand Up @@ -100,7 +100,7 @@ Look at the Interpreter documentation for more information.
Is a list of functions that are called after the execution. They are called in the following order:

* `refund`
Add EIP-7702 refund for already created accounts and calculates final gas refund that can
Add [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) refund for already created accounts and calculates final gas refund that can
be a maximum of 1/5 (1/2 before London hardfork) of spent gas.

* `reimburse_caller`:
Expand All @@ -117,4 +117,4 @@ Is a list of functions that are called after the execution. They are called in t
Called after transaction. End handler will not be called if validation fails.

* `clear`:
Clears journal state and error and it is always called for the cleanup.
Clears journal state and error and it is always called for the cleanup.
Loading