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

[jsconsole] personal.sign(...) fails even though personal_sign API is available and working #1190

Closed
chris-j-h opened this issue May 4, 2021 · 3 comments
Labels

Comments

@chris-j-h
Copy link
Collaborator

To Reproduce:

  1. From the attached js console of node 1 of the 7nodes example, Quorum v21.4.0+
> personal.sign("0xaaaaaa","0xed9d02e382b34818e88b88a309c7fe71e65f419d","")

GoError: Error: invalid address at web3.js:3930:11(47)
	at native
	at <eval>:1:71(5)
  1. personal_sign RPC API works as expected
% curl -X POST -H "Content-Type:application/json" -d '{"id":1,"method":"personal_sign","params":["0xaaaaaa","0xed9d02e382b34818e88b88a309c7fe71e65f419d",""]}' http://localhost:22000

{"jsonrpc":"2.0","id":1,"result":"0xa661ee8721999743d40bcbefec309c262c10dcf159f60c3d1dfbb67b850007f010d926403753c6d949e132be4327f36344ffe4cade07c55fe229b1460c15e0481c"}

Possible cause

The v21.4.0 upgrade introduced commit 7b68975a which changed the js console interpreter from otto to goja.

Reverting this commit makes personal.sign work as expected again. A dev branch with this commit reverted can be found here.

The error is thrown by the inputAddressFormatter applied to the address param.

Curiously none of the other APIs that use this formatter have the same issue (e.g. eth.getCode, personal.unlockAccount, ...).

@chris-j-h chris-j-h added the bug label May 4, 2021
@prd-fox
Copy link
Contributor

prd-fox commented May 4, 2021

As you mentioned, it was a bug in the JS upgrade. Looks to be fixed in geth 1.9.21.
ethereum/go-ethereum#21417
ethereum/go-ethereum#21503

@ricardolyn
Copy link
Contributor

thanks for the info @chris-j-h @prd-fox . I will link this to a geth upgrade issue so we can get it soon fixed from upstream

@ricardolyn ricardolyn self-assigned this May 5, 2021
@ricardolyn ricardolyn removed their assignment May 27, 2021
@chris-j-h
Copy link
Collaborator Author

chris-j-h commented Oct 29, 2021

Fixed in 21.7.0 - ff23e26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants