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

Support LondonSigner in Ledger USBWallet #30173

Closed
shrimalmadhur opened this issue Jul 16, 2024 · 0 comments · Fixed by #30180
Closed

Support LondonSigner in Ledger USBWallet #30173

shrimalmadhur opened this issue Jul 16, 2024 · 0 comments · Fixed by #30180
Assignees

Comments

@shrimalmadhur
Copy link
Contributor

shrimalmadhur commented Jul 16, 2024

Rationale

Why should this feature exist?
Currently Ledger only support LegacyTx and I want it to support DynamicTx as the LegacyTx is well, Legacy.

// Create the correct signer and signature transform based on the chain ID
var signer types.Signer
if chainID == nil {
signer = new(types.HomesteadSigner)
} else {
signer = types.NewEIP155Signer(chainID)
signature[64] -= byte(chainID.Uint64()*2 + 35)
}
signed, err := tx.WithSignature(signer, signature)

What are the use-cases?
Can use EIP1559 dynamic fee tx

Implementation

Do you have ideas regarding the implementation of this feature?
No - I have been reading the code and trying to see what all changes I will have to make, but I can give it a shot.

From what I understand this block needs to support typed transactions as ethereum app on ledger supports parsing that.

if chainID == nil {
if txrlp, err = rlp.EncodeToBytes([]interface{}{tx.Nonce(), tx.GasPrice(), tx.Gas(), tx.To(), tx.Value(), tx.Data()}); err != nil {
return common.Address{}, nil, err
}
} else {
if txrlp, err = rlp.EncodeToBytes([]interface{}{tx.Nonce(), tx.GasPrice(), tx.Gas(), tx.To(), tx.Value(), tx.Data(), chainID, big.NewInt(0), big.NewInt(0)}); err != nil {
return common.Address{}, nil, err
}

I still don't know how to deal with this though

// Chunk size selection to mitigate an underlying RLP deserialization issue on the ledger app.
// https://github.com/LedgerHQ/app-ethereum/issues/409
chunk := 255
for ; len(payload)%chunk <= ledgerEip155Size; chunk-- {
}

Are you willing to implement this feature?
Yes

@shrimalmadhur shrimalmadhur changed the title Support LonderSigner in Ledger USBWallet Support LondonSigner in Ledger USBWallet Jul 16, 2024
@gballet gballet self-assigned this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants