trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

`type: "quorum"` config does not work with hdwallet-provider #3061

Open kigawas opened 4 years ago

kigawas commented 4 years ago

Issue

Say you have network config, whose backend is a quorum RPC (Raft consensus, started by quorum-wizard).

// ..
    local: {
      protocol: 'http',
      host: 'localhost',
      port: 22000,
      gas: 5000000,
      gasPrice: 0,
      networkId: '*',
      type: "quorum" // works
    },
    quorum: {
      provider: () => new HDWalletProvider(
        MNEMONIC,
        `http://127.0.0.1:22000`
      ),
      networkId: 10,
      gasPrice: 0,
      // type: "quorum" is not working
    },

Steps to Reproduce

  1. start a quorum by quorum-wizard like npx quorum-wizard -q

  2. cd network/3-nodes-raft-tessera-bash/ and bash start.sh. Then deploy the contract registry in quorum's cakeshop blockexplorer.

  3. Deploy contract

Expected Behavior

Successfully deployed.

Actual Results

It shows error "Number can only safely store up to 53 bits" the same as https://stackoverflow.com/questions/54128954/quorum-ethereum-truffle-error-number-can-only-safely-store-up-to-53-bits/61885468

Environment

eggplantzzz commented 4 years ago

Hmm, I don't know if HDWalletProvider supports quorum. @CruzMolina do you have any information about whether this is possible?

CruzMolina commented 4 years ago

Hey @kigawas , currently raft won't work out of the box with @truffle/hdwallet-provider (nanosecond timestamp issue as mentioned in the StackOverflow thread). I'm not sure if the Proxy mentioned in that thread will integrate well with quorum-wizard, but last I checked using the default istanbul BFT should be compatible with @truffle/hdwallet-provider.

kigawas commented 4 years ago

Hey @kigawas , currently raft won't work out of the box with @truffle/hdwallet-provider (nanosecond timestamp issue as mentioned in the StackOverflow thread). I'm not sure if the Proxy mentioned in that thread will integrate well with quorum-wizard, but last I checked using the default istanbul BFT should be compatible with @truffle/hdwallet-provider.

Confirmed and switched to istanbul.

Was wondering whether it can respect the "type" parameter as a normal truffle config.

CruzMolina commented 4 years ago

Was wondering whether it can respect the "type" parameter as a normal truffle config.

This would be awesome, but would require, at a minimum, pulling in the hdwallet-provider logic into @truffle/contract... There might be more to it that entails messing around with provider logic.

For future reference, an easy option would be to publish a separate hdwallet-provider specifically intended for quorum usage (@truffle/hdwallet-provider-quorum?) that makes sure to monkey patch web3 to resolve known compatibility issues betw quorum & eth rpc responses.