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

chore: resolve merge conflicts for upstream-fef2098 #736

Merged
merged 59 commits into from
Nov 25, 2024

Conversation

Karrq
Copy link
Contributor

@Karrq Karrq commented Nov 21, 2024

What 💻

  • Resolves merge conflicts for fef2098

l1nxy and others added 30 commits November 7, 2024 13:55
* fix(forge): fix stack overflow when the lib path is absolute.

* format

* add test for setting absolute lib path.

* remove useless code:
…258)

* fix(remappings): ignore remappings of root proj dir when merging

* Remove unused code

* Add test

* Update

* Load project paths from figment

---------

Co-authored-by: zerosnacks <[email protected]>
* feat(`cheatcodes`): mockCall with bytes4

* fix

* fix
…receive` (#9288)

fix(coverage): do not report empty constructors, enable reports for receive fn
* feat: add anvil_get_interval_mine method

* refactor: keep consistent naming

---------

Co-authored-by: Your Name <[email protected]>
Co-authored-by: grandizzy <[email protected]>
…#9268)

* enforce for script and verify crates

* complete and enforce common shell

* permit eprintln! due to circular dependency outside of common path

* avoid code duplication
Locking 61 packages to latest compatible versions
    Updating allocator-api2 v0.2.18 -> v0.2.19
    Updating alloy-chains v0.1.46 -> v0.1.47
    Updating anyhow v1.0.92 -> v1.0.93
    Updating arbitrary v1.3.2 -> v1.4.1
    Updating aws-config v1.5.9 -> v1.5.10
    Updating aws-sdk-kms v1.49.0 -> v1.50.0
    Updating aws-sdk-sso v1.48.0 -> v1.49.0
    Updating aws-sdk-ssooidc v1.49.0 -> v1.50.0
    Updating aws-sdk-sts v1.48.0 -> v1.49.0
    Updating aws-smithy-runtime-api v1.7.2 -> v1.7.3
    Updating aws-smithy-types v1.2.8 -> v1.2.9
    Updating cc v1.1.36 -> v1.1.37
    Updating clap_complete v4.5.36 -> v4.5.37
    Updating derive_arbitrary v1.3.2 -> v1.4.1
    Updating fastrand v2.1.1 -> v2.2.0
 Downgrading fs4 v0.10.0 -> v0.9.1
    Updating gcloud-sdk v0.25.7 -> v0.25.8
    Updating handlebars v5.1.2 -> v6.2.0
    Updating hyper-timeout v0.5.1 -> v0.5.2
      Adding icu_collections v1.5.0
      Adding icu_locid v1.5.0
      Adding icu_locid_transform v1.5.0
      Adding icu_locid_transform_data v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
      Adding icu_provider v1.5.0
      Adding icu_provider_macros v1.5.0
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating libc v0.2.161 -> v0.2.162
      Adding litemap v0.7.3
    Updating mdbook v0.4.40 -> v0.4.42
    Updating newtype-uuid v1.1.2 -> v1.1.3
      Adding num-modular v0.6.1
      Adding num-order v1.2.0
    Updating quinn-udp v0.5.6 -> v0.5.7
    Updating security-framework-sys v2.12.0 -> v2.12.1
    Updating serial_test v3.1.1 -> v3.2.0
    Updating serial_test_derive v3.1.1 -> v3.2.0
    Updating snapbox v0.6.19 -> v0.6.20
      Adding stable_deref_trait v1.2.0
 Downgrading svm-rs v0.5.8 -> v0.5.7 (available: v0.5.8)
 Downgrading svm-rs-builds v0.5.8 -> v0.5.7 (available: v0.5.8)
      Adding synstructure v0.13.1
    Updating tempfile v3.13.0 -> v3.14.0
      Adding tinystr v0.7.6
    Updating tokio v1.41.0 -> v1.41.1
    Updating tracy-client-sys v0.24.1 -> v0.24.2
    Removing unicode-bidi v0.3.17
    Updating url v2.5.2 -> v2.5.3
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
      Adding write16 v1.0.0
      Adding writeable v0.5.5
      Adding yoke v0.7.4
      Adding yoke-derive v0.7.4
      Adding zerofrom v0.1.4
      Adding zerofrom-derive v0.1.4
      Adding zerovec v0.10.4
      Adding zerovec-derive v0.10.3
note: pass `--verbose` to see 42 unchanged dependencies behind latest

Co-authored-by: mattsse <[email protected]>
* fix(trace): check fn sigs for contract with fallbacks

* Add Json test

* Execute test with traces

* Simplify, check only for decoded function
…g with `cargo test` runner (#9296)

* use regular println to avoid interfering with cargo test runner

* revert test change
…s (#9295)

* fix(cast run): decode traces for non mainnet

* Add test

* Changes after review: use EtherscanOpts, remove short -e from evm_version
Simplify test to avoid rate limiting.
* feat(cast): add artifact method

* Remove unneeded clone

* Get chain info from provider

* Rebase fix
…as header` is Some (#9298)

fix(fork): set block blob_excess_gas_and_price only if excess_blob_gas header is Some
…cing `--verbose` (#9273)

* remove --verbose, prefer output mode, introduce verbosity level (-vvv)

* remove leftover

* fix arg

* add ability to set verbosity level

* fix tests

* remove evm args specific verbosity arg in favor of global arg due to Clap limitation

* revert test modifications from foundry-rs/foundry#9244 for TestArgs, simply pass + flatten ShellOpts in args

* in lieu of a context specific help document the verbosity levels of the EVM as an example

* format comment, update tests

* fix clippy
chore: do not trim generic custom error trace
Update to soldeer 0.5.1

Co-authored-by: zerosnacks <[email protected]>
fix(forge eip712): handle recursive types
* feat(forge): allow `--verifier custom` option

* Changes after review: add description of custom verifier, reorg err message, add custom verifier api key

* Fix descriptions

* Update crates/verify/src/provider.rs

Co-authored-by: zerosnacks <[email protected]>

---------

Co-authored-by: zerosnacks <[email protected]>
* begin api and rough comments

* impl cheatcode

* add check for eoa

* fix eoa check on each prank call

* add to assets

* prank compiling

* delegate call working, storage not upating

* delegate call working, some tidy up

* add prank2 calls

* impl remaining tests

* formatting

* forge fmt

* add pranks to cheatcodes.json

* run cargo cheats

* If verbosity level is 1 or higher, it shows dirty files.

* Fix, add EOA prank test

* Revert "If verbosity level is 1 or higher, it shows dirty files."

This reverts commit d03ac1d59acb8096b12f46dfb5a397bcc4d28ce9.

* Fix test

* apply on extdelegatecall

---------

Co-authored-by: mgiagante <[email protected]>
Co-authored-by: grandizzy <[email protected]>
…#9321)

* add --sizes and --names JSON compatibility + generalize report kind

* add additional json output tests

* fix feedback nit
* test: enhance tests

* update ws url

* Assert json unordered

* Update crates/test-utils/src/util.rs

Co-authored-by: DaniPopes <[email protected]>

* Changes after review

* Fix rpc url test

---------

Co-authored-by: grandizzy <[email protected]>
Co-authored-by: grandizzy <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
DaniPopes and others added 23 commits November 18, 2024 21:46
* [wip] feat: compilation restrictions

* Cargo.lock

* update patch

* fixes

* update patch

* update patch

* wip

* deps

* bytecode hash

* fixes

* rm patches

* pub
* fix: identification of contracts in scripts

* clippy
* fix(coverage): allow ir-minimum for versions < 0.8.5

* Fix

* Remove 0.8.13 restriction, update message and sanitize for 0.8.4 if version cannot be detected

* Update crates/forge/bin/cmd/coverage.rs

Co-authored-by: DaniPopes <[email protected]>

---------

Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
* chore: don't color error message in red

* Update crates/cli/src/handler.rs

Co-authored-by: zerosnacks <[email protected]>

---------

Co-authored-by: zerosnacks <[email protected]>
* chore: move archive endpoints to different provider

* Make archive endpoints configurable in env vars

* Truncate fork url in err

* Include only provider in failed fork message

* Add env vars from secrets

* Fix tests

---------

Co-authored-by: Matthias Seitz <[email protected]>
Fix typographical error in default value assignment for FOUNDRY_DIR
inherit secrets, use alchemy as default for external PRs, comment out infura
* add EIP-7702 cheatcodes: createDelegation, signDelegation, attachDelegation

* add cheatcode implementations for EIP-7702: createDelegationCall, signDelegationCall, attachDelegationCall; modify broadcast to check if sender has a delegation

* add delegations hashmap to Cheatcodes struct

* add revm crate

* create AttachDelegationTest for EIP-7702 transactions

* regen cheatcodes.json

* cargo fmt

* move broadcast under attachDelegation

* combine createDelegationCall logic with signDelegationCall in order to create and sign delegation in a single call; remove delegation logic from broadcast() - no need to track delegations here

* remove revm import from workspace

* combine createDelegation logic inton signDelegation for simplicity

* remove revm from forge script deps

* combine createDelegation with signDelegation

* WIP - refactor test to use SimpleDelegateContract and ERC20 - test currently failing bc 7702 implementation.execute not executed as Alice EOA

* add logic to include authorization_list for EIP 7702 in TransactionRequest by searching delegations hash map by active_delegation

* add address authority param to attachDelegation; remove nonce param from signDelegation, as it can be constructed in cheatcode.

* remove 7702 tx request construction logic - now handled in attachDelegation cheatcode implementation

* refactor attachDelegation cheatcode implementation to handle verifying signature and setting bytecode on EOA; refactor signDelegation cheatcode implementation to get nonce from signer

* remove nonce param from attachDelegation cheatcode in favor of loading from authority account

* refactor test to check for code on alice account and call execute on alice account through SimpleDelegateContract

* revert refactor on TransactionRequest

* format

* cargo fmt

* fix clippy errors

* remove faulty logic comparing nonce to itself - nonce still checked by recovered signature

* add more tests to cover revert cases on attachDelegation and multiple calls via delegation contract

* cargo fmt

* restore logic to check if there's an active delegation when building TransactionRequest; add fixed values for gas and max_priority_fee_per_gas to ensure tx success, with TODO comment to explain what's left

* remove obsolete comment

* add comments explaining delegations and active_delegation

* cargo fmt

* add logic to increase gas limit by PER_EMPTY_ACCOUNT_COST(25k) if tx includes authorization list for EIP 7702 tx, which is seemingly not accounted for in gas estimation; remove hardcoded gas values from call_with_executor

* revert logic to add PER_EMPTY_ACCOUNT_COST for EIP 7702 txs - handled inside of revm now

* remove manually setting transaction type to 4 if auth list is present - handled in revm

* add method set_delegation to Executor for setting EIP-7702 authorization list in the transaction environment; call set_delegation from simulate_and_fill if auth list is not empty

* remove redundancy with TransactionMaybeSigned var tx

* cargo fmt

* refactor: use authorization_list() helper to return authorization_list and set delegation

* refactor: change Cheatcodes::active_delegation to Option<SignedAuthorization> and remove delegations hashmap - tx will only use one active delegation at a time, so no need for mapping

* replace verbose logic to set bytecode on EOA with journaled_state.set_code helper

* cargo fmt

* increment nonce of authority account

* add logic to set authorization_list to None if active_delegation is None

* add test testSwitchDelegation to assert that attaching an additional delegation switches the implementation on the EOA

* remove set_delegation logic in favor of adding call_raw_with_authorization - previous approach kept the delegation in the TxEnv, resulting in higher gas cost for all subsequent calls after the delegation was applied

* refactor signDelegation to return struct SignedDelegation and for attachDelegation to accept SignedDelegation

* update delegation tests to reflect change in cheatcode interface for signDelegation and attachDelegation

* add cheatcode signAndAttachDelegation

* add signAndAttachDelegationCall cheatcode logic; refactor helper methods for shared logic used in 7702 delegation cheatcodes

* add test testCallSingleSignAndAttachDelegation for new cheatcode signAndAttachDelegation

* add comments to SignedDelegation struct and cargo fmt

* cargo fmt

* fix ci

* fix spec

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: grandizzy <[email protected]>
* rename ShellOpts to GlobalOpts

* prefer arg / command over clap

* add global opts

* remove redundant GlobalOpts injection, only use where access to the global variables is required

* add global thread pool

* add try_jobs method for global rayon pool

* limit unnecessary globalopts injection where shell::* is preferred

* fix tests

* port custom threads iterator to use global rayon thread pool

* remove redundant ignores

* remove leftover from merge conflict, fix clashing args with inlined global in nodeargs / anvil top level args

* leftovers

* add back global args in script args

* fix unused global opts

* ignore attempted multiple initializations of the global thread pool

* add init, default spawn with default rayon settings on forge test

* make test thread number configurable

* add back max threads back test to reduce pressure

* remove global --jobs rayon pool, revert to current implementation

* fix import
* bump alloy to 0.6.1

* fix: ui - use AnyRpcBlock
* fix: wallets - use PrimitveSig

* bump 0.6.2

* replace: AnyNetworkBlock with AnyRpcBlock + HeaderResponse with BlockHeader

* fix: configure_tx_env

* fix: crypto cheatcodes

* fix: anvil_core tx

* fix

* fix: verify-bytecode

* fix cast + get_pretty_tx_attr

* fix(`anvil`): core TypedTx + BlockListener task

* fix

* fix: anvil tests

* fix: test_deser_block

* fix: transaction_build

* fix: test load state files

* fix: deny.toml

* fix: try_from AnyRpcTx to DepositTx + bump op-alloy types

* bump

* fix: configure_tx_env

* fix: UiFmt

* fix: vb

* fix: common-fmt tests

* nit

* fix: sig encoding

* fix: process deposit tx in transaction_build

* fix: common-fmt tests

* fix

* Update deny.toml

Co-authored-by: zerosnacks <[email protected]>

* fixes

* fix: use alloy impls for conversions

* nit

* fix: transaction_build

* nit

* fix: eip155 check and rm anvil core utils

* clippy

* nits

* fix

* nit

* fix: impl UIfmt for TxEnvelope and AnyTxEnvelope

* make header in pretty_block_basics exhaustive

* clippy

* fix

* fix: txpool_content

* fix

* fix

* fix overriding hashes

* fix

---------

Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: grandizzy <[email protected]>
* feat(`anvil`): --cache-path

* nits

* test

* nit

* run with tempdir

* nit
* feat: add global -j, --threads

* Update crates/cli/src/opts/global.rs

* fix tests after comment update

---------

Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: zerosnacks <[email protected]>
@Karrq Karrq requested a review from a team as a code owner November 21, 2024 16:52
@Karrq Karrq changed the title Upstream fef2098 merge conflicts chore: resolve merge conflicts for upstream-fef2098 Nov 21, 2024
@Karrq Karrq merged commit 2af15c1 into upstream-fef2098 Nov 25, 2024
4 of 5 checks passed
@Karrq Karrq deleted the upstream-fef2098-merge-conflicts branch November 25, 2024 16:50
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.