-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat(SwingSet): Add a tool for classifying unsettled promises #8499
Conversation
f307e28
to
615fb90
Compare
OK, I think this now provides enough information to provide a complete analysis. $ packages/SwingSet/misc-tools/classify-promises.js /mnt/Downloads/run-9-slog.sqlite | \
jq -c '{ decider, subscriber, type, details: (try (.details | keys_unsorted)) }' | sort | uniq -c | \
sed 's/\([{,}]\)"\([^"]*\)":/\1 \2: /g; s/\(.\)$/ \1/; s/"v[0-9]"/ &/g;'
9 { decider: "v14", subscriber: "v28", type: "unknown E(<Alleged: PublishKit subscriber>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
1 { decider: "v14", subscriber: "v28", type: "unknown PublishKit tail", details: ["subscribeRequest","containingResult"] }
1 { decider: "v14", subscriber: "v43", type: "unknown PublishKit tail", details: ["subscribeRequest","containingResult"] }
13 { decider: "v2", subscriber: "v9", type: "Zoe E(contractInstanceAdminNode).done()", details: ["vatName"] }
12 { decider: "v2", subscriber: "v9", type: "Zoe E(governor contractInstanceAdminNode).done()", details: ["subject"] }
8 { decider: "v2", subscriber: "v9", type: "Zoe E(mintHolder contractInstanceAdminNode).done()", details: ["for"] }
6 { decider: "v2", subscriber: "v9", type: "Zoe E(psm contractInstanceAdminNode).done()", details: ["pair"] }
11 { decider: "v2", subscriber: "v9", type: "Zoe E(voteCounter contractInstanceAdminNode).done()", details: ["deadline"] }
3 { decider: "v29", subscriber: "v46", type: "unknown E(<Alleged: QuoteNotifier>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
23 { decider: "v43", subscriber: "v10", type: "wallet spend action: executeOffer", details: ["blockHeight","blockTime","owner","spendAction","type"] }
1 { decider: "v45", subscriber: "v48", type: "unknown PublishKit tail", details: ["subscribeRequest","containingResult"] }
1 { decider: "v46", subscriber: "v45", type: "unknown E(<Alleged: QuoteNotifier>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
2 { decider: "v46", subscriber: "v48", type: "unknown E(<Alleged: QuoteNotifier>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
1 { decider: "v5", subscriber: "v23", type: "unknown E(<Alleged: timerNotifier notifier>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
1 { decider: "v5", subscriber: "v48", type: "unknown E(<Alleged: timerNotifier notifier>).getUpdateSince(...)", details: ["targetKref","failure","krefHistory","syscalls","request","useRecord"] }
24 { decider: "v9", subscriber: "v43", type: "E(invitation)[getPayouts](...)", details: ["invitationSourceVatID","invitationCreatorKref","invitationKpid"] }
24 { decider: "v9", subscriber: "v43", type: "E(invitation)[numWantsSatisfied](...)", details: ["invitationSourceVatID","invitationCreatorKref","invitationKpid"] }
250 { decider: "v9", subscriber: "v43", type: "WalletFactory E(likelyPurse).getCurrentAmountNotifier(...) .getUpdateSince(...)", details: ["likelyPurseKref"] }
23 { decider: "v9", subscriber: "v63", type: "E(zoeInstanceAdmin).getExitSubscriber(likelySeatHandle) .getUpdateSince(...)", details: ["contractBundleID"] } |
Promise Analysis v14-bank-v28-provisionpool
consume: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/vats/src/provisionPoolKit.js#L351
The associated head value for each of these is an identical Testing should cover recognition of new bank assets in the subscribing vats (e.g., producer restart: restart vat-provisionPool, then add an asset to vat-bank and confirm a reaction in the consuming provisionPool). v2-vat-admin-v9-zoe
produce: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js#L270-L281 returns the promise from
v29-pricefeed-v46-scaledpriceauthority
v46 is scaledPriceAuthority-ATOM and v29 is ATOM-USD_price_feed. Both vats are explicitly non-upgradable, and talk to each other. They probably just need to be replaced, but cf. https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/zoe/src/contractSupport/priceAuthorityInitial.js#L83 .
v43-wallet-v10-bridge
produce/consume: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/vats/src/bridge.js#L151 is This should be fine as long as the unhandled rejection does not crash the bridge vat, but we should dig in on the spendAction details to investigate potential long-unsettled promises.
v45-auctioneer-v48-vaultfactory
v45 is auctioneer; v48 is vaultFactory. The associated head value is It looks like governance is non-durable, and therefore restarting the producer permanently breaks the consumer. This needs followup. cf. https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/inter-protocol/src/vaultFactory/liquidation.js#L211 v46-scaledpriceauthority-v45-auctioneer-v48-vaultfactory
v45-auctioneer and v48-vaultFactory need to be taught about a replacement price authority before we can replace v46 and v29. Ticket TBD.
v5-timer-v23-feedistributor-v48-vaultfactory
v48 is vaultFactory, which at https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/inter-protocol/src/vaultFactory/vaultManager.js#L360-L368 consumes like v23 is feeDistributor, and https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/inter-protocol/src/feeDistributor.js#L92-L98 follows the same pattern.
vaultFactory appears prepared for upgrade, however we should find a way to test it
v23-feeDistributor does not appear to be upgradable. If #8730 reveals that the feeDistributor would break upon v5-timer upgrade, we must find a way to replace the feeDistributor service entirely before we can upgrade v5-timer.
v9-zoe-v43-wallet
produce: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/zoe/src/zoeService/zoeSeat.js#L318 and https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/zoe/src/zoeService/zoeSeat.js#L265-L273 are both
produce: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/ERTP/src/purse.js#L80 (but see also https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/vats/src/virtual-purse.js#L238 for vat-bank) is v9-zoe-v63-KREAd
produce: https://github.com/Agoric/agoric-sdk/blob/release-mainnet1B/packages/zoe/src/zoeService/startInstance.js#L151 is |
Differences from run 9 to run 14: $ git diff --no-index --word-diff-regex='[[:alnum:]_]+|.' --word-diff=plain run-{9,14}-summary.txt | sed -r '1,/@@/d; s#^[[:space:]]+##; s#<#\<#g; s#[[]-#❌ Mostly just changes in the count per category, but also the addition of three new categories involving v69-scaledPriceAuthority-stATOM in patterns matching those associated with v46-scaledPriceAuthority-ATOM:
|
Details of the 605 unsettled cross-vat promises as of run 14: run-14-promises.jsonl.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tool worked for me, let's land it
5b7d00c
to
ae7c433
Compare
efada8c
to
4bcc951
Compare
#8735 addresses v46-scaledpriceauthority-v45-auctioneer-v48-vaultfactory. |
Ref #8336
Description
Status as of opening draft PR: 348 / 414 (84%)
Security Considerations
n/a
Scaling Considerations
Queries against the "mezzanine" database have not been optimized, but performance seems reasonable with the given data set (on my machine, about 5 seconds to classify all unsettled mainnet promises).
Documentation Considerations
Admittedly a bit sparse, but this is a special-purpose internal tool.
build-mezzanine-db.js
itself is also missing from the repository (I've used a direct copy from @warner).Testing Considerations
Also lacking (and for the same reason).
Upgrade Considerations
This tool supports identification of issues that must be resolved before upgrading vats.