Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node is really slow to process transactions after fork #138

Open
MexicanAce opened this issue Sep 27, 2023 · 1 comment
Open

Node is really slow to process transactions after fork #138

MexicanAce opened this issue Sep 27, 2023 · 1 comment
Labels
bug 🐛 Something isn't working medium 🚩 Indicates moderately difficult item p3 🔵 Indicates low priority item

Comments

@MexicanAce
Copy link
Collaborator

🐛 Bug Report for zkSync Era In-Memory Node

📝 Description

After starting up the node with era_test_node fork testnet, deploying a smart contract and processing transactions seem to be really slow (6+ seconds). Even the make test-e2e command practically times out attempting to mine 100 blocks.

🔄 Reproduction Steps

  1. Run era_test_node fork testnet
  2. Run make test-e2e
  3. Wait until it finishes

🤔 Expected Behavior

This should be almost as fast as era_test_node run, and complete all end-to-end tests in less than 2 seconds.

😯 Current Behavior

make test-e2e takes 11+ seconds just for two tests, and times out when attempting to mine too many blocks.

📎 Log Output

$ hardhat test --network zkSyncTestnet


  evm_mine
    ✔ Should mine one block (6256ms)

  evm_increaseTime
    ✔ Should increase current timestamp of the node (5142ms)

  evm_setNextBlockTimestamp
    ✔ Should set current timestamp of the node to specific value (2909ms)

  evm_setTime
    ✔ Should set current timestamp of the node to specific value (2890ms)

  hardhat_setBalance
    ✔ Should update the balance of an account (118ms)

  hardhat_setNonce
    ✔ Should update the nonce of an account (650ms)

  hardhat_mine
^C
@MexicanAce MexicanAce added bug 🐛 Something isn't working p2 🟡 Indicates moderately high priority item medium 🚩 Indicates moderately difficult item p3 🔵 Indicates low priority item and removed p2 🟡 Indicates moderately high priority item labels Sep 27, 2023
@nbaztec
Copy link
Contributor

nbaztec commented Oct 5, 2023

I looked into it and it seems in fork mode, there are many storage read calls that are made (which isn't done on the run mode) especially during block creation/mining. As of now I do not see how to not have this behavior (with the exception of pre-fetching the entire state). Caching will not help since most of these storage keys are only requested once but there are ~20 of those and each is a network call.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working medium 🚩 Indicates moderately difficult item p3 🔵 Indicates low priority item
Projects
None yet
Development

No branches or pull requests

2 participants