-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stricter validation of EIP-7702 transactions #11885
Conversation
return txpoolcfg.NoAuthorizations | ||
} | ||
for i := 0; i < authorizationLen; i++ { | ||
if txn.Authorizations[i].S.Gt(crypto.Secp256k1halfN) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just use TransactionSignatureIsValid
here, as it it used in authority recover, and if it fails there, the entire tx fails. So maybe we can check all aspects of the signature
ref: link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, but I'm holding off until ethereum/EIPs#8865 is merged.
Check (in the txpool and in the main code) that an EIP-7702 transaction is [valid](https://eips.ethereum.org/EIPS/eip-7702#set-code-transaction), namely that: - `to != nil` - `len(authorization_list) != 0` - `authorization.chain_id` is `uint256` - `authorization.nonce` is `uint64` - `authorization.address` is `bytes20` - `authorization.y_parity == 0 || authorization.y_parity == 1` - `authorization.r` is `uint256` - `authorization.s` is `uint256` and `authorization.s <= secp256k1n/2` This PR doesn't implement ethereum/EIPs#8865 or ethereum/EIPs#8845
Check (in the txpool and in the main code) that an EIP-7702 transaction is valid, namely that:
to != nil
len(authorization_list) != 0
authorization.chain_id
isuint256
authorization.nonce
isuint64
authorization.address
isbytes20
authorization.y_parity == 0 || authorization.y_parity == 1
authorization.r
isuint256
authorization.s
isuint256
andauthorization.s <= secp256k1n/2
This PR doesn't implement ethereum/EIPs#8865 or ethereum/EIPs#8845