Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Problem: eth.estimateGas blanket failure #8893

@yrashk

Description

@yrashk

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:

https://github.com/paritytech/parity/blob/98b7c07171cd320f32877dfa5aa528f585dc9a72/ethcore/src/executed.rs#L77-L82


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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    F3-annoyance 💩The client behaves within expectations, however this “expected behaviour” itself is at issue.M6-rpcapi 📣RPC API.P5-sometimesoon 🌲Issue is worth doing soon.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions