Skip to content
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

Stax/flex support #19

Merged
merged 56 commits into from
Oct 30, 2024
Merged

Stax/flex support #19

merged 56 commits into from
Oct 30, 2024

Conversation

steel97
Copy link
Contributor

@steel97 steel97 commented Oct 14, 2024

  • split code to use nbgl for flex/stax, bagl for nanos+/nanox
  • removed nanos target

Checklist

  • App update process has been followed
  • Target branch is develop
  • Application version has been bumped

@steel97
Copy link
Contributor Author

steel97 commented Oct 16, 2024

Great! Thanks for your quick response. I believe @kushti forwarded you an additional review from another developer.

I made few changes, tokens UI is now dynamically allocated

Copy link
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some issues while doing functional tests.

Important: Please note that this review isn't complete, just wanted to report what I have ASAP so you can have something to work with, I'm still working on functional tests and new issues can eventually come up

Derive address operation

  • It should be a one screen operation, just like in "Ext PubKey Export" command.
  • Currently it displays "Confirm send address", it would be good to keep it consistent with other "export" commands, so please rename it to "Address Export".

Sign operation

  • It's showing a zeroed AppID page even if no AppId is send.
Screenshot 2024-10-17 at 17 37 50

@arobsn
Copy link
Member

arobsn commented Oct 17, 2024

Found more issues on the Tx Signing flow:

  1. The user is not able to navigate back on the signing screens, just forward.
  2. Transaction signing crashes when the user clicks "confirm", with no error code, just a blank screen. Here you can see an minimal reproduction of the issue: https://github.com/arobsn/ledger-issue-minimal-reproduction
    Edit: Just confirmed that the minimal-reproduction code works perfectly on the nanosp build

@steel97
Copy link
Contributor Author

steel97 commented Oct 18, 2024

* It should be a one screen operation, just like in "Ext PubKey Export" command.

Done

* Currently it displays "Confirm send address", it would be good to keep it consistent with other "export" commands, so please rename it to "Address Export".

Done

Sign operation

* It's showing a zeroed AppID page even if no `AppId` is send.

Should be fixed with last commits

@steel97
Copy link
Contributor Author

steel97 commented Oct 18, 2024

2. Transaction signing crashes when the user clicks "confirm", with no error code, just a blank screen. Here you can see an minimal reproduction of the issue: https://github.com/arobsn/ledger-issue-minimal-reproduction
   **Edit**: Just confirmed that the `minimal-reproduction` code works perfectly on the `nanosp` build

Confirm is shown on Attest input stage, do you mean Approve signing stage?
image
For some reason it works for me in both debug/release builds.
Could you please try latest version?
image

@steel97
Copy link
Contributor Author

steel97 commented Oct 18, 2024

1. The user is not able to navigate back on the signing screens, just forward.

I made few improvements. Now back button is active in certain cases (should match nano x/s+ behavior).
Basically it's possible to navigate forward/backward while reviewing tokens.

image

@steel97
Copy link
Contributor Author

steel97 commented Oct 18, 2024

@arobsn actually I noticed that 0x00000000 app id is also shown in nano s+ build when signing tx:
image

Edit: fixed for nano s+/x as well
Edit 2: looks like test case requires app id even if it's zero:

flows[i].push({ header: 'Application', body: '0x00000000' });

commented out this check

Copy link
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address derivation

  • On both "Address export" and "Address confirm", change and index nodes of the derivation path are getting omitted. If I request 44'/429'/0'/0/0, only 44'/429'/0 is displayed, for example.

Transaction signing

I can confirm that signing is not crashing as previously reported, it was a mistake on my side, I though that just clicking on "hold to sign" was enough, but I need to click-and-hold until signing process is finished, not sure if it's a VNC issue tho.

  • Change must be displayed in the outputs confirm flow if CHANGE_INDEX_PATH - SIGN_INDEX_PATH > 19, this is important to avoid bad agents to set change to something like change_index = Int.MAX, see details in "Change confirmations" in Reduce the amount of confirmations on sign flow #11

@arobsn
Copy link
Member

arobsn commented Oct 18, 2024

@arobsn actually I noticed that 0x00000000 app id is also shown in nano s+ build when signing tx:

Thank you

@steel97
Copy link
Contributor Author

steel97 commented Oct 18, 2024

* On both "Address export" and "Address confirm", `change` and `index` nodes of the derivation path are getting omitted. If I request `44'/429'/0'/0/0`, only `44'/429'/0` is displayed, for example.

Fixed

* Change must be displayed in the outputs confirm flow if `CHANGE_INDEX_PATH - SIGN_INDEX_PATH > 19`, this is important to avoid bad agents to set change to something like `change_index = Int.MAX`, see details in "Change confirmations" in [Reduce the amount of confirmations on `sign` flow #11](https://github.com/ergoplatform/ledger-app-ergo/issues/11)

Stax/flex shares logic from s+/x, so this should work same. Screenshot from tx sign change 22 test:
image

Copy link
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be working as expected now. Thanks

@kushti kushti merged commit 709af7b into ergoplatform:main Oct 30, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase TOKEN_MAX_COUNT Drop Nano S support Add support for Stax and Flex devices
3 participants