uport-project / uport-identity

uPort Contracts for managing identity DEPRECATED
Apache License 2.0
210 stars 68 forks source link

Declare a specific choice for the IdentityManager constants #92

Closed oed closed 6 years ago

oed commented 7 years ago

fix #62

We choose the constants in IdentityManager and MetaIdentityManager to be:

Constant Value
_userTimeLock 3600 (1 hour)
_adminTimeLock 129600 (1.5 days)
_adminRate 1200 (20 minutes)

Rationale as from doc:

These values gives an OlderOwner the ability to recover from a stolen recoveryKey. If a stolen recoveryKey is used to add a user, that user will be able to transact from the proxy after 1 h, but won't be able to remove other users etc until 1.5 days have passed. An adminRate of 20 minutes gives the admin enought time to first remove the stolen recoveryKey and then remove the malicious owner added by the stolen recoveryKey before the new owner will become an OlderOwner. The adminRate simply limits the amount of "admin actions" an OlderOwner can make in a given time period. So for example if the OlderOwner adds a new owner, it can't remove that owner until adminRate has passed. The recoveryKey is also affected by this rate and can only add new owners at a rate of adminRate.

maurelian commented 6 years ago

I would expect these to change as well, no?

https://github.com/uport-project/uport-identity/blob/release/2.0.0/migrations/2_deploy_identity_managers.js#L6-L8

This also suggests that no tests were done with non-zero timelock values.

oed commented 6 years ago

@maurelian Yep, they should be changed. Tests are done with non-zero timelocks since the contracts gets deployed in the tests with timelocks specified there.

maurelian commented 6 years ago

oh yeah. I see that here too: https://github.com/uport-project/uport-identity/blob/release/2.0.0/test/metaIdentityManager.js#L16-L18

FWIW, I also changed it so that userTimeLock > adminRate to match plans. Tests still passed.