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

feat(pass-style): generalize passable errors, throwables #2223

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erights
Copy link
Contributor

@erights erights commented Apr 17, 2024

Just placeholder for now. Not yet expected to work or almost work.

closes: #XXXX
refs: #XXXX

Description

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Compatibility Considerations

Upgrade Considerations

  • Includes *BREAKING*: in the commit message with migration instructions for any breaking change.
  • Updates NEWS.md for user-facing changes.

@erights erights self-assigned this Apr 17, 2024
@erights erights force-pushed the markm-to-throwable branch 2 times, most recently from 1402c8a to dd4b963 Compare April 21, 2024 22:56
@erights erights changed the base branch from master to markm-rebase-2233-on-2232 April 21, 2024 22:56
@erights erights marked this pull request as ready for review April 21, 2024 22:58
@erights erights marked this pull request as draft April 21, 2024 22:58
@erights erights changed the base branch from markm-rebase-2233-on-2232 to master April 21, 2024 22:59
@erights erights changed the base branch from master to markm-rebase-2233-on-2232 April 21, 2024 23:00
erights added a commit that referenced this pull request May 6, 2024
closes: #XXXX
refs: #2223 

## Description

Modest step towards #2223 , 
- bringing all the intended safety: the exo boundary only throws
throwables, and that `callWhen` async exo methods only reject with
throwable reasons.
- but with less flexibility: the definition of passable errors and
throwables is narrower than it need be.

### Security Considerations

This is one of three necessary steps towards having the exo boundaries
become the new intravat defensive security boundary, rather than
treating every object boundary as a potential defensive security
boundary. The rationale for this step is that the throw-control-path is
too hard for reviewers to pay full attention to, so we wish to prevent
caps from leaking over the exo boundary via the throw path. (E prevented
caps from escaping via throws in general, but we're not in a position to
be able to enforce that in general within Hardened JS.)

The other two steps are
- Converting uses of `Far` for making far objects into making exos.
- Addressing the leakage of promise settlements across exo boundaries
due to the inability to synchronously enforce such a constraint on a
promise passed through the boundary.

### Scaling Considerations

Given that the exceptional pathways (throws and rejects) are only used
for low frequency exceptional conditions, or at least exceptional
conditions whose speed we don't care about, making this slow path a tiny
bit slower should be inconsequential. Indeed, I expect the overall
impact to be unmeasurable. (But we won't know until we measure!)

### Documentation Considerations

This restriction on what can be throws across the exo boundary (or for
exo async `callWhen` methods, what can be used as a rejection reason)
needs to be documented. But it should not affect any normal code, and so
documents an edge case.

### Testing Considerations

tests included

### Compatibility Considerations

If there are currently any throws or rejects that violate these
constraints (likely) where other code depends on these violations
(unlikely), then we have a compat problem.

### Upgrade Considerations

None.

- ~[ ] Includes `*BREAKING*:` in the commit message with migration
instructions for any breaking change.~
- [x] Updates `NEWS.md` for user-facing changes.
@erights erights force-pushed the markm-to-throwable branch from 76c3c58 to d06c83b Compare May 6, 2024 22:33
@erights erights changed the base branch from markm-rebase-2233-on-2232 to master May 6, 2024 22:33
@erights erights mentioned this pull request May 6, 2024
@erights erights force-pushed the markm-to-throwable branch 4 times, most recently from 0d49be1 to b450373 Compare May 9, 2024 00:09
@erights erights force-pushed the markm-to-throwable branch 3 times, most recently from 55ee7c5 to 6d1363a Compare June 2, 2024 18:47
@erights erights added the ocapn label Jun 9, 2024
@erights erights force-pushed the markm-to-throwable branch 2 times, most recently from 2e2ee98 to 4163fa8 Compare June 13, 2024 13:30
@erights erights force-pushed the markm-to-throwable branch from 4163fa8 to 5c5287a Compare August 27, 2024 02:59
@erights erights changed the base branch from master to markm-repair-arraybuffer-transfer-2 August 27, 2024 03:00
@erights erights force-pushed the markm-to-throwable branch from 5c5287a to d32a490 Compare August 27, 2024 03:07
@erights erights changed the base branch from markm-repair-arraybuffer-transfer-2 to markm-anticipate-disposal August 27, 2024 03:07
@erights erights force-pushed the markm-to-throwable branch from d32a490 to 409a62f Compare August 27, 2024 20:02
@erights erights force-pushed the markm-anticipate-disposal branch from 7a908f6 to 611ea5b Compare August 27, 2024 21:50
@erights erights force-pushed the markm-to-throwable branch from 409a62f to 05c5887 Compare August 27, 2024 21:51
@erights erights force-pushed the markm-anticipate-disposal branch from 611ea5b to 62895a4 Compare September 2, 2024 21:33
@erights erights force-pushed the markm-anticipate-disposal branch from a0ac6a1 to 2901427 Compare September 7, 2024 20:46
@erights erights changed the base branch from markm-anticipate-disposal to master September 10, 2024 04:52
@mhofman
Copy link
Contributor

mhofman commented Oct 30, 2024

We should consider only allowing a passable error as a throwable so that we maintain the ability to reconstitute distributed stack traces. Only the top level needs to be a passable error, nested values can be any copy data or passable error.

@erights
Copy link
Contributor Author

erights commented Oct 30, 2024

See also Agoric/agoric-sdk#10375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants