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

feat: precompile with generic context #1155

Merged
merged 6 commits into from
Mar 6, 2024
Merged

feat: precompile with generic context #1155

merged 6 commits into from
Mar 6, 2024

Conversation

rakita
Copy link
Member

@rakita rakita commented Mar 5, 2024

Generics are added to precompile and are set to EvmContext and EXT (External context) this allows us to have precompiles that have access to full context.

Few things were shuffled to make this possible.

Update builder docs with example of ContextStatefulPrecompile

Copy link
Contributor

github-actions bot commented Mar 5, 2024

Valgrind Results:

==3906== Cachegrind, a cache and branch-prediction profiler
==3906== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==3906== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==3906== Command: target/release/snailtracer
==3906== 
--3906-- warning: L3 cache found, using its data for the LL simulation.
Snailtracer Host+Interpreter benchmark (2.1s) ...            not enough samples
==3906== 
==3906== I   refs:      463,577,573
==3906== I1  misses:          3,365
==3906== LLi misses:          2,983
==3906== I1  miss rate:        0.00%
==3906== LLi miss rate:        0.00%
==3906== 
==3906== D   refs:      237,187,010  (160,464,432 rd   + 76,722,578 wr)
==3906== D1  misses:        324,823  (    184,983 rd   +    139,840 wr)
==3906== LLd misses:        137,566  (      4,062 rd   +    133,504 wr)
==3906== D1  miss rate:         0.1% (        0.1%     +        0.2%  )
==3906== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==3906== 
==3906== LL refs:           328,188  (    188,348 rd   +    139,840 wr)
==3906== LL misses:         140,549  (      7,045 rd   +    133,504 wr)
==3906== LL miss rate:          0.0% (        0.0%     +        0.2%  )

crates/precompile/src/lib.rs Outdated Show resolved Hide resolved
crates/primitives/src/precompile.rs Outdated Show resolved Hide resolved
@rakita rakita merged commit 0d42796 into main Mar 6, 2024
25 checks passed
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
@DaniPopes DaniPopes deleted the context_precompile branch March 13, 2024 23:38
fubuloubu pushed a commit to ApeWorX/revm that referenced this pull request Apr 11, 2024
* feat: precompile with generic context

* move ContextPrecompile to revm crate

* nits

* hashmap and comments

* fmt
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.

2 participants