-
Notifications
You must be signed in to change notification settings - Fork 1
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
Change query input enconding #1
Comments
I saw PR #6 but I still wonder if we need all of this, have you tested different running conditions and understood why the |
In order to understand why the |
Yes exactly, maybe you can leverage on our logging system to know more. |
I'm doing some experiments, for now, I don't have good news. Starting from the run on my local machine with that 3 args:
The output on mu cmd is:
From the online logger we can see that as args array:
Conclusion the "`" can't be used as a delimiter (like I did in this example) for the args, the single and the double quotes are working correctly. About the workerpool execution, I can't execute the DApp in a workepool from the app-order (yet), but I can run it in a workerpool using the run command. I found some problems here. Using simpler args in order to understand the problem, in that case, we will pass 3 arguments that are strings with spaces, so we need to use double quotes as delimiters for the args. So the correct command should be like: We can see that the JSON string removes the first level of double quotes, so I tried with: |
Yes ` is a well know delimiter for bash and it is used to call subshell. Not sure if you use PowerShell for your experiments but I guess it is used there similarly.
Ok, something is weird, but why don't you use
I would try this:
|
Yea, this worked, you can see here the transaction with that params: Iexec explorer deal I tested that too: Now we are pretty sure that, the problem is the |
Good news, can you try passing the JSON serialization of the query in this testing app? Perhaps it would be nice to add a simple
After that test, we can move on with DESMO-LD. It is the SDK that is calling the execution. |
Check also this StackOverflow answer about how to escape |
Confirmed it work with --args: |
What about this? |
Sorry, I missed that comment. The problem maybe is that JSON.stringify is converting We need to escape all the special chars inside: Error: SyntaxError: Unexpected token d in JSON at position 57 After that I tried that: |
The new version of the desmo-dapp_test_param, same command of the last test:
It works!!! |
The new version of the desmo-dapp_test_param, same command of the last test:
Why don't you use |
That does not work: I think this is cause of IExec CLI. I tried with Is possible that the At the end I tested that: In my opinion that is a little bit strange, but it seems that: if the single quote is internal to a double quote it will not be removed by the iexec command, but if you use the single quote as a string delimiter for the Args that will not work, it will be removed. |
@FerrariAndrea regarding this issue we would like to know the max string length that we can encode in the iexec args. Can you give us a number? |
Also seems that somebody didn't get through enough in the iexec documentation. We can use |
Yea I know about the Input-files... but I thought that was not the best solution for us, we do not have files. Of course, we can use a file in order to pass the JSON query, but just because the query passed by args is not working well. I will have a look |
I don't find any on the documentation about ARGs size, I think it depends on the OS that is running on the worker pool. I tested a long query string with 2187 chars and it works, you can see that on the explorer: https://explorer.iex.ec/viviani/deal/0xfe3cc81f895615ae8dcf42752a5ad16c9afbdc70ea353081783c90761b77782a Using the input file method instead pass the query by args can be a problem for our project structure. |
Can you do more tests with longer strings?
Sometimes I wonder if you really read the comments.... :
Read the ipfs documentation and how it works you'll see that ipfs is a distributed storage for files and it is pretty common in the Web3 world as an immutable record of files. We already have considered the pros and cons of this solution and it is not that bad. I just want to know if it works. |
Considering only the length of the query, in the args, we have the requestID in addition. Query length 13542 chars: Query length 11082 chars: Query length 9277 chars: Query length 5475 chars, it worked Query length 8250 chars, it worked 6700000:10464190=x:13542 -> x=8.670 |
Encoding the query JSON with
__!_
and__#_
is not valid for production. We should investigate how to correctly escape"
and'
characters and if it is not possible to escape it would be probably better to just use an URL encoder (ex: https://meyerweb.com/eric/tools/dencoder/ ) as an encoding algorithm.The text was updated successfully, but these errors were encountered: