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

priceQuery must return a quote #2831

Closed
katelynsills opened this issue Apr 7, 2021 · 2 comments · Fixed by #2839
Closed

priceQuery must return a quote #2831

katelynsills opened this issue Apr 7, 2021 · 2 comments · Fixed by #2839
Assignees
Labels
bug Something isn't working

Comments

@katelynsills
Copy link
Contributor

Describe the bug

2021-04-07T01:24:16.904Z SwingSet: vat: v16: ----- VV.7  2 vaultSeat proposal { want: {}, give: {}, exit: { onDemand: null } }
UnhandledPromiseRejectionWarning: (Error#38)
Error#38: priceQuery must return a quote

  at createQuote (packages/zoe/src/contracts/multipoolAutoswap/priceAuthority.js:42:20)
  at mutableTrigger (packages/zoe/src/contractSupport/priceAuthority.js:169:40)
  at Alleged: PriceAuthority.mutableQuoteWhenOutTrigger [as mutableQuoteWhenLT] (packages/zoe/src/contractSupport/priceAuthority.js:202:25)

Error#38 ERROR_NOTE: Rejection from: (Error#39) : 5478 . 0
Nested error under Error#38
  Error#39: Event: 5477.1
  
    at Function.applyMethod (packages/tame-metering/src/tame.js:184:20)
    at meteredConstructor.deliver (packages/SwingSet/src/kernel/liveSlots.js:525:28)
    at eval (packages/SwingSet/src/kernel/vatManager/deliver.js:51:48)
  
Error#38 ERROR_NOTE: Sent as error:liveSlots:v17#70005
2021-04-07T01:24:17.146Z SwingSet: ls: v17: Logging sent error stack (Error#38)
(node:38522) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
UnhandledPromiseRejectionWarning: (RemoteError(error:liveSlots:v17#70005)#40)
RemoteError(error:liveSlots:v17#70005)#40: priceQuery must return a quote

  at fullRevive (packages/marshal/src/marshal.js:874:43)
  at meteredConstructor.unserialize (packages/marshal/src/marshal.js:954:19)
  at notifyOnePromise (packages/SwingSet/src/kernel/liveSlots.js:597:19)
  at meteredConstructor.notify (packages/SwingSet/src/kernel/liveSlots.js:610:7)
  at eval (packages/SwingSet/src/kernel/vatManager/deliver.js:51:48)

RemoteError(error:liveSlots:v17#70005)#40 ERROR_NOTE: Rejection from: (Error#41) : 5476 . 0
Nested error under RemoteError(error:liveSlots:v17#70005)#40
  Error#41: Event: 5475.1
  
    at Function.applyMethod (packages/tame-metering/src/tame.js:202:19)
    at Proxy.eval (packages/eventual-send/src/E.js:37:126)
    at reschedulePriceCheck (packages/treasury/src/vaultManager.js:123:60)
  

To Reproduce

Occurs when creating a vault and then closing it immediately afterward. Trying to find the minimal steps to reproduce.

@katelynsills katelynsills added the bug Something isn't working label Apr 7, 2021
@katelynsills katelynsills added this to the Beta Treasury Launch milestone Apr 7, 2021
@erights
Copy link
Member

erights commented Apr 7, 2021

This looks like a good actual example of a cross vat bug that can be tracked back to its origin using the extra tracking info added by ses 0.12.7. Did this turn out to be useful in practice? Is this sufficiently representative of other bugs we expect people to run into that it is a good expository example?

Chris-Hibbert added a commit that referenced this issue Apr 7, 2021
fixes #2831

priceAggregator shows that when priceQuery() returns a falsy value, createQuote()
is expected to return undefined. This happens when the comparefunction returns
false, so the promise isn't resolved.

I added a test of the priceAuthority in multipoolAutoSwap. The test fails before
the change (The first trigger gets false on the comparison)  and passes afterward.
@Chris-Hibbert
Copy link
Contributor

Did this turn out to be useful in practice?

The top of the stack and the error message showed me all the context I needed. I re-studied the model I had based the code on (priceAggregator) and figured out why the assertion was incorrect. #2839 is the fix.

I think that means the answer to your question is mostly yes, but I didn't actually need the context, etiology or symptoms to figure out what was wrong.

Chris-Hibbert added a commit that referenced this issue Apr 8, 2021
…2839)

fixes #2831

priceAggregator shows that when priceQuery() returns a falsy value, createQuote()
is expected to return undefined. This happens when the comparefunction returns
false, so the promise isn't resolved.

I added a test of the priceAuthority in multipoolAutoSwap. The test fails before
the change (The first trigger gets false on the comparison)  and passes afterward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants