-
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
feat(cosmos): Add a "CapData" vstorage RPC endpoint #8056
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8bdd7cb
feat(cosmos): Add a vstorage package for decoding CapData
gibson042 8943f2f
feat(cosmos): Add a "CapData" vstorage RPC endpoint
gibson042 b68a5ba
chore(cosmos): Regenerate protobuf code
gibson042 22c7d49
fixup! feat(cosmos): Add a "CapData" vstorage RPC endpoint
gibson042 9356509
chore(cosmos): Improve vstorage capdata error messages
gibson042 36b921d
test(cosmos): Test vstorage capdata
gibson042 a7f17fe
test(cosmos): Test gRPC endpoint "/agoric.vstorage.Query/CapData"
gibson042 e4bfad3
chore(cosmos): Improve vstorage/keeper/grpc_query.go doc comments
gibson042 dff7e93
chore(cosmos): Add vstorage README
gibson042 b4fdcc9
chore(cosmos): Avoid special treatment of HTML characters in vstorage…
gibson042 e2cbffa
feat(cosmos): Always include alleged name and slot id in vstorage Cap…
gibson042 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Virtual Storage | ||
|
||
This module manages "[IAVL](https://github.com/cosmos/iavl)" chain storage data with a hierarchical keyspace in which each key is a "[path](./types/path_keys.go)" composed of zero or more dot-separated nonempty segments in a restricted alphabet. It exposes gRPC endpoints to arbitrary external clients for reading data, and internal read/write interfaces for use by SwingSet (which itself manages further subtree-scoped attenuation). | ||
|
||
## Internal Go interface | ||
|
||
[Keeper](./keeper/keeper.go) | ||
* generic | ||
* GetChildren | ||
* GetEntry | ||
* HasEntry | ||
* HasStorage | ||
* SetStorage[AndNotify] | ||
* StreamCell-oriented (a StreamCell captures a block height and an array of values) | ||
* AppendStorageValue[AndNotify] | ||
* queue-oriented (a queue stores items at paths like "$prefix.$n", documenting | ||
the n for the next item to be consumed at "$prefix.head" and the n for the next | ||
next item to be pushed at "$prefix.tail" such that the queue is empty when both | ||
head and tail store the same n) | ||
* GetQueueLength | ||
* PushQueueItem | ||
|
||
## Internal JSON interface | ||
|
||
This is used by the SwingSet "bridge". | ||
|
||
[Receive](./vstorage.go) with input `{ "method": "...", "args": [...] }` | ||
* generic | ||
* method "entries", args path | ||
* method "get"/"has", args path | ||
* method "set"/"setWithoutNotify", args [[path, value?], ...] | ||
* method "children", args path | ||
* method "values", args path (returns values for children in the same order as method "children") | ||
* method "size", args path (returns the count of children) | ||
* StreamCell-oriented | ||
* method "append", args [[path, value?], ...] | ||
|
||
## External protobuf interface | ||
|
||
gRPC via [Querier](./keeper/keeper.go) | ||
and CometBFT method "abci_query" with params `{ "path": "/agoric.vstorage.Query/...", "data": "<hexadecimal representation of serialized protobuf>" }` via the same | ||
* /agoric.vstorage.Query/CapData | ||
* /agoric.vstorage.Query/Children | ||
* /agoric.vstorage.Query/Data | ||
|
||
## Arbitrary-response HTTP interface | ||
|
||
This depends upon appModule `LegacyQuerierHandler` functionality that is [removed from cosmos-sdk as of v0.47](https://github.com/cosmos/cosmos-sdk/blob/fa4d87ef7e6d87aaccc94c337ffd2fe90fcb7a9d/CHANGELOG.md#api-breaking-changes-3) | ||
|
||
[legacy querier](./keeper/querier.go) | ||
* /custom/vstorage/children/$path | ||
* /custom/vstorage/data/$path |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is important documentation. is it published somewhere using godoc ?
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.
Not that I know of (as mentioned in the PR summary, we don't seem to have any documentation of RPC endpoints). Does anyone have a place where they would expect to find 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.
It's far from perfect, but we have >0 for inter protocol RPC stuff: https://github.com/Agoric/agoric-sdk/tree/master/packages/inter-protocol#reading-data-off-chain
As to the rest, yes, it's been a hole in our docs for some time; I put what notes I learn in...
In some sense, this is a different issue, since that issue was about documentation of the form "Agoric stuff is based on cosmos-sdk; go read XYZ to find out how the lower level works." It turns out that there's no obvious candidate for XYZ, btw.
The inter-protocol precedent suggests a readme under
golang/cosmos/x/vstorage
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.
Added golang/cosmos/x/vstorage/README.md.
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.
Also, it turns out that the documentation is available via godoc of the generated pb.go.