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

Move precompiles into standalone library #628

Merged
merged 27 commits into from
Jun 16, 2022
Merged

Move precompiles into standalone library #628

merged 27 commits into from
Jun 16, 2022

Conversation

yperbasis
Copy link
Member

@yperbasis yperbasis commented Apr 3, 2022

Move precompiles into a standalone library https://github.com/torquem-ch/silkpre. That library has a C API.

Paweł wrote a suggestion on the C API for Ethereum precompile libraries. Currently the API of torquem-ch/silkpre is somewhat different, but later we can converge to the proposed API.

@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #628 (1e4452b) into master (3b43267) will decrease coverage by 0.51%.
The diff coverage is 90.16%.

@@            Coverage Diff             @@
##           master     #628      +/-   ##
==========================================
- Coverage   75.91%   75.39%   -0.52%     
==========================================
  Files         189      183       -6     
  Lines       13447    12465     -982     
  Branches     2162     2081      -81     
==========================================
- Hits        10208     9398     -810     
+ Misses       2347     2186     -161     
+ Partials      892      881      -11     
Impacted Files Coverage Δ
core/silkworm/consensus/base/engine.cpp 90.90% <ø> (ø)
core/silkworm/execution/evm.hpp 80.00% <ø> (ø)
...ilkworm/stagedsync/stage_senders/recovery_farm.cpp 54.27% <0.00%> (ø)
...kworm/stagedsync/stage_senders/recovery_worker.hpp 100.00% <ø> (+50.00%) ⬆️
...kworm/stagedsync/stage_senders/recovery_worker.cpp 54.54% <50.00%> (-4.98%) ⬇️
core/silkworm/execution/evm.cpp 93.12% <95.65%> (-0.69%) ⬇️
core/silkworm/consensus/engine.cpp 98.07% <100.00%> (ø)
core/silkworm/types/transaction.cpp 82.10% <100.00%> (+0.23%) ⬆️
core/silkworm/types/y_parity_and_chain_id.cpp 100.00% <100.00%> (ø)
core/silkworm/state/intra_block_state.cpp 93.99% <0.00%> (-1.42%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b43267...1e4452b. Read the comment docs.

@yperbasis yperbasis changed the title [WIP] Extract precompiles into standalone library Extract precompiles into standalone library Jun 16, 2022
@yperbasis yperbasis changed the title Extract precompiles into standalone library Move precompiles into standalone library Jun 16, 2022
@yperbasis yperbasis marked this pull request as ready for review June 16, 2022 11:34
@chfast
Copy link
Member

chfast commented Jun 16, 2022

Hi, I actually started playing with the C API today. I should be able to share some results maybe tomorrow. WIP: https://github.com/torquem-ch/silkpre/compare/capi.

I try to separate core functionality from gas cost so this can be used without heap allocated buffer. The nice C++ API could be build on top of it with gas cost so this becomes hourglass pattern.

Don't you have issue with diamond dependency of secp256k1?

@yperbasis
Copy link
Member Author

Don't you have issue with diamond dependency of secp256k1?

Silkworm depends on silkpre, which in turns depends on secp256k1, so no diamond dependency. I've removed secp256k1 submodule from Silkworm.

@yperbasis yperbasis merged commit fabd6e2 into master Jun 16, 2022
@yperbasis yperbasis deleted the silkpre branch June 16, 2022 12:56
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.

3 participants