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: execute single transaction #2665

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Conversation

JacekGlen
Copy link
Member

@JacekGlen JacekGlen commented Jan 19, 2025

Adds execution of a single transaction to be called externally (Erigon 3).

MDBX was updated to v0.38.4, in line with Erigon 3.

Minor modifications made to the domain data access, no prev_step is necessary. Please take a look at the breakdown below of how data is stored in Erigon 3, also in the Erigon 3 book:

Account:

  • AccountVals: address | step + encoded account
  • AccountHistoryVals: address | txn_num + original encoded account
  • AccountHistoryKeys: txn_num | address
  • AccountIdx: none

Code (has_large_values):

  • CodeVals: address + step | code
  • CodeHistoryVals: address + txn_num | original code
  • CodeHistoryKeys: txn_num | address
  • CodeIdx: none

Storage:

  • StorageVals: address + loc | step + value
  • StorageHistoryVals: address + loc | txn_num + original value
  • StorageHistoryKeys: txn_num | address + loc
  • StorageIdx: none

@JacekGlen JacekGlen marked this pull request as ready for review January 24, 2025 08:41
@JacekGlen JacekGlen marked this pull request as draft January 29, 2025 10:05
@JacekGlen JacekGlen marked this pull request as ready for review January 29, 2025 15:32
@JacekGlen
Copy link
Member Author

Also see erigontech/silkworm-go#13 for the related silkworm-go update

Copy link
Contributor

@battlmonstr battlmonstr left a comment

Choose a reason for hiding this comment

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

great progress 👍 see comments

silkworm/db/datastore/kvdb/domain_get_latest_query.hpp Outdated Show resolved Hide resolved
silkworm/db/datastore/kvdb/domain_put_query.hpp Outdated Show resolved Hide resolved
silkworm/db/state/accounts_domain.hpp Show resolved Hide resolved
silkworm/db/state/accounts_domain.hpp Outdated Show resolved Hide resolved
silkworm/db/datastore/kvdb/mdbx.hpp Outdated Show resolved Hide resolved
@@ -53,6 +53,8 @@ struct SilkwormInstance {
std::unique_ptr<silkworm::rpc::Daemon> rpcdaemon;
std::unique_ptr<silkworm::stagedsync::ExecutionEngine> execution_engine;

std::optional<silkworm::ChainConfig> chain_config;
Copy link
Contributor

Choose a reason for hiding this comment

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

We also have this field inside instance.node_settings.chain_config.
I have on my TODO list to split it to be separate from NodeSettings, because we believe that NodeSettings should just only reflect static CLI options.
So even if duplicate - it is a change in a good direction :)

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/execution/domain_state.cpp Show resolved Hide resolved
@JacekGlen JacekGlen requested a review from battlmonstr January 30, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants