Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

REP-0023: Increase max code size limit to 32KB #18

Merged
merged 1 commit into from
Aug 16, 2024
Merged
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
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/).