Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[abstraction] Add support for AccountAbstraction #622

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

GhostWalker562
Copy link
Contributor

Description

This pull request introduces several new features and improvements related to account abstraction. The changes include adding new examples, new tests, and updating core account classes to support account abstraction.

  • Added support for AbstractedAccount which enables signing AA transactions using a custom signer
  • Added support for account.abstraction namespace which supports basic authentication function apis including adding functions, removing functions, and checking for whether functions exist.
  • Added E2E test suite
  • Added E2E examples

Test Plan

  • tests/e2e/abstraction.test.ts
  • enable and disable account abstraction
  • enable account abstraction, send a transaction, and disable all account abstraction
  • enable custom account abstraction, send a transaction with custom signer, and send a transaction with an invalid signer

Related Links

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

@GhostWalker562 GhostWalker562 requested a review from a team as a code owner January 28, 2025 01:56
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 65d541a to 4a6ea55 Compare January 28, 2025 02:03
Copy link

@lightmark lightmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm in general.
Just 2 cents:

  1. serialize fixed bytes for authenticator?
  2. verify sdk for permissioned delegation works.

src/account/AbstractedAccount.ts Show resolved Hide resolved
src/internal/abstraction.ts Outdated Show resolved Hide resolved
src/account/AbstractedAccount.ts Outdated Show resolved Hide resolved
src/transactions/authenticator/account.ts Show resolved Hide resolved
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch 3 times, most recently from f77d79e to 5645212 Compare January 31, 2025 03:41
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch 2 times, most recently from 99176a8 to 538bc15 Compare January 31, 2025 20:56
@networkdm
Copy link

networkdm commented Feb 3, 2025

Hi @GhostWalker562, I'm getting the error Failed to deserialize input into SignedTransaction: unexpected end of input when running examples and tests. This is happening with version 1.26, deployed on both Devnet and Testnet. Or should I run a local node?

My Aptos CLI version is 6.0.2.

  ● abstraction api › enable account abstraction, send a transaction, and disable all account abstraction › should be able to send a transaction using acount abstraction

    AptosApiError: Request to [Fullnode]: POST https://api.devnet.aptoslabs.com/v1/transactions (trace_id:53a3e82172ae45fac8b89f21eaba68c6) failed with: {"message":"Failed to deserialize input into SignedTransaction: unexpected end of input","error_code":"invalid_input","vm_error_code":null}

      117 |   // We have to explicitly check for all request types, because if the error is a non-indexer error, but
      118 |   // comes from an indexer request (e.g. 404), we'll need to mention it appropriately
    > 119 |   throw new AptosApiError({ apiType, aptosRequest: aptosRequestOpts, aptosResponse });
          |         ^
      120 | }
      121 |

      at aptosRequest (src/client/core.ts:119:9)
      at submitTransaction (src/internal/transactionSubmission.ts:327:22)
      at Object.<anonymous> (tests/e2e/api/abstraction.test.ts:89:19)

@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 538bc15 to f699520 Compare February 3, 2025 03:53
@GhostWalker562
Copy link
Contributor Author

@networkdm Sorry pushed a small issue with network deserialization late last week. Reverted that change and everything should work normally now

Copy link

@lightmark lightmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the example is confusing.

tests/e2e/api/abstraction.test.ts Show resolved Hide resolved
tests/e2e/api/abstraction.test.ts Outdated Show resolved Hide resolved
tests/e2e/api/abstraction.test.ts Outdated Show resolved Hide resolved
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch 2 times, most recently from ee16ab0 to ab073ef Compare February 4, 2025 18:27
@networkdm
Copy link

@GhostWalker562 Suddenly aptos.fundAccount is not working. I still can fund account using aptos account fund-with-faucet command on Devnet and test cases pass with manually funded accounts though.

@GhostWalker562
Copy link
Contributor Author

@networkdm The devnet indexer is currently down which fundAccount relies on for awaiting transaction confirmations. I believe it's being worked on to bring it back up

@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 5648bb3 to 0724dd2 Compare February 5, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants