-
Notifications
You must be signed in to change notification settings - Fork 71
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(ses): Add XS variant of shim #2471
Open
kriskowal
wants to merge
4
commits into
kriskowal-xs-module-source-shim
Choose a base branch
from
kriskowal-ses-xs-shim
base: kriskowal-xs-module-source-shim
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
September 27, 2024 05:23
8ddbfc3
to
70beef1
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
2 times, most recently
from
September 27, 2024 05:34
5e2a457
to
edb5c78
Compare
29 tasks
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 9, 2024 06:04
70beef1
to
5342ea3
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 9, 2024 06:04
edb5c78
to
08138db
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 17, 2024 22:54
5342ea3
to
607b4ee
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 17, 2024 22:54
08138db
to
a4f3663
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 00:05
607b4ee
to
a02438f
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 00:05
a4f3663
to
920ddd8
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 00:50
a02438f
to
82a89a8
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 00:50
920ddd8
to
ae04c9e
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 01:18
82a89a8
to
84a2fb7
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 01:18
ae04c9e
to
f2e4a22
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 05:40
84a2fb7
to
c1cdb57
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 05:40
f2e4a22
to
aca33ea
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 19:32
c1cdb57
to
7312722
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 19:32
aca33ea
to
47fa5f2
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 19:49
7312722
to
f8dd207
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 19:49
47fa5f2
to
10ef65c
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 20:01
f8dd207
to
13eb35a
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 20:01
10ef65c
to
b45a4e0
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 20:28
13eb35a
to
9f9b0ae
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 20:28
b45a4e0
to
63ce6b4
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 20:33
9f9b0ae
to
f6a6bac
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 20:33
63ce6b4
to
8d472d9
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 20:39
f6a6bac
to
69152ea
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 20:39
8d472d9
to
dff1b9c
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 22:45
e853ee6
to
6375752
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 22:45
869de15
to
9c0c099
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 22:53
6375752
to
a4b58b6
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 22:53
9c0c099
to
b8e30f2
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 22:57
a4b58b6
to
8c51679
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 22:57
b8e30f2
to
8ef4eb1
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 22:59
8c51679
to
3b5df29
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 22:59
8ef4eb1
to
968cc08
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 23:23
3b5df29
to
8ca8e06
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 23:23
968cc08
to
b753362
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 23:27
8ca8e06
to
4a3848c
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 18, 2024 23:27
b753362
to
c015be9
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 18, 2024 23:32
4a3848c
to
6639091
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
7 times, most recently
from
October 19, 2024 02:58
5a01c91
to
14b0197
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 19, 2024 02:59
6639091
to
fd90e45
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 19, 2024 03:21
14b0197
to
7995659
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 19, 2024 05:35
fd90e45
to
555ea34
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 19, 2024 05:35
7995659
to
ed90854
Compare
kriskowal
force-pushed
the
kriskowal-xs-module-source-shim
branch
from
October 19, 2024 05:52
555ea34
to
317c723
Compare
kriskowal
force-pushed
the
kriskowal-ses-xs-shim
branch
from
October 19, 2024 05:52
ed90854
to
563a390
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: #2251
Description
To take advantage of native XS compartments while retaining backward compatibility and parity with the SES shim, we introduce an
xs
specific Compartment adapter that requires two levels of opt-in.xs
package export/import condition.__native__
option to sacrifice the ability to use precompiled module sources (as generated by@endo/module-source
without thexs
package export/import condition) and instead use adapted nativeModuleSource
(as generated by@endo/module-source
with thexs
package export/import condition). This allows@endo/import-bundle
, for example, to use the JSON serialization of a precompiled module source that is captured in a bundle and also opt-in for__native__
treatment if the archive/bundle contains original sources.This change introduces an XS-specific shim that is an adapter for
Compartment
andlockdown
, and also papers over parity gaps like the XSObject.freeze
second boolean argument. The adapter creates parallel native and shim (virtual) compartment trees, where any individual Compartment can elect to use the native or shim variant for a child Compartment.We have not yet found a workable design that obviates the need for the
__native__
opt-in. Such a design would need to create an adapter from precompiled module sources to XS’s virtual module source protocol. To do that would require native module to emit notifications for the mutation of exported live bindings and also require the native Compartment evaluate method to accept an argument like the shim’s__moduleGlobalLexicals__
.Security Considerations
Uncountably numerous. Among them, with the
__native__
option, censorship does not occur, so dynamic import and direct eval are possible.Scaling Considerations
The native ModuleSource makes it practical to defer module parsing to runtime, and should improve the performance of execution as well.
Documentation Considerations
The NEWS.md qualifies these changes as under "incubation". When the shape of these changes settles, the NEWS will need to reiterate the final user facing API in README.md and NEWS.md. With the
__native__
option, censorship does not occur, so dynamic import and direct eval are possible.Testing Considerations
This change contains a token of
xst
testing that is exercised in CI withtest:xs
. This demonstrates the use of@endo/compartment-mapper/bundle.js
to thread thexs
package export/import condition and generate a script that canxst
can run directly. This gives us some modest confidence that lockdown works and demonstrates the__native__
feature but does not provide sufficient confidence of parity for the gamut of Compartment usage, both legacy and XS, for all of the accepted module descriptors and other Compartment features. This is an exercise that will begin with a subsequent change that introduceshardened262
, a comprehensive parity checking framework for the full cross-product of [ SES on Node.js, SES on XS, and XS stand-alone ] ⨉ [ Lockdown, not Lockdown ] ⨉ [ Compartment, no Compartment ] ⨉ [ Sloppy, Strict, Module ].Compatibility Considerations
This change preserves all existing usage and introduces an unstable alternate version of SES for XS that requires two layers of opt-in. The use of the
xs
condition introduces an adapter forCompartment
that may not have full parity with the underlying implementation, and requires additional testing. The__native__
option elects to break some usage (precompiled moduels) in favor of others (dynamic import, direct eval, top-level-await).Upgrade Considerations
In order to realize these changes on the Agoric chain will likely require a more recent version of XS and switching the bundle format for the lockdown/bootstrap script for xsnap swingset workers.