Skip to content
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

Merged
merged 19 commits into from
Dec 22, 2024

Conversation

forshtat
Copy link
Contributor

No description provided.

packages/bundler/src/BundlerServer.ts Outdated Show resolved Hide resolved
packages/bundler/src/modules/BundleManager.ts Show resolved Hide resolved
packages/bundler/src/BundlerServer.ts Outdated Show resolved Hide resolved
@forshtat forshtat changed the title AA-453: (WIP) Support EIP-7702 tuples in ERC-4337 bundlers AA-453: Support EIP-7702 tuples in ERC-4337 bundlers Sep 24, 2024

const debug = Debug('aa.exec.cron')

const THROTTLED_ENTITY_BUNDLE_COUNT = 4

const TX_TYPE_EIP_7702 = 4
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still relevant?

Copy link
Contributor Author

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
}
Copy link
Contributor

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 ?? []) {
Copy link
Contributor

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

@shahafn shahafn merged commit 1736790 into master Dec 22, 2024
4 checks passed
@shahafn shahafn deleted the AA-453-eip-7702-support branch December 22, 2024 12:17
@forshtat forshtat restored the AA-453-eip-7702-support branch December 22, 2024 12:21
@forshtat forshtat deleted the AA-453-eip-7702-support branch December 22, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants