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

[DON'T MERGE] Update evmone to v0.13.0 #17

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

Conversation

elmato
Copy link
Contributor

@elmato elmato commented Jan 16, 2025

No description provided.

chfast and others added 30 commits March 26, 2024 22:08
Drop the Silkworm-driven execution of the blockchain tests.
These tests don't provide any new coverage once we run state tests
and some blockchain tests by evmone directly.
Moreover, maintaining a compatible Silkworm build while evmone is
in development is challenging.
Create single template function for running the benchmark and feed it
with precompiles by type traits.
Also provide nice names for the benchmarked implementations.
- Create single template function for running the benchmark and feed it
with precompiles by type traits.
- Also provide nice names for the benchmarked implementations.
- Provide more real-world inputs to precompiles benchmarks.

Example results:

```shell
---------------------------------------------------------------------------------------------------------------
Benchmark                                                     Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------------------------------------
precompile<PrecompileId::identity, identity_execute>       39.4 ns         39.4 ns     17721334 gas_rate=10.1339G/s gas_used=798
precompile<PrecompileId::ecrecover, evmmax_cpp>          771434 ns       771419 ns          780 gas_rate=3.88894M/s gas_used=30k
precompile<PrecompileId::ecrecover, libsecp256k1>         50077 ns        50076 ns        10000 gas_rate=59.909M/s gas_used=30k
precompile<PrecompileId::ecadd, evmmax_cpp>               12623 ns        12623 ns        60510 gas_rate=11.883M/s gas_used=1.5k
precompile<PrecompileId::ecadd, libff>                     4038 ns         4038 ns       189140 gas_rate=37.1512M/s gas_used=1.5k
precompile<PrecompileId::ecmul, evmmax_cpp>              352971 ns       352948 ns         1950 gas_rate=16.9997M/s gas_used=60k
precompile<PrecompileId::ecmul, libff>                   246113 ns       246094 ns         2840 gas_rate=24.3809M/s gas_used=60k
precompile<PrecompileId::ecpairing, libff>             11265465 ns     11260857 ns           62 gas_rate=16.0734M/s gas_used=181k
```
Add C++ implementation of the RIPEMD160 
and use it for the precompile `0x03`.
Adds the implementation of the BLAKE2b compress function F following
the [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693).
Implement [EIP-152](https://eips.ethereum.org/EIPS/eip-152)
"BLAKE2 compression function `F` precompile" by exposing
the `evmone::crypto::blake2b_compress()`.
- Adds the implementation of the BLAKE2b compress function F following
the [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693).
- Implements [EIP-152](https://eips.ethereum.org/EIPS/eip-152) "BLAKE2
compression function `F` precompile" by exposing the
`evmone::crypto::blake2b_compress()`.
- Do not cache this precompile.
The `blockchaintests` flag is not used any more.
The `statetests` flag is unnecessarily limited to only some directories.
Create individual stubs for precompiles with missing implementation.
They can be enabled selectively and by default.
Create individual stubs for precompiles with missing implementation.
They can be enabled selectively and by default.

Remove cache layer and JSON stubs.
Also support EOFCREATE and EOF with containers in bytecode helper.

Co-authored-by: pdobacz <[email protected]>
gumb0 and others added 30 commits September 17, 2024 15:10
…e_address (#1008)

This is needed to prepare for EIP-7702
ethereum/evmone#961

The main goal is to get rid of assertion that requires `recipient ==
code_address` in case `kind == EVMC_CALL`. (In 7702 world CALL can have
`code_address` pointing to a different (delegate) address.)

The idea is to split a variable `dst_acc` that was containing either
`recepient` or `code_address` account into two separate variables for
each thing.
Implementation of the `bls12_g1msm` and `bls12_g2msm` precompiles: multi
scalar affine points' multiplication from BLS12-381 curve according to
the EIP-2537 spec https://eips.ethereum.org/EIPS/eip-2537#abi-for-g1-msm
and https://eips.ethereum.org/EIPS/eip-2537#abi-for-g2-msm.

Co-authored-by: Paweł Bylica <[email protected]>
Pulled out of #961 

This is related to https://eips.ethereum.org/EIPS/eip-7685 and required
for filling EEST for Prague.
…e points (#1012)

Implementation of the `bls12_map_fp_to_g1` and `bls12_map_fp2_to_g2`
precompiles: mapping of `fp` field element to a point on `E1` curve
(BLS12-381) and mapping `fp2` extension field element to a point on `E2`
curve (BLS12-381) according to the EIP-2537 spec
https://eips.ethereum.org/EIPS/eip-2537#abi-for-mapping-fp-element-to-g1-point
and
https://eips.ethereum.org/EIPS/eip-2537#abi-for-mapping-fp2-element-to-g2-point.

Depends on: ethereum/evmone#1010
Implementation of the `bls12_pairing_check` precompile: According to
spec https://eips.ethereum.org/EIPS/eip-2537#abi-for-pairing-check

Depends on: ethereum/evmone#1012

Co-authored-by: Paweł Bylica <[email protected]>
Implement the KZG proof verification following the spec of
`verify_kfz_proof` in
https://eips.ethereum.org/EIPS/eip-4844#point-evaluation-precompile.
Use `crypto::kzg_verify_proof` to implement and enable
the `point_evaluation` precompile.
…) (#979)

Implement the KZG proof verification using the blst library.
Add native `point_evaluation` implementation.
Add benchmarks and report the comparison with Silkworm's implementation (see PR).
…(#1021)

This is required for [EIP-7702
implementation](ethereum/evmone#961), because
there the sender's nonce must be bumped before processing transaction's
Authorization List.
Also set default `chain_id` to 1 - see confirmation that this is
expected behavior
https://discord.com/channels/595666850260713488/753271902520213625/1280839101687533619

Pulled out of #961, required for 7702 tests.
Bump version: 0.12.0 -> 0.13.0
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.

8 participants