the issue was about estimateGas function fails when it 'call' contract to simulate tx data in below condition :
estimateGas function is sent to mining node
tx data executed by estimate Gas needs latest block state(the current block state) to success
mining node gets mining token at the time when tx requests estimateGas
it is due to 2 factors :
estimateGas use PendingBlock to estimate gas of tx and it refers to snapshot db
when mining node acquire mining token snapshot update is delayed due to blockCreationTime. ( thus the case is more frequent when blockCreationTime is long)
so the work is done as below :
fix estimateGas function to use LatestBlock instead of PendingBlock
however, it is logical for mining node to update pending state properly, updateSnapshot before time.Sleep
additionally, non-mining node is entering commitWork which is useless; just updateSnapshot if the node is not miner member
pr is for issue#109
the issue was about
estimateGas
function fails when it 'call' contract to simulate tx data in below condition :it is due to 2 factors :
PendingBlock
to estimate gas of tx and it refers to snapshot dbso the work is done as below :
LatestBlock
instead of PendingBlock