Repository navigation
fix: encode authorization r and s as quantities in Authorization.toRpc - #693
Open
gomesalexandre wants to merge 1 commit into
Open
gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
….toRpc`
execution-apis types authorization list `r` and `s` as `uint256`, so
nodes expect them without leading zeros. `Authorization.toRpc` passed
the 32-byte padded values through, and geth-based nodes reject them in
`eth_estimateGas`, `eth_call` and `eth_sendTransaction` ("hex number
with leading zero digits") whenever the top nibble is zero.
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.
execution-apis types the
randsof an authorization list entry asuint256(src/schemas/transaction.yaml, pattern^0x(0|[1-9a-f][0-9a-f]{0,63})$), so nodes expect them without leading zeros. ox keeps them as 32-byte padded hex, andAuthorization.toRpcpassed them through as is.TransactionRequest.toRpc,Transaction.toRpcandUserOperation.toRpc(eip7702Auth) go through it. So a signed authorization whoserorshas a zero top nibble went out with a leading zero digit. That's about 1 in 16 forrand 1 in 8 for a low-ss, and geth-based nodes reject the request.I sent a real mainnet authorization (from tx
0x701f5911…7b51, whosesis 62 digits) throughTransactionRequest.toRpcintoeth_estimateGason publicnode:-32602 ... cannot unmarshal hex number with leading zero digits into Go struct field TransactionArgs.authorizationList.s of type *uint256.Int0xb52e-326020xcfd4-326020xb52e0xb52e(these backends accept it)0xb52etoRpcnow encodesrandswithHex.fromNumber(BigInt(...)), the same way viem'sformatAuthorizationListdoes (numberToHex(BigInt(r))), so zero comes out as0x0.Transaction.toRpc(Transaction.fromRpc(tx))now matches the node JSON for the authorization list. Before this change, 43 of 173 live mainnet authorizations didn't match.The new test round-trips that mainnet authorization and a zero
r, and it fails onmain. Two existing snapshots change to0x1/0x2: the authorization list in theTxEnvelopeEip7702.toRpctest, andeip7702Authin theUserOperation.toRpctest. Transaction-levelr/sare unchanged:Transaction.toRpccopies them directly, and nodes don't read them from requests.🤖 Generated with Claude Code