-
Notifications
You must be signed in to change notification settings - Fork 2
support sstoragePisa.RemoveKVData #113
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
base: tm_w3q
Are you sure you want to change the base?
Conversation
The remove operation consists of two steps.
Test
|
core/vm/contracts.go
Outdated
evm.StateDB.SstorageWrite(caller, lastKvIdx.Uint64(), make([]byte, sstorage.ShardInfos[0].KVSize)) | ||
} else { | ||
// Read the data corresponding to lastKvIdx | ||
replaceData, _, _ := evm.StateDB.SstorageRead(caller, lastKvIdx.Uint64(), int(sstorage.ShardInfos[0].KVSize), common.Hash{}) |
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.
What if the replaceData does not exist locally?
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.
TWP Section 5.3 has a discussion on this https://galileo.web3q.io/file.w3q/0x67d0481cc9c2e9dad2987e58a365aae977dcb8da/dynamic_data_sharding_0_1_6.pdf
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 took an approach that only allows deletion of KV entries in the last shard
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.
What will happen in this case: the shard is still synchronizing, so the SstorageRead
may be stale. If we move the last kv into a kv index past synchronizing, the stale data will be there forever. If we add verification logic when SstorageRead
, we can't even guarantee the execution result is the same across nodes.
No description provided.