HarryR / panautomata

Cross-chain proofs and atomic transactions
GNU General Public License v3.0
18 stars 2 forks source link

Truffle debugging is buggered #5

Open HarryR opened 6 years ago

HarryR commented 6 years ago

The truffle debugger is buggered,

Gathering transaction data...

redux-saga error: uncaught at session.saga
at session.saga 
 TypeError: Cannot destructure property `sourcePath` of 'undefined' or 'null'.
    at recordSources (/home/user/github.com/HarryR/panautomata/solidity/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:3445:36)

See:

Using truffle 5.0 ('next') prevents project from deploying (it errors out during migrations)

Truffle v4.1.13 cannot debug my stuff

Truffle v4.1.11 cannot debug my stuff due to other reasons (as per the ticket)

Truffle v4.1.10 can't debug stuff for same reason as 4.1.11

Truffle 4.1.5 cannot deploy contracts:

(node:32539) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'address' of undefined
(node:32539) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:32539) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Have to use truffle 4.1.13 because there's a bug when retrieving transaction receipts that we cannot live without, cannot use earlier versions for some reason.

I think the problem is that some of the new constructs being used by the contracts are broken with Truffle, or the newer solidity compiler is outputting a source map which is incompatible with the debugger. With Truffle 4.1.13 everything works fine, apart from debugging.

Stuff being used:

This is making it painful to develop at the moment, without the debugger - if something goes wrong it sucks to find out what's gone wrong.

HarryR commented 6 years ago

Seems like the problem is with interface being used, and abstract classes for that, which cause undefined entries to be included in the sources variable in truffle-debugger.

The solution was found on https://github.com/trufflesuite/truffle/issues/1051 - and hopefully will be included in the next version, but in the meantime the workarounds are listed on that ticket.

HarryR commented 6 years ago

Will close this issue when upstream fix is pushed through.

HarryR commented 6 years ago

The fix has been pushed through https://github.com/trufflesuite/truffle/pull/1084 - but this is on the @develop branch and I'm not sure if it'll be backported to 4.1.14 or of 5.x is in a workable state at the moment.

In the meantime the patch can be applied manually to the cli.bundled.js file, at around the 200k line offset, to get it working.

gnidan commented 6 years ago

@HarryR develop targets v4.1.x right now, so that'll go out with v4.1.14 next time we do a release.

It sounds like you've been getting familiar with the debugger. Please keep us informed as you find workarounds and/or fixes. Thanks!