Replies: 1 comment
-
|
LGTM, with few considerations:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Continuing the idea of #965 presenting the
pseudo-atomic executionworkflowMotivation
User wants to make an atomic transfer from account
Ato accountB. The flow ismlamports from Amlamports to BIdeally you would write this as
or in a more general terms:
On blockchain
Userexpects that in case any of this fails the state will not be affected/partial.Problem
Unfortunately at the moment
User'sexpectations aren't met. Partial state problem arises when, say accountBisn't delegated to ER. In that caseUserneeds to use action.The problem with
Actionsas that they may fail on Base chain and in our examples the user would have partial state.We can do better!
Wouldn't it be great if user could just write the following?
Solution
Promise(aka Callback/OnResult). To mimic the behavior the proposed API is:
Callback input payload (prepended by validator):
Same as in MIMD-0020:
Execution rules:
Callback is optional; existing behavior is unchanged when omitted.
Validator must enqueue callback execution as part of intent finalization.
If Solana status is unresolved after 60 seconds, validator must execute callback with failed timeout status.
Callback delivery is guaranteed (persisted + retried until success); callback handlers must be idempotent.
Execution rules
If single BaseAction fails - all of them fail. Hence, all of the callbacks receive Error
Callbacks are part of intent and are stored in it at the moment it will be a part of MagicContext
As result of such design all of the logic above is possible and can be defined by User's smart-contract
Beta Was this translation helpful? Give feedback.
All reactions