LIT-Protocol / Issues-and-Reports

For bug reports, feature requests, and implementation questions related to Lit Protocol and use of the Lit SDK.
0 stars 0 forks source link

[Discord] `Error getting owner of PKP` and `Failed to sign ecdsa` errors #43

Open spacesailor24 opened 2 months ago

spacesailor24 commented 2 months ago

Description of the issue

37 was closed and this issue tracks the user's new implementation and errors they're receiving:

To help me you need:

Pinata keys, Set up two private wallets, one with LIT tokens available. Check and run this code

A common error is: "Error getting owner of PKP" Also with old (which uses authSign and was working) version:

[Lit-JS-SDK v5.1.0] [2024-05-29T18:40:32.977Z] [ERROR] [core] [id: 4ef30127fe67f] Something went wrong, internal id for request: lit_4ef30127fe67f. Please provide this identifier with any support requests. 
[Lit-JS-SDK v5.1.0] [2024-05-29T18:40:33.758Z] [ERROR] [core] [id: 4ef30127fe67f] most common error: {"success":false,"error":"Failed to sign ecdsa: lit_node::Error { kind: Unexpected, code: NodeContractResolverConversionFailed, msg: "Error getting owner of PKP", source: Revert(Bytes(0x)), caller:  { file: "src/pkp/auth/mod.rs:343:13" } }"}

Worth mention and highlight that I do use:contractClient.pkpNftContract.write.mintGrantAndBurnNext in my deployment.

Additional context

No response

spacesailor24 commented 2 months ago

My reply in Discord:

Hey @ssribeiro , regarding the Error getting owner of PKP error, I believe this is a known issue on our side that we're attempting to address. As part of effort to address the issues with our rollup Chronicle (⁠📣-announcements⁠), we've stopped communicating directly with our sequencer and instead are communicating with our replica nodes. As a result, when minting a PKP and attempting to immediately use it, a race condition occurs on some nodes because they're attempting to call PKPNFT.ownerOf(pkpTokenId) before they've even seen the tx to mint the PKPNFT. The team did mention that this error is likely to go away if you have a delay (~1 second) between minting and using a PKP, but that not really feasible if you're using mintGrantAndBurnNext. I've asked the team what to do in the case of mintGrantAndBurnNext and will get back to you when I have more info


A follow up from the user:

Hi. I've set up a dummy PKP with authorization to sign any and using authSign to keep going with the tests and debugs. With one simple lit action validator (just validates data input in the json right format, string size, etc..) it works and signs. But with exact same code setup, same publicKey, eth address.. same pkp, execpt by a bigger and more complex lit action (pricing), it returns the exact same error as before:

[Lit-JS-SDK v5.1.0] [2024-06-05T14:39:29.090Z] [ERROR] [core] [id: 6aab38e12ad1f] Something went wrong, internal id for request: lit_6aab38e12ad1f. Please provide this identifier with any support requests. 
[Lit-JS-SDK v5.1.0] [2024-06-05T14:39:29.800Z] [ERROR] [core] [id: 6aab38e12ad1f] most common error: {"success":false,"error":"Failed to sign ecdsa: lit_node::Error { kind: Unexpected, code: NodeContractResolverConversionFailed, msg: "Error getting owner of PKP", source: Revert(Bytes(0x)), caller:  { file: "src/pkp/auth/mod.rs:343:13" } }"}

This is suggesting me that this may??.. has something to do with the time duration of the lit action??? complexity? rather than the PKP creation process? Really blind here.


We asked for a follow up on the latest user implementation, but they're currently OOO so we are awaiting a reply:

image
ssribeiro commented 2 months ago

Hi, @spacesailor24 . I'm glad to be back. Thanks for all the support and help given so far.

I can identify, currently, two main issues I need help with:

First Issue: I need a CODE REVIEW. I need help with the new implementation for the new SDK version 6, which does not support the parameter "authSig" when calling the LIT action "executeJs" function. This is a simple matter of what to do, instead of a bug report. It is a simple stupid guide to a newby on how to implement the lit action with the new SDK. To make it easy, I made a git repo and put all the code there with all the necessary steps to achieve what I needed for our project. It is simply running a dummy lit action with the following steps:

Deploy the lit action using Pinata. Mint&Grant&Burn a PKP to allow only the lit action executing nodes to sign the transaction. Buy Capacity Credits. Delegate the credits to the Lit action (what I am attempting on the code) or either to the executing Lit action user. Execute the dummy Lit action.

The repo is this one: https://github.com/ssribeiro/lit-debug

I do remember you mentioned an issue with the mint&grant&burn method if I'm not wrong. Can you please clarify the current status of support for this feature? I want to state that this method of PKP creation is important to attend to the trustless requisites of our application, as we, ourselves can't be able to create another lit action capable of signing with one certain PKP. That is one reason why it is important to get this repo working following these steps. We can use any decentralized network of lit like Manzano or Habanero, or even a step back to a centralized, if not ready yet, as long as I have an ETD for such a decentralized one.

Second Issue: The issue with the timeout with the lit action is a mix between two issues: The new network got too slow, which made me set the lit action to use a big "time window" parameter. That "Time Window" parameter deserves a better explanation of what it is, what it does, and why it is there. Let's save this for later now. What is important to know now is that this caused the lit action to take too long, which causes it to time out in the nodes. (From my better guess).

I believe we need to fix things in the right order and my priority now is getting help with a very simple basic dummy lit action, the first issue. I think I can debug and maybe find a solution on my own with the second issue or at least make it clarified to get help, but I don't like the idea of doing it with the old SDK and using the "authSig" parameter. It is imperative for me to focus on the solution with the system as closely as possible as it will be when done. Please I beg you to help with this simple implementation first before we start to dive into the specific problem.

Our system is very coupled with the Lit Action protocol and we will be using it massively for validations, business rules enforcement, and pricing. It is aiming for a real-time application where the moment pricing took place and how long it takes for lit action to return the signed data is critical. I'm willing to share the details of the system, but first I ask you for a bit of patience to step back on the basics.

Please take a look at this repo and gimme light on what to change to make it run, as well as any comment on its feasibility with active LIT decentralized networks. Thanks in advance!

https://github.com/ssribeiro/lit-debug