hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
650 stars 402 forks source link

Caliper with Raft Consensus Algo #1449

Closed AlbshriAdel closed 1 year ago

AlbshriAdel commented 1 year ago

Which Caliper version are you using?

latest

Which Node.JS version are you using?

v18.3.0

Which operating system are you using?

Ubuntu 20.04

Please provide some context for your error. For example, when did the error occur? What were you trying to achieve, and how?

I tried to use the Caliper benchmark with Quorum by using the latest Ethereum as SUT, which has worked perfectly with consensus algorithms supported by Quorum networks such as Istanbul and qbft. However, an error message appeared when I tried to use raft as a consensus algorithm, as shown below in fig 6. Therefore, I tried all possible solutions, but unfortunately, all attempts failed. If anyone has faced the same issue or has any suggestions to overcome this issue, I would appreciate that.

Figure 1. shows the docker process status, which indicates 4 nodes running. docker process status

Figure 2. shows the networking config file. networking config file

Figure 3. shows the benchmarkConfig file. benchmark config file

Figure 4. shows the results of the Caliper benchmark when I used qbft as the consensus algorithm. results of the caliper

Figure 5. shows the block explorer, which presents that Caliper had Successfully sent all transactions block explorer

Figure 6. shows the message error when I used raft. error

What was the observed incorrect behavior?

An error message appeared when I tried to use raft as a consensus algorithm, as shown below in fig 6.

Please provide the error logs and their surroundings.

2022.09.22-15:42:59.335 info  [caliper] [cli-launch-manager]    Set workspace path: /root
2022.09.22-15:42:59.336 info  [caliper] [cli-launch-manager]    Set benchmark configuration path: /root/benchmark/benchconfig.yaml
2022.09.22-15:42:59.336 info  [caliper] [cli-launch-manager]    Set network configuration path: /root/quorum-test-network/networkconfig.json
2022.09.22-15:42:59.336 info  [caliper] [cli-launch-manager]    Set SUT type: ethereum
2022.09.22-15:42:59.625 info  [caliper] [benchmark-validator]   No observer specified, will default to `none`
2022.09.22-15:42:59.625 info  [caliper] [caliper-engine]        Starting benchmark flow
2022.09.22-15:42:59.626 info  [caliper] [caliper-utils]         Executing command: cd ./; echo start benchmark
start benchmark
2022.09.22-15:42:59.650 info  [caliper] [caliper-engine]        Executed start command in 0.024 seconds
2022.09.22-15:42:59.660 info  [caliper] [caliper-engine]        Executed "init" step in 0 seconds
2022.09.22-15:42:59.661 info  [caliper] [ethereum-connector]    Creating contracts...
/root/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js:6
    if (!val) throw new Error(msg || 'Assertion failed');
              ^

Error: Number can only safely store up to 53 bits
    at assert (/root/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js:6:21)
    at BN.toNumber (/root/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js:506:7)
    at Object.hexToNumber (/root/node_modules/web3-utils/src/utils.js:239:24)
    at Object.outputBlockFormatter [as outputFormatter] (/root/node_modules/web3-core-helpers/src/formatters.js:301:29)
    at Subscription._formatOutput (/root/node_modules/web3-core-subscriptions/src/subscription.js:122:84)
    at /root/node_modules/web3-core-subscriptions/src/subscription.js:263:44
    at Array.forEach (<anonymous>)
    at Object.callback (/root/node_modules/web3-core-subscriptions/src/subscription.js:262:28)
    at requestManagerNotification (/root/node_modules/web3-core-requestmanager/src/index.js:103:65)
    at /root/node_modules/web3-providers-ws/src/index.js:122:25
    at Array.forEach (<anonymous>)
    at /root/node_modules/web3-providers-ws/src/index.js:120:45
    at Array.forEach (<anonymous>)
    at WebsocketProvider.connection.onmessage (/root/node_modules/web3-providers-ws/src/index.js:104:36)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/root/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/root/node_modules/@web3-js/websocket/lib/W3CWebSocket.js:234:14)

Please provide your benchmark configuration file content, if possible.

No response

Please provide your network configuration file content, if possible.

No response

Please provide your workload module content, if possible.

No response

Please provide any additional information you deem relevant to the error.

No response

AlbshriAdel commented 1 year ago

Any suggestion regarding this issue?

aakzubaidi commented 1 year ago

Try the following, which should resolve the issue:

npm install web3@v4.0.1-alpha.1

AlbshriAdel commented 1 year ago

I appreciate your response. Upon trying your suggestion, I found that it worked perfectly. Once again, thank you.