transeptorlabs / transeptor-bundler

A lightweight ERC4337 bundler node designed specifically for Node.js environment; with a focus on minimal resource consumption, and minimal dependencies.
https://transeptorlabs.io/bundler
GNU General Public License v3.0
25 stars 3 forks source link

Preverificationgas too low #69

Open sruiz-vtn opened 1 week ago

sruiz-vtn commented 1 week ago

With local node running and bundler server running, when I try to run (npm run op) to test it, it throws an error like this: jsonrpc: "2.0" id: 44 error: { "code": -32602, "message": "preVerificationGas 46560 too low: expected at least 46836" } The problem happens in the gas.utils.ts file, calcPreVerificationGas method that it is called from ValidationService.ts Captura de pantalla 2024-09-08 a las 23 50 07

Step to reproduce and config eth-node file: Terminal 1 => npm run local-eth Terminal 2 => npm run dev Terminal 3 => npm run op

eth-node config image

And of course I already copied to .env files the needed variables.

I have reviewed every .sol and .ts files involved in the script (npm run op) and I could solve it, is this an error from the repo or I am doing something wrong? I use the address generated by hardhat and this accounts are already funded I do not know what is happening, could someone help me?? Thanks!!

V00D00-child commented 1 week ago

Hey, @sruiz-vtn there are a few errors in the script to send the userOp. The send-userOp.e2e.ts script useseth_estimateUserOperationGas to calculate the preVerificationGas and verificationGasLimit gas values which returns inaccurate values causing the userOp to fail validation.

I updated the script to use hard-coded values on a separate branch and updated the deposit values to pass sending userOp locally, but this is not ideal as we would want to the values returned from eth_estimateUserOperationGas to work properly.

sruiz-vtn commented 1 week ago

Nice!! I will test it asap.

Thanks!!!