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: split silkworm_execute_blocks() into functions with ext and int txns #1917

Merged
merged 17 commits into from
Mar 20, 2024

Conversation

JacekGlen
Copy link
Member

@JacekGlen JacekGlen commented Mar 18, 2024

This PR splits the existing silkworm_execute_blocks endpoint in CAPI and creates two separate endpoints:

  • silkworm_execute_blocks_ephemeral: takes a db txn as a parameter and uses it to flush the data, but does not commit the transaction
  • silkworm_execute_blocks_perpetual: creates its own db txn, commits the data and leaves the database in a coherent state

The change cleans up the code and structures it in a more logical way. It also lays the ground for future improvements.

Associated PRs:

@JacekGlen JacekGlen changed the title Capi main loop rework txn capi: split silkworm_execute_blocks() into functions with ext and int txns Mar 18, 2024
@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Mar 20, 2024
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
silkworm/capi/silkworm.cpp Show resolved Hide resolved
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
silkworm/capi/silkworm.cpp Outdated Show resolved Hide resolved
@canepat canepat merged commit 1943c1b into master Mar 20, 2024
4 checks passed
@canepat canepat deleted the capi-main-loop-rework-txn branch March 20, 2024 11:02
JacekGlen added a commit to erigontech/erigon that referenced this pull request Mar 29, 2024
This PR splits the existing `silkworm_execute_blocks` endpoint in CAPI
and creates two separate endpoints:
- `silkworm_execute_blocks_ephemeral`: takes a db txn as a parameter and
uses it to flush the data, but does not commit the transaction
- `silkworm_execute_blocks_perpetual`: creates its own db txn, commits
the data and leaves the database in a coherent state

Associated PRs:
- erigontech/silkworm-go#4
- erigontech/silkworm#1917

---------

Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants