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

Sepo-Ledger: Patch @ledgerhq/hw-app-eth for Arbitrum Sepolia chain id handling #3650

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

Shadowfiend
Copy link
Contributor

@Shadowfiend Shadowfiend commented Oct 31, 2023

It currently seems like there is an issue with Ledger's handling of high chain ids for certain transactions, where the Ledger can provide a first byte that breaks the expectations of the chain id adjustment done for legacy transactions to conform to EIP-155. The resulting v value returned from the signing flow is invalid and Ethers throws because of this.

This fix may be correct, but it may not be. To adjust for this fact, the patch limits adjustments of the underlying parity value in Ledger to happen only when the chain id matches Arbitrum Sepolia's (412614), as that's the only place we've seen consistent reports of the issue.

See also LedgerHQ/ledger-live#5265 .

Fixes #3647 .

Testing

  • Easiest way to test here is really to just hammer https://app.taho.xyz/ . In reproducing, we've found that some transactions trigger the issue and others don't, depending on what the first byte of the Ledger response to the signing request is.

Latest build: extension-builds-3650 (as of Thu, 02 Nov 2023 02:14:12 GMT).

It currently seems like there is an issue with Ledger's handling of high
chain ids for certain transactions, where the Ledger can provide a first
byte that breaks the expectations of the chain id adjustment done for
legacy transactions to conform to EIP-155. The resulting `v` value
returned from the signing flow is invalid and Ethers throws because of
this.

This fix *may* be correct, but it may not be. To adjust for this fact,
the patch limits adjustments of the underlying parity value in ledger to
happen only when the chain id matches Arbitrum Sepolia's (412614).
Copy link
Contributor

@jagodarybacka jagodarybacka left a comment

Choose a reason for hiding this comment

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

Looks good, only this comparison is worrying me a bit. I'll let @andreachapman and @michalinacienciala QA it before merging (unless we want to QA it all in one batch on the release)

patches/@ledgerhq+hw-app-eth+6.33.4.patch Show resolved Hide resolved
@Shadowfiend Shadowfiend merged commit 641ef8b into main Nov 2, 2023
6 of 7 checks passed
@Shadowfiend Shadowfiend deleted the sepo-ledger branch November 2, 2023 01:56
@Shadowfiend Shadowfiend mentioned this pull request Nov 3, 2023
Shadowfiend added a commit that referenced this pull request Nov 7, 2023
## What's Changed
* v0.50.0 by @jagodarybacka in
#3643
* Unsettled Networks: Clear an origin's current network when revoking
dApp permissions by @Shadowfiend in
#3616
* Sepo-Ledger: Patch @ledgerhq/hw-app-eth for Arbitrum Sepolia chain id
handling by @Shadowfiend in
#3650
* Proxy Wars: More QoL improvements for dApp connections by @Shadowfiend
in #3613


**Full Changelog**:
v0.50.0...v0.51.0

Latest build:
[extension-builds-3652](https://github.com/tahowallet/extension/suites/17870144186/artifacts/1025746882)
(as of Fri, 03 Nov 2023 02:06:50 GMT).
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.

transaction.chainId/signature.v mismatch error when signing transactions using Ledger
2 participants