-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Anvil Write Performance Issue #4399
Comments
could you perhaps prepare a repro for this? |
Can try. What's best way to do this? |
smol repository with an example that I can just run via my js skills are incredibly limited so support on this would speed up debugging immensely. |
Let me know if you need assistance in running the test |
@mattsse hey folks! faced the same issue there. Do you have any updates or maybe config recommendations to speedup the node? Thank you! |
I think this issue is related as well #7631 |
@PhilippLgh from what I can tell there is no perf issue with Anvil here, the bottleneck looks to be ethers library, code here for (const [numbersA, numbersB] of testData) {
console.log('write data chunk', i++, numbersA.length, 'after', Date.now()-t0, 'ms')
tx = await contract.writeData(numbersA, numbersB)
await tx.wait()
} blocks at some point in fetch("http://localhost:8543", {
method: "POST",
body: JSON.stringify({
method: "eth_getTransactionReceipt",
params: [hash],
id: 1,
jsonrpc: "2.0"
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
}
})
.then((response) => response.json())
.then((json) => console.log(json)); to make sure receipts are properly retrieved and your test went really fast (see output below) What's likely to happen here is ethers-io/ethers.js#4224 and a possible fix in ethers ethers-io/ethers.js#4229 Wonder if you could retest this given this info, thank you
|
Closing this per comment above, likely related to ethersjs wait lock. Please reopen if you still see the issue after updating test driver. Thank you! |
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (e2fa2b5 2023-02-19T00:05:02.282096Z)
What command(s) is the bug in?
No response
Operating System
None
Describe the bug
Anvil seems to have big performance issues when lots of data are written:
Test Contract
Writing Data in chunks of 150 + 150 uint
Result console.log output
Subsequent writes on same node will be incredibly slow and node needs to be restarted.
The text was updated successfully, but these errors were encountered: