NatoliChris / diablo-benchmark

The "DIstributed Analytical BLOckchain" Benchmark Framework. (Diablo). Measures blockchains with a focus on real-world applications and workload generation.
Apache License 2.0
11 stars 8 forks source link

[BUG] Primary: ERROR failed to generate workload {"error": "json: cannot unmarshal array into Go struct field .Contracts.Abi of type string"} #27

Closed KunPengRen closed 2 years ago

KunPengRen commented 2 years ago

Describe the bug Run the etherum example at Master branch

To Reproduce Steps to reproduce the behavior:

  1. ./scripts/sample/start_testnet.sh
  2. ./diablo primary -c scripts/sample/workloads/sample_contract_store.yaml -cc scripts/sample/blockchain-configs/ganache-using-keyfile.yaml -a "0.0.0.0:8323" --level DEBUG
  3. ./diablo secondary -m ":8323" -c scripts/sample/workloads/sample_contract_store.yaml -cc scripts/sample/blockchain-configs/ganache-using-keyfile.yaml --level DEBUG --timeout 2

Expected behavior Run succssfully.

Screenshots Primary: 2022-09-19T15:02:05.395+0800 INFO Secondary 1 / 1 connected {"Addr:": "127.0.0.1:37920"} 2022-09-19T15:02:05.395+0800 DEBUG SendSync {"len": 9} 2022-09-19T15:02:05.398+0800 DEBUG GOT REPLY FROM 127.0.0.1:37920

2022-09-19T15:02:05.398+0800 INFO Benchmark secondaries all connected. {"secondaries": 1} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 DEBUG tps interval {"total": 5, "thread": 5} 2022-09-19T15:02:05.399+0800 INFO Generating workload {"workloadType": "contract", "threadsTotal": 1, "totalTransactions per worker": 25} 2022-09-19T15:02:05.422+0800 ERROR failed to generate workload {"error": "json: cannot unmarshal array into Go struct field .Contracts.Abi of type string"} 2022-09-19T15:02:05.422+0800 DEBUG Closing Secondary 0 @ 127.0.0.1:37920

Secondary 2022-09-19T15:02:05.394+0800 DEBUG Loaded accounts {"accounts": 2000} 2022-09-19T15:02:05.395+0800 WARN Overwriting config timeout (0) with flag 2 2022-09-19T15:02:05.395+0800 DEBUG Connection OK {"ADDR": ":8323"} 2022-09-19T15:02:05.395+0800 INFO Secondary init 2022-09-19T15:02:05.395+0800 DEBUG Performing Initial Read 2022-09-19T15:02:05.395+0800 DEBUG Received Command Message {"CMD": "AQAAAAAAAAAB"} 2022-09-19T15:02:05.395+0800 INFO Got command from primary {"CMD": "PREPARE"} 2022-09-19T15:02:05.398+0800 DEBUG Connect and Init of workload handler and client interface OK {"ID": 0} 2022-09-19T15:02:05.398+0800 DEBUG OK sent to master 2022-09-19T15:02:05.398+0800 DEBUG Performing Initial Read 2022-09-19T15:02:05.422+0800 WARN failed to read {"err": "EOF"} 2022-09-19T15:02:05.422+0800 DEBUG Closing Connection to primary

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

NatoliChris commented 2 years ago

Hi @KunPengRen

Thanks for submitting the bug. This looks like an issue with the solidity version, but we might need a few more things before we can triage; what is your solidity version?

solc --version

In the sample https://github.com/NatoliChris/diablo-benchmark/blob/master/docs/sample-example.md One of the requirements is solidity version 0.7.5, this is primarily because the ABI coder for 0.8.0+ changed the interface, which made it incompatible with the way that solidity contracts and invocation functions are generated in the workload. Unfortunately this does mean in the master branch release, the sample will only run with that specific solidity version (0.7.5).

https://github.com/ethereum/solidity/releases/tag/v0.7.5 Or get the binary: https://github.com/ethereum/solc-bin

Please note, we are looking to deprecate the master branch, since the majority of the development has been focused on v2 and with preparations for a more stable release. Right now, the master branch was a last-minute migration from a different VCS due to limitations in the availability.

KunPengRen commented 2 years ago

Hi @NatoliChris ,Thanks for your reply. After I change the solc to 0.7.5. The system work ok. Thank you again.