Merged
Conversation
- Fix CREATE2 base gas in ops.h from G_ACCESS to G_CREATE - Add createNewAccount2: keccak256(0xff ++ sender ++ salt ++ keccak256(initcode))[12:] - Add evmCreate2 and case CREATE2 handler; charges initcode word gas plus keccak word gas per EIP-1014; fails early for endowments exceeding 96 bits - Add tst/evm.c unit tests: address formula (EIP-1014 vector #1), insufficient balance, oversized endowment - Add assembler/execution tests in tst/create2.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
CREATE2opcode per EIP-1014.Changes
CREATE2base gas inops.hfromG_ACCESS(100) toG_CREATE(32000)createNewAccount2: computes address askeccak256(0xff ++ sender ++ salt ++ keccak256(initcode))[12:]; writes initcode hash directly into the input buffer with no intermediaryevmCreate2: mirrorsevmCreate, delegates to_evmConstructviacreateNewAccount2case CREATE2handler: reads salt as a pointer into the stack (no copy), charges initcode word gas + keccak word gas (EIP-1014), applies L function, fails early for endowments exceeding 96-bitval_tcapacitytst/evm.c: address formula verified against EIP-1014 vector#1, insufficient balance, oversized endowmenttst/create2.json/tst/in/create2.evm