-
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(internal): Add StorageNode delete
method
#8063
base: master
Are you sure you want to change the base?
Conversation
await childNode.delete(); | ||
t.deepEqual( | ||
messages.slice(-1), | ||
[{ method: 'delete', args: [childPath] }], |
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 seems to verify that a message crosses a bridge.
How about a a test where we see something like 3 child nodes a, b, and c; then we delete b and we see only a and c?
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 runs against a fake backend, so such a test wouldn't be indicative of much (and also, the StorageNode interface does not provide a means of enumerating children). But verification of effects upon chain storage data when messages such as this are received is included in the changes to golang/cosmos/x/vstorage/vstorage_test.go.
ee5da3d
to
5bd85dd
Compare
This is clearly progress on #7405, but I'm not sure it fixes that issue until we have a tested path to upgrade I suppose that likewise upgrading the bridge vat without upgrading the golang side won't work, so the upgrade has to be a chain software upgrade. I see #7977, but it doesn't mention this feature explicitly. (It doesn't mention any features explicitly, though.) |
Documenting @gibson042 's work-around until this available in production. with
|
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 think @mhofman has some design feedback. I'm reviewing as Comment to get it off my review queue until we hear that.
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.
My thoughts were captured in #7405 (comment), and I haven't had time to get back to this since. We should probably have a design discussion on this topic.
Fixes #7405
Description
Adds a StorageNode
delete
method and the backing implementation in vstorage.Security Considerations
This extends the power of holding an append-style StorageNode to include clearing out yet-to-be-published chain storage data (i.e., from a
setValue(…)
earlier in construction of the block). But since StorageNodes are not widely shared and the same situation is already possible if a non-append StorageNode references the same path, this is considered acceptable.Scaling Considerations
This represents a slight reduction in message size vs. using "set" to accomplish the same effect, because the new vstorage "delete" message expects an array of paths rather than an array of
[path, value?]
entries.Documentation Considerations
No documentation is needed beyond the TypeScript information in JSDoc comments.
Testing Considerations
Extension of existing unit tests should suffice.
Upgrade Considerations
Vats (and more specifically, the bridge vat that holds all StorageNodes) must not be allowed to pull in the updated lib-chainStorage before all nodes have pulled in the vstorage.go changes—although it would be acceptable for both to coincide in a single release, and in practice vat changes will require an explicit upgrade that is managed separately from updating Go code.