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

REVM debugger #920

Merged
merged 23 commits into from Mar 15, 2022
Merged

REVM debugger #920

merged 23 commits into from Mar 15, 2022

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Mar 12, 2022

Ports the debugger to the new REVM executor, greys out zero values in the stack and memory, and adds support for running functions with arguments

To do

  • Inspector
  • Adjust ui crate
  • Adjust forge run
  • Revert checks
  • Set stack title to signify number of stack items, not the current step

Nice to have

Closes #758
Closes #761

@onbjerg onbjerg added the L-ignore Log: ignore PR in changelog label Mar 12, 2022
/// Opcode to be executed
pub instruction: Instruction,
/// Optional bytes that are being pushed onto the stack
pub push_bytes: Option<Vec<u8>>,
Copy link
Member Author

Choose a reason for hiding this comment

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

I should adjust this to Option<Bytes> (same for call traces) since it's cheaper to clone

@onbjerg onbjerg mentioned this pull request Mar 12, 2022
18 tasks
Base automatically changed from onbjerg/revm-traces to revm March 13, 2022 19:55
@onbjerg
Copy link
Member Author

onbjerg commented Mar 14, 2022

This PR also includes some minor stylistic changes to the debugger, as well as a fix for #902 (I also greyed out zero values in the stack view).

On top of this it also adds support for forge run with arguments. For example, to run the FuzzTest::testFailFuzz function in https://github.com/onbjerg/foundry-test:

../../gakonst/foundry/target/debug/forge run src/fuzz/Fuzz.t.sol --sig "testFailFuzz(uint8)" --target-contract "FuzzTest" --debug 6

Passing 5 will end the debugging session with a STOP op, anything else will end it with a REVERT op.

I've tested the debugger on various contracts in the foundry-test repository side-by-side with the current debugger. There are some slight differences:

  • Gas usage is different in this port (but this is true for most of the port)
  • The current debugger will include debugging for DSTest IS_TEST and failed calls, but the port will not

Remaining items:

  • Checking for success/failure in forge run

forge/src/debugger.rs Outdated Show resolved Hide resolved
Comment on lines +200 to +209
Instruction::Cheatcode(cheat) => write!(
f,
"VM_{}",
&*HEVM_ABI
.functions()
.find(|func| func.short_signature() == *cheat)
.expect("unknown cheatcode found in debugger")
.name
.to_uppercase()
),
Copy link
Member Author

@onbjerg onbjerg Mar 14, 2022

Choose a reason for hiding this comment

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

I got rid of the CheatOp struct. Collecting debug info is a flag-gated one time cost and it is fast enough that we can focus on maintanability instead - this just makes it so we don't have to touch the debugger when we add new cheatcodes.

