-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from phuctd95/REP-0023
REP-0023: Increase max code size limit to 32KB
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,32 @@ | ||
# REP-0023: Increase max code size limit to 32KB | ||
|
||
## Preamble | ||
<pre> | ||
REP-0023 | ||
Title: Increase max code size limit to 32KB | ||
Author: Ronin Core Team | ||
Type: Standard Track | ||
Status: Draft | ||
Created: 2024-08-07 | ||
</pre> | ||
|
||
## Abstract | ||
|
||
This proposal specifies to increase max contract code size limit to 32KB. | ||
|
||
## Rationale | ||
|
||
The author proposes raising the limit to 32KB to allow for the deployment of more complex contracts without needing to resort to alternative development patterns. | ||
|
||
## Specification | ||
|
||
the `MAX_CODE_SIZE` limit set in [EIP-170](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md) changes from `0x6000` (`2**14+2**13`) bytes to `0x8000` (`2**15`) bytes. If contract creation initialization returns data with length of more than `0x8000` bytes, contract creation fails with an out of gas error. | ||
|
||
## Security analysis | ||
|
||
`MAX_CODE_SIZE` was implemented to mitigate an attack vector where the process of reading code from disk, which has a quadratic complexity of `O(n)`, was being charged a constant amount of gas. However, since this limit was introduced, data fetching has become faster, so raising the limit will not pose a problem. | ||
|
||
|
||
## License | ||
|
||
The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |