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

build: use new revm with analysis cache #2527

Merged
merged 9 commits into from
Aug 1, 2022
Merged

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Jul 31, 2022

image

This is a pretty naive port, I think there are some places we can improve it a bit. For example, we can probably reuse the analysis from REVM now instead of building our own IC maps.

The speedup is also only really for fuzz tests that deploy their contracts in setUp or the constructor - we can potentially improve here as well

Depends on bluealloy/revm#156

@onbjerg onbjerg added L-ignore Log: ignore PR in changelog T-perf Type: performance labels Jul 31, 2022
Whenever we output the bytecode of an account, whether to
a file or in a response, we need to return the *original*
bytecode using `Bytecode::len`, otherwise the bytecode
will differ depending on whether the bytecode has been
checked, analyzed or not.
anvil/src/eth/backend/mem/in_memory_db.rs Show resolved Hide resolved
evm/src/executor/fork/cache.rs Outdated Show resolved Hide resolved
evm/src/executor/inspector/tracer.rs Outdated Show resolved Hide resolved
evm/src/executor/mod.rs Outdated Show resolved Hide resolved
@onbjerg onbjerg marked this pull request as ready for review August 1, 2022 18:36
Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

pretty insane - i also got a large perf boost

@gakonst gakonst merged commit 4cfe78c into master Aug 1, 2022
@gakonst gakonst deleted the onbjerg/revm-analysis-cache branch August 1, 2022 20:05
iFrostizz pushed a commit to iFrostizz/foundry that referenced this pull request Nov 9, 2022
* build: use new revm with analysis cache

* refactor: use checked bytecode

See bluealloy/revm#121 (comment)

* build: use git revm

* build: use revm 1.8

* test: fix test

* fix: correct bytecode getters/setters

Whenever we output the bytecode of an account, whether to
a file or in a response, we need to return the *original*
bytecode using `Bytecode::len`, otherwise the bytecode
will differ depending on whether the bytecode has been
checked, analyzed or not.

* refactor: use `Bytecode::hash`

* fix: get original account code for traces

* refactor: remove unsafe code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-ignore Log: ignore PR in changelog T-perf Type: performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants