go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

```personal_unlockAccount``` third parameter error ```cannot unmarshal string into Go value of type uint64```

Open SinErgy84 opened this issue 3 years ago • 2 comments

PUSH / REOPEN

The issue still exists. It is a contradiction of its own documentation, compare https://eth.wiki/json-rpc/API#hex-value-encoding All other endpoints require a clean conversion from numeric values to their HEX representation. personal_unlockAccount and its third parameter for the duration is the only method that deviates from this rule and is implemented incorrectly in my opinion.

Apparently other developers got used to it after implementation and it works. But interoperability between different clients is not possible because Geth handles it differently than e.g. Parity/OpenEthereum or Erigon.

Originally posted by @SinErgy84 in https://github.com/ethereum/go-ethereum/issues/15293#issuecomment-1153641734

Expected behaviour

personal_unlockAcount third parameter accepts hex-encoded value like personal_unlockAccount('0xaccount', 'secret', '0x100')

SinErgy84 avatar Jun 13 '22 08:06 SinErgy84

The personal namespace is not really covered by the JSON RPC spec: https://ethereum.org/en/developers/docs/apis/json-rpc/

There's probably less inclination to get it included since it's not recommended to run accounts embedded within the node.

karalabe avatar Jun 15 '22 12:06 karalabe