Skip to content

Conversation

@jennwiederholen
Copy link

pr is for issue#109

the issue was about estimateGas function fails when it 'call' contract to simulate tx data in below condition :

  1. estimateGas function is sent to mining node
  2. tx data executed by estimate Gas needs latest block state(the current block state) to success
  3. mining node gets mining token at the time when tx requests estimateGas

it is due to 2 factors :

  1. estimateGas use PendingBlock to estimate gas of tx and it refers to snapshot db
  2. 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 :

  1. fix estimateGas function to use LatestBlock instead of PendingBlock
  2. however, it is logical for mining node to update pending state properly, updateSnapshot before time.Sleep
  3. additionally, non-mining node is entering commitWork which is useless; just updateSnapshot if the node is not miner member

@egonspace egonspace added the bug Something isn't working label Jun 20, 2024
Copy link

@egonspace egonspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jennwiederholen jennwiederholen merged this pull request into dev Jun 24, 2024
@jennwiederholen jennwiederholen deleted the feat/update-snapshot-pending-state branch June 24, 2024 01:50
@egonspace egonspace restored the feat/update-snapshot-pending-state branch June 24, 2024 02:50
This was referenced Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants