Open ChiHaoLu opened 1 week ago
Couple of things here:
maxFeePerGas
and maxPriorityFeePerGas
values when estimating. Since those impact PVG its recommended that they don't change between estimation and submission.I know all of things you mentioned. But the problem is that the responded PVG is rational or not. It is much higher than other chains.
Below example is my latest userOp which sent successfully on OP mainnet.
The PVG (responded by bundler) is 0x21ea868
(= 35,563,624
), the total cost for userOp sender is 0x28515a648335
(= 0.000044329873998645
ETH).
[JsonRpcProvider][eth_estimateUserOperationGas][request] {"jsonrpc":"2.0","id":0,"method":"eth_estimateUserOperationGas","params":[{"sender":"0x5F890C1952e8952ACFafc829143aeEA5f2a27a5d","nonce":"0x0","callData":"0xe9ae5c5301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002600000000000000000000000005f890c1952e8952acfafc829143aeea5f2a27a5d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000184d64db8fc00000000000000000000000092c6e5d5ceb3e069abe4b58caae0d850ae40e51c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000502801e794fd1b9048ec9c97fd34f62bf0488222000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a40fd8377b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000005f890c1952e8952acfafc829143aeea5f2a27a5d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092c6e5d5ceb3e069abe4b58caae0d850ae40e51c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001443f707e6b00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000002aeeb6ac7a9b98fa7a086f725df0cc10c3cbde2d00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","factory":"0x5eab992e90ce6144df8f218c359bcafa787acd85","factoryData":"0x4d44ac28000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000124cf7a1d770000000000000000000000000000000071727de22e5e9d8baf0edac6f37da0320000000000000000000000005442f6bd07b08f164a616d829dda50eae93f2dae000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a06f0c704a838d013c0dcfcd626e71908f6d7e83e73f49cb4b8086cb066aa1ba34293c23677b07a0f1df6430d796fee487e382b16155d39903b21d7d7c08d52ad749960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630000000000000000000000004d7f573039fddc84fdb28515ba20d75ef6b987ff000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000","maxFeePerGas":"0x125175","maxPriorityFeePerGas":"0x124f80","signature":"0x5442f6bd07b08f164a616d829dda50eae93f2dae000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040e6957b6184564b3c8619910d1c4814da267124d6b633ec4b6ea815b3d0a00c280556ef669e59df09d5ee03d48f76a9c2c5a927d66d51603dffc80330d3adeeef000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000005050000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000362c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a35313733222c2263726f73734f726967696e223a66616c73657d0000000000000000000000"},"0x0000000071727De22E5E9d8BAf0edAc6f37da032"]}
[JsonRpcProvider][eth_estimateUserOperationGas][response] {
"jsonrpc": "2.0",
"id": 0,
"result": {
"preVerificationGas": "0x21ea868",
"callGasLimit": "0x85bb8",
"verificationGasLimit": "0xeab91",
"paymasterVerificationGasLimit": null
}
}
[JsonRpcProvider][eth_sendUserOperation][request] {"jsonrpc":"2.0","id":0,"method":"eth_sendUserOperation","params":[{"sender":"0x5F890C1952e8952ACFafc829143aeEA5f2a27a5d","nonce":"0x0","callData":"0xe9ae5c5301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002600000000000000000000000005f890c1952e8952acfafc829143aeea5f2a27a5d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000184d64db8fc00000000000000000000000092c6e5d5ceb3e069abe4b58caae0d850ae40e51c00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000502801e794fd1b9048ec9c97fd34f62bf0488222000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a40fd8377b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000024c4d66de80000000000000000000000005f890c1952e8952acfafc829143aeea5f2a27a5d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092c6e5d5ceb3e069abe4b58caae0d850ae40e51c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001443f707e6b00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000002aeeb6ac7a9b98fa7a086f725df0cc10c3cbde2d00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","factory":"0x5eab992e90ce6144df8f218c359bcafa787acd85","factoryData":"0x4d44ac28000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000124cf7a1d770000000000000000000000000000000071727de22e5e9d8baf0edac6f37da0320000000000000000000000005442f6bd07b08f164a616d829dda50eae93f2dae000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a06f0c704a838d013c0dcfcd626e71908f6d7e83e73f49cb4b8086cb066aa1ba34293c23677b07a0f1df6430d796fee487e382b16155d39903b21d7d7c08d52ad749960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630000000000000000000000004d7f573039fddc84fdb28515ba20d75ef6b987ff000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000","callGasLimit":"0x931b0","verificationGasLimit":"0x119aae","preVerificationGas":"0x21ea868","maxFeePerGas":"0x125175","maxPriorityFeePerGas":"0x47868c00","paymasterVerificationGasLimit":"0x0","paymasterPostOpGasLimit":"0x0","signature":"0x5442f6bd07b08f164a616d829dda50eae93f2dae000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040d12e1763053d948c80ff494b5f5b5c58d84dd3a28ceb33d3f00ef275902109ce132d60711a57eb402b5564b73769fe00b9d3112f8e2b95f3fd4b45ffa73acb1d000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000005050000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a32c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a35313733222c2263726f73734f726967696e223a66616c73652c226f746865725f6b6579735f63616e5f62655f61646465645f68657265223a22646f206e6f7420636f6d7061726520636c69656e74446174614a534f4e20616761696e737420612074656d706c6174652e205365652068747470733a2f2f676f6f2e676c2f796162506578227d000000000000000000000000000000000000000000000000000000000000"},"0x0000000071727De22E5E9d8BAf0edAc6f37da032"]}
[JsonRpcProvider][eth_sendUserOperation][response] {
"jsonrpc": "2.0",
"id": 0,
"result": "0x04838cbbccca629ad6b038e2da91a1969a7f070bf2a1a3d88f7aaac190b5f9fc"
}
Besides, the responded PVG from eth_estimateUserOperationGas
is very different from the precheck
in eth_sendUserOperation
. How can I calculate a rational PVG which can make my userOp on-chain but not exceed too much?
PVG is charging for L1 DA costs in L2 gas. So if L1 costs are high, but L2 gas is low, then PVG may be a large number. But in terms of absolute cost, it should be similar to any L2 transaction (maybe slightly higher due to due PVG buffers).
Besides, the responded PVG from eth_estimateUserOperationGas is very different from the precheck in eth_sendUserOperation.
What do you mean from the precheck
?
How can I calculate a rational PVG which can make my userOp on-chain but not exceed too much?
eth_estimateUserOperationGas
with those fees and dummy signatureMy question is the precheck from here which occurs in eth_sendUserOperation
. Do you know Alchemy Bundler do a precheck in the eth_sendUserOperation
?
Error: {
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32000,
"message": "precheck failed: preVerificationGas is 1133120 but must be at least 2490360"
}
}
You can reproduce this error by:
eth_estimateUserOperationGas
and get the bundler suggests PVG (maybe a x
value).0
. eth_sendUserOperation
.y
which is totally different from the x
.Yes, I understand what you mean now. The required preVerificationGas
value changes on L2s due to changes in fees and a higher value may be required when you submit. The same suggestions from this comment apply https://github.com/alchemyplatform/rundler/issues/908#issuecomment-2468304797
Describe the bug Hi, I use the alchemy bundler on OP stack chains, but the
preVerificationGas
returned by the estimateUserOperationGas is weird.If I send this userOp to bundler, the precheck will failed due to PVG is too low.
This problem also occurs in all OP stack.
To reproduce Re-estimate the above userOp by calling Alchemy Bundler API again on OP mainnet before the block
0x79ed4e2
.Expected behavior The PVG should be lower.