The ethereum adapter doesn't sign transactions when fromAddress and fromAddressPrivateKey are used in the networkConfig
Context
A user came to me asking for help. In his network config he was using fromAddress and fromAddressPrivateKey. This was causing failures on creating the contracts for his benchmarks, because Besu was reporting that eth_sendTransaction is not supported.
This only happens when web3.js isn't signing transactions on behalf of the user, and that only happens when the wallet for the sending account isn't set up correctly.
Expected Behavior
Transactions would be signed by web3.js for network configs that make use of the fields fromAddress and fromAddressPrivateKey.
Actual Behavior
Caliper doesn't sign transactions, and attempts to send transactions using the eth_sendTransaction RPC call. Besu responds to these calls with errors, and the benchmark fails.
Possible Fix
Likely the web3.js wallet isn't being set up properly.
Steps to Reproduce
- Run a benchmark using
fromAddressandfromAddressPrivateKeyinstead offromAddressSeed.
Should reproduce with any benchmark.
Your Environment
- Version used: v0.3.0 and current
masterbranch at time of writing - Environment name and version (e.g. Chrome 39, node.js 5.4): Uncertain - I wasn't the one who was running Caliper
- Operating System and version (desktop or mobile): Uncertain
@shemnon Any insights?
@shemnon and I are working fairly closely these days. We haven't discussed this issue directly, but I'm fairly confident it's something to do with how the web3 wallet is initialized in this codepath here.
The user in question shared his networkConfig with me. Given what's happening I'd have thought that maybe he'd also specified a fromAddressSeed, but as you can see below, that's not the case.
{
"caliper": {
"blockchain": "ethereum"
},
"ethereum": {
"url": "http://localhost:8545",
"contractDeployerAddress": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
"contractDeployerAddressPrivateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
"fromAddress": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
"fromAddressPrivateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
"transactionConfirmationBlocks": 2,
"contracts": {
"simple": {
"path": "build/test.json"
}
}
}
}
Also worth noting that switching to fromAddressSeed did in fact solve his problem.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I don't think this issue should be closed yet. Go away stalebot! ;-)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Labeled as a bug, so no stalebot from now on.