Repository navigation
fix: accept unpadded r and s in zod Authorization.Signed - #694
Open
gomesalexandre wants to merge 1 commit into
Open
gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
Nodes return authorization list `r` and `s` as `uint256` quantities, so any value below 2**248 has fewer than 32 bytes. The schemas typed them as `Hex32` and rejected those, failing the whole `Transaction.Eip7702` decode with "expected 32 bytes" on about 1 in 128 authorizations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@gomesalexandre is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been 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.
Nodes return the
randsof an authorization list entry asuint256quantities (execution-apissrc/schemas/transaction.yaml), so any value below2**248has fewer than 32 bytes. The zodAuthorization.Signed/SignedToRpcschemas typed them asHex32and rejected those values. That's about 1 in 128 authorizations, and it fails the wholeTransaction.Eip7702decode withexpected 32 bytes. CoreAuthorization.fromRpcaccepts them and pads them.On live data from publicnode (30 latest blocks), 2 of 103 mainnet type-4 transactions and 1 of 30 on BSC failed
z.decode(Transaction.Transaction, tx). One example is mainnet tx0x701f5911c66298aee60c1fc2b56063de81efcde3186d0ad317d083098bbb7b51, which fails atauthorizationList.0.s, a 62-digit0xcd04…ce84. With this change none fail.randsnow use a codec that takes auint256quantity and decodes it to 32-byte hex, likeAuthorization.fromRpc. On encode it emits a quantity. The decoded type is still0x${string}, so the type tests are unchanged. The new test decodes that mainnet authorization, re-encodes it to the exact node JSON throughSignedandSignedToRpc, and decodes it throughListSigned. It fails onmain.Left out:
Authorization.TupleSignedand theSignatureschemas useHex32the same way. The tuple one needs an RLP-specific codec, because zero is0xthere. I can follow up if you want them.🤖 Generated with Claude Code