-
Notifications
You must be signed in to change notification settings - Fork 24
Debugging on a forked network #97
Comments
Hey, are you using the pre-release version of the extension from the marketplace? We have added some new features to allow forking. |
Hey, thanks for the response. I just upgraded to the new release 2.3.1. The new features are really nice, thanks for that :) The original issue still persists and there is one more thing. When I create the forked ganache using the new features it is first run without forking. Correct me if I am doing something wrong. Steps to reproduce are the following:
In the output Truffle: Ganache Server:8545 there is no mention of the fork. A workaround I found is to restart ganache. A new instance is opened with Forked Chain information. I have also tried to run deployments that refer to some deployed contracts on Rinkeby and they fail to deploy before I restart the ganache - confirming that the network is not a fork. After I reset Ganache they ran without any issues. Now back to the original issue. I have tested it with the above-mentioned Fork and Local Ganache and it still looks like on the fork it is trying to read all the blocks since block 0.
After the 5th step just take a look at the output Truffle: Ganache Server:8545 and you will see the endless eth_getBlockByNumber I can also confirm that if you use the truffle console for debugging and you load the transaction manually by its tx hash it will work properly. Anyway, it would be amazing to use the native IDE debugging that the extension offers. I'd love to hear any suggestions on how to achieve it on a forked chain. |
Hey @kulho, super sorry as it looks like this one slipped through net! Happy to help troubleshoot if it's still an issue though. Just tried the repro steps and it was looking ok on my side (tried with both a fork of rinkeby and mainnet). All looked good with both deploying and debugging the contract. Would you mind trying on the latest release of the extension ( |
Hey @kevinbluer, I just tested with the latest release and it is still not working correctly. If you do not start the Ganache instance manually - by right click start or via Truffle: Start Ganache it will not run a forked version of Ganache even though you selected it to be. Deploying to development will only launch a local network, not a fork. Scroll in your output higher and see if you get the forked info. If you try to debug the transaction on the forked chain I still get an endless "eth_getBlockByNumber" Note, in the case of a not forked network it behaves correctly. |
Hey @kulho, thanks for the follow-up and your patience while we get this resolved! Regarding the first screenshot (without starting the ganache manually - not being forked) where is that output coming from? The reason I ask is I believe if you've just added the forked network it won't have started yet. In the second screenshot, that looks correct in that you've manually started Ganache. Few thoughts though...
Regarding the other issue (if you try to debug the transaction on the forked chain I still get an endless "eth_getBlockByNumber"), I've just tried again and been able to reproduce it 🙂 Interestingly, it looks like it's the Truffle console continuously polling for it because if the console is exited then the cc @xhulz for visibility 👍 |
Also should note that I'm seeing the |
Initial response re the
Also it can be turned off by setting the
|
It is coming from the "Truffle: Ganache Server:8545" which is started by the deployment of the contract.
Either that or at least if I deploy contracts to that (added forked) network it should start the forked one and not a local one.
I have also found this but it does not change anything for me if I add it to the config. |
Hey @kulho, thanks for clarifying! @xhulz was actually able to repro ✨ and has opened an issue (#140) accordingly. We should have fix out shortly 🙂 Re Thanks again! |
Hey @kevinbluer, thanks for your support. I made a giff to better illustrate what I am doing :) It kinda has 2 parts: |
Awesome, thanks for recording that @kulho (and likewise thanks so much for the support). Re the first one, it's already cued up for the next sprint so all good there 👌 Re the second and debugging on the fork, I'm able to repro myself too (the gif definitely helped so thanks again for that). I'll relay to the team and we'll aim to come back with an ETA for a fix shortly. |
No problem, glad to be of help. There is one offtopic regarding the debugging features I would like to ask. Are you planning to or have you implemented the "fetch external sources" option for the native vs code debugger as well? That would be amazing. I am referring to this feature of the truffle debugger https://trufflesuite.com/blog/debugging-verified-external-contracts-with-truffle-debugger/ |
Awesome suggestion @kulho and it's something we've actually talked about implementing! Any interest in creating a new issue for it (as we don't actually have one yet)? 🙌 |
Hey @kulho! How is it going? Just a friendly reminder about the improvements:
Next release, all these fix will be available. Anyway, when we finish the last one, I let you know Cheers! |
Hey @kulho! How is it going? Just a friendly reminder about the improvements: #140 - ✅ Already done and merged Next release, all these fix will be available. Thank you so much for you contribution! cc @kevinbluer Cheers! |
Hello,
Steps to reproduce:
Behavior:
eth_getBlockByNumber goes on forever
not sure if it is trying to go through the 10M+ blocks, but it would be nice to somehow limit it or stop it and get the latest transactions.
Could anyone please advise me if there is any fix? Thank you.
Node v16.15.0
Truffle v5.5.17
Truffle for VS Code v2.2.1
ganache v7.2.0
The text was updated successfully, but these errors were encountered: