-
Notifications
You must be signed in to change notification settings - Fork 224
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
AA-453: Support EIP-7702 tuples in ERC-4337 bundlers #226
Conversation
…3-eip-7702-support
|
||
const debug = Debug('aa.exec.cron') | ||
|
||
const THROTTLED_ENTITY_BUNDLE_COUNT = 4 | ||
|
||
const TX_TYPE_EIP_7702 = 4 |
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 it be in config or something? We already know that this type means different things on different networks
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.
I don't think so, the EIP-7702 once merged into mainnet will be a part of the EVM and any chain that wants Tx 4 to mean anything else will have to switch. I don't know if there is any reasonable chain that will not be compatible, do you?
@@ -168,6 +184,67 @@ export class BundleManager implements IBundleManager { | |||
} | |||
} | |||
|
|||
// TODO: this is a temporary patch until ethers.js adds EIP-7702 support |
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.
Is it still relevant?
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.
Yes, I would prefer to use Ethers.js and not import Ethereumjs as well, but for the server the difference is insignificant (in the browser you wouldn't want two ether libraries) and Ethers.js is not ready with 7702 yet.
maxFeePerGas: tx.maxPriorityFeePerGas!.toHexString() as PrefixedHexString, | ||
accessList: [], | ||
authorizationList | ||
} |
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.
This is an issue when we have unused gas penalty
@@ -330,13 +410,27 @@ export class BundleManager implements IBundleManager { | |||
} | |||
mergeStorageMap(storageMap, validationResult.storageMap) | |||
|
|||
const newBundleGas = entry.userOpMaxGas.add(bundleGas) | |||
bundleGas = newBundleGas | |||
for (const eip7702Authorization of entry.userOp.authorizationList ?? []) { |
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.
Please extract to a function. This function is already too big to read
No description provided.