Repository navigation
fix(0.x): port recent viem fixes to SignatureErc6492, AbiParameters.encodePacked and Address.checksum - #684
Merged
Merged
Conversation
…he zero address Ports wevm/viem#5468. ecrecover returns the zero address for a malformed signature, so the deployless validator accepted any such signature for the zero address. The bytecode is rebuilt from the updated UniversalSigValidator.sol with solc 0.8.26, 200 optimizer runs, the paris EVM version, and no metadata, which reproduces the previous constant from the previous source. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports the encodePacked half of wevm/viem#5466. An odd-length bytes value was concatenated as is, shifting every later value by a nibble. It now throws Hex.InvalidLengthError, matching AbiParameters.encode since #617; viem left-pads instead. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports wevm/viem#5514. The checksum depends only on the lowercase address, so a result computed for one casing is reused for the others instead of hashing again. main already does this. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ddd3-d469-72eb-a88c-673c40859557 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis 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. |
Merged
This branch was successfully deployed
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.
0.xcounterpart of #683. One commit per fix.SignatureErc6492.universalSignatureValidatorBytecodereturnsfalsewhenecrecoveryields the zero address.UniversalSigValidator.solgets the same change, and the bytecode is the same as onmainand in viem. The0.xsource rebuilds to it with solc 0.8.26, 200 optimizer runs, theparisEVM version, and no metadata.encodePackedhalf):AbiParameters.encodePackedthrowsHex.InvalidLengthErrorfor an odd-lengthbytesvalue, matchingAbiParameters.encodesince fix(0.x): reject odd-length hex forbytesandbytesNin ABI encoding #618.Address.checksumreuses the result computed for the lowercase form of an address, so other casings of the same address do not hash again.mainalready does this.Differences from #683
The
Address.checksumcommit is0.xonly. Likemain, it checks the caller's exact string first, validates the address, and then looks up the lowercase key, so0X-prefixed and other invalid inputs still throw.Validation
The tests match #683, and both new tests fail with the source changes reverted. A scratch check of 2,000 random addresses in uppercase, lowercase, and checksummed casings matched the previous
checksumoutput. It also showed that one casing caches the lowercase key, and that0X…still throws.pnpm check:typesandbiome checkpass. Fullcorerun: 2,609 passed; the 3 failures are the same Anvilbehavior: networktransaction tests (TransactionEnvelopeEip1559,Eip4844,Eip7702).