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

asyncFlow: add meta operation to query the state of replay from within the flow #10103

Open
mhofman opened this issue Sep 17, 2024 · 0 comments
Assignees
Labels
asyncFlow related to membrane-based replay and upgrade of async functions enhancement New feature or request

Comments

@mhofman
Copy link
Member

mhofman commented Sep 17, 2024

What is the Problem Being Solved?

An upgrade may need to change the logic of a flow for existing but not yet completed invocations. For that, the guest function needs some way to detect where it has to follow replay, and where it can branch off. This requires "meta operations" about the flow (split from #9304)

Description of the Design

In #9384 we describe the need to record which incarnation of the flow the log entry corresponds. This issue describes a way expose this information to the guest function.

Async flow currently reserves the this context of the function for its own use (forced to undefined value). The idea is to provide meta operations regarding the flow available on this. We possibly want this to be a guest object part of the membrane (in case some interactions should be recorded for replay), but since asking about where in the replay we are is fundamentally a non replayable interaction, we also need a mechanism to escape the membrane when needed. One possibility would be to have a power created along the flow definition that allows "unwrapping" the flow meta operations guest object, in order to have the ability to interact directly with the host side outside the membrane. This guest object might be a wrapper created by the endowments mechanism (#9304) which combines interactions with both the membrane and the powers outside the membrane.

Security Considerations

Avoid exposing too much power to guest functions
Maintain replayability of guest flows where expected

Scaling Considerations

After the flow is complete, no internal references left to the flow

Test Plan

Test of guest logic conditional on upgrade

Upgrade Considerations

See above

@mhofman mhofman added enhancement New feature or request asyncFlow related to membrane-based replay and upgrade of async functions labels Sep 17, 2024
@mhofman mhofman self-assigned this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asyncFlow related to membrane-based replay and upgrade of async functions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant