pimlicolabs / alto

A performant, reliable, and type-safe ERC-4337 Bundler written in Typescript
https://docs.pimlico.io/reference/bundler
GNU General Public License v3.0
152 stars 34 forks source link

Running Alto in Prod #215

Open Brianspha opened 3 months ago

Brianspha commented 3 months ago

Hello,

I would like to ask if it's advisable to run Alto in production using the unsafe mode, I'm asking because we have been trying to get Alto to work by sending mint operation using the lightAccount but the bundler seems to revert it only works in unsafe mode is there something I'm doing wrong?

e.g. callData

  const callData = await lightAccount.encodeCallData({
    to: deployments.TestToken,
    data: encodeFunctionData({
      abi: ERC20_ABI,
      args: [
        lightAccount.address,
        new BigNumber(2).multipliedBy(10 ** 18).toFixed(0),
      ],
      functionName: "mint",
    }),
    value: 0n,
  });

Then we use a paymaster the estimateUserOperationGas endpoint manages to estimate gas but when we send the user operation we get issues the bundler errors out with a response

{"message":"Cannot read properties of undefined (reading 'slice')"}

kristofgazso commented 3 months ago

hey! thanks for this — do you know where that error gets thrown?

Brianspha commented 3 months ago

Hey @kristofgazso right here: https://github.com/pimlicolabs/alto/blob/main/src/rpc/validation/SafeValidator.ts#L391

Brianspha commented 3 months ago

@kristofgazso any updates on this?