mfolnovic / besu-private-transaction-bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Besu Private Transaction Bug

I've created a simple contract SimpleStorageFactory that has two methods:

  1. create - creates an instance of SimpleStorage
  2. count - just emits event with constant 123 (to check that private transactions works)
  3. set - calls set method of creates an instance of SimpleStorage

Prerequisites

  • truffle
  • postman

Setup network

  • npx quorum-dev-quickstart@latest --clientType besu --privacy true --outputPath quorum-test-network
  • cd quorum-test-network
  • git apply ../besu-private-transaction-bug/quorum-test-network.patch
  • ./run.sh

There's a small patch that makes ethsigner use member1besu instead of rpcnode, so that we can use eea_sendTransaction through node that has privacy enabled.

Setup postman

Deploy contract

  • inside besu-private-transaction-bug, run truffle migrate --reset -f 1
  • if necessary, update contract address (from truffle output) in postman collection, variable contract_addr (if it's 0x51A21A51aa59B0b4BF99Ea7a79c7293d601FF689, it's already set up)
  • check other postman variables (from_addr is address that was setup in ethsigner, member1_public_key and member2_public_key are tessera public keys for first two members)

Scenarios (all in postman)

Before anything

  • run request: Create Privacy Group

Count (both public and private work)

  1. public:
  • request: count/Create Public Transaction
  • request: Get Public Transaction Receipt
    • expect to see log with data 0x000000000000000000000000000000000000000000000000000000000000007b
  1. private:
  • request: count/Create Private Transaction
  • request: Get Private Transaction Receipt
    • expect to see log with data 0x000000000000000000000000000000000000000000000000000000000000007b

Create (public works, private doesn't)

  1. public:
  • request: create/Create Public Transaction
  • request: Get Public Transaction Receipt
    • expect to see 2 logs (one is from SimpleStorageFactory, another from SimpleStorage)
  1. private:
  • request: create/Create Private Transaction
  • request: Get Private Transaction Receipt
    • expect to see 2 logs (one is from SimpleStorageFactory, another from SimpleStorage)
    • but got: "status": "0x0", and error in log: Failed to process private transaction 0xe379a9658662d1fc0e8837f57b3ded8b0151d10d1d07512ac1d9385935173d8a: PRIVATE_TRANSACTION_FAILED

Set (public works, private doesn't)

  1. public:
  • request: create/Create Public Transaction
  • request: set/Create Public Transaction
  • request: Get Public Transaction Receipt
    • expect to see 1 log
  1. private:
  • request: create/Create Public Transaction
  • request: set/Create Private Transaction
  • request: Get Private Transaction Receipt
    • expect to see 1 log
    • but got: "status": "0x0", and error in log: Failed to process private transaction 0x20854c109f089887bc8976690b63819ece6ca3691cc9cddbda24301aad316c49: PRIVATE_TRANSACTION_FAILED
    • logs here

Notes

  • data in both Create Public Transaction and Create Private Transaction was generated by script in scripts/abi-encode.ts, which can be run by node run scripts/abi-encode.ts.

About


Languages

Language:JavaScript 86.9%Language:Solidity 13.1%