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

Gas Metering for Deployment & Token Operation #175

Merged
merged 62 commits into from
Dec 21, 2023
Merged

Gas Metering for Deployment & Token Operation #175

merged 62 commits into from
Dec 21, 2023

Conversation

remedcu
Copy link
Member

@remedcu remedcu commented Nov 29, 2023

To Do:

  • Tests within 4337 folder for checking gas usage.
  • Alchemy Based Gas Usage for Safe 4337 (Paymaster with/out Gas Policy).
  • Pimlico Based Gas Usage for Safe 4337 (Paymaster with/out Gas Policy).
  • Gelato Based Gas Usage for Safe 4337 (With 1Balance).
  • Detailed analysis of Gas for each section of the TX Lifecycle.

Closes #170

@remedcu remedcu self-assigned this Nov 29, 2023
@coveralls
Copy link

coveralls commented Nov 30, 2023

Pull Request Test Coverage Report for Build 7287608968

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 13.547%

Totals Coverage Status
Change from base Build 7287161487: 0.0%
Covered Lines: 33
Relevant Lines: 282

💛 - Coveralls

@nlordell
Copy link
Collaborator

For the paymaster, do you think it would be possible to vendor the Pimlico and Alchemy paymaster code into the repo? Would make future tests (including paymasters) easier to compute.

@remedcu
Copy link
Member Author

remedcu commented Nov 30, 2023

I won't suggest adding those codes as it uses "type": "module" for package.json, which is not compatible with our current setup.

@nlordell
Copy link
Collaborator

I won't suggest adding those codes as it uses "type": "module" for package.json, which is not compatible with our current setup.

Would it work if we just imported the contracts and not the JS source (assuming they build with Solidity v0.8.23)?

@remedcu
Copy link
Member Author

remedcu commented Nov 30, 2023

It is done purely with Typescript and onchain deployed contracts.

Most of the code taken from: https://github.com/schmanu/poc-safe-erc20-paymaster

@remedcu remedcu marked this pull request as ready for review December 4, 2023 09:18
@remedcu remedcu requested a review from a team as a code owner December 4, 2023 09:18
Copy link
Member

@mmv08 mmv08 left a comment

Choose a reason for hiding this comment

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

A question:

I wanted to compare the numbers to https://github.com/zerodevapp/aa-benchmark/pull/10/files, but I found no transfer benchmarks without a paymaster and not while deploying. Should we implement that, or perhaps I just looked at the wrong place?

@remedcu
Copy link
Member Author

remedcu commented Dec 18, 2023

I wanted to compare the numbers to https://github.com/zerodevapp/aa-benchmark/pull/10/files, but I found no transfer benchmarks without a paymaster and not while deploying. Should we implement that, or perhaps I just looked at the wrong place?

I believe you are asking for this one: https://github.com/safe-global/safe-modules/blob/gas-metering/4337/test/gas/Gas.spec.ts#L137

For deployment and operations without paymaster, that is implemented within this folder: https://github.com/safe-global/safe-modules/tree/gas-metering/4337/test/gas

@mmv08
Copy link
Member

mmv08 commented Dec 18, 2023

I wanted to compare the numbers to https://github.com/zerodevapp/aa-benchmark/pull/10/files, but I found no transfer benchmarks without a paymaster and not while deploying. Should we implement that, or perhaps I just looked at the wrong place?

I believe you are asking for this one: https://github.com/safe-global/safe-modules/blob/gas-metering/4337/test/gas/Gas.spec.ts#L137

For deployment and operations without paymaster, that is implemented within this folder: https://github.com/safe-global/safe-modules/tree/gas-metering/4337/test/gas

Are the results written down somewhere?

@remedcu
Copy link
Member Author

remedcu commented Dec 18, 2023

Right now on the first comment of this PR: #175 (comment)

But once I change to v0.2 of Module for the paymaster once as well, will have all the gas values in the README, like this: https://github.com/safe-global/safe-modules/tree/gas-metering/4337-gas-metering

@nlordell
Copy link
Collaborator

It would be nice to setup some CI for the gas-metering workspace package. In particular, just doing:

  • Prettier formatting check
  • ESLint check
  • TSC compile check

Not blocking the PR though.

@remedcu remedcu requested a review from nlordell December 21, 2023 11:38
Copy link
Collaborator

@nlordell nlordell left a comment

Choose a reason for hiding this comment

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

LGTM

@remedcu remedcu merged commit 1298321 into master Dec 21, 2023
8 checks passed
@remedcu remedcu deleted the gas-metering branch December 21, 2023 12:08
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gas Metering Analysis for ERC-4337 Module
4 participants