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

Merged
merged 48 commits into from
Jan 31, 2025
Merged

capi: execute single transaction #2665

merged 48 commits into from
Jan 31, 2025

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

@@ -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 :)

@JacekGlen JacekGlen requested a review from battlmonstr January 30, 2025 15:18
@JacekGlen JacekGlen merged commit 1ca6a44 into master Jan 31, 2025
5 checks passed
@JacekGlen JacekGlen deleted the capi-execute-single-txn branch January 31, 2025 09:31
@canepat canepat added c api The C API exposed for Erigon erigon3 Erigon3 feature labels Feb 3, 2025
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 erigon3 Erigon3 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants