-
Notifications
You must be signed in to change notification settings - Fork 215
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
7004 wallet errors #7135
7004 wallet errors #7135
Conversation
@@ -182,15 +202,17 @@ test('close vault', async t => { | |||
{ | |||
offerId: 'close-well', | |||
collateralBrandKey, | |||
giveMinted: 5.0, |
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.
this was a bug in the test. it wasn't detected because I had mistakenly thought numWantsSatisified: 1
meant it succeeded. There were no wants so they were trivially satisfied.
That it looked like it succeeded and it didn't underlines the value of the promise rejecting.
Datadog ReportBranch report: ✅ |
I hope we have an issue to represent that plan. This PR would still be forward progress without it, though... |
Are there any UI changes that need to accompany this? |
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.
I need to understand the compatibility impact on the wallet UI better.
With this change, if the wallet UI doesn't change, will the wallet UI fail to notice some of the errors that it currently notices?
@@ -1,3 +1,4 @@ | |||
import { Fail } from '@agoric/assert'; |
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.
Where did we get on that idiom? Ah yes... #5672 is still open.
error: | ||
'Error: In "pushPrice" method of (OracleKit oracle): arg 0: unitPrice: number 1 - Must be a bigint', | ||
// trivially satisfied because the Want is empty | ||
numWantsSatisfied: 1, | ||
message: | ||
'In "pushPrice" method of (OracleKit oracle): arg 0: unitPrice: number 1 - Must be a bigint', |
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.
Does the wallet UI need a corresponding update to error handling?
That would make this a BREAKING CHANGE, yes?
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.
That would be a breaking change, but the wallet UI isn't affected. The same errors are written to vstorage.
err, | ||
); | ||
updatePublishKit.publisher.publish({ | ||
updated: 'walletAction', |
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.
impacts wallet UI?
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.
Wallet UI can begin to observe these messages. It shouldn't break because it should never have assumed that new updates would never be added.
* Designed to be called by the bridgeManager vat. | ||
* | ||
* If this errors before calling handleBridgeAction(), the failure will not be observable. The | ||
* promise does rejects, but as of now bridge manager drops instead of handling it. Eventually |
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.
* promise does rejects, but as of now bridge manager drops instead of handling it. Eventually | |
* promise does reject, but as of now bridge manager drops instead of handling it. Eventually |
* associate it with. (We could have a shared `lastError` node but it would be so noisy as to | ||
* not provide much info to the end user. |
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.
* associate it with. (We could have a shared `lastError` node but it would be so noisy as to | |
* not provide much info to the end user. | |
* associate it with. (We could have a shared `lastError` node but it would be so noisy as to | |
* not provide much info to the end user.) |
const likePayouts = (collateral, minted) => ({ | ||
Collateral: { | ||
value: { | ||
digits: String(collateral * 1_000_000), |
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.
I don't think this will survive the move to smallcaps (#6822).
Not critical. We'll notice when it's time.
No, this doesn't change any of the what has been published to vstorage. The only change to vstorage is that it adds a new update event for The changes to the tests for existing messages is that now the function call carries the rejection message so tests running in JS (which can get the promise) don't need to resort to reading over RPC. |
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.
ok, not a breaking change then.
5d89556
to
308caab
Compare
|
closes: #7004
Description
Users need to be able find out about errors in their wallet actions. The offer handler already publishes errors to vstorage. This makes it so that errors that happen earlier, in reading the walletAction, also get published, under a new
updated: walletAction
status.It leaves out publishing errors before that because there's no way yet to associate it with the account owner or transaction. And once there is, feeding it back will be done by the Cosmos bridge instead of the contract.
This also cleans up error handling within the offer executor. This required test changes, mostly simplifications to use
throwsAsync
instead of checking vstorage after. We have sufficient tests for offer failures writing to vstorage so we don't have to test it everywhere.Security Considerations
Error's
message
is logged to vstorage. The error construction should redact as needed.Scaling Considerations
Writes walletAction errors to vstorage.
Documentation Considerations
--
Testing Considerations
CI