eth-infinitism / account-abstraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sender pays more than required due to PVG calculation

novaknole opened this issue · comments

I noticed that in the calculation of "preVerificationGas", the following is executed in this package:

const ret = Math.round(callDataCost +
        ov.fixed / ov.bundleSize +
        ov.perUserOp +
        ov.perUserOpWord * lengthInWord);

Note the ov.fixed / ov.bundleSize. bundleSize is set to 1. This means that every userOp operation is setting more than required. I also understand that this package can't know in advance what the bundleSize must be, as this is dependent on the current moment of bundler.

Question 1: So does "sender" really pay for more than required just because of this or what's going on?

Question 2: Also, I'd appreciate if you could tell how you decided to use the values for "ov.perUserOp + ov.perUserOpWord * lengthInWord);"

Bundlers currently send mostly bundles of 1 op, so the user doesn't overpay on this
The overhead parameters were calculated empirically. We did submit a set of UserOps with various values of for each of the dynamic fields, to check their impact on gas usage.
We need to add the above test to the gas calculation

Thanks for the answer @drortirosh .

Is there any reason why bundlers only send 1 op ? handleOps definitely can receive an array. Just curious why they send only 1.

@drortirosh I also noticed that "verificationGasLimit" is calculated as: 10000 + deploymentOfInitCode. I wonder the hard decoded value of 10000, where does it come from ?

https://docs.stackup.sh/docs/useroperation-gas-values the article here says that verificationGasLimit is for initCode + validateUserOp + validatePaymasterUserOp + paymasterPostOp. How come 10000 would be enough for validateUserOp + validatePaymasterUserOp + paymasterPostOp ? no chance. Thoughts ?

Hello @drortirosh,
I would also be interested in why bundlers are sending only one op? Wouldn't bundling more of them together lower the fees for everyone?

Best regards

Yes, but currently the load is low, and waiting for more UserOps would make a delay.