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

walletFactory holds 158 promises from Zoe - why? #8245

Closed
Tracked by #8219
dckc opened this issue Aug 24, 2023 · 4 comments
Closed
Tracked by #8219

walletFactory holds 158 promises from Zoe - why? #8245

dckc opened this issue Aug 24, 2023 · 4 comments
Assignees
Labels
performance Performance related issues question Further information is requested wallet

Comments

@dckc
Copy link
Member

dckc commented Aug 24, 2023

What is the Problem Being Solved?

The walletFactory is holding on to 158 promises from Zoe. I can't think of a good reason. Let's figure out why.

source: chord chart by @toliaqat based on Swingstore Snapshot: Aug 23th

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

cc @turadg

@dckc dckc added question Further information is requested wallet performance Performance related issues labels Aug 24, 2023
@dckc
Copy link
Member Author

dckc commented Aug 30, 2023

One per revived smartWallet accounts for 152

Some investigatin by @warner finds at least 1 promise that seems to come from observeNotifier(E(purse).getCurrentAmountNotifier())

https://github.com/Agoric/agoric-sdk/blob/mainnet1B/packages/smart-wallet/src/smartWallet.js#L363-L370

That makes some sense: each smart wallet subscribes to balance updates for its invitation purse.

But that would suggest 1 promise per smart wallet, but we have many more than 158 smart wallets: 1160 per agd --node=https://main.rpc.agoric.net:443 query vstorage children published.wallet | grep agoric1 | wc -l.

p.s. @mhofman reminded me of the possibility that a smartWallet has not been revived.

finding revived wallets
$ agd --node=[https://main.rpc.agoric.net:443](https://main.rpc.agoric.net/) query vstorage children published.wallet -o json >,main-addrs.json
$ jq -r '.children | .[]' ,main-addrs.json >,main-addrs

$ (for a in $(cat ,main-addrs); do echo -n $a ,; check1 $a; sleep 1; done) | tee ,checks
agoric10229lxdgw6urj90h8xvkg7y6lw6s06u7zgwyy6 ,"#{}"
agoric102adncf7jlfh2ryuvedu80g6tnanf4et0saqcg ,"#{}"
agoric102rdjfsaqea5mslcpg0h6hf4jaa3f4w67k0u4y ,"#{\"currentAmount\":{\"brand\":\"$0.Alleged: Zoe Invitation brand\",\"value\":[]},\"updated\":\"balance\"}"

$ type check1
check1 is a function
check1 () 
{ 
    agd --node=[https://main.rpc.agoric.net:443](https://main.rpc.agoric.net/) query -o json vstorage data published.wallet.$1 | jq '.value | fromjson | .values[0] | fromjson | .body'
}

@warner
Copy link
Member

warner commented Aug 30, 2023

The current count (from a snapshot made yesterday, 10:19am PT 29-aug-2023, at blockHeight 11415808) is 160 promises (subscriber=v43-walletFactory, decider=v9-zoe), of which 153 are from a getCurrentAmountNotifier(), 3 from numWantsSatisfied, and 4 from getPayouts.

@dckc
Copy link
Member Author

dckc commented Aug 31, 2023

2 for each outstanding liquidation bid x4 = 8

There are 4 outstanding liquidation bid offers. The smartWallet waits on numWantsSatisfied() and getPayouts() for each.

152 + 4*x = 160.

All present and accounted for.

We found 3 issues along the way:

  1. smartWallet exits offers (e.g. bids) on zoe upgrade #8292
  2. smart wallet may drop offer notification (e.g. bids) on upgrade #8286
  3. smartWallet stops updating purse balance on upgrade #8293

I'm inclined to leave this open until the remaining 2 are written up.

@dckc
Copy link
Member Author

dckc commented Aug 31, 2023

I'm inclined to leave this open until the remaining 2 are written up.

done.

@dckc dckc closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance related issues question Further information is requested wallet
Projects
None yet
Development

No branches or pull requests

2 participants