-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Sequence mismatch. Got 1 from device. Expected 0 #3266
Comments
Is this error still around? Did you try replugging the ledger? |
Yes, I kept getting the error, after replugging and restarting the ledger several times. As a note, I saw a similar issue trying to connect my Ledger to Metamask, through I then connected it to the Coinbase wallet without issue. I suspect there's some protocol version incompatibility between the ledger and whatever client library you're using on linux. |
cc @joshieDo |
cc @prestwich re: Ledger, has there been any change recently? |
error originates here during APDU response payload header parsing: https://github.com/summa-tx/bitcoins-rs/blob/c6fdb4cc6b2c8779d1e71c7046ff3eec6dcf61e1/ledger/src/transports/hid.rs#L259-L264 no change to the lib for a couple months. The sequence mismatch (got 0 expected 1) would indicate one of
Documentation of the sequence system for large blob txns Are you running ledger live or any other ledger-using application at the same time you're running the script? |
Leaning towards this. I don't have access to a ledger anymore, but I remember seeing some recent changes to how we instantiate wallets in the beginning. May be a resurgence of this gakonst/ethers-rs#1602 / #2790 - although i remember the error being different at the time. edit: #3047 recent changes i mentioned |
maybe?
maybe?
I was careful to close down Ledger Live and unconnect/reconnect the ledger, and clean the forge cache. Didn't help.
The error started with a two-transaction script. The first (small) transaction succeeded, and the second repeatedly failed after approval on the ledger. The second transaction was big-ger, but still only about 256 bytes of calldata. I also tried re-doing the script to only broadcast the second transaction, but it still failed. I'll try to post a redacted broadcast record to help debugging... |
this would seem to rule out the large payload, as the response payload from the ledger sign is small |
I don't have much time to work on this. but if someone wants to add tracing to the underlying ledger lib.....? :) |
Bump. This is still happening with latest foundryup. |
@gakonst I'm pretty sure this is related to running multiple signing processes at once |
Hi @AmesCornish, Would be great if you could check again, we've since moved to Alloy and a bug related to the kb size of the contract suite being deployed was fixed: #6516 (comment) |
Tentatively marking as Feel free to re-open if you are still facing issues around this @AmesCornish |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (084ef3d 2022-09-19T00:07:01.878472846Z)
What command(s) is the bug in?
script
Operating System
Linux
Describe the bug
I'm getting this error when trying to broadcast a transaction to mainnet using a ledger. The command is:
forge script script/MyScript.s.sol --broadcast --ledger
I had one transaction with a different script work this way, but this one succeeded in the dry run just fine, I approved it in the ledger just fine, but then I get the following output with a warning:
At first I thought this might be a nonce error, but the on-chain nonce is 3, so that doesn't fit.
What is this "sequence" of which it speaks? Any pointers would be appreciated!
The text was updated successfully, but these errors were encountered: