fix(async-flow): fix endowment equate bug #9736
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: #XXXX
refs: #9722
Extracted from #9722 into an independently mergeable PR
Description
The failure at https://github.com/Agoric/agoric-sdk/pull/9719/files#diff-cbd091458bbd51ddc6640a3783cdb340d7f2588cb7ff27b330ba228cfbd0e18dR64-R87 revealed a bug introduced to async-flow when adding support for endowments. Because of the so-called "unwrapping" of some guests, there can be two guests corresponding to one host, with the host of course only mapping back to one of them -- the outer one. This makes
bijection.js
more complicated and irregular than an actual bijection.equate(g, h)
had a test for early return, if theg
andh
were already "equated", i.e., were corresponding guest and host. But the equate test was written before the elaboration of bijection. In fact, it should only test whether this guestg
maps to the hosth
, irrespective of whetherh
maps back to thisg
.Unfortunately:
This failure was not tested by any async-flow test before it failed for a user of async-flow.
This PR should fix the failing test case https://github.com/Agoric/agoric-sdk/pull/9719/files#diff-cbd091458bbd51ddc6640a3783cdb340d7f2588cb7ff27b330ba228cfbd0e18dR64-R87 . Unfortunately, it does not. However, it now fails with different symptoms. Someone who understands #9719 better than I should investigate the nature of these new symptoms. If it still looks like it might be an async-flow problem, let me know!
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations