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

refactor: prepare for non-trapping integrity trait #2679

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

erights
Copy link
Contributor

@erights erights commented Jan 2, 2025

Closes: #XXXX
Refs: Agoric/agoric-sdk#10795

Description

Prepare for anticipated introduction and use of the non-trapping integrity trait as explained at https://github.com/endojs/endo/blob/b12eb434b6672f0ceae41be55aac7f24c4562b7b/packages/ses/docs/preparing-for-stabilize.md

These preparations must work now, before these traits are introduced, and should continue to work after these traits are introduced and used.

Security Considerations

Some things that had been deeply frozen automatically by harden are now manually frozen by explicit calls to freeze. We need to review these carefully to ensure that nothing has inadvertently be left unfrozen as a result of the changes in this PR.

Some proxies will become unhardenable, but they will still be hardenable as of now, so mistaken hardenings will not be detected.

Scaling Considerations

For this PR by itself, none. Using the shim-based implementation of the non-trapping trait will have scaling consequences: #2675

Documentation Considerations

https://github.com/endojs/endo/blob/b12eb434b6672f0ceae41be55aac7f24c4562b7b/packages/ses/docs/preparing-for-stabilize.md will need to be reflected in developer docs.

Testing Considerations

Since this PR by itself should be a pure refactor with no observable changes, there is nothing to test at this stage. The testing burden will come with #2675 to see how adequate these preparations were.

Compatibility Considerations

The point. This changes to coding patterns that should be compat both with the current status quo and with #2675

Upgrade Considerations

As a pure refactor, none.

@erights erights self-assigned this Jan 2, 2025
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch 2 times, most recently from ce2d645 to 526e404 Compare January 2, 2025 20:42
@erights erights changed the base branch from master to markm-cleanup-type-warning January 2, 2025 20:43
@erights erights changed the title refactor: prepare for non-trapping integrity level refactor: prepare for non-trapping integrity trait Jan 2, 2025
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch from 526e404 to b12eb43 Compare January 2, 2025 21:30
@erights erights marked this pull request as ready for review January 2, 2025 22:35
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch 2 times, most recently from 9925c0c to 6ff2c89 Compare January 2, 2025 23:43
Base automatically changed from markm-cleanup-type-warning to master January 3, 2025 02:30
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch from 6ff2c89 to c3b3d92 Compare January 3, 2025 19:54
Copy link
Contributor

@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.

Reading this and thinking through the implications, I have concerns we may be painting ourselves in a corner. Our recommendation is that one should harden values before passing them around. That implies we will never be able to use a Proxy as a remotable value. Is that something we're ok with? I know you have reservations with using O style objects as presences, but I'm a little worried about forever closing the door to this possibility.

packages/eventual-send/src/E.js Outdated Show resolved Hide resolved
packages/ses/docs/preparing-for-stabilize.md Show resolved Hide resolved
packages/pass-style/test/passStyleOf.test.js Outdated Show resolved Hide resolved
packages/pass-style/test/passStyleOf.test.js Outdated Show resolved Hide resolved
packages/pass-style/test/passStyleOf.test.js Outdated Show resolved Hide resolved
packages/ses/src/strict-scope-terminator.js Show resolved Hide resolved
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch 3 times, most recently from f5d2c57 to 02a6965 Compare January 15, 2025 21:48
@erights
Copy link
Contributor Author

erights commented Jan 15, 2025

ping

@erights
Copy link
Contributor Author

erights commented Jan 15, 2025

Reviewers: I claim that this PR by itself prior to the introduction or use of the non-trapping or stabilize integrity traits is a pure refactor, i.e., it should not produce any observable changes. Please review with that claim in mind. If you do spot something that looks like an observable change, please let me know. Thanks!

Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

Please consider my suggestion for reducing some TODOs.

packages/pass-style/test/passStyleOf.test.js Show resolved Hide resolved
packages/pass-style/test/passStyleOf.test.js Outdated Show resolved Hide resolved
@erights erights force-pushed the markm-prepare-for-stabilize-2 branch from 02a6965 to 39b46e1 Compare January 18, 2025 02:38
@erights erights requested review from michaelfig and mhofman January 18, 2025 02:39
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

LGTM after these two suggestions, which I expect you'll address somehow before merging.

const hardenToBeSuppressTrapping = harden;

/**
* Local alias of `harden` to eventually be switched to whatever applies
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Local alias of `harden` to eventually be switched to whatever applies
* Local alias of `freeze` to eventually be switched to whatever applies

* explicitly make this non-trapping, which we cannot yet express.
* @see https://github.com/endojs/endo/blob/master/packages/ses/docs/preparing-for-stabilize.md
*/
const makeInput = () => freeze({ __proto__: mercurialProto });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const makeInput = () => freeze({ __proto__: mercurialProto });
const makeInput = () => freezeToBeSuppressTrapping({ __proto__: mercurialProto });

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

Successfully merging this pull request may close these issues.

3 participants