Consensys / quorum

A permissioned implementation of Ethereum supporting data privacy
https://www.goquorum.com/
GNU Lesser General Public License v3.0
4.69k stars 1.3k forks source link

get error when using privacy enabled quorum #1642

Closed laurivers closed 1 year ago

laurivers commented 1 year ago

I deployed the sample contract code ('private-contract.js') successfully,and could call the private.set()and private.get successfully. But when I called eth.getPrivateTransaction, got error like this.

> private.set(40,{from:eth.accounts[0],privateFor:["6CZ/yNFFCVXxPFFGKLDwo0h1HXSgJsWEH11ddZhRVlo="]});
"0x281125ea71298123c16574c8818732c20a1e4352292c4eafc4b63887499f55a4"
> eth.getPrivateTransaction('0x281125ea71298123c16574c8818732c20a1e4352292c4eafc4b63887499f55a4')
Error: invalid character '`' looking for beginning of value
    at web3.js:6355:37(47)
    at web3.js:5089:62(37)
    at <eval>:1:26(4)

> eth.getPrivateTransactionReceipt('0x281125ea71298123c16574c8818732c20a1e4352292c4eafc4b63887499f55a4')
Error: invalid character '`' looking for beginning of value
    at web3.js:6355:37(47)
    at web3.js:5089:62(37)
    at <eval>:1:33(4)

i already asked about this in discord channel, and i don't know whether it is a bug or something i did't make right.

laurivers commented 1 year ago

I tried the offical docker image.

QUORUM_VERSION=22.7.5 TESSERA_VERSION=22.10.1

also got error

> private.get()
42
> private.set(4,{from:eth.accounts[0],privateFor:["QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc="]});
Error: method handler crashed
    at web3.js:6355:37(47)
    at web3.js:5089:62(37)
    at web3.js:4145:41(57)
    at web3.js:4231:75(24)
    at <eval>:1:49(12)

> private.set(4,{from:eth.accounts[0],privateFor:[]});
Error: method handler crashed
    at web3.js:6355:37(47)
    at web3.js:5089:62(37)
    at web3.js:4145:41(57)
    at web3.js:4231:75(24)
    at <eval>:1:48(11)

> eth.getPrivateTransaction("0x8e6c2b4e84ebd294418aea67031de2a958dd6315abbc1f217347d6831101f9de")
Error: invalid character '`' looking for beginning of value
    at web3.js:6355:37(47)
    at web3.js:5089:62(37)
    at <eval>:1:26(4)
ToToDoDo commented 1 year ago

I got the same error message when I using quorum-dev-quickstart to build a goquorun + tessera network on Amzon Linux 2023 and my local MacbookPro(M1).

baptiste-b-pegasys commented 1 year ago

I think this method is relevant in the PMT mode. Otherwise you should ask the payload from tessera. https://docs.goquorum.consensys.net/concepts/privacy/privacy-marker-transactions#using-privacy-marker-transactions Have you enabled PMT?

laurivers commented 1 year ago

@baptiste-b-pegasys Thank you for your response. I didn't enable PMT. I will try PMT later. So is there a way to get the payload in normal private transaction mode?

baptiste-b-pegasys commented 1 year ago

With the public input of the private transaction, you can get the private payload from authorized nodes only: https://docs.goquorum.consensys.net/reference/api-methods#eth_getquorumpayload

laurivers commented 1 year ago

@baptiste-b-pegasys Thanks a lot. It helped.