Comment on lines +63 to +66
pub fn enter(&mut self, depth: usize, address: Address, creation: bool) {
self.head =
self.arena.push_node(DebugNode { depth, address, creation, ..Default::default() });
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Called by call and create since we enter a new execution context

Comment on lines +69 to +75
pub fn exit(&mut self) {
if let Some(parent_id) = self.arena.arena[self.head].parent {
let DebugNode { depth, address, creation, .. } = self.arena.arena[parent_id];
self.head =
self.arena.push_node(DebugNode { depth, address, creation, ..Default::default() });
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Called by call_end and create_end since we go back to the previous execution context, which in this case is the parent of our current head node

Comment on lines +101 to +102
// TODO: The number reported here is off
total_gas_used: interpreter.gas().spend(),
Copy link
Member Author

Choose a reason for hiding this comment

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

The numbers are off compared to the debugger on master - it doesn't update as frequently and the numbers are higher. Requires more investigation

Comment on lines +112 to +115
let mut runner =
Runner::new(builder.build(), evm_opts.initial_balance, evm_opts.sender);
let (address, mut result) =
runner.setup(&predeploy_libraries, bytecode, needs_setup)?;
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved forge run away from using ContractRunner since I think that should be kept more test specific. We could move this runner into the forge crate if it makes sense, and maybe even build ContractRunner on top of it instead

Comment on lines -179 to -227
} else if evm_opts.verbosity > 2 {
// support traces
if let (Some(traces), Some(identified_contracts)) =
(&result.traces, &result.identified_contracts)
{
if !result.success && evm_opts.verbosity == 3 || evm_opts.verbosity > 3 {
let mut ident = identified_contracts.clone();
let (funcs, events, errors) =
foundry_utils::flatten_known_contracts(&known_contracts);
let mut exec_info = ExecutionInfo::new(
&known_contracts,
&mut ident,
&result.labeled_addresses,
&funcs,
&events,
&errors,
);
let vm = vm();
let mut trace_string = "".to_string();
if evm_opts.verbosity > 4 || !result.success {
// print setup calls as well
traces.iter().for_each(|trace| {
trace.construct_trace_string(
0,
&mut exec_info,
&vm,
"",
&mut trace_string,
);
});
} else if !traces.is_empty() {
traces.last().expect("no last but not empty").construct_trace_string(
0,
&mut exec_info,
&vm,
"",
&mut trace_string,
);
}
if !trace_string.is_empty() {
println!("{}", trace_string);
}
} else {
// 5. print the result nicely
if result.success {
println!("{}", Colour::Green.paint("Script ran successfully."));
} else {
println!("{}", Colour::Red.paint("Script failed."));
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Minified all of this into the same branch

});

// Tests that the run command can run arbitrary functions
forgetest!(can_execute_run_command_with_sig, |prj: TestProject, mut cmd: TestCommand| {
Copy link
Member Author

Choose a reason for hiding this comment

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

New test

});

// Tests that the run command can run functions with arguments
forgetest!(can_execute_run_command_with_args, |prj: TestProject, mut cmd: TestCommand| {
Copy link
Member Author

Choose a reason for hiding this comment

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

New test

@@ -7,6 +7,7 @@ members = [
"cli/test-utils",
"config",
"fmt",
"ui"
Copy link
Member Author

Choose a reason for hiding this comment

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

The ui crate was not in the workspace members for some reason

@onbjerg onbjerg marked this pull request as ready for review March 14, 2022 22:51
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.

🔥 🔥

forge/src/executor/inspector/debugger.rs Outdated Show resolved Hide resolved
forge/src/debugger.rs Outdated Show resolved Hide resolved
forge/src/lib.rs Outdated Show resolved Hide resolved
forge/src/executor/mod.rs Show resolved Hide resolved
@onbjerg
Copy link
Member Author

onbjerg commented Mar 15, 2022

I cleaned up some of the output in the --help flag for forge test and forge run. I also moved debug out of EvmArgs to make it a bit more flexible on a per-command basis.

Finally, added forge test --debug. The way it works is:

  • You run forge test --debug <TEST NAME>, where <TEST NAME> is the name of the test function
  • If the test function exists in multiple contracts, we fail and ask the user to add more constraints (using --match-contract etc.)
  • If it is a fuzz test, we run until we find a failure: if we do not fail, we run the last fuzz case

There's still a lot that could be refactored in cli/src/cmd/test.rs, cli/src/cmd/run.rs and the ui crate

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.

LGTM. Feel free to merge / address nit + merge

cli/src/cmd/test.rs Outdated Show resolved Hide resolved
@onbjerg onbjerg merged commit d879ded into revm Mar 15, 2022
@onbjerg onbjerg deleted the onbjerg/revm-debugger branch March 15, 2022 18:31
onbjerg added a commit that referenced this pull request Mar 15, 2022
* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`
@gakonst gakonst mentioned this pull request Mar 17, 2022
onbjerg added a commit that referenced this pull request Mar 17, 2022
* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`
onbjerg added a commit that referenced this pull request Mar 21, 2022
* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`
onbjerg added a commit that referenced this pull request Mar 22, 2022
* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`
onbjerg added a commit that referenced this pull request Mar 22, 2022
* Simple REVM test runner (#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (#789)

* REVM cheatcodes (#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes #752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (#956)

Ports #903

* REVM: FFI cheatcode updates (#955)

* feat: only strip 0x in ffi output if present

Ports #904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (#962)

* Cross-crate testdata (#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes #959

* REVM fuzz dictionary (#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(config): add caching settings

* feat: add none option

* feat: add foundry data dir

* feat: add storage map support

* bump ethers

* chore(clippy): make clippy happy

* refactor: diskmap

* feat: add rpc caching support

* feat: add no storage cache option

* refactor: rename cnfig value

* docs: more storage caching docs

* fix: with config builder function

* refactor: address review

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>
gakonst added a commit that referenced this pull request Mar 23, 2022
* Simple REVM test runner (#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (#789)

* REVM cheatcodes (#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes #752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (#956)

Ports #903

* REVM: FFI cheatcode updates (#955)

* feat: only strip 0x in ffi output if present

Ports #904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (#962)

* Cross-crate testdata (#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes #959

* REVM fuzz dictionary (#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(cli): Refactor cli/cmd over forge and cast (#1009)

* ⚙️ refactor cli

* 🧪 refactor casts

* REVM: Support cheatcodes in `setUp` (#997)

* fix: support cheatcodes in `setUp`

* fix: subtract stipend without panic

* chore: rename test

* fix: set tx gas price to block basefee

* fix: use `CALLER` for `is_success` check

* chore: remove duplicate clap attribute

* fix: set chain id correctly in fork mode

* fix: separate evm block env from execution env

* chore: clippy

* refactor: block override without `block_env` fn

* test: explain why git clone failed

* test: disable maple-labs/loan

* refactor: make addresses statics instead of lazies

* docs: fix console address comment

* refactor: make `DUMMY_CREATE_ADDRESS` a static

* chore: minor nits

* refactor: move inspector state collection

* fix: report correct fuzz failure case (#1017)

* fix: report correct fuzz failure case

* docs: improve some docs in fuzzer

* feat: add support for storage caching (#1006)

* Simple REVM test runner (#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (#789)

* REVM cheatcodes (#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes #752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes #902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (#956)

Ports #903

* REVM: FFI cheatcode updates (#955)

* feat: only strip 0x in ffi output if present

Ports #904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (#962)

* Cross-crate testdata (#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes #959

* REVM fuzz dictionary (#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(config): add caching settings

* feat: add none option

* feat: add foundry data dir

* feat: add storage map support

* bump ethers

* chore(clippy): make clippy happy

* refactor: diskmap

* feat: add rpc caching support

* feat: add no storage cache option

* refactor: rename cnfig value

* docs: more storage caching docs

* fix: with config builder function

* refactor: address review

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: default to 80m gas

* fix(evm): gracefully shutdown backendhandler (#1021)

* feat(evm/cache): improve json file caching (#1025)

* feat(cache): proper json cache

* refactor: use new db types

* chore(clippy): make clippy happy

* bump revm

* docs: some docs

* refactor: extend Fork type

* remove diskmap types

* test: refactor tests

* remove sharedmemcache

* add tests

* more tracing

* chore(clippy): make clippy happy

* release: 0.2.0

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>
Co-authored-by: abigger87 <abigger87@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
mattsse added a commit to mattsse/foundry that referenced this pull request Mar 28, 2022
* Simple REVM test runner (foundry-rs#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (foundry-rs#789)

* REVM cheatcodes (foundry-rs#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes foundry-rs#752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (foundry-rs#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (foundry-rs#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (foundry-rs#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes foundry-rs#902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (foundry-rs#956)

Ports foundry-rs#903

* REVM: FFI cheatcode updates (foundry-rs#955)

* feat: only strip 0x in ffi output if present

Ports foundry-rs#904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (foundry-rs#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (foundry-rs#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (foundry-rs#962)

* Cross-crate testdata (foundry-rs#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (foundry-rs#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (foundry-rs#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes foundry-rs#959

* REVM fuzz dictionary (foundry-rs#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(cli): Refactor cli/cmd over forge and cast (foundry-rs#1009)

* ⚙️ refactor cli

* 🧪 refactor casts

* REVM: Support cheatcodes in `setUp` (foundry-rs#997)

* fix: support cheatcodes in `setUp`

* fix: subtract stipend without panic

* chore: rename test

* fix: set tx gas price to block basefee

* fix: use `CALLER` for `is_success` check

* chore: remove duplicate clap attribute

* fix: set chain id correctly in fork mode

* fix: separate evm block env from execution env

* chore: clippy

* refactor: block override without `block_env` fn

* test: explain why git clone failed

* test: disable maple-labs/loan

* refactor: make addresses statics instead of lazies

* docs: fix console address comment

* refactor: make `DUMMY_CREATE_ADDRESS` a static

* chore: minor nits

* refactor: move inspector state collection

* fix: report correct fuzz failure case (foundry-rs#1017)

* fix: report correct fuzz failure case

* docs: improve some docs in fuzzer

* feat: add support for storage caching (foundry-rs#1006)

* Simple REVM test runner (foundry-rs#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (foundry-rs#789)

* REVM cheatcodes (foundry-rs#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes foundry-rs#752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (foundry-rs#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (foundry-rs#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (foundry-rs#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes foundry-rs#902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (foundry-rs#956)

Ports foundry-rs#903

* REVM: FFI cheatcode updates (foundry-rs#955)

* feat: only strip 0x in ffi output if present

Ports foundry-rs#904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (foundry-rs#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (foundry-rs#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (foundry-rs#962)

* Cross-crate testdata (foundry-rs#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (foundry-rs#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (foundry-rs#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes foundry-rs#959

* REVM fuzz dictionary (foundry-rs#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(config): add caching settings

* feat: add none option

* feat: add foundry data dir

* feat: add storage map support

* bump ethers

* chore(clippy): make clippy happy

* refactor: diskmap

* feat: add rpc caching support

* feat: add no storage cache option

* refactor: rename cnfig value

* docs: more storage caching docs

* fix: with config builder function

* refactor: address review

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: default to 80m gas

* fix(evm): gracefully shutdown backendhandler (foundry-rs#1021)

* feat(evm/cache): improve json file caching (foundry-rs#1025)

* feat(cache): proper json cache

* refactor: use new db types

* chore(clippy): make clippy happy

* bump revm

* docs: some docs

* refactor: extend Fork type

* remove diskmap types

* test: refactor tests

* remove sharedmemcache

* add tests

* more tracing

* chore(clippy): make clippy happy

* release: 0.2.0

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>
Co-authored-by: abigger87 <abigger87@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
mattsse added a commit to mattsse/foundry that referenced this pull request Mar 28, 2022
* Simple REVM test runner (foundry-rs#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (foundry-rs#789)

* REVM cheatcodes (foundry-rs#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes foundry-rs#752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (foundry-rs#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (foundry-rs#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (foundry-rs#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes foundry-rs#902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (foundry-rs#956)

Ports foundry-rs#903

* REVM: FFI cheatcode updates (foundry-rs#955)

* feat: only strip 0x in ffi output if present

Ports foundry-rs#904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (foundry-rs#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (foundry-rs#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (foundry-rs#962)

* Cross-crate testdata (foundry-rs#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (foundry-rs#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (foundry-rs#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes foundry-rs#959

* REVM fuzz dictionary (foundry-rs#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(cli): Refactor cli/cmd over forge and cast (foundry-rs#1009)

* ⚙️ refactor cli

* 🧪 refactor casts

* REVM: Support cheatcodes in `setUp` (foundry-rs#997)

* fix: support cheatcodes in `setUp`

* fix: subtract stipend without panic

* chore: rename test

* fix: set tx gas price to block basefee

* fix: use `CALLER` for `is_success` check

* chore: remove duplicate clap attribute

* fix: set chain id correctly in fork mode

* fix: separate evm block env from execution env

* chore: clippy

* refactor: block override without `block_env` fn

* test: explain why git clone failed

* test: disable maple-labs/loan

* refactor: make addresses statics instead of lazies

* docs: fix console address comment

* refactor: make `DUMMY_CREATE_ADDRESS` a static

* chore: minor nits

* refactor: move inspector state collection

* fix: report correct fuzz failure case (foundry-rs#1017)

* fix: report correct fuzz failure case

* docs: improve some docs in fuzzer

* feat: add support for storage caching (foundry-rs#1006)

* Simple REVM test runner (foundry-rs#788)

* refactor: nuke `evm-adapters`

* refactor: simple revm test runner

Current features:

- Can run unit tests
- Works with both revert-type tests and DSTest-type tests
- Collects logs, albeit not for reverting tests
- Integrated with config and CLI flags

Disabled features:

- Gas reports
- Tracing
- Cheatcodes
- Fuzzing
- Log decoding
- Forking mode
- Hardhat-style `console.log`, since those require
  us to decode calls to a specific address (HH does
  not emit logs)
- The debugger

In addition to this, I've disabled some tests that
could never pass under the current circumstances,
but that should be adjusted and re-enabled when their
respective features are implemented (such as fuzz tests)

* refactor: adjust CLI to new runner API

* feat: log collector inspector

* feat: hardhat logs

* chore: lint

* refactor: extract hh log converter to helper fn

* refactor: return single test result if setup fails

* build: use upstream revm

chore: renuke `evm-adapters`

* REVM fuzzer (foundry-rs#789)

* REVM cheatcodes (foundry-rs#841)

* feat: add `InspectorStack`

Adds `InspectorStack`, an inspector that calls a stack
of other inspectors sequentially.

Closes foundry-rs#752

* feat: port cheatcodes to revm

* feat: port `expectCall` cheatcode

* feat: extract labels from cheatcode inspector

* feat: port `expectEmit` cheatcode

* refactor: move log decoding into `forge` crate

* chore: remove unused evm patch

* test: re-enable debug logs test

* fix: record reads on `SSTORE` ops

* refactor: rename `record` to `start_record`

* docs: clarify why `DUMMY_CALL_OUTPUT` is 320 bytes

* fix: handle `expectRevert` with no return data

* build: bump revm

* chore: remove outdated todo

* refactor: use static dispatch in `InspectorStack`

* build: use k256

* fix: make gas usage not so crazy

* feat(revm): add forking mode (foundry-rs#835)

* feat: copy-paste old forking provider

* feat(fork): convert to REVM traits

* chore: remove unnecessary codehash handler

* feat: impl Database for shared backend

* chore: fix tests

* chore: fmt

* fix(fork): correctly convert H256 <> U256 for storage

* refactor: separate storage from accounts in cache

* feat(fork): fetch block hashes

* chore: remove unused DB parameter

* test: add test for block hashes

* feat: add forked backend to executor builder

* feat(cli): set fork url on the executor

* refactor: move shared backend to separate file

* feat(fork): add fn for instantiating forked env

* feat(cli): allow pinning block number

* fix(fork): install missing listeners

* feat(fork): instantiate environment with forked state

* fix: use a CALLER address with maxed out balance for calls

this is required because in forking mode otherwise the account wont have enough balance
to transact

* chore: fmt

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>

* chore: fmt

* REVM tracing and gas reports (foundry-rs#867)

* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>

* REVM debugger (foundry-rs#920)

* feat: port debugger data structures

* feat: initial port of `ui` crate

* chore: add `ui` crate as a workspace member

* refactor: adjust ui contract identification

* feat: grey out 0 values in debugger memory

Closes foundry-rs#902

* style: minor debugger ui beautification

* feat: better stack display in debugger ui

* feat: gray out zero bytes in stack view

* feat: debugger inspector

* refactor: minor code cleanup

* feat: port `forge run`

* fix: temp fix for failing `DsTest.sol` include

* chore: fix lints

* test: adjust `forge run` tests

* refactor: use simple bool for revert checks

* chore: remove unused display impl

* chore: remove unused comment

* fix: display number of stack items in ui

* docs: prettify cli help for some commands

* feat: `forge test --debug`

* refactor: `get_create_address` util

* refactor: `InspectorData`

* docs: more detailed err for `forge test --debug`

* feat: support hardhat artifacts in `vm.getCode` (foundry-rs#956)

Ports foundry-rs#903

* REVM: FFI cheatcode updates (foundry-rs#955)

* feat: only strip 0x in ffi output if present

Ports foundry-rs#904

* Update forge/src/executor/inspector/cheatcodes/ext.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* REVM gas fixes (foundry-rs#950)

* feat: account for gas refunds

* refactor: merge `call_raw` and committing variant

* fix: actually use refund quotient

* feat: strip tx gas stipend

* fix: fix reported gas usage in debugger

* build: use upstream revm

* test: adjust `forge run` gas values in tests

* chore: remove unused copy

* chore: add note on push maths

* feat: make stipend reduction optional

* fix: remove tx stipend in `forge run`

* REVM: Pull EVM executor into own crate (foundry-rs#961)

* refactor: move evm executor to own crate

* refactor: `evm::executor::fuzz` -> `evm::fuzz`

* refactor: `evm::debugger` -> `evm::debug`

* test: fix multi runner test

* feat: better ux for expect revert without reason (foundry-rs#962)

* Cross-crate testdata (foundry-rs#965)

* feat: cross-crate shared testdata

* refactor: move `foundry-utils` to common tests

* fix: fix getcode test

* fix: compile once in tests

* fix: fix prank cheatcode (foundry-rs#973)

Correctly apply `msg.sender` prank to both transfers
and calls.

* fix: prank depth math

* test: fix lib linking test

* refactor: use revm `log` hook (foundry-rs#984)

* refactor: use revm `log` hook

* chore: bump revm

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* test: add lil-web3 to integration tests

* test: add maple labs loans to integration tests

Closes foundry-rs#959

* REVM fuzz dictionary (foundry-rs#985)

* feat: fuzz dictionary

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: handle malformed bytecode

* fix: limit search for push bytes

* feat: collect fuzz state from logs

* feat: build initial fuzz state from db

* perf: use `Index` instead of `Selector`

Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* feat(config): add caching settings

* feat: add none option

* feat: add foundry data dir

* feat: add storage map support

* bump ethers

* chore(clippy): make clippy happy

* refactor: diskmap

* feat: add rpc caching support

* feat: add no storage cache option

* refactor: rename cnfig value

* docs: more storage caching docs

* fix: with config builder function

* refactor: address review

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>

* fix: default to 80m gas

* fix(evm): gracefully shutdown backendhandler (foundry-rs#1021)

* feat(evm/cache): improve json file caching (foundry-rs#1025)

* feat(cache): proper json cache

* refactor: use new db types

* chore(clippy): make clippy happy

* bump revm

* docs: some docs

* refactor: extend Fork type

* remove diskmap types

* test: refactor tests

* remove sharedmemcache

* add tests

* more tracing

* chore(clippy): make clippy happy

* release: 0.2.0

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
Co-authored-by: brockelmore <31553173+brockelmore@users.noreply.github.com>
Co-authored-by: abigger87 <abigger87@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port forge run Debugging inspector
2 participants