-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to transfer ethers in Raft using web3js due to high gas estimate #461
Comments
Hi, can you please make sure that genesis file you are using matches this one: https://github.com/jpmorganchase/quorum-examples/blob/master/examples/7nodes/genesis.json |
Hi, I have copied the genesis into the template that quorum-maker uses. All config except the alloc part is the same now:
Still |
I just tried the same thing on the 7 nodes example using raft consensus.
Even the 7 nodes example gives a high estimate |
Hi, I'm getting the same issue with the genesis file that you provided. A huge gas limit that's limiting transactions. |
I just tried setting the gasLimit to the puppeth default ( |
Hi, have you actually tried submitting the transaction to transfer the ether?
|
@SatpalSandhu61 when I do the transfer from one local account to another using cli, it does succeed. But when I try to send a transaction from a non-local account using truffle-hdwallet-provider using its seedwords, it gets stuck in the txpool and all subsequent transactions fail with the error
The sender account has sufficient balance, allocated to it in the genesis. I am facing this issue in quorum-maker which starts the node with the command |
Hi kbhokray, we are investigating the issue. |
I have added a minimal code here: The code tries to do two transactions from an account in 1. Ropsten and 2. Custom Quorum network. The quorum-maker default genesis has been changed to include the transferring address Steps to reproduce Test on Ropsten
Output:
The transfers take place without errors Test on Quorum
Output:
The last line shows the error. Now all further transactions error out because the transaction is stuck in pending state, which can be seen by attaching to the container and starting geth console inside it.
The genesis is generated dynamically upon running |
I mentioned this in another issue, the root cause here is:
To clarify: the block gas limit isn't a constant; it will be slightly different for each block. Ethereum will try to adjust the block gas limit depending on actual usage, in a "use it or lose it" fashion. That means if you only use a bit of gas but have a huge gas limit, the next block's gas limit will be lower than the previous block. This isn't a problem for Ethereum, but is a problem for Quorum (using Raft) because the // Pending block is only known by the miner Unfortunately, In other words, if you set a massive gas limit in your genesis block that ironically will be causing the problem because of the downward trend in block gas limits. We've resolved this by simply not estimating gas if using Raft, but the real (albeit technically distasteful) fix would be to use the same calculation as the miner when estimating gas, since you can't actually share the pending block state when using Raft. |
Issue root cause is that the EVM is failing with ErrReadOnlyValueTransfer, so the gas estimate is being increased up to the max value. The EVM failure occurs because private state has not been initialised and the EVM believes we are calling from private to public state, so it sets the evm.quorumReadOnly flag. Code change to fix this issue is being worked on, in order for it to be applied to the v1.8.12 branch. Note that the v1.8.12 code has been tightened up in this area, so that an EVM failure is caught and reported, rather than a max gas estimate just being returned. |
System information
Geth version:
geth version
OS & Version: Windows/Linux/OSX
Ubuntu 16.04.4 LTS
Branch, Commit Hash or Release:
git status
Quorum: v2.0.2
Expected behaviour
Gas estimate for ether transfer should be minimal
Actual behaviour
Gas estimate for ether transfer > 3 * 10 ^ 9
Steps to reproduce the behaviour
Download quorum-maker and start a Development Network. Query the started nodes to estimate the gas requirement for ether transfer
curl -X POST --data '{ "jsonrpc":"2.0", "id":2, "method":"eth_estimateGas", "params":[ { "to":"0xE2F384B526C57309e7798B9E8455BF05bE89A465", "value":"0x64", "from":"0x7798673316D6028b7fF2CF7369aa658276e5C1C5" } ] }' http://10.50.0.2:22000
The resulting gas estimate is too high (3754428764).
I'm trying to transfer ethers from one account to another and web3js is not allowing me to do it because the gas estimate is greater than the block gas limit. I am using truffle-hdwallet-provider. Is there any other way to transfer ethers in nodejs?
Other Details
quorum-maker internally uses this command to start the network:
geth --verbosity 6 --datadir qdata --raft --nodiscover --networkid 41418 --rpc --rpcaddr 0.0.0.0 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,raft --emitcheckpoints --raftport 22003 --rpcport 22000 --port 22001 --nat extip:10.50.0.2
More details here:
https://ethereum.stackexchange.com/q/55587/38431
The text was updated successfully, but these errors were encountered: