-
Notifications
You must be signed in to change notification settings - Fork 217
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
all pass-by-reference objects must be marked with Far #2634
Comments
I'll assign this to the four people from whom I want confirmation: feel free to unassign yourselves once you've commented your approval for the plan. |
Just to confirm my understanding: The requirement for developers writing Zoe contracts is that they must mark objects with I think with documentation we are ready to enforce this. I can help with any errors that come up. |
I was going to ask a variation of the same question. Unmarked objects within a vat will continue to function, and their methods can be called. Should we have a variant of |
My sense is no. Just mark those as |
This plan LGTM.
confirmed. |
This is the only remaining item to close #2018, yes? |
I believe this is complete. |
What is the Problem Being Solved?
#2018 was split up into two pieces. The original ticket remains concentrated on making empty (hardened) objects be pass-by-copy instead of pass-by-reference.
This new ticket is about making all pass-by-reference objects as
Far
(orRemotable
). Once complete,marshal
will throw an error if you attempt to serialize a hardened object with Function properties that is not marked with Far/Remotable. The classification code (passStyleOf
) will change from:to:
getInterfaceOf
to decide whether we use pass-by-reference or pass-by-copy, which means only Far/Remotable-marked objects are pass-by-reference, and everything else is pass-by-copyWe've marked a lot of Far objects already, and I have a batch of local changes to the dapp repos with some more to come. To find them all:
marshal.js
lines that emit a warning and/or throw an error, at the end of thecase 'object'
clause ofpassStyleOf()
, currently around line 479.Far
until they pass quietly, coming up with a plausibleinterfaceName
for eachpassStyleOf()
to remove the tail caseassertRemotable(val); return REMOTE_STYLE
, and changeisPassByCopyRecord
to becomeassertPassByCopyRecord
Test Plan
A few
test-marshal.js
cases will change: unmarked Function-bearing objects must be marked asFar
/Remotable
, whereas previously only empty objects needed such marking.Compatibility Issues
I believe we have consensus that this is a good approach, but it's pretty wide-ranging, and takes us further away from the E ideals of everything-is-an-object. So I'd like @dtribble @erights @katelynsills @Chris-Hibbert to confirm that we're willing to require all authors of contracts and vat code to declare all of their pass-by-reference objects with
Far
/Remotable
.cc @tyg since this needs to be part of the developer guidelines, if it isn't already
The text was updated successfully, but these errors were encountered: