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

fix(async-flow)!: stopgap E only for makeReplayMembraneForTesting #10156

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Sep 25, 2024

closes: #9772

Description

To accomplish #9772, disable the stopgap eventual send support except when explicitly calling makeReplayMembraneForTesting({..., __eventualSendForTesting: true }). We do this surgically to allow the membrane tests to prevent regression concerning the stopgap eventual-send guest support, and provide coverage for when we implement proper, always-on eventual-send support.

Security Considerations

The replay membrane used by asyncFlow cannot be overridden, so the stopgap E option is not available to users of asyncFlow, only to tests that are explicitly using makeReplayMembraneForTesting.

Scaling Considerations

n/a

Documentation Considerations

n/a

Testing Considerations

n/a

Upgrade Considerations

None, provided the version of async flow before this PR has not yet been deployed.

@michaelfig michaelfig self-assigned this Sep 25, 2024
Copy link

cloudflare-workers-and-pages bot commented Sep 25, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: fcc3dda
Status: ✅  Deploy successful!
Preview URL: https://b3bf6ec9.agoric-sdk.pages.dev
Branch Preview URL: https://mfig-async-flow-no-e.agoric-sdk.pages.dev

View logs

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

It seems that the reverted commit did more than simply enabling E support. I think we'll need to be more surgical. Let's discuss.

packages/async-flow/src/replay-membrane.js Outdated Show resolved Hide resolved
Comment on lines 238 to 241
if (optVerb === undefined) {
throw Panic`guest eventual call not yet supported: ${guestTarget}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
} else {
throw Panic`guest eventual send not yet supported: ${guestTarget}.${b(optVerb)}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
Copy link
Member

Choose a reason for hiding this comment

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

Can't we just replace the guestHandler with traps that do this? Possibly configured as an option when preparing the vow tools?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit confused by what you mean by "replace ... with traps". Are you talking about Proxy traps? Or eventual traps?

If eventual traps, that's exactly what the guestHandler already is.

@michaelfig michaelfig changed the title Revert "feat(asyncFlow): Stopgap E support (#9519)" fix(asyncFlow)!: remove Stopgap E support Oct 2, 2024
@michaelfig michaelfig force-pushed the mfig-async-flow-no-e branch from f807dbb to ab33bad Compare October 4, 2024 16:50
@michaelfig michaelfig requested a review from a team as a code owner October 4, 2024 16:50
@michaelfig michaelfig changed the title fix(asyncFlow)!: remove Stopgap E support feat(async-flow): plumb an enableEventualSend option Oct 4, 2024
@michaelfig michaelfig force-pushed the mfig-async-flow-no-e branch from ab33bad to b9398d0 Compare October 4, 2024 16:56
@michaelfig michaelfig requested a review from mhofman October 4, 2024 17:15
@michaelfig michaelfig force-pushed the mfig-async-flow-no-e branch from b9398d0 to 3b75e30 Compare October 4, 2024 19:01
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

I'm a little confused by the switching behavior of the test. Let's discuss

packages/async-flow/src/async-flow.js Outdated Show resolved Hide resolved
packages/async-flow/test/replay-membrane-eventual.test.js Outdated Show resolved Hide resolved
@michaelfig michaelfig changed the title feat(async-flow): plumb an enableEventualSend option fix(async-flow): only enable stopgap eventual send for testing Oct 6, 2024
@michaelfig michaelfig force-pushed the mfig-async-flow-no-e branch from 3b75e30 to fcc3dda Compare October 6, 2024 22:44
@michaelfig michaelfig changed the title fix(async-flow): only enable stopgap eventual send for testing fix(async-flow)!: stopgap E only for makeReplayMembraneForTest Oct 6, 2024
@michaelfig michaelfig requested a review from mhofman October 6, 2024 22:53
@michaelfig michaelfig changed the title fix(async-flow)!: stopgap E only for makeReplayMembraneForTest fix(async-flow)!: stopgap E only for makeReplayMembraneForTesting Oct 6, 2024
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

Clean and targeted. Thanks for the updated tests

Comment on lines +40 to +46
* @param {object} arg
* @param {LogStore} arg.log
* @param {Bijection} arg.bijection
* @param {VowTools} arg.vowTools
* @param {(vowish: Promise | Vow) => void} arg.watchWake
* @param {(problem: Error) => never} arg.panic
* @param {boolean} [arg.__eventualSendForTesting] CAVEAT: Only for async-flow tests
Copy link
Member

Choose a reason for hiding this comment

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

I wish there was an easier way to "extend" options while being able to use JSDoc to document the additional option (the only one I'm aware of is multiple typedef which is not clean)

@michaelfig michaelfig added the automerge:no-update (expert!) Automatically merge without updates label Oct 7, 2024
@mergify mergify bot merged commit 7940ef4 into master Oct 7, 2024
94 checks passed
@mergify mergify bot deleted the mfig-async-flow-no-e branch October 7, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable stopgap E support in async-flow
3 participants