Skip to content

Commit

Permalink
Merge pull request #18 from phuctd95/REP-0023
Browse files Browse the repository at this point in the history
REP-0023: Increase max code size limit to 32KB
  • Loading branch information
phuctd95 authored Aug 16, 2024
2 parents 18c77fb + d3c80ba commit 21e9b4e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions REP-0023/REP-0023.md
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/).

0 comments on commit 21e9b4e

Please # to comment.