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: cheap auxdata #6355

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

fix: cheap auxdata #6355

wants to merge 1 commit into from

Conversation

erights
Copy link
Member

@erights erights commented Sep 29, 2022

Liveslots adds to all remote presences an aux() method.

A remote presence has an aux() method that either returns a promise or a non-promise. The first time it is called, it does an eventual-send of an aux() message to the far object it designates, remembers that promise as its auxdata, and returns that. It also watches that promise to react to its fulfillment. Until that reaction, every time its aux() is called, it will return that same promise. Once it reacts to the promise being fulfilled, if that ever happens, then the fulfillment becomes its new auxdata which gets returned from then on.

Initially only liveslots does this. But the mechanism is in a reusable makeRemotePresence function that should probably move to @endo/marshal so that other things that make remote presences can use it.

A good first test will be for ERTP brands to provide an auxdata object with the things that you can currently ask a brand for that are stable, and that zoe needs to cache before it can register the brand. Zoe's caching logic should then become much simpler as it need only delay registration until a local call to the brand's aux() returns a non-promise. After that, the remote presence's aux() method must always immediately return the same non-promise.

(Some brands are co-located with Zoe, in which case their aux() method may not be similarly stable. But that would be a misbehaving brand. The only brands co-located with the Zoe service are made by Zoe and relied on not to misbehave.)

Back in draft pending needed redesign to play well with virtual and durable storage.

If we believe this approach is adequate for our auxdata needs, then
Fixes: #2069

@Chris-Hibbert @warner @FUDCo @michaelfig @mhofman when this is ready, I'll ask you to review. Until then, please ignore. @Chris-Hibbert I'm leaving you listed since you already commented.

@erights erights self-assigned this Sep 29, 2022
@erights erights requested a review from michaelfig September 29, 2022 08:22
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

The ERTP/Zoe changes look fine. Someone else should approve the SwingSet changes.

There's a lint (import ordering) failure in CI.

@@ -13,6 +13,7 @@ import buildManualTimer from '../../../tools/manualTimer.js';

import { setupZCFTest } from './setupZcfTest.js';
import { assertAmountsEqual } from '../../zoeTestHelpers.js';
import { M } from '@agoric/store';
Copy link
Contributor

Choose a reason for hiding this comment

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

CI failure from lint. Move this up above line 9.

@erights erights marked this pull request as draft September 29, 2022 17:51
@erights
Copy link
Member Author

erights commented Sep 29, 2022

Converting to draft because of unintuitive interaction with durable state and upgrade :(

(Will file bugs explaining the problems)

@erights erights force-pushed the markm-cheap-auxdata branch 2 times, most recently from 0664fa8 to c48a881 Compare October 3, 2022 18:04
@erights erights force-pushed the markm-cheap-auxdata branch 3 times, most recently from 1cfa395 to 8321dd7 Compare October 11, 2022 04:18
@erights erights requested a review from mhofman October 11, 2022 23:52
@erights erights force-pushed the markm-cheap-auxdata branch from 8321dd7 to e9c7254 Compare October 19, 2022 02:18
@erights erights force-pushed the markm-cheap-auxdata branch from e9c7254 to 56d7dcb Compare November 5, 2022 03:20
@erights erights force-pushed the markm-cheap-auxdata branch from 56d7dcb to 03b53d8 Compare November 9, 2022 05:34
@mhofman
Copy link
Member

mhofman commented Nov 9, 2022

Liveslots adds to all remote presences an aux() method.

This will require the program to understand, and have a way to test, whether an object is local or remote. Do we have such a predicate today?

method that either returns a promise or a non-promise

Sounds like releasing Zalgo in the worst possible shape. I'd much prefer have a this method return a pseudo promise which is guaranteed to have a stable identity, and have an external promise result memoization helper.

Even then I still don't understand how you'll be able to escape our rules that we never await conditionally. Seems like releasing Zalgo is a design choice here?

Edit: this is based on reading the PR description. I did not read the implementation.

@erights erights force-pushed the markm-cheap-auxdata branch from 03b53d8 to 2784454 Compare November 9, 2022 22:24
@erights erights force-pushed the markm-cheap-auxdata branch from 5df58dc to dc67a20 Compare November 19, 2022 05:40
@erights erights force-pushed the markm-cheap-auxdata branch from 54ab831 to 85225cc Compare December 4, 2022 05:52
@erights erights force-pushed the markm-cheap-auxdata branch 2 times, most recently from 689c5b1 to d63b7c9 Compare December 23, 2022 23:26
@erights erights force-pushed the markm-cheap-auxdata branch from d63b7c9 to d58b94b Compare January 20, 2023 04:47
@erights erights mentioned this pull request Feb 19, 2023
@erights erights force-pushed the markm-cheap-auxdata branch 2 times, most recently from d5101b8 to a994ef7 Compare February 19, 2023 21:40
@erights erights force-pushed the markm-cheap-auxdata branch 2 times, most recently from 90bd935 to e7cd52a Compare March 3, 2023 23:54
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 4, 2023

Datadog Report

Branch report: markm-cheap-auxdata
Commit report: 33d0d13

agoric-sdk: 0 Failed, 0 New Flaky, 3556 Passed, 57 Skipped, 15m 27.3s Wall Time

@erights erights force-pushed the markm-cheap-auxdata branch from e7cd52a to 9c90ec5 Compare March 20, 2023 02:23
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 20, 2023

Datadog Report

Branch report: markm-cheap-auxdata
Commit report: 6076b68

agoric-sdk: 0 Failed, 0 New Flaky, 3757 Passed, 53 Skipped, 20m 0.78s Wall Time

@erights erights force-pushed the markm-cheap-auxdata branch from 9c90ec5 to 8118747 Compare May 20, 2023 22:08
@erights
Copy link
Member Author

erights commented May 25, 2023

Closing in favor of an actual solution to this problem, which I need to explain.

@erights erights closed this May 25, 2023
@erights
Copy link
Member Author

erights commented Jun 8, 2023

Reopening, as my "better idea" does not work at all. See #2069 (comment)

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

Successfully merging this pull request may close these issues.

add (immutable) auxiliary data to Presences?
3 participants