-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix(cli): handle not found error in vstorage requests #8538
Conversation
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.
Just one question but lgtm either way
packages/agoric-cli/src/lib/rpc.js
Outdated
@@ -143,7 +147,11 @@ export const makeVStorage = (powers, config = networkConfig) => { | |||
)); | |||
// console.debug('readAt returned', { blockHeight }); | |||
} catch (err) { | |||
if (err.message.match(/unknown request/)) { | |||
if ( | |||
err.message.match(/unknown request/) || |
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.
Any reason to keep this check around or can we remove it?
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.
to not break mainnet and devnet users, until each is respectively updated.
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.
Ah I just tested on devnet, I'm getting error code "6", so looks like the code changed and not just the message
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.
@gibson042 I added a test suite to vstorage querier. PTAL |
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.
Nice!
path: []string{"data", "bar"}, | ||
// DO NOT CHANGE | ||
// The UI and CLI check for the specific cosmos-sdk error code & codespace | ||
err: sdkerrors.ErrNotFound, |
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.
Would it be going too far to also assert somewhere that sdkerrors.ErrNotFound
itself corresponds with code 38 in codespace "sdk"? That would capture our requirement of stability in cosmos-sdk.
2e97211
to
21db80e
Compare
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 defer to other reviewers.
filing this review to get it off my queue
…t-found fix(cli): handle not found error in vstorage requests
closes: #8535
refs: #8348
Description
#8348 changed the validation of vstorage paths, including the errors returned for invalid or not found paths.
Unfortunately some code had hardcoded part of the error message when iterating over values to break out of the iteration, resulting in the error terminating abruptly instead.
This change uses the more stable error code of the error returned by the RPC server.
Security Considerations
None
Scaling Considerations
None
Documentation Considerations
None
Testing Considerations
No integration test exists for this. I'm not sure where it could live.
Tested manually.
Upgrade Considerations
Should be backported to the
release-mainnet1B
for consistency