Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/update snapshot pending state #111

Merged
merged 6 commits into from
Jun 24, 2024

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
graphql/graphql.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@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
5 checks passed
@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
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.

3 participants