Skip to content

Ledger: pass gasPrice when signing a legacy transaction - #5

Closed
techdigger wants to merge 1 commit into
mainfrom
pr/ledger-legacy-gas-price
Closed

techdigger wants to merge 1 commit into
mainfrom
pr/ledger-legacy-gas-price

Conversation

@techdigger

Copy link
Copy Markdown

What

LedgerWallet.get_signed_raw_transaction now passes gasPrice to ledgereth's create_transaction, alongside maxFeePerGas and maxPriorityFeePerGas.

Why

It passed only the EIP-1559 fields. On networks without EIP-1559, execute_safe_tx builds a legacy transaction with gasPrice. ledgereth then finds no price and assumes 0, so the Ledger signs a transaction the network refuses. Trezor already handles both types.

Tested

A new test in tests/test_hw_wallet_manager.py checks the call to create_transaction: a legacy transaction passes gas_price, and an EIP-1559 one passes the max fees and no gas_price. I did not test with a physical Ledger.


Generated by Claude Code

LedgerWallet.get_signed_raw_transaction passes only maxFeePerGas and
maxPriorityFeePerGas to ledgereth. For a legacy transaction, which
execute_safe_tx builds on networks without EIP-1559, ledgereth then
assumes a gas price of 0, so the Ledger signs a transaction the network
refuses. Pass gasPrice too.
@techdigger techdigger closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant