Closed spacesailor24 closed 1 month ago
Using the cli, I created a new project using ethersv5 and it doesn't seem to be an issue anymore
hey @spacesailor24 this might be related to the cache that ethers v6 has implemented by default. This has been mentioned across different issues (example here. Please try disabling the cache by initialising your provider this way:
const provider = new Provider(url, undefined, {cacheTimeout: -1});
Closing due to staleness.
🐛 Bug Report for zkSync CLI
📝 Description
There seems to be some sort of delay between a transaction that transfers ETH being included in a block, and the ETH balance of the receiving account being update and queryable via
provider.getBalance
-tx.wait
doesn't seem to have an affect🔄 Reproduction Steps
I've created a minimal reproduction repo here
🤔 Expected Behavior
After doing:
The
console.log
ed value should immediately be1000000000000000000n
😯 Current Behavior
The immediate
console.log
(and many after) log0n
, after sometimegetBalance
finally returns the expected incremented balance for the receiver🖥️ Environment
1.5.1
v20.11.1
pnpm 8.15.4
macOS Sonoma 14.3.1
📋 Additional Context
See reproduction repo