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

fix(marshal): serialize empty objects as data, not pass-by-reference #2622

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

warner
Copy link
Member

@warner warner commented Mar 12, 2021

Finally change the serialization of a plain empty object, i.e. harden({}),
from a pass-by-reference "marker" to plain pass-by-copy data. We think we've
identified all the places where an empty object was used represent a marker,
and changed them to use Far(iface, {}) instead, which triggers
pass-by-reference.

refs #2018

Finally change the serialization of a plain empty object, i.e. `harden({})`,
from a pass-by-reference "marker" to plain pass-by-copy data. We think we've
identified all the places where an empty object was used represent a marker,
and changed them to use `Far(iface, {})` instead, which triggers
pass-by-reference.

refs #2018
@warner warner added the marshal package: marshal label Mar 12, 2021
@warner
Copy link
Member Author

warner commented Mar 12, 2021

@michaelfig any idea what's making this test fail? I thought we'd caught all the empty-objects-as-handle that needed changing. The specific failure (https://github.com/Agoric/agoric-sdk/pull/2622/checks?check_run_id=2093138223#step:9:1558) is in cosmic-swingset/test/test-home.js line 174.

@warner
Copy link
Member Author

warner commented Mar 12, 2021

Wait, weird, I re-ran the checks and the second time it didn't fail. I'm not sure what's going on.

@warner
Copy link
Member Author

warner commented Mar 12, 2021

Ok, I think that was an artifact, the test looks like it might be timing sensitive, and the assertion was that the number of calls to the timer handler was 2 instead of 1, which sounds like timing.

So I think this is ready for review. This flips the big #2018 switch, so review really means "are we ready to change the behavior of harden({}).

@warner warner marked this pull request as ready for review March 12, 2021 09:53
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM whew!

@warner warner self-assigned this Mar 12, 2021
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!

@warner warner enabled auto-merge (rebase) March 12, 2021 19:47
@warner warner disabled auto-merge March 12, 2021 19:47
Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

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

LGTM! I think we are ready to flip the switch

@warner warner merged commit aeee1ad into master Mar 12, 2021
@warner warner deleted the 2018-empty-objects-are-data branch March 12, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
marshal package: marshal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants