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

Unable to send transactions using cast sendon Arbitrum One and Arbitrum Testnet #1461

Closed
2 tasks done
ntchjb opened this issue Apr 30, 2022 · 7 comments
Closed
2 tasks done
Assignees
Labels
C-cast Command: cast C-forge Command: forge Cmd-forge-create Command: forge create T-bug Type: bug

Comments

@ntchjb
Copy link

ntchjb commented Apr 30, 2022

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

cast 0.2.0 (dda0189 2022-04-30T00:13:42.850610+00:00)

What command(s) is the bug in?

cast send --chain "arbitrum" --rpc-url "https://arb1.arbitrum.io/rpc" --ledger --hd-path "m'/44'/60'/3'/0/0" --value 0.001ether [Receiver Address]

Operating System

macOS (M1)

Describe the bug

When cast send is used to send an arbitrary transaction e.g. send some ether to someone, it always fail on Arbitrum One and Arbitrum testnet chains. The Error after sent eth_sendRawTransaction request is as follow.

(code: -32000, message: invalid chain id for signer, data: None)

I'm not sure whether transaction encoding format used by Arbitrum is different from other chains.

@ntchjb ntchjb added the T-bug Type: bug label Apr 30, 2022
@onbjerg
Copy link
Member

onbjerg commented Apr 30, 2022

Does your ledger support Arbitrum One? It seems this error is directly from your ledger

@onbjerg onbjerg added C-cast Command: cast C-forge Command: forge Cmd-forge-create Command: forge create labels Apr 30, 2022
@ntchjb
Copy link
Author

ntchjb commented May 1, 2022

Yes. I tested sending the same transaction to Arbitrum One using (ethers.js + Ledger) and (remix + Metamask (+ledger)) stacks, and it was successful. I use Ledger Nano S with Ethereum App for signing.

The error above came from RPC node after eth_sendRawTransaction RPC call was sent.

@ntchjb
Copy link
Author

ntchjb commented May 1, 2022

I have found the issue. It is about v value of ECDSA signature that its value is incorrect when chain ID is large, which has been described by this PR: gakonst/ethers-rs#1198.

I also have proposed a solution in this PR, gakonst/ethers-rs#1204, which is the same solution used by Ledger's JavaScript Library.

@gakonst
Copy link
Member

gakonst commented May 2, 2022

ethers was bumped here, 609a556 with the fixes, could you please check if it solves the issue @ntchjb ?

@ntchjb
Copy link
Author

ntchjb commented May 3, 2022

I tested on Arbitrum testnet and Rinkeby and it was successful 🎉 . I am going to close the issue for now, but feel free to re-open it if the issue still persist.

cast send --chain="arbitrum-testnet" --rpc-url="https://rinkeby.arbitrum.io/rpc" --gas=2000000 --ledger --hd-path="m'/44'/60'/3'/0/0" 0x0000000000000000000000000000000000000066 "register(address)" 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac

cast send --chain="rinkeby" --rpc-url="https://rinkeby.infura.io/v3/<api>" --gas=2000000 --ledger --hd-path="m'/44'/60'/3'/0/0" --value=0.001ether vitalik.eth

@ntchjb ntchjb closed this as completed May 3, 2022
@gakonst
Copy link
Member

gakonst commented May 3, 2022

I think the --chain argument might not be required because you get it from the RPC URL! LGTM Otherwise :)

@ntchjb
Copy link
Author

ntchjb commented May 3, 2022

Ah yes, I copied the command that was used before found the cause of this issue just for controlling variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast C-forge Command: forge Cmd-forge-create Command: forge create T-bug Type: bug
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants