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

Taking a long time for executing estimate_gas of tx with infinite loop. #7074

Closed
miyao-gmo opened this issue Nov 17, 2017 · 0 comments
Closed
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.
Milestone

Comments

@miyao-gmo
Copy link
Contributor

miyao-gmo commented Nov 17, 2017

When estimate_gas of tx with infinite loop was executed, RPC server returns no response for a long time.
In a following environment, it takes about 3 minutes for estimate_gas.

parity: v1.8.2
OS: ubuntu 16.04.1
Memory: 3G
contract A {
  function loop() {
    while (true) {}
  }
}
> var calcInfiniteLoopTime = function() {
... var start = new Date().getTime();
... A.loop.estimateGas(function(err, gas) {
..... var end = new Date().getTime();
..... console.log(end - start);
..... });
... }
> calcInfiniteLoopTime();
> 170040

Tx with 1,000,000,000,000 gas was executed (https://github.com/paritytech/parity/blob/master/ethcore/src/client/client.rs#L1234), so it takes a long time.
A parity node owner should decide whether estimate_gas upper limit is a block gas limit or UPPER_CEILING(1,000,000,000,000) by config.
If I skipped estimate_gas execution with 1,000,000,000,000 gas, it takes about 80 msec.

@5chdn 5chdn added 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. labels Nov 17, 2017
@5chdn 5chdn added this to the 1.9 milestone Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

2 participants