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(ertp): ertp on zones #7116

Merged
merged 3 commits into from
Feb 24, 2024
Merged

refactor(ertp): ertp on zones #7116

merged 3 commits into from
Feb 24, 2024

Conversation

erights
Copy link
Member

@erights erights commented Mar 5, 2023

closes: #XXXX
refs: #8021 #8965 #8977 #8779

Description

ERTP predates both durability and zones. Before zones, it was made durable using baggage-based abstractions. We want to start shifting in general from baggage-based durability to zone-based parameterizability, so that the same parameterizable abstraction can be run in different storage regimes (heap, virtual, durable).

However, the public exports of @agoric/ertp are not changed by this PR. These are the issuer making / preparing / upgrading functions to be invoked from outside @agoric/ertp, and remain parameterized by baggage as of this PR. Later PRs may also directly expose functions parameterized by zones, but this PR does not take that step. Thus, this PR by itself does not yet enable users of @agoric/ertp to parameterize issuer creation by zone.

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

Aside from upgrade testing, nothing special. Because the publicly exported API of @agoric/ertp has not changed, nothing outside of this package needs new tests. The fact that CI runs without such modification supports that.

Likewise though less obviously for the tests inside @agoric/ertp. The fact that the change to internal APIs did not cause us to revise any tests within the package means that there are no unit tests that are using those internal APIs. A bit of a surprise, but not cause to change that in this PR.

Upgrade Considerations

We believe we are using zones in a sufficiently literal analog to how we used to use baggage that this PR should not cause or need any change to durable state. If true, it should have no effect on upgrade. But this has not yet been tested. I would appreciate help in figuring out how to test that this PR is upgrade neutral.

@erights erights requested a review from michaelfig March 5, 2023 21:08
@erights erights self-assigned this Mar 5, 2023
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 5, 2023

Datadog Report

Branch report: markm-ertp-on-zones
Commit report: c333a19

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

@erights erights force-pushed the markm-ertp-on-zones branch from 8ac1531 to 241ec12 Compare March 6, 2023 02:19
@erights erights changed the base branch from master to mfig-zones March 6, 2023 02:19
@erights erights force-pushed the markm-ertp-on-zones branch 2 times, most recently from 1ec6ade to e1b781a Compare March 6, 2023 18:55
@michaelfig michaelfig force-pushed the mfig-zones branch 5 times, most recently from ba481f6 to 667bfb0 Compare March 19, 2023 22:20
Base automatically changed from mfig-zones to master March 19, 2023 23:01
@erights erights force-pushed the markm-ertp-on-zones branch from 5e44278 to 25ac290 Compare March 20, 2023 01:17
@erights erights marked this pull request as ready for review March 20, 2023 01:17
@erights erights changed the title WIP refactor(ertp): ertp on zones refactor(ertp): ertp on zones Mar 20, 2023
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 20, 2023

Datadog Report

Branch report: markm-ertp-on-zones
Commit report: a90cc99

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

@erights erights force-pushed the markm-ertp-on-zones branch from 25ac290 to c5b54db Compare May 10, 2023 05:12
@erights erights changed the base branch from master to markm-zone-once May 10, 2023 05:12
@erights erights force-pushed the markm-ertp-on-zones branch from a0ef385 to 2c74cfc Compare May 10, 2023 05:27
@erights erights requested a review from mhofman May 10, 2023 05:29
@erights erights added ERTP package: ERTP stores labels May 12, 2023
@erights erights force-pushed the markm-zone-once branch from fb0def0 to ce9d1b8 Compare May 20, 2023 22:22
@erights erights force-pushed the markm-ertp-on-zones branch 2 times, most recently from eeae1bd to 46ca164 Compare February 20, 2024 20:51
*/
/** @typedef {import('@agoric/zone').Zone} Zone */

// TODO Type InterfaceGuard better than InterfaceGuard<any>
Copy link
Member Author

Choose a reason for hiding this comment

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

Need help. Finally resorted to any after everything else I tried failed. I don't understand why this problem arose in this PR but not prior to this PR.

I got rid of all the @typedefs in case it could help with this, which it did not. But I left the non-@typedef form in anyway because it is now our recommended practice. Preserves type info better in the IDE.

const { Fail } = assert;

// TODO Type InterfaceGuard better than InterfaceGuard<any>
Copy link
Member Author

Choose a reason for hiding this comment

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

Need help. Finally resorted to any after everything else I tried failed. I don't understand why this problem arose in this PR but not prior to this PR.

I got rid of all the @typedefs in case it could help with this, which it did not. But I left the non-@typedef form in anyway because it is now our recommended practice. Preserves type info better in the IDE.

@erights erights force-pushed the markm-ertp-on-zones branch 2 times, most recently from f7246b4 to cf5b231 Compare February 22, 2024 23:03
@erights erights changed the base branch from master to markm-move-revocability-to-base-zone February 22, 2024 23:03
@dckc dckc removed their request for review February 23, 2024 15:43
@erights erights force-pushed the markm-move-revocability-to-base-zone branch from af26446 to b252dcb Compare February 23, 2024 20:36
@erights erights force-pushed the markm-ertp-on-zones branch from cf5b231 to bb984c9 Compare February 23, 2024 20:38
@erights erights changed the base branch from markm-move-revocability-to-base-zone to markm-virtual-exo-meta-ops February 23, 2024 20:57
@erights erights force-pushed the markm-ertp-on-zones branch from bb984c9 to 8b6fd8b Compare February 23, 2024 22:46
@erights erights changed the base branch from markm-virtual-exo-meta-ops to markm-move-revocability-to-base-zone-2 February 23, 2024 22:47
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.

LGTM.

one question that's more about zones and doc than about this PR.

const recoverySet = makeScalarBigSetStore('recovery set', {
durable: true,
});
const recoverySet = issuerZone.detached().setStore('recovery set');
Copy link
Contributor

Choose a reason for hiding this comment

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

What does detached() do? Is there any documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

detached() is how you ask that a new one always be made, even if it is a durable zone. Without detach(), issuerZone.setStore('recovery set') would reuse a 'recovery set' entry in issuerZone if there is one, and register the newly made one there otherwise. IOW, detached() is the new way to say make*SetStore rather than provide*SetStore.

@michaelfig , I leave the documentation question to you. Thanks.

@erights erights force-pushed the markm-ertp-on-zones branch from 8b6fd8b to a7e3695 Compare February 24, 2024 00:11
@erights erights changed the base branch from markm-move-revocability-to-base-zone-2 to master February 24, 2024 00:12
@erights erights added automerge:squash Automatically squash merge and removed automerge:squash Automatically squash merge labels Feb 24, 2024
@erights erights force-pushed the markm-ertp-on-zones branch from a7e3695 to 6558152 Compare February 24, 2024 02:01
@erights erights force-pushed the markm-ertp-on-zones branch from 6558152 to 85e997d Compare February 24, 2024 02:02
@erights erights added the automerge:squash Automatically squash merge label Feb 24, 2024
@mergify mergify bot merged commit be6d970 into master Feb 24, 2024
76 checks passed
@mergify mergify bot deleted the markm-ertp-on-zones branch February 24, 2024 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge ERTP package: ERTP stores
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants