aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Aptos Framework][Account] added rotation capability offer and revoke functions

Open 0xchloe opened this issue 3 years ago • 2 comments

Description

  • added offer_rotation_capability function to allow an account owner to delegate their rotation capability to another account
  • added revoke_rotation_capability function to allow an account owner to revoke their rotation capability offer to the to_be_revoked_address
  • added struct RotationCapabilityOfferProofChallengeV2 for backward compatibility and deprecated the previous RotationCapabilityOfferProofChallenge
  • changed the more ambiguous EACCOUNT_DOES_NOT_EXIST error in capability-related functions to either EOFFERER_ADDRESS_DOES_NOT_EXIST or ERECIPIENT_ADDRESS_DOES_NOT_EXIST
  • changed ENO_SUCH_SIGNER_CAPABILITY error to the more accurate naming ENO_SUCH_SIGNER_CAPABILITY_OFFER
  • changed sequence number for harness.new_account_with_key_pair() from 10 to 0, so if other devs are trying to generate a valid signature for unit test purpose, they don't have to manually change the sequence number from 10 to 0.

Test Plan

unit & e2e tests


This change is Reviewable

0xchloe avatar Sep 14 '22 20:09 0xchloe

  1. I don't see any function using RotationCapability to rotate the auth key. we should add these delegation&revoking after the capability is used somewhere.

  2. another issue is rotation capability delegation on resource account, If we allow another account to rotate the auth_key. The resource account can be controlled by both signer capability and an auth_key that seems against the resource account original design.

  3. we probably don't want the rotation capability delegation on resource account, which could be achieved by signer_cap delegation.

areshand avatar Oct 05 '22 21:10 areshand

@chloeqjz / @alinush is the current plan to wait until we have the new domain separation?

yes! we communicated on slack

0xchloe avatar Oct 28 '22 17:10 0xchloe

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

github-actions[bot] avatar Jan 16 '23 02:01 github-actions[bot]