Repository navigation
Add keccak_words, create2_address and a direct packed-encoding path - #1604
Conversation
a175825 to
c84bd2e
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c84bd2ef1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`std::evm::keccak_words([..])` hashes a fixed list of words, the common `keccak256(abi.encode(a, b, ...))` over word-sized values, and `create2_address(deployer, salt, init_code_hash)` computes CREATE2 addresses. `EncodePacked` gains a provided `write_packed` method that stores a value directly at its packed width. The std implementations override it with a single word store or copy, tuples chain it, and `keccak_packed` / `encode_packed` use it instead of the `Packed` builder: `keccak_packed((address, int24, int24, bytes32))` drops from about 2,140 to about 470 gas. Non-canonical `Address` and `FixedBytes<N>` values still revert. The custom-width `sol::` integers implement `EncodePacked`.
c84bd2e to
6fdd38d
Compare
std::evm::keccak_words([..])hashes a fixed list of words, the commonkeccak256(abi.encode(a, b, ...))over word-sized values, andcreate2_address(deployer, salt, init_code_hash)computes CREATE2 addresses.EncodePackedgains a providedwrite_packedmethod that stores a value directly at its packed width. The std implementations override it with a single word store or copy, tuples chain it, andkeccak_packed/encode_packeduse it instead of thePackedbuilder:keccak_packed((address, int24, int24, bytes32))drops from about 2,140 to about 470 gas. Non-canonicalAddressandFixedBytes<N>values still revert. The custom-widthsol::integers implementEncodePacked.