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

4489 walletFactory virtual #6165

Merged
merged 7 commits into from
Sep 9, 2022
Merged

4489 walletFactory virtual #6165

merged 7 commits into from
Sep 9, 2022

Conversation

turadg
Copy link
Member

@turadg turadg commented Sep 8, 2022

closes: #4489

Description

Updates the smart wallet contract to be virtualized.

This is my first use of the new Far Class stuff. I cut some paper cuts and tried to sand the edges with refactor(store): types for interface-tools but stopped eventually. Many types in this PR have regressed to any but addressing that can wait to after launch.

Security Considerations

More guards

Documentation Considerations

--

Testing Considerations

There's one test that started failing after I rebased, I think due to #6166

  • un-disable "govern offerFilter" test

@turadg turadg changed the base branch from master to 6062-wallet-patterns September 8, 2022 20:29
Base automatically changed from 6062-wallet-patterns to master September 8, 2022 20:32
@turadg turadg marked this pull request as ready for review September 8, 2022 23:39
@@ -153,7 +154,8 @@ test('want stable', async t => {
t.is(purseBalance(computedState, stableBrand), swapSize - 1n);
});

test('govern offerFilter', async t => {
// FIXME this broke after https://github.com/Agoric/agoric-sdk/pull/6166
Copy link
Contributor

Choose a reason for hiding this comment

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

please create an issue and assign to me. (Unless you want to fix it in this PR.)

brandDescriptors: makeScalarMapStore(),
// To ensure every offer ID is unique we require that each is a number greater
// than has ever been used. This high water mark is sufficient to track that.
lastOfferId: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

does lastOfferId need to survive upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's a SHOULD not a MUST. if it doesn't survive it's easy to determine from the offerStatus update in RPC. I'll make a note of that.

Comment on lines +175 to +176
getDepositFacet: M.call().returns(M.eref(M.any())),
getOffersFacet: M.call().returns(M.eref(M.any())),
Copy link
Contributor

Choose a reason for hiding this comment

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

These facets should be simple to describe.

Copy link
Member Author

Choose a reason for hiding this comment

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

what's the value? these are input guards. why runtime validate the return?

seems like busy work, especially when we have to write types twice (until #6160)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm worried that we'll do something like #6160, but have incomplete types on the returns because they're currently not enforced, so they'll all say .returns(M.promise()) or .returns(M.eref(M.any()).

Not suggesting a change here, just registering my concern.

packages/smart-wallet/src/smartWallet.js Outdated Show resolved Hide resolved
@turadg turadg added the automerge:no-update (expert!) Automatically merge without updates label Sep 9, 2022
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.

I approve on the basis that the conversion to heapFarInstances looks clean.

I haven't looked at the smartWallet design enough to have confidence that the local rearrangements haven't done violence to it. Is there anyone who understands wallet/smartWallet well enough to review?

@turadg
Copy link
Member Author

turadg commented Sep 9, 2022

79f3df2 passed deployment test and the only change since then is fixing a TS lint error so I'm adding bypass:integration to get this in faster.

@turadg turadg added the bypass:integration Prevent integration tests from running on PR label Sep 9, 2022
@mergify mergify bot merged commit 6f402a0 into master Sep 9, 2022
@mergify mergify bot deleted the 4489-walletFactory-virtual branch September 9, 2022 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates bypass:integration Prevent integration tests from running on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

walletFactory uses virtual objects
2 participants