-
Notifications
You must be signed in to change notification settings - Fork 18
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
Filecoin TX params buffer size is very small #166
Comments
Thank you for the request, we're already working into this. |
Hey @kacperzuk-neti, thanks for your comments. We are already checking it. My guess is that this should be possible, but I want to add a test for such a case like this. Do you have the encoded blob you would send to the device? Is it possible you share it? We will add it as a test case on the app repo. |
@emmanuelm41 thanks for looking into it. Encoded Filecoin message to sign is in the first ticket message, I'll copy it here:
You can decode it on cbor.me. Though as mentioned, we expect it to grow to perhaps even twice this size depending on exact parameters. Is this what you need or do you need something lower-level? APDU commands? We're using |
I am sorry I did not see the blob on your first message. That is exactly what I need. I am checking right now! |
@kacperzuk-neti I am currently working on it here #167. As it is right now, I see an error parsing the cbor-encoded tx. I need to check what it is happening. According to cbor.me, the blob is a valid cbor. |
@kacperzuk-neti now it is working. I need to adjust now the max value, as it won't fit on nano s devices. Resources are really different between that one and the others, so I don't think it will be feasible on nano s devices |
Maybe streaming would be an option as a long-term solution? Here's a sample from ethereum app: https://github.com/LedgerHQ/app-ethereum/blob/develop/src_features/signMessageEIP712/field_hash.c#L239 Instead of loading all into memory and then hashing and signing it, they take a chunk, ask user to confirm on device, update the hash and drop the data. That way they support arbitrarily long data. Alternatively the data could perhaps be stored in NVRAM? That would make the app larger, but wouldn't require as much changes in the code. |
Yes, I agree there are many options to have support to much bigger params fields. I went straight to the quicker one, as it is easier to increase that buffer size, which will increase the stack usage. One thing is the buffer, other is the space used to show that param on the screen. Storing the input data on nvram is something we already do. But here we are talking about parsing mostly. We could implement lazy parsing too, which would allow us to parse just the piece of info we need, use it, and discard it. I added a zemu test for the tx blob provided, and it is working for all devices, except nano s. That should unlock you now! Could you please have a look and let me know? |
* chore: add test cases to cover reported issue #166 * feat: increase str buf len * chore: set deps correctly * feat: update snapshots, skip nano s
@kacperzuk-neti It is already merged on master. Now we will send the PR to ledger. It will be released once ledger does it! |
Sounds great, thank you! It will definitely help a lot already. |
I too have a nano s (plus) ledger. |
ledger-filecoin/app/src/parser_txdef.h
Line 34 in de3ee0e
Params size is limited to 200B. We have a use case in which this isn't enough:
Our first test transactions (see CBOR-encoded tx below) have ~500B of params data, but we expect it to get to around ~1000.
Is it technically feasible to increase this buffer size?
The transaction:
🔗 zboto Link
The text was updated successfully, but these errors were encountered: