-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Problem: eth.estimateGas blanket failure #8893
Description
I'm running:
- Which Parity version?:master (b37b3cd)
- Which operating system?: Any
- How installed?: Doesn't matter
- Are you fully synchronized?: N/A
- Which network are you connected to?: Any
- Did you try to restart the node?: N/A
eth.estimateGas RPC function will always fail with "Requires higher than upper limit of {}" error even when an error is clearly not gas related (say, an exception thrown in the contract). This failure is very confusing as it doesn't tell the real story.
Proposed solution: try to use the result of transact_virtual to make a better determination.
My brief research yielded the following points of consideration:
Err invariant:
Ok invariant's exception field:
https://github.com/paritytech/parity/blob/master/ethcore/vm/src/error.rs#L30-
There may be other indications that specifically suggest out-of-gas conditions I might not be aware of. There are also other indications within this invariant that can tell that we're definitively not hitting an out-of-gas condition.
Also, my preliminary research suggests that we can (perhaps) use https://github.com/paritytech/parity/blob/98b7c07171cd320f32877dfa5aa528f585dc9a72/ethcore/src/executed.rs#L39 to see how much gas was confused instead of finding a transition point (and re-running the contract multiple times). Unless there's something else that makes this value not very useful to us.
Any thoughts or an explanation for why gas estimation is implemented the way it is will be highly appreciated.