safe-global / safe-modules

A collection of modules that can be used with the Safe contract
GNU Lesser General Public License v3.0
151 stars 74 forks source link

Gas Metering ERC20 Paymaster Script Sometimes Fails #480

Open nlordell opened 3 months ago

nlordell commented 3 months ago

Description

Originally posted in https://github.com/safe-global/safe-modules/pull/478#pullrequestreview-2232514117

The ERC20 paymaster gas metering script does not always fund enough. In particular, it funds the account with 1.0 USDC, but in a recent run, the paymaster required a debit of ~1.8 USDC.

We should change the metering script to be more resilient to changing gas prices and potentially fund the contract more when needed.

mmv08 commented 3 months ago

I wanted to do this the last time I worked on benchmarking, but there was no method in Pimlico API for this. I didn't want to spend much time on it and haven't looked into how exactly Pimlico calculates the fee, and they didn't get back to my question: https://5afe.slack.com/archives/C05JA2HFQ1J/p1716898280881779

This may be a little effort because you'll have to read the source code. (Also we don't really run benchmarks that often so maybe a configuration option is sufficient)

remedcu commented 3 months ago

(Also we don't really run benchmarks that often so maybe a configuration option is sufficient)

+1