Open bropoCorpd opened 1 year ago
Your trace is hitting the max string length size JavaScript can handle.
Ganache has heuristic protections to try to prevent this, but sometimes it's not enough. I have a PR open to work around this Node.js limitation (https://github.com/trufflesuite/ganache/pull/3997) but we haven't had time to review it before merging it yet.
Currently we just check if the number is steps in the transaction is greater than 100000. If it is, we transmit the trace piece by piece instead of all in one blob. You might be able to try modifying the transaction to ensure it runs at least 100000 steps by throwing a big loop in to your code.
You can also try checking out that PR's branch and building it yourself, but I suspect the truffle debugger and remix will both choke on it (since they are both JS and will probably attempt to read the JSON as a string before parsing). I do have a truffle branch that makes the debugger work with these giant traces, but it was just experimental and be a lot more work: https://github.com/trufflesuite/truffle/commits/fix/streaming-web3-http-provider.
thanks alot for your answer, after searching thoroughly i did find one of your posts mentioning the 10000 limit in the connector, i'll take a look, but i guess my only option would be to make alot of unit tests to test every piece separately, thanks again, and i'll take a look at the truffle branch.
EDIT : for those who need to debug but cannot with remix like me, i found a workaround, you can use ganache console.log alongside truffle console logging, and you can just do console.log in your solidity code...it's amazing i don't really need to debug anymore, i also use unit tests, i have split my code into tiny function calls and i do chai unit tests on them using truffle testing.
i connect remix to my ganache instance with these parameters : package.json
then i connect remix to ganache, and when i try to debug a transaction created in my migrations file, i get this error:
if i run truffle debug 0x1854e0c32a07ca85a15cbb6576e22c244da4b9d8131b81dc082442b0181db4de i get this instead :
i tried upping my node heap size limit by putting into my bashrc export NODE_OPTIONS=--max-old-space-size=4096, but i cannot debug my transaction at all. if anyone has an idea on how to fix this, it would be really appreciated, thanks