Error: Transaction hash is "NULL" while executing Privacy enabled On-chain permission (Client Lib Web3j)
Description
I wanted to create a network with Privacy enabled On chain permission to execute a transaction with
Steps to re-produce - a. I have created 3 Besu nodes with privacy enabled. b. Each node is running a tressera node inside. c. --privacy-flexible-groups-enabled="true" d. Using Ethash consensus. (I have tested with CLIQE and IBFT. Its same) e. Created Privacy group with 2 participants by generating 32 bit random unique Id f . Call to create privOnChainCreatePrivacyGroup
Getting Error : Returning Transaction hash null 2022-03-01 14:46:01.800 ERROR 52874 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: 400; { "jsonrpc" : "2.0", "id" : 3, "error" : { "code" : -32602, "message" : "Invalid params" } }]
Code Snippet -
PollingPrivateTransactionReceiptProcessor processor = new PollingPrivateTransactionReceiptProcessor(
rootBesuNode.getBesuNode(), 15000, 20);
String txHash = rootBesuNode.getBesuNode()
.privOnChainCreatePrivacyGroup(besuNetwork.getPrivacyGroupId(),
rootBesuNode.getCredential(),
rootBesuNode.getEnclaveKey(),
participantEnclaveKeyList)
.send()
.getTransactionHash(); //*** getResult returning NULL
// Wait for the transaction to be mined & get the receipt
System.out.println("Transaction hash => " + txHash);
Stacktrace
2022-03-01 14:46:01.800 ERROR 52874 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: 400; { "jsonrpc" : "2.0", "id" : 3, "error" : { "code" : -32602, "message" : "Invalid params" } }] with root cause
org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: 400; { "jsonrpc" : "2.0", "id" : 3, "error" : { "code" : -32602, "message" : "Invalid params" } } at org.web3j.protocol.http.HttpService.performIO(HttpService.java:173) ~[core-5.0.0.jar:na] at org.web3j.protocol.Service.send(Service.java:48) ~[core-5.0.0.jar:na] at org.web3j.protocol.core.Request.send(Request.java:87) ~[core-5.0.0.jar:na] at org.web3j.tx.response.PrivateTransactionReceiptProcessor.sendTransactionReceiptRequest(PrivateTransactionReceiptProcessor.java:35) ~[besu-5.0.0.jar:na] at org.web3j.tx.response.PollingPrivateTransactionReceiptProcessor.getTransactionReceipt(PollingPrivateTransactionReceiptProcessor.java:44) ~[besu-5.0.0.jar:na] at org.web3j.tx.response.PollingPrivateTransactionReceiptProcessor.waitForTransactionReceipt(PollingPrivateTransactionReceiptProcessor.java:36) ~[besu-5.0.0.jar:na] at com.dapp.dappsample.BesuNetwork.getNewNetwork(BesuNetwork.java:57) ~[classes/:na] .....
Versions
Besu Version - 22.1.0 web3j Lib - 5.0.0 Jopen JDK 11 okHTTP 4.9.3
@jann2005 Hi please use version 4.9.1 no version 5