matter-labs / era-test-node

In-memory node that can be used for integration testing and debugging.
https://matter-labs.github.io/era-test-node
Apache License 2.0
308 stars 75 forks source link

gas estimation error while deploying smart accounts using default node #347

Open sarahschwartz opened 2 weeks ago

sarahschwartz commented 2 weeks ago

πŸ› Bug Report for zkSync Era In-Memory Node

πŸ“ Description

Trying to deploy a smart account to a local node with era_test_node only works by forking the sepolia testnet first when using the latest hardhat plugin. Running the standard node results in an error estimating gas:

Error: execution reverted: Deployment failed (payload={ "id": 3, "jsonrpc": "2.0", "method": "zks_estimateFee", "params": [ { "data": "0x76fb8b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a192369cb8e3c45eabec4750d8673d084e996fc000000000000000000000000a34a855daabd08b7e716bca0ab92ff44e47ad1d7", "from": "0xbc989fde9e54cad2ab4392af6df60f04873a033a", "to": "0x9c1a3d7c98dbf89c7f5d167f2219c29c2fe775a7" } ] }, error={ "code": 3, "data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000114465706c6f796d656e74206661696c6564000000000000000000000000000000", "message": "execution reverted: Deployment failed" }

πŸ”„ Reproduction Steps

  1. Clone this repo: https://github.com/dutterbutter/min-custom-aa & install deps
  2. Start a local node with era_test_node run
  3. Add a .env file and add the private key of a pre-configured rich wallet.
  4. Change the default network to inMemoryNode in the hardhat config.
  5. Update the provider url in deploy/deploy-multisig.ts to point to the local node (http://127.0.0.1:8011).
  6. Run bun run compile
  7. Run bun hardhat deploy-zksync --script deploy-factory.ts
  8. Add the deployed factory address to deploy/deploy-multisig.ts
  9. Run bun hardhat deploy-zksync --script deploy-multisig.ts

πŸ€” Expected Behavior

The script should succeed and deploy a new instance of a smart account using the factory.

😯 Current Behavior

The last script will fail with the error above.