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

capi: block execution commits after state batch has been flushed #1621

Merged
merged 14 commits into from
Jan 23, 2024

Conversation

canepat
Copy link
Member

@canepat canepat commented Oct 29, 2023

This PR contains the following changes related to block execution API implementation:

  • commit the current state when the batch size crosses over threshold
  • commit the state history after each block
  • change the batch size unit from cumulated gas to bytes
  • fix many batch size computations in db buffer
  • avoid caching read values in db buffer
  • sort storage locations to insert ordered data into db
  • fix empty element in call traces
  • fix unmanaged RW txn destruction

Moreover, some other things as well:

  • improve logging in block execution
  • add unit tests

All these changes have been made in the process of reaching full binary data compatibility between Erigon and Erigon+Silkworm, step by step, over a long sequence of comparative tests: that's why this PR required quite a long time to be finalised.

@canepat canepat added the c api The C API exposed for Erigon label Oct 29, 2023
@canepat canepat requested a review from mriccobene October 29, 2023 21:03
@canepat canepat force-pushed the node_fix_execution_state_counters branch from 92f25b8 to fc1316f Compare November 21, 2023 08:57
canepat and others added 11 commits January 19, 2024 17:40
node: fix batch size computation in db buffer
node: avoid caching read values in db buffer
node: change RWTxnUnmanaged to allow commit and abort
api: change batch flush policy from gas to size
node: fix empty element in call traces
node: fix state batch size computation for account code and storage
node: sort storage locations to insert ordered data into db
node: fix unmanaged r/w txn destruction
add unit tests
@canepat canepat force-pushed the node_fix_execution_state_counters branch from fe93c80 to 5d01cde Compare January 19, 2024 17:29
@canepat canepat changed the title api: block execution commits after state batch has been flushed capi: block execution commits after state batch has been flushed Jan 19, 2024
@canepat canepat marked this pull request as ready for review January 19, 2024 17:48
@canepat canepat marked this pull request as draft January 19, 2024 18:23
@canepat canepat marked this pull request as ready for review January 19, 2024 23:07
@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Jan 19, 2024
Copy link
Member

@JacekGlen JacekGlen left a comment

Choose a reason for hiding this comment

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

Looks good!
We probably need to check if this PR has any performance hit, but I can do it separately.

@JacekGlen JacekGlen merged commit 9f2436f into master Jan 23, 2024
@JacekGlen JacekGlen deleted the node_fix_execution_state_counters branch January 23, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api The C API exposed for Erigon maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants