Consensys / truffle-security

MythX smart contract security verification plugin for Truffle Framework
https://mythx.io
124 stars 28 forks source link

Inconsistent Timeouts #98

Closed nbanmp closed 5 years ago

nbanmp commented 5 years ago

Sometimes analysis times out before it reaches the specified --timeout duration.

━┫ truffle run verify Vulnerable --timeout 30
Vulnerable |*********                               | 23% || Elapsed: 6.7s ✗ timeout

These smart contracts were unable to be analyzed: Vulnerable
Internal MythX errors encountered:
Vulnerable: Timeout reached after 30 seconds. The analysis job status is queued and the result may become available later. UUID: c9095e6a-dfb5-4b91-b019-3fe863f4f3a4

Analysis running significantly longer than the default timeout duration has also been reported.

tagomaru commented 5 years ago

see https://github.com/ConsenSys/armlet/pull/88

I think this occured because armlet did not use initialDelay to wait for first polling. armlet uses initialDelay which is set at https://github.com/ConsenSys/armlet/blob/c12a62be790cb88be637fb97b8743f0ad956af52/index.js#L126.

If you set 30sec to timeout, remainTime was unfortunatelly 0 according to this logic since 30(timeout which you set) - 45(determined initialDelay) is negative number....

However this was fixed at https://github.com/ConsenSys/armlet/pull/88 .

rocky commented 5 years ago

@nbanmp please double check this works for you and then close if satisfied.

nbanmp commented 5 years ago

It seems to work.