Closed tagomaru closed 5 years ago
np! I look forward to the new version API !
I just moved the steps for login within analysis
function out to the new function, so I think analysis
function behavior never changed.
As I said, this change is for bug fix of truffle-security
relying on armlet
which is the problem to issue unnecessary multiple login caused by concurrency.
This change makes the bug fix of truffle-security
easier.
We need two releases.
armlet
. (This PR)truffle-security
before calling analyzeWithStatus
function. (PR for this should be sent after updating armlet
)Thx!
@rocky will send the new PR for this after #79 is handled to avoid conflict. Thx!
refer to #80
I propose to add login function in Client class for external module.
background
truffle-security
uses this package and callsanalyzeWithStatus
.https://github.com/ConsenSys/truffle-security/blob/master/helpers.js#L252
some of
analyzeWithStatus
are executed simultaneously. (concurrency) This causes sending of unnecesally login requests to Mythirl API. The reason is the below part.https://github.com/ConsenSys/armlet/blob/master/index.js#L136-L140
The first line can be true for each call from truffle-security since truffle-security calls
analyzeWithStatus
simultaneously. The evidence is the below.1. exeucte truffle-security
2. Many login requests were sent from truffle-security
countermeasure
This PR is for the countermeasure at
armlet
. I implemented login part as a new function for external module such astruffle-security
. By this,truffle-security
can call login request independent from analysis.For
truffle-security
, I will send a new PR totruffle-security
repository after confirming that this PR is mergerd and the version ofarmlet
is incremented. We have to increment the version ofarmlet
inpackage.json
oftruffle-security
before updatingtruffle-security
to avoid an error attruffle-security
side.My idea of modification of
truffle-security
is adding step 'await client.login();
' to calllogin
before callinganalyzeWithStatus
like below.https://github.com/ConsenSys/truffle-security/blob/master/helpers.js#L414-L416
Could you give me any comments? Thx!