aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.89k stars 3.56k forks source link

[Bug] Ledger key fails to sign the upgrade of a multisig contract for some packages #13640

Open robojosef opened 3 weeks ago

robojosef commented 3 weeks ago

🐛 Bug

My team uses a multisig to manage our mainnet contracts. I recently started using a Ledger wallet as my multisig approver key. I've been able to perform most tasks except one: I can't execute the multisig upgrade of one of our contracts. When I attempt the upgrade I see the following error:

aptos multisig execute-with-payload     --multisig-address 0xccd2621d2897d407e06d18e6ebe3be0e6d9b61f1e809dd49360522b9105812cf  --json-file payload.json
Do you want to submit a transaction for a range of [3101100 - 4651600] Octas at a gas unit price of 100 Octas? [yes/no] >
yes
{
  "Error": "Unexpected error: Error - Wrong raw transaction length (0xb004)"
}

This error code appears to originate from the ledger hardware itself:

https://github.com/aptos-labs/aptos-core/blob/914cea9ee8adba1060fc9bb96d1852a443f007a2/crates/aptos-ledger/src/lib.rs#L173

What's more: I'm able to execute the upgrade with a soft cli wallet.

To reproduce

This works fine some packages but not other. The only obvious distinction between the packages that work and the package that fails is that the package that fails is much larger.

The other interesting detail is that proposing the upgrade of the large package works fine with the ledger hardware. It only fails on execution.

Expected Behavior

I expect execution of multisig transactions to work the same regardless of using a soft cli key or a hardware ledger key.

System information

Please complete the following information:

Aptos CLI v3.4.1

0xbe1 commented 2 weeks ago

this is a known issue due to ledger wallet small memory https://aptos.dev/tools/aptos-cli/use-cli/on-chain/ledger/#signing-using-ledger