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

Add a rule removing init code size limit checks #900

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

palinatolmach
Copy link
Collaborator

Follow up to #897.

This PR adds a rule that removes a code size limit check on the initialization bytecode during deployment by overriding the original one.

Otherwise, if the contract getting deployed is sufficiently big, this rule kicks in:

    rule [create-invalid]:
         <k> CREATE _ _ _ => #end EVMC_OUT_OF_GAS ... </k> [owise]

reporting an EVMC_OUT_OF_GAS error, even though we aren't checking

The check that the code getting deployed is not passing is this one:

rule #hasValidInitCode(INITCODELEN, SCHED) => notBool Ghasmaxinitcodesize << SCHED >> orBool INITCODELEN <=Int maxInitCodeSize < SCHED >

and, for Shanghai (and Cancun), the code limit for the initialization bytecode it's twice the runtime code size limit:

rule maxInitCodeSize   < SHANGHAI > => 2 *Int maxCodeSize < SHANGHAI >

@palinatolmach palinatolmach merged commit 3311bbe into master Dec 3, 2024
12 checks passed
@palinatolmach palinatolmach deleted the remove-init-code-size-check branch December 3, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants