hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.47k stars 800 forks source link

priv.distributeRawTransaction method not working #6180

Open Alexsilva43 opened 9 months ago

Alexsilva43 commented 9 months ago

Description

In the context of concurrent transactions in a privacy group, the method priv.distributeRawTransaction of web3js-quroum library doesn't work. The method is unable to decode the private signed raw transaction. With ethers.js and web3.js out of a privacy group context, the concurrent transactions are executed correctly.

Expected behavior: the method should return the enclave key.

Actual behavior: Error: Returned error: Unable to decode the private signed raw transaction

Frequency: 100% of the time

Versions

Additional Information:

Snipped code in Typescript:

import Web3 from "web3";
const Web3Quorum = require("web3js-quorum");
const {Transaction} = require('ethereumjs-tx');

// privacy options masked
const privacyOptions = {
  privateFrom: "XXX",
  privateKey: "YYY",
  privacyGroupId: "ZZZ"
};

const web3 = new Web3("address provider");
const web3q = new Web3Quorum(web3);

const rawTx= {
    ...privacyOptions,
    to: contractAddress,
    data: "0xa621d15e",
    nonce : ethers.toBeHex(nonce)
  }
   const tx = new Transaction(raxTx);
   tx.sign(Buffer.from(privateKey, "hex"));
   const hexTx = `0x${tx.serialize().toString("hex")}`;

  const enclaveKey = web3q.priv.distributeRawTransaction(hexTx);
non-fungible-nelson commented 9 months ago

@gtebrean and @NickSneo - any ideas here?