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

Improve fee payer txn submission APIs #522

Merged
merged 16 commits into from
Oct 4, 2024
Merged

Conversation

heliuchuan
Copy link
Contributor

@heliuchuan heliuchuan commented Oct 2, 2024

Description

This simplifies the fee payer APIs by reducing the steps needed to submit such a transaction while still maintaining support for remote signing.

Now the txn may be submitted either on the fee payer side or the sender side.

This also improves the keyless experience as proofs may be fetched asynchronously, in those cases since submission is an async function where we can await the proof fetch.

Test Plan

Tested via sponsored txn example.

More tests in progress

Related Links

@heliuchuan heliuchuan requested a review from a team as a code owner October 2, 2024 22:22
Copy link
Collaborator

@0xmaayan 0xmaayan left a comment

Choose a reason for hiding this comment

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

Have you seen this PR? following upcoming changes to the framework
#467

@heliuchuan
Copy link
Contributor Author

Have you seen this PR? following upcoming changes to the framework #467

I have but is it relevant to this PR? doesn't seem so afaict

@heliuchuan heliuchuan requested a review from 0xmaayan October 3, 2024 06:02
Copy link
Contributor

@GhostWalker562 GhostWalker562 left a comment

Choose a reason for hiding this comment

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

Looks good, seems to miss one condition though.

  1. signAndSubmitTransaction -> sender: Account, feePayer: Account (1 step sign)
  2. signAndSubmitTransaction -> sender: Account, feePayer: AccountAuthenticator (2 step sign)
  3. signAndSubmitAsFeePayer -> sender: AccountAuthenticator, feePayer: Account (2 step sign)
  4. (Missing) signAndSubmitAsFeePayer -> sender: Account, feePayer: Account (1 step sign)

tests/e2e/transaction/transactionSubmission.test.ts Outdated Show resolved Hide resolved
tests/e2e/transaction/transactionSubmission.test.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

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

KeylessAccountCommon seems like the wrong name for that interface, and it's a little weird of functionality here

examples/typescript/simple_sponsored_transaction.ts Outdated Show resolved Hide resolved
src/account/MultiKeyAccount.ts Outdated Show resolved Hide resolved
src/api/transaction.ts Show resolved Hide resolved
@heliuchuan
Copy link
Contributor Author

  1. (Missing) signAndSubmitAsFeePayer -> sender: Account, feePayer: Account (1 step sign)

I figure that this doesn't make sense. If you are submitting as the fee payer you don't have access to the sender account and the sender ought to send you an authenticator that's valid for sponsorship.

Additionally the case is covered by the usual signAndSubmitTransaction.

src/account/MultiKeyAccount.ts Outdated Show resolved Hide resolved
src/api/transaction.ts Show resolved Hide resolved
@heliuchuan heliuchuan merged commit fe2ea74 into main Oct 4, 2024
8 checks passed
@heliuchuan heliuchuan deleted the add-sign-as-fee-payer branch October 4, 2024 22:16
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