You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You posted this on the Quorum slack channel as well. I've encountered this before. From a strictly technical perspective, the EVM has failed to simulate your transaction (it's always returning an error) so the estimateGas function is tending towards the highest valid value which is the block gas limit of the pending block.
So why is it returning an error? If I had a guess, it'd be because this conditional is being hit. The set function will be doing a SSTORE which is a mutating op-code. I'm uncertain what causes the quorumReadOnly flag to be set.
So why does it work when you actually send the transaction? Probably because when you actually send the transaction, quorumReadOnly is no longer true.
It's worth noting that estimateGas is buggy if you use Raft because BlockByNumber was edited to return the latest block instead of the pending block. You generally cannot do this safely due to how the gas limit tends towards the amount of gas actually being used, meaning the returned estimate will be greater than the gas block limit.
You've not given me enough information to say definitively whether this is your problem or not. Try enabling trace logging then try again. In geth:
debug.verbosity(5)
If the cause is down to quorumReadOnly then you should see:
System information
Geth version:
geth 2.0.1
OS & Version: Linux
Contract code
Used this following code as example, but the problem exists for any other contract as well.
Get estimatedGas from call simulation, and get the result as 4712388, which is shown as the gas limit of the latest block too.
When actually run the transaction, the gas turned out to be 90000.
So the question is why the estimatedGas return the gas limit of latest block, instead of the actually running gas?
The text was updated successfully, but these errors were encountered: