Skip to content

chore: merge master #3

Closed
odyslam wants to merge 1975 commits intophylaxsystems:feat/cast-logsfrom
foundry-rs:master
Closed

chore: merge master #3
odyslam wants to merge 1975 commits intophylaxsystems:feat/cast-logsfrom
foundry-rs:master

Conversation

@odyslam
Copy link
Collaborator

@odyslam odyslam commented May 10, 2022

Motivation

Solution

Evalir and others added 19 commits May 5, 2023 12:57
…4856)

* chore: upgrade default evm version to shanghai for optimizoors

* fix: make test runner actually respect evm_version

* chore: clippy?

* chore: add paris and shanghai to available evm versions but run london on tests

* chore: add missing post-merge block properties

* chore: poc on checking for shanghai compat per RPC

* chore: dedupe evm_spec fn

* feat: set default test runner config to shanghai

* feat: add prevrandao cheatcode

* chore: modify tests to use prevrandao

* chore: fmt

* chore: test out comp by setting solc 0.8.19

* chore: improve warning message

* chore: unpin solidity version, fmt

* chore: pin things to ethers default (merge) instead of shanghai

* chore: clippy

* chore: force forge tests to use at least 0.8.19

* feat: fix fixtures and other test-related compiler errors

* chore: add missing semicolons to failed compiler run msg

* chore: fix last complaining test

* chore: fix remaining tests

* chore: format warning as yellow, use Chain type instead of raw U256s

* chore: correct difficulty for prevrandao

* chore: make testconfig evm spec nicely configurable

* feat: add Shanghai compat test (thanks karmacoma and vex)

* chore: make own folder for evm spec tests

* chore: move shanghai compat test to its own spec folder

* chore: remove duplicated function

* Apply suggestions from code review

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* feat: rewrite shanghai support check to be more efficient

* chore: use any

* chore: fmt

* chore: show chain IDs that are unsupported

* chore: point out unsupported chain IDs explicitly in message

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
…4885)

* fix(executor): throw proper errors and ignore prevrandao error

* fix(anvil): port reth gas estimation

* chore: clippy/fmt

* chore: fix test

* update fixture

* chore: add minimum create transaction gas from reth

* chore: use appropiate minimum gas depending on tx kind

* update fixture

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* fix(chisel): upgrade default solc version to 0.8.19

* chore: clippy happy
* refactor(evm): precompiles

* chore: clippy

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
#4874)

* feat: add way to specify remote signing to fall back to eth_sendTransaction

* chore: bail on walking folders, add some more message context around ledger/local failures

* chore: light refactor on send command to add more strictness

* chore: change error messages

* chore: lint

* chore: remove dir check from test

* chore: escape trailing newlines
…not using the correct EVM Version (#4904)

* chore(cheatcodes): ensure difficulty/prevrandao fail if not using the correct EVM version.

* chore: touch up revert error
* feat: print log hints converting uint to ether values

* chore: updated comments

* feat: exponential notation

* Update common/src/abi.rs

take by value

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: added helper function to calculate exponential notation, added docs to functions

* chore: added tests

* fix: removed generics

* fix: tests

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat(cheatcodes): restrict cheatcodes on precompiles

* chore: exclude address(0) from precompiles check

* chore: fix test

* chore: add revert tests
* feat(tests): add statefulFuzz alias to invariant

* chore: tests
… erroring (#4826)

* init start change prank

* testChangePrank

* revert startChangePrank and change startPrank to overwrite existing prank instead of erroring as per review suggestion

* add tests for prank0 after prank1 and prank1 after prank0

* fmt

* add error if prank is not used at least once before overwritten as per suggestion

* fmt

* unit test for startPrank0 - and startPrank1 -

* fix

* remove clones by only updating prank after first time applied

* fmt

* more readable names

* chore: fix/add tests, use ensure util

* chore: add missing edge case test

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: evalir <hi@enriqueortiz.dev>
* Parse FuzzConfig from string (brief impl)
Unit tests

* ConfParser trait is able to extract configurations out of a  structured text

Unit tests

* cargo +nightly fmt

* FuzzConfig implements ConfParser trait

Unit tests

* InvariantConfig implements ConfParser trait

Unit tests

* Parsing logic optimized
Meaningful e2e test

* Configurations can be parsed from project compilation output

* E2E tests for inline configuration load

* - ConfParser: parse fn is now try_merge
- TestOptions struct extended to track test specific configs
- Tests

* Since TestOptions is no more Copy => TEST_OPTS constant is now a function

* Inline config matcher uses stripped file prefixes to identify contracts

* TestOptionsBuilder docs

* Inline fuzz configs are applied during fuzz test execution + E2E tests

* Inline invariant configs are applied during fuzz test execution + E2E tests +  Docs

* typos

* Docs typo

* cargo +nightly fmt

* Added test for block comments

* Renamed ConfParser to InlineConfigParser

* Use NodeType enum to match condition

* Use helper type to describe the HashMap key

* Misconfigured line number added to the error - Need UNIT TESTS

* Added very descriptive context to the parse error + unit test

* Emphasis on the "Invalid" keyword

* Big refactoring. Design is cleaner and more appropriate.
It allows better validation flexibility.

Need to fix tests

* natspec unit tests

* Refactor Unit tests InvariantConfig + FuzzConfig

* Noisy comment test

* Use meaningful names

* Profile validation implemented + Unit tests

* Given a natspec, extract current profile configs + Unit tests

* TestOptions instantiated with new validation rules - NEED TESTS

* Integration tests working

* Integration tests docs and typos

* Utility function to get all available profiles in config - unit tests

* try update PR

* Punctuation in config/src/inline/conf_parser.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* Punctuation in config/src/inline/conf_parser.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: docs in cli/src/cmd/forge/test/mod.rs

* review: naming convention in InlineConfigParser

* review: test renaming suggestion

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: test renaming suggestion

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: test renaming suggestion

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: docs punctuation

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: docs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: function internal utils function renaming + docs

* review: get_fn_docs unit tests

* review: test renaming suggestion

Co-authored-by: evalir <hi@enriqueortiz.dev>

* review: clarify intent

* review: document functions

* review: applied case typos

* FIX CI: Available profiles fallback to vec![current_profile] in case the foundry.toml path cannot be resolved

* cargo +nightly fmt

* review: case typo

* review: remove double quotes from src line

* review: removed duplicated error msg; removed row:col:len detail (it was not accurate)

* fix CI

---------

Co-authored-by: evalir <hi@enriqueortiz.dev>
* improving docs generation by adding homepage to config

* comments

* remove comments

* chore: rizz up as per comments

* chore: skip serializing if empty

* chore: fix if

---------

Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
* chore: add tests to test proper behavior

* fix(cheatcodes): properly handle all cases for expectCall

* chore: allow too many arguments

* chore: store calldata as a vec instead of bytes to avoid interior mutability lint

* chore: more clippy

* chore: add more docs and abstract signature
* chore: add new expect emit logic

* feat: handle expect emits on the next immediate call and error appropiately

* chore: tests

* chore: simplify errors

* chore: remove unused actual count

* chore: clippy

* chore: remove unneeded test artifacts

* chore: ignore STATICCALLs

* chore: fix additive behavior

* chore: add more tests

* chore: lint

* chore: be able to match in between events rather than strictly full-sequences

* chore: clippy

* chore: lint expect emit

* chore: simplify if
* - add try_shrinking config in [invariant], default true, tries to reduce number of calls in scenario to min
- when set to false test will just error with the original number of calls in scenario

* Add comment

* Improve option name: shrink_sequence

* Changes after request: proper way to fix warnings

* add shrink-sequence to valid config keys for the parser

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
* Script: ensure prevrandao is set, even if no mixHash in response

* Update evm/src/executor/fork/init.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* Update evm/src/executor/fork/init.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* Update evm/src/executor/fork/init.rs

* chore: ensure prevrandao is set

---------

Co-authored-by: 0xCalibur <0xCalibur@protonmail.com>
Co-authored-by: evalir <hi@enriqueortiz.dev>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
mattsse and others added 26 commits August 5, 2023 20:50
…ot sort unnecesarily (#5562)

* chore: remove unneeded sorting

* fix: use correct include condition, and filter automatically

* chore: simplify check

* chore: fix test

* chore: to_owned to clone

* clippy

* chore: add test
* Implementing Otterscan support

Adds anvil support for Otterscan's custom RPC endpoints.

This is still a work in progress, as I have two endpoints to implement
still, but they should be **easy** (famous last words) compared to a lot
of the others, so I'm opening this ahead of time to gather feedback.

This was a bit tricky for a couple of reasons:
* Otterscan's endpoints are inherently hard to compute with existing
  data (otherwise they wouldn't be needed in the first place). They
  solve things that the original RPC spec didn't account for (most
  notably, listing historical transactions by address). For anvil, this
  is mostly a non-issue, as we can choose to traverse all the blocks &
  traces in-memory. Would be interesting to test this on an node with
  a heavy data-set though;
* After having gone through the spec, it seems to not be as well
  though-out as it could, and in some cases outdated compared to
  their code. Some of the design decisions behind it are a
  bit awkward to implement (see otterscan/otterscan#1081).

* comments

* code review

* code review

* code review

* code review

* code review

* Some fixes

* code review

* Update anvil/src/eth/otterscan.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* code review

* code review

* ots_getBlockDetailsByHash

* search endpoints tests

* tests for ots_getBlockTransactions

* tests for ots_getBlockDetails

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* code review

* Update Cargo.toml

* code review

* clippy

* code review

* code review

---------

Co-authored-by: evalir <hi@enriqueortiz.dev>
* chore: use latest revm main branch

* chore: solve hashmap issues

* chore: fix cheatcodes executor

* chore: fix evm crate imports/types

* fix: anvil inspector types

* chore: properly check bit flag

* chore: bump revm to include initcode size checks
* add fetchJsonKeys() cheatcode

* fmt

* forge fmt

* fix tests

* Remove unwrap()

* Fix typo
* feat: record logs and traces of the last call for all invariants

* feat: fill logs and traces with last call returned logs/traces

* chore: simplify return type

* chore: use struct instead of tuple

* chore: show all invariant logs across all depths when failing

* chore: insert all logs, even if the function reverts

* chore: heavily simplify types

* chore: clippy

* chore: fmt
* chore: make dummy call output lazy, bump

* chore: fmt

* chore: make lazy bytes
* chore: add flag to skip interactivity

* chore: docs

* chore: add eip-170 size limit info
* Reorganize Wallet struct to isolate raw options

* feature: cast wallet import

* feature: cast wallet list

* MultiWallet/Wallet now leverage imported keystores

* chore: fmt

* chore: clippy

* chore: foundry_keystores_dir function

* chore: split wallet push for readability

* chore: remove unused account from MultiWallet

* fixup! chore: foundry_keystores_dir function

* chore: wallet list creates dir if non-existent

* chore: remove dirs from cli Cargo.toml

* chore: docs for RawWallet

* chore: error into

* chore: success message for importing keystore

* refactor: green println from ansi -> yansi::Paint

---------

Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
* initial start

* traces working

* Update opts.rs

* clean up

* comments/debugger

* comment

* change build -> fill

* start of move to evm crate

* rename

* put fork setup on tracing executor

* comment

* return err on no traces

* moving trace handlers to cast::cmd::utils

* rm formatting

* fmt

* use a ref

* fix unneeded borrow

* unused import

* panic instead of bail

* initial

* Update cli/src/cmd/cast/call.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* Update cli/src/cmd/utils.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* Update cli/src/cmd/utils.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* Update evm/src/trace/mod.rs

Co-authored-by: evalir <hi@enriqueortiz.dev>

* comment

* unresolve convo

* TraceResult::from

* clippy --fix

* use from/try_from

* clippy --fix

* clean up, no extra url in panic

* formatting

* fix imports

* fix clap rxequirements

* Update cli/src/cmd/cast/call.rs

* cargo fmt

* move tracing executor to its own file

---------

Co-authored-by: N <mail@nuhhtyy.xyz>
Co-authored-by: evalir <hi@enriqueortiz.dev>
* Clarifies readme regarding ignored env variables

* chore: make permalink

---------

Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
* chore: separate cast and forge binaries

* chore: extract build args to cli

* chore: remove outdated comments
@odyslam odyslam closed this Aug 11, 2023
@odyslam odyslam reopened this Aug 11, 2023
@odyslam odyslam closed this Aug 11, 2023
odyslam pushed a commit that referenced this pull request Oct 24, 2023
* feat: use alloy revm branch

* fuzz/mod migrated

* progress

* progress, fmt

* fix imdb

* feat: cheatcodes compile

* feat: fork backend compiles

* feat: trace

* fuzz

* anvil progress

* chore: mem, fmt

* chore: db.rs

* chore: it lives

* fix test

* chore: clippy

* workin

* main backend stuff migrated

* chore: add glue on other crates

* chore: make executor use alloy types

* add glue for executor migration

* chore: use workspace alloy

* chore: undo revm bump changes

* chore: remove unneded prefix

* chore: fix fork fixture

* chore: uncomment tests

* chore: switch to up-to-date revm

* chore: clippy

* (#2) Alloy Migration: Migrate non-cheatcode inspectors (foundry-rs#5770)

* feat: migrate non-cheatcode inspectors

* fix: properly create both create and create2 addresses

* chore: clippy

* (#3) Alloy Migration: migrate fork-adjacent files to alloy primitives (foundry-rs#5771)

* chore: use create2_from_code

* borrow it brah

* chore: use from word

* chore: drop to_be_bytes

* fmt

* chore: use from_word on both palces

* chore: use address::random

* chore: make failure slot b256

* chore: use address::random

* chore: fix indexes

* chore: use contract.hash

* chore: do not collect

* chore: use display on alloy nums

* use + operator

* chore: unwrap bytes and replace import

* chore: Into:: -> ::from

* chore: fix test

* chore: use alloy imports

* chore: switch to alloy typesd

* chore: fix test
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.