Skip to content

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

@chris-j-h

Description

@chris-j-h

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, ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions