Skip to content

fix(cheatcodes): preserve non-empty zero bytecode - #1165

Open
DicksonWu654 wants to merge 1 commit into
runtimeverification:masterfrom
DicksonWu654:fix/vm-etch-zero-bytecode
Open

fix(cheatcodes): preserve non-empty zero bytecode#1165
DicksonWu654 wants to merge 1 commit into
runtimeverification:masterfrom
DicksonWu654:fix/vm-etch-zero-bytecode

Conversation

@DicksonWu654

Copy link
Copy Markdown

Summary

vm.etch(..., hex"00") previously stored empty code because #setCode treated any byte sequence with numeric value zero as empty. That changed the observable runtime from one byte to zero bytes, including code-size and code-hash results.

This changes the normalization check to use lengthBytes(CODE) ==Int 0, preserving actual empty code while retaining every non-empty byte sequence.

The regression test AccountParamsTest.testEtchEmptyAndZero() checks both empty bytes and the one-byte zero runtime, and is registered in foundry-prove-all.

Testing

Tests were not run locally under the review constraint; upstream CI can execute the regression.

@DicksonWu654
DicksonWu654 marked this pull request as ready for review September 1, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant