eth-infinitism / bundler

GNU General Public License v3.0
334 stars 221 forks source link

Trying to deployFactory getting data,slice is not a function #187

Closed sdelvalle57 closed 6 months ago

sdelvalle57 commented 9 months ago

Im trying to run yarn run runop --deployFactory --network http://localhost:8545/ --entryPoint 0x0000000071727De22E5E9d8BAf0edAc6f37da032 using hardhat node, Im already running the bundler with yarn run bundler --unsafe, with a successful response:

command-line arguments:  {
  config: './localconfig/bundler.config.json',
  auto: false,
  unsafe: true
}
Merged configuration: {"port":"3000","entryPoint":"0x0000000071727De22E5E9d8BAf0edAc6f37da032","unsafe":true,"conditionalRpc":false,"minStake":"1","minUnstakeDelay":0,"gasFactor":"1","network":"http://127.0.0.1:8545","beneficiary":"0xd21934eD8eAf27a67f0A70042Af50A1D6d195E81","minBalance":"1","mnemonic":"./localconfig/mnemonic.txt","maxBundleGas":5000000,"autoBundleInterval":3,"autoBundleMempoolSize":10}
url= http://127.0.0.1:8545
== debugrpc was undefined
deployed EntryPoint at 0x0000000071727De22E5E9d8BAf0edAc6f37da032
url= http://127.0.0.1:8545
signer 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 balance 9999.599134268547385368
Bundle interval (seconds) 3
connected to network { name: 'unknown', chainId: 31337 }
running on http://localhost:3000/rpc

but when I try running yarn run runop --deployFactory --network http://localhost:8545/ --entryPoint 0x0000000071727De22E5E9d8BAf0edAc6f37da032 I get:

url= http://localhost:8545/
using account index= 1709766455411
account address 0x31268cc0Dac36f67e28D7712e9bAD40c32D532Ee deployed= false bal= 0.0
funding account to 5268632172000000
data= 0xb0d691fe
Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":43,\"error\":{\"message\":\"data.slice is not a function\"}}", error={}, requestBody="{\"method\":\"eth_sendUserOperation\",\"params\":[{\"sender\":\"0x31268cc0Dac36f67e28D7712e9bAD40c32D532Ee\",\"nonce\":\"0x0\",\"factory\":\"0x12a4F339F74c08F23D8033dF4457eC253DC9AdC0\",\"factoryData\":\"0x5fbfb9cf000000000000000000000000ae72a48c1a36bd18af168541c53037965d26e4a80000000000000000000000000000000000000000000000000000018e1605b073\",\"callData\":\"0xb61d27f600000000000000000000000031268cc0dac36f67e28d7712e9bad40c32d532ee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004b0d691fe00000000000000000000000000000000000000000000000000000000\",\"callGasLimit\":\"0x5601\",\"verificationGasLimit\":\"0x42dc1\",\"maxFeePerGas\":\"0x7f371436\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"preVerificationGas\":\"0xaf54\",\"signature\":\"0x3fa5bb68da08729b8c67a5651d2b514e1093ed97c194edf8060bd811475a37677706df5ba898072d75c1540d5e1e4bb2e71d6e9bec77a192759033c294369bd91b\"},\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\"],\"id\":43,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:3000/rpc", code=SERVER_ERROR, version=web/5.7.1)
    at Logger.makeError (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at /home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/src.ts/index.ts:341:28
    at step (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.next (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:14:53)
    at fulfilled (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  reason: 'processing response error',
  code: 'SERVER_ERROR',
  body: '{"jsonrpc":"2.0","id":43,"error":{"message":"data.slice is not a function"}}',
  error: Error: data.slice is not a function
      at getResult (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:142:28)
      at processJsonFunc (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/src.ts/index.ts:383:22)
      at /home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/src.ts/index.ts:320:42
      at step (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:33:23)
      at Object.next (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:14:53)
      at fulfilled (/home/santiago/projects/erc4337/bundler/node_modules/@ethersproject/web/lib/index.js:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
    code: undefined,
    data: undefined
  },
  requestBody: '{"method":"eth_sendUserOperation","params":[{"sender":"0x31268cc0Dac36f67e28D7712e9bAD40c32D532Ee","nonce":"0x0","factory":"0x12a4F339F74c08F23D8033dF4457eC253DC9AdC0","factoryData":"0x5fbfb9cf000000000000000000000000ae72a48c1a36bd18af168541c53037965d26e4a80000000000000000000000000000000000000000000000000000018e1605b073","callData":"0xb61d27f600000000000000000000000031268cc0dac36f67e28d7712e9bad40c32d532ee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004b0d691fe00000000000000000000000000000000000000000000000000000000","callGasLimit":"0x5601","verificationGasLimit":"0x42dc1","maxFeePerGas":"0x7f371436","maxPriorityFeePerGas":"0x59682f00","preVerificationGas":"0xaf54","signature":"0x3fa5bb68da08729b8c67a5651d2b514e1093ed97c194edf8060bd811475a37677706df5ba898072d75c1540d5e1e4bb2e71d6e9bec77a192759033c294369bd91b"},"0x0000000071727De22E5E9d8BAf0edAc6f37da032"],"id":43,"jsonrpc":"2.0"}',
  requestMethod: 'POST',
  url: 'http://localhost:3000/rpc'
}
drortirosh commented 8 months ago

not sure what the problem is. just cloned the repo from scratch, and did yarn preprocess, and in 3 windows yarn hardhat-node, yarn bundler, yarn runop --deployFactory (the other params are the defaults)

Maybe it has to do with your node version? worked with v20.11.1 for me.