Open sohkai opened 5 years ago
@sohkai I have reviewed the items that you proposed to test and I have a few doubts:
AppProxyFactory.newPinnedAppProxy(IKernel, bytes32)
are you referring to newAppProxyPinned
?
https://github.com/aragon/aragonOS/blob/d10d195387269e8d51d0aa3e608ec44ecb9b8173/contracts/factory/AppProxyFactory.sol#L38EVMScriptRunner.protectState
, since DelegateScript and DeployDelegateScript executors removed, is it possible to change the kernel address without a malicious executor?@dapplion
Regarding
AppProxyFactory.newPinnedAppProxy(IKernel, bytes32)
are you referring tonewAppProxyPinned
?
Oops, yes! I've edited the issue :).
Regarding EVMScriptRunner.protectState, since DelegateScript and DeployDelegateScript executors removed, is it possible to change the kernel address without a malicious executor?
Not with the current set of executors, but this is something that may be possible if alternative executors get installed.
Could you provide an example of an existing test that explicitly tests a modifier as a reference?
https://github.com/aragon/aragonOS/blob/dev/test/contracts/apps/app_acl.js is a generic test against the ACL's auth
modifier, but we should also add explicit tests for those named AragonApps to make sure their authentication works as expected (especially with parameters).
Thank you so much for your answer @sohkai. I have opened a PR https://github.com/aragon/aragonOS/pull/542 testing item 2 EVMScriptRunner.protectState
. I still have doubts regarding the other items:
AppProxyFactory.newPinnedAppProxy(IKernel, bytes32)
is never called by the kernel or any contract, in contrast to AppProxyFactory.newAppProxyPinned(IKernel, bytes32, bytes)
https://github.com/aragon/aragonOS/blob/c85d34e4bae0bf5b1ab78340b32e712d895179a7/contracts/kernel/Kernel.sol#L131. The intended usage of this function is to be called directly by a user? If so, should the test just call it externally anyway without the extra steps done in the Kernel.newPinnedAppInstance
method?APMRegistry
, Repo
and EVMScriptRegistry
permissions are tested extensively in their respective test suites. I don't fully understand if you mean that those test should be extended, or do another suite of test with stubs similar to the example you provided.First of all, thanks for contributing to the tests! ❤️
AppProxyFactory.newPinnedAppProxy(IKernel, bytes32) is never called by the kernel or any contract, in contrast to AppProxyFactory.newAppProxyPinned(IKernel, bytes32, bytes)
I'd say we could add a completely new test file, test/contracts/factory/app_proxy_factory.js
, and explicitly test all functionality in AppProxyFactory
by itself.
The fact that all of the functions are public is indeed a bit of an abstraction leak we didn't catch onto, and they should've been marked internal
instead (too late now to change this, for aragonOS 4).
The three mentioned contracts APMRegistry, Repo and EVMScriptRegistry permissions are tested extensively in their respective test suites. I don't fully understand if you mean that those test should be extended, or do another suite of test with stubs similar to the example you provided.
They are meant to be extended to test the permissions parameters themselves, but setting this up is a bit difficult without better tooling for ACL params, so I wouldn't worry about this one too much :).
@sohkai Thanks for the recommendation. I have tested
newAppProxy(IKernel _kernel, bytes32 _appId)
and newAppProxyPinned(IKernel _kernel, bytes32 _appId)
in a new file covering the last remaining untested line. Let me know if this issue would require further actions or we should skip the auth modifiers explicit tests for now.
According to coveralls, the only file with remaining lines/branches to be tested is SafeERC20.sol I see you discussing coverage decrease in https://github.com/aragon/aragonOS/pull/541, may it be that SafeERC20.sol should be ignored for coverage?
Ahhh good point! It was once ignored in coverage due to solidity-coverage not supporting some assembly opcodes, but this has been fixed and we should increase the coverage of SafeERC20 too!
@sohkai I have written extra test to cover SafeERC20
and get coverage to 100.00%. However, the Travis build on my fork's branch completes the coverage step successfully https://travis-ci.com/dapplion/aragonOS/builds/125316450 but on Aragon's repo it doesn't. The error is:
Writing artifacts to ./build/contracts
Instrumenting ./coverageEnv/contracts/acl/ACL.sol
Skipping instrumentation of ./coverageEnv/contracts/acl/ACLSyntaxSugar.sol
Instrumenting ./coverageEnv/contracts/acl/IACL.sol
Cleaning up...
There was a problem instrumenting ./coverageEnv/contracts/acl/IACL.sol: TypeError: Cannot read property 'stop' of null
Exiting without generating coverage...
npm ERR! code ELIFECYCLE
Do you have any clue on what might be the issue?
@dapplion It's a bug coming from solidity-parser-antlr which should be fixed in solidity-coverage 0.6.5
. Maybe a lower version is cached here?
@cgewecke Bumped the version of solidity-coverage
to 0.6.7
and fixed the problem. Thank you for your insight!
A few items left from the test suite advisory:
AppProxyFactory. newAppProxyPinned(IKernel, bytes32)
EVMScriptRunner.protectState
modifierAPMRegistry
,Repo
,EVMScriptRegistry
)