capsule-corp-ternoa / ternoa-enclaves

TEE enclaves that are highly secure with P2P real-time sync
2 stars 3 forks source link

Conflict when trying to add secret in a capsule #10

Closed Leouarz closed 11 months ago

Leouarz commented 11 months ago

Hello @peshwar9 @zorvan !!

A user from Secret Stash found an issue that was reproduced. When you :

Is that a bug or a wanted feature ? Is it documented somewhere ?

Let me know if you need more details

image

zorvan commented 11 months ago

Hello @Leouarz Thanks for your valuable feedback.

On the enclave side, base on the source-code, there is only single situation that returns "CONFLICT (409)", It is when someone wants to update a "secret-nft" keyshare which is not possible by definition.

Are you sure that you are using the right API endpoint for updating the key (nft instead of capsule)? Because in your logs, I can see/secret-nft/store-keyshare while it should be capsule-nft/store-keyshare

The updated documentation for Enclaves is here.

We have all returning errors documented somewhere else, I guess it is nice if we have them in Enclave documentation as well.

Leouarz commented 11 months ago

Hey @zorvan,

Thanks for your quick feedback. The NFT is this one : https://secret-stash.io/fr/nft/371652

I first created a capsule and it worked perfectly with the correct API to store capsule shards.

I then added a secret to it and got the conflict error. Probably because the enclaves have the Capsules shards.

You can see on the chain storage that the capsule is synced but not the secret. Also the chain does not contains any secret shards so the correct API should be to store the secret keys. That's where I get the conflict.

Also this must have happen recently because it was not like that before.

Pls telle me if you need more data.

zorvan commented 11 months ago

Agree.

I found the cause. It's been changed recently and the fixed will be applied in our new deployment. Until then, you should not have problem if you create the secret-nft first, then add capsule.

Thanks again.

Leouarz commented 11 months ago

Thank you very much, i'll wait for the release. Good luck !!