Prevent redundant eip7702Auth inclusion in UserOps to avoid unnecessary type 4 tx overhead #446
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.
Summary
This PR fixes an issue where the permissionless lib always forwards the authorization field (eip7702Auth) to the bundler, even if the account has already been authorized with the same delegation.
Currently, this causes all subsequent UserOps to be bundled into type 4 transactions, which adds ~23,000 gas overhead per transaction. This is not required by EIP-7702 semantics and results in wasted gas for users.
Changes
In
actions/smartAccount/sendTransaction.ts
, before forwarding arguments tosendUserOperation
, we:Retrieve deployed bytecode for the account.
Detect if the account is already attached via 7702 (prefix 0xef0100).
Extract the attached delegate address.
If it matches the authorization.address provided, remove the redundant authorization field.
Rationale
User benefit: prevents every tx from incurring the extra type 4 overhead once the account is already authorized.
Spec alignment: EIP-7702 only requires including eip7702Auth when setting or changing delegation, not on every tx.
Safety: redelegations are still supported — if the target differs, the field is preserved.
Example
UserOp
https://etherscan.io/tx/0xa9ba257d5c5231cecbcb9f0da54597777cff44309267ea931b6c1b253b2a0901
Account
https://etherscan.io/address/0xa764D0B9777cc53A0620650d3A089091272A9Bea#authlist7702