Skip to content

fix(zoe): Fix guards to accurately guard args#8642

Merged
mergify[bot] merged 1 commit into
masterfrom
markm-fix-missing-arg-guards
Dec 15, 2023
Merged

fix(zoe): Fix guards to accurately guard args#8642
mergify[bot] merged 1 commit into
masterfrom
markm-fix-missing-arg-guards

Conversation

@erights

@erights erights commented Dec 11, 2023

Copy link
Copy Markdown
Member

closes: #XXXX
refs: #8641 #8514 endojs/endo#1765 endojs/endo#1890

Description

#8641 throws errors when a call has more arguments than are declared in a method guard. These throws have diagnosed several errors that were otherwise undiagnosed, even after endojs/endo#1765 . After endojs/endo#1765 these mismatches would have been genuine observable runtime bugs that remained undiagnosed by CI, as seen by the clean CI run at #8514 .

This PR reproduces the bug fixes from #8641 by themselves, without the endo-branch directive or the rest of #8514 , testing that these fixes are also compat with current agoric-sdk and should be merged as is.

Security Considerations

More accurate arg guarding supports better input validation.

Scaling Considerations

None

Documentation Considerations

For the methods whose guards are fixed here, we should also check whether the documentation of those methods include those args.

Testing Considerations

The fact that the bugs fixed in this PR were not detected by #8514 shows that endojs/endo#1765 was too hazardous: It would introduce changes in behavior that could be unlikely to be detected in tests, but be genuine dynamic bugs.

Upgrade Considerations

See the Upgrade Considerations of endojs/endo#1890

@erights erights self-assigned this Dec 11, 2023
@erights erights requested review from kriskowal and turadg December 11, 2023 04:25
@erights erights marked this pull request as ready for review December 11, 2023 04:32
Comment thread packages/zoe/src/typeGuards.js Outdated
@erights erights force-pushed the markm-fix-missing-arg-guards branch from b7ed892 to 331944c Compare December 11, 2023 18:38
@erights erights added the automerge:squash Automatically squash merge label Dec 11, 2023
Comment thread packages/zoe/src/typeGuards.js
@erights erights removed the automerge:squash Automatically squash merge label Dec 11, 2023
@erights erights force-pushed the markm-fix-missing-arg-guards branch from 9b8878b to 331944c Compare December 11, 2023 20:00

@kriskowal kriskowal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A test that would have previously failed would hedge against regression.

@erights erights force-pushed the markm-fix-missing-arg-guards branch from 331944c to 4c935b5 Compare December 11, 2023 21:57
@erights

erights commented Dec 11, 2023

Copy link
Copy Markdown
Member Author

A test that would have previously failed would hedge against regression.

Done. Since this PR is currently tested against an endo prior to endojs/endo#1765 , the test's difference in behavior is in what error message is generated. This same test, prior to the rest of this PR while still prior to endojs/endo#1765 emits an error message from the operation itself. Whereas with the rest of this PR, we're getting the error from the guard mismatch.

After agoric-sdk is updated to current endo, i.e., one post endojs/endo#1890 , then this test without the rest of this PR would still fail from a guard mismatch, but still with a different error: that there were too many arguments.

@erights erights mentioned this pull request Dec 12, 2023
@github-actions

Copy link
Copy Markdown

@erights - This PR appears to be stuck. It's had a merge label for > 24 hours

1 similar comment
@github-actions

Copy link
Copy Markdown

@erights - This PR appears to be stuck. It's had a merge label for > 24 hours

@turadg turadg force-pushed the markm-fix-missing-arg-guards branch from 4c935b5 to 3016a9a Compare December 15, 2023 15:38
@mergify mergify Bot merged commit b235bd8 into master Dec 15, 2023
@mergify mergify Bot deleted the markm-fix-missing-arg-guards branch December 15, 2023 16:08
anilhelvaci pushed a commit to Jorge-Lopes/agoric-sdk that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge:squash Automatically squash merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants