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 wallet backend for POLA #4488

Closed
michaelfig opened this issue Feb 7, 2022 · 2 comments · Fixed by #6084
Closed

Refactor wallet backend for POLA #4488

michaelfig opened this issue Feb 7, 2022 · 2 comments · Fixed by #6084
Assignees
Labels
enhancement New feature or request wallet
Milestone

Comments

@michaelfig
Copy link
Member

michaelfig commented Feb 7, 2022

What is the Problem Being Solved?

Each aspect of the wallet backend should be kept as separate as possible from the other implementations. Right now is dangerous because it has a lot of authority and it's all comingled.

Description of the Design

Break out the wallet backend into separate modules for each area managed by the wallet.

Time box project to pick the fruit we can in the allotted time. Target 2 days of 2 engineers, plus code review.

Break the kitchen sink API into separate objects. E.g. "pet name manager" owns the pet names.

State is split across collections and there's a bunch at the top. So any bug in any of that code could iterate over those purses and spend your money. Instead need to encapsulate the purse state.

Dapp UIs shouldn't break. The only thing that relies on the shallow list of functions is the Wallet UI (not dapps, which rely on the wallet bridge).

Security Considerations

Test Plan

@michaelfig michaelfig added enhancement New feature or request wallet labels Feb 7, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 milestone Mar 23, 2022
@dckc
Copy link
Member

dckc commented May 13, 2022

To what extent is #4484 a good time to do this?

@dckc
Copy link
Member

dckc commented Sep 2, 2022

let's hope this refactor takes care of this too:

2022-09-02T01:08:21.329Z SwingSet: ls: v10: Error#1: Object [Alleged: AUSD payment] {} was not a live payment for brand Object [Alleged: AUSD brand] {} . It could be a used-up payment, a payment for another brand, or it might not be a payment at all.
2022-09-02T01:08:21.330Z SwingSet: ls: v10: Error: (an object) was not a live payment for brand (an object). It could be a used-up payment, a payment for another brand, or it might not be a payment at all.
 at construct ()
 at Error (/workspaces/agoric/agoric-sdk/packages/SwingSet/src/supervisors/subprocess-xsnap/lockdown-subprocess-xsnap.js:6160)
 at makeError (/workspaces/agoric/agoric-sdk/packages/SwingSet/src/supervisors/subprocess-xsnap/lockdown-subprocess-xsnap.js:2717)
 at fail (/workspaces/agoric/agoric-sdk/packages/SwingSet/src/supervisors/subprocess-xsnap/lockdown-subprocess-xsnap.js:2844)
 at baseAssert (/workspaces/agoric/agoric-sdk/packages/SwingSet/src/supervisors/subprocess-xsnap/lockdown-subprocess-xsnap.js:2862)
 at assertLivePayment (.../ertp/src/paymentLedger.js:204)
 at (.../ertp/src/paymentLedger.js:289)
 at ()

cc @mhofman @samsiegart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wallet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants