-
Notifications
You must be signed in to change notification settings - Fork 220
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
block-aware API for deleting StorageNodes #7405
Comments
Question: Is there a need for recursive delete, or just a single storage node? |
@michaelfig @gibson042, thinking about this, should a |
Ugh, that would bring in all kinds of complexity (e.g., write then delete then write again). I'd really prefer to keep stomping on any writes that precede |
I'm really concerned that contract code does not have the concept of what the block boundary is, and they may expect the write performed in a previous delivery, but executed in the same block, to be visible off-chain. |
Keep in mind that basically every write is accompanied by a I may be convinced to handle |
First, a clarification. My understanding is that vstorage has 2 features:
vstorage accomplishes the first by offering a I believe that a node should not switch semantics over time. If a node has I would expect that a deletion of a Then there is the question of intent for a delete of an append node. I think that's where my previous observation comes in that we could optimize our storage cost by actually removing the cell in the subsequent block (if the last value of the cell is a deletion). From what I understand of the vstorage model, we could theoretically generalize this and always rewrite all cell nodes that were just updated the previous block to the latest value from the cell only (low level write, without events generated), but given how an IAVL DB works, that may actually be counter productive. |
A potential workaround for a publisher, until a deletion API is available:
The advantage of the above is that it delays the actual deletion of the node to a subsequent block so that external consumers can consume any final value. The drawback is that it puts the deletion book keeping burden onto the publisher. Update: The potential users of this deletion API do not currently have a timer, and don't want to gain one, so this workaround doesn't work. |
We discussed this more today with @gibson042. Some quick observations:
|
I prefer this approach. Using "another store altogether" goes against the Cosmos convention of having just one main store per module, and dividing it up by subprefixes. The current |
refs: #10598 ## Description The dashboard will requires data for each transaction. In the course of designing that we explored how to design the storage node paths without creating too much cost in IAVL. (The data in HEAD carry a burden of magnitude O(k+v) for all network nodes (including non-validators) into perpetuity.) Examining [the trade-offs](https://alpha.decidedly.co/d/b27cbb6a-df71-4136-aa27-3e947015e84b/view) we arrived at: - store one node per transaction - push all changes through it - rely on indexer to demux - delete on demand - when we have [an API for block-safe deletion](#7405) it can delete in the operation - until then keep track of what to delete - a core-eval can be run to cull data whenever necessary ### Security Considerations none ### Scaling Considerations One storage path per transaction, which persists until the deletion job is called. One entry in a set to keep track of transactions to delete. ### Documentation Considerations Not developer facing ### Testing Considerations CI ### Upgrade Considerations not yet deployed
What is the Problem Being Solved?
Once a StorageNode is made, there's no clear way to delete it from RPC. #5945 describes
setValue(undefined)
but that will only delete ifsequence: set
whereas the contracts all usesequence: append
presently.The
sequence
value is on the StorageNode object, not the stored path so one work-around is to make a StorageNode object withsequence:false
and then callsetValue('')
, but that wipe out any data written within the current block.Description of the Design
An API method to delete the node.
When a contract marks a
sequence:true
node for deletion, it should not affect data already written. That entails waiting for the next block to actually delete it.A way to trigger that from a wrapping
Recorder
.Security Considerations
Scaling Considerations
Test Plan
The text was updated successfully, but these errors were encountered: