-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add del_state support #640
Conversation
Signed-off-by: Marcus Brandenburger <[email protected]>
Signed-off-by: Marcus Brandenburger <[email protected]>
Signed-off-by: Marcus Brandenburger <[email protected]>
Signed-off-by: Marcus Brandenburger <[email protected]>
Signed-off-by: Marcus Brandenburger <[email protected]>
DO NOT merge until issue in #641 is discovered |
Need to check what is the problem here. Will continue after holidays :/ |
Signed-off-by: Marcus Brandenburger <[email protected]>
Expect(err).ShouldNot(HaveOccurred()) | ||
Expect(res).Should(Equal([]byte(value))) | ||
|
||
_, err = echoContract.EvaluateTransaction("del_state", key) | ||
res, err = contract.SubmitTransaction("del_state", key) |
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 fixes the failing integration test.
ctx->write_set.erase(key); | ||
ctx->del_set.insert(key); | ||
|
||
ocall_del_state(key, ctx->u_shim_ctx); |
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 unrelated to the PR)
Why do we do this ocall? -- we do the same for the put_state
.
The ocall for reading is necessary to grab the data. However, the ocalls for putting and deleting keys essentially update the transaction's rwset in Fabric, which we are not using (if I recall correctly). In fact, FPC maintains its own rwset, which is validated and replayed in the second step (of the two-step transaction commit procedure).
There may still be one reason for these ocall: checking for errors, and returning any error to the enclave.
The big problem is that any feedback/error would not be trustworthy. This is likely a showstopper for such error handling.
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.
very good observation. We should look into that in ideally remove the ocall for put_state
and del_state
if really not needed. This may positively chaincode execution performance.
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.
looks good - not tested locally
This PR adds
del_state
to the FPC shim.Signed-off-by: Marcus Brandenburger [email protected]