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

Foundry script breaks on Base network for certain transactions signed with Ledger (error: chainId 0) #5819

Closed
2 tasks done
sendra opened this issue Sep 12, 2023 · 2 comments
Closed
2 tasks done
Labels
A-compatibility Area: compatibility Cmd-forge-script Command: forge script T-bug Type: bug T-to-reproduce Type: requires reproduction
Milestone

Comments

@sendra
Copy link

sendra commented Sep 12, 2023

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (bff4ed9 2023-08-29T00:32:25.634676000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

When using forge script to deploy on the Base network, on certain transactions its sending chainId 0 to ledger, which makes it fail with error:


==========================

Chain 8453

Estimated gas price: 0.109494488 gwei

Estimated total gas used for script: 5370493

Estimated amount required: 0.000588039381342584 ETH

==========================

###
Finding wallets for all the necessary addresses...
##
Sending transactions [0 - 2].
2023-09-12T11:21:32.611137Z ERROR coins_ledger::transports: Received error from device err="Ledger device: APDU Response error `Code 6985 ([APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied)`"
2023-09-12T11:21:32.611366Z ERROR ethers_signers::ledger::app: error=Ledger device: APDU Response error `Code 6985 ([APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied)`

Transactions saved to: /Users/SomeContractPath/8453/run-latest.json

Sensitive values saved to: /Users/SomeContractPath/8453/run-latest.json

Error:
Failed to sign transaction

Context:
- Ledger device: APDU Response error `Code 6985 ([APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied)`
make: *** [deploy-payloads-controller-chain] Error 1

Have not been able to isolate the cases for when this happens. But provably similar problem to this issue: #4362

@sendra sendra added the T-bug Type: bug label Sep 12, 2023
@zerosnacks zerosnacks added the T-to-reproduce Type: requires reproduction label Jul 4, 2024
@zerosnacks
Copy link
Member

zerosnacks commented Jul 4, 2024

Hi @sendra thanks for reporting. Have you experienced issues around this more recently? We've since migrated from Ethers to Alloy. If so, would greatly appreciate a minimal reproduction if possible.

The root cause of #4362 is still open unfortunately: LedgerHQ/app-ethereum#409

The workaround implemented in Ethers has also been implemented in Alloy: https://github.com/alloy-rs/alloy/blob/ca1f1f00dc98c975ab81ea095ecd6de627974e82/crates/signer-ledger/src/signer.rs#L246-L249

@zerosnacks zerosnacks added Cmd-forge-script Command: forge script A-compatibility Area: compatibility labels Jul 4, 2024
@zerosnacks zerosnacks changed the title Foundry script breaks on Base network for certain transactions (with chainId 0) Foundry script breaks on Base network for certain transactions signed with Ledger (error: chainId 0) Jul 4, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy
Copy link
Collaborator

@sendra we're going to optimistically close this one as an workaround is already implemented in alloy. Please reopen if still an issue. Thank you!

@grandizzy grandizzy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: compatibility Cmd-forge-script Command: forge script T-bug Type: bug T-to-reproduce Type: requires reproduction
Projects
Status: Done
Development

No branches or pull requests

3 participants