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

Refactor how native token authentication is verified #2761

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

jvff
Copy link
Contributor

@jvff jvff commented Oct 31, 2024

Motivation

The rules for authentication to access native tokens will be changed soon to make them stricter, preventing access to the chain's balance shared by owners to be transferred by incoming messages. With the goal of making that change simpler and hopefully easier to audit, the authentication for native tokens can be centralized in a single location of the code before it is changed.

Proposal

Create new AuthenticatedAccount and AuthenticatedAccountOwner types that represent in compile time when an Account and Option<Owner> have been successfully authorized to move native tokens.

Test Plan

CI should catch any regressions.

Release Plan

  • These changes follow the usual release cycle, because they are just an internal refactor.

Links

jvff added 15 commits October 31, 2024 03:20
Represent an `AccountOwner` that has been authenticated to move funds.
Add an `AuthenticatedAccountOwner` constructor meant to be called from a
user application's execution runtime.
Create an `AuthenticatedAccountOwner` to be passed along to the system
application later.
Require authentication to be performed while still in the runtime
thread.
Add an `AuthenticatedAccountOwner` constructor meant to be called from
the system application's execution of an operation.
Perform authentication earlier in the code, preparing to pass along a
type that indicates authentication was performed.
Change the function signature so that it expects a source account that
has already been authenticated.
The authenticated version of `Account`.
Add an `AuthenticatedAccount` constructor meant to be called from a user
application's execution runtime.
Create an `AuthenticatedAccount` to be passed along to the system
application later.
Require authentication to be performed while still in the runtime
thread.
It's a bug if the authentication is not correctly checked and sent by
the system application.
Add an `AuthenticatedAccount` constructor meant to be called from the
system application's execution of an operation.
Perform authentication earlier in the code, preparing to pass along a
type that indicates authentication was performed.
Change the function signature so that it expects a source account that
has already been authenticated.
@jvff jvff added this to the Testnet #2 milestone Oct 31, 2024
@jvff jvff requested a review from ma2bd October 31, 2024 03:27
@jvff jvff self-assigned this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant