Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement changes for zksolc 1.5.1 #460

Closed
wants to merge 458 commits into from
Closed

feat: implement changes for zksolc 1.5.1 #460

wants to merge 458 commits into from

Conversation

elfedy
Copy link
Contributor

@elfedy elfedy commented Jul 5, 2024

Motivation

1.5.0 renames system_mode to enable_vm_extensions and moved some cli flags to std json.

Solution

Adapt configs to those changes and make 1.5.1 the default compiler.

Related PRs

Needs Moonsong-Labs/compilers#15

sealer3 and others added 30 commits April 22, 2024 14:20
…once (#7741)

Return transaction hash in ots_getTransactionBySenderAndNonce
* fix(fuzz): deduplicate fuzz inputs

* Fix tests, collect fixtures in test setup, arc fixtures

* Cleanup

* Use fixture_ prefix

* Update tests to reflect that random values are used if no fixtures

* Review changes

* Group fuzz_calldata and fuzz_calldata_from_state in calldata mod

* Review changes: remove unnecessary clones, nicer code to collect fixtures

* Add support for bytes and string fixtures, fixture strategy macro. Solidity test

* Remove unnecessary clone

* Use inline config

* More robust invariant assume test
- previously rejecting when param was 0 (vm.assume(param != 0)) that is param should have been fuzzed twice with 0 in a run
- with fuzz input deduplication is now harder to occur, changed rejected if param is not 0 (vm.assume(param != 0)) and narrow down to one run and just 10 depth

* Fixtures as storage arrays, remove inline config

* Simplify code

* Support fixed size arrays fixtures

* Update comment

* Use DynSolValue::type_strategy for address and fixed bytes fuzzed params

* Add prefix to mark a storage array or a function as fixture

* Fix test

* Simplify code / fixture strategy macro, panic if configured fixture not of param type

* Consistent panic with fixture strategy if uint / int fixture of different type.
Keep level of randomness in fixture strategy, at par with uint / int strategies.

* Review changes: don't panic when invalid fixture, use prop_filter_map for fixture strategy and raise error
* migrate: cast doctests to alloy

* migrated: cast doctests to alloy

* nits

* use alloy_provider not helper fn
* fix: change envExists return sig

* update: cheats testdata
* bump alloy to include `get_receipt` hotfix

* refactor: alloy bump breaking changes

* fix(cast): doctests

* fix(forge/tests): can_broadcast_script_skipping_simulation

* fix(forge): create tests
* perf(invariant): sequentially shrink failed sequence

* If invariant function to test sequence is not set then return true (meaning original sequence is the smallest sequence we can identify)
Follow ups: always set invariant function so we can shrink / test sequence, figure out why sometimes a failed sequence (reproducible with a regression test) doesn't fail when it's replayed

* Reduce number of calls by trying to simplify in same step as complicate and avoid duplicate tests

* Changes after review
- for loop to shrink run limit
- store only call seq len in shrinker
- clone call seq only once

* Nit
* feat: `vm.blobhashes`

* chore: rename

* test: add `vm.blobhashes` test

* fix: add missing vm fn

* fix: `cargo cheat`

* fix: specify blobhashes loc

* fix: use solidity 0.8.24 for blobhash test

* chore: reinsert noop line ¯\_(ツ)_/¯

* refactor: move cancun cheats to sep dir

* temp

* temp

* feat(cheatcodes): getBlobhashes

---------

Co-authored-by: Yash Atreya <[email protected]>
* fix: blob cheats shadowing

* fix: cargo cheats
* add: alloy utils and fix anvil tests

* fix: clippy

* migrate`can_order_transactions` test

* migrate(anvil/tests): transactions - `can_respect_nonces`, `can_replace_transaction`, `can_reject_too_high_gas_limits`, `can_reject_underpriced_replacement`

* add: provider with signer utils

* use: sol! in abi

* start porting anvil_api tests

* additional tests

* add: can_impersonate_gnosis_safe

* add: can_impersonate_multiple_account

* add: can_mine_manually +  test_set_next_timestamp

* more tests

* add: test_can_set_storage_bsc_fork

* port the rest of the tests, final test is blocked on lack of txpool_inspect methods on the provider, see alloy-rs/alloy#502

* simplify types

* use provider_with_signer, unclear exactly if it will interact as expected in relation to impersonation

* migrate(anvil/tests): `can_deploy_greeter_http`, `can_deploy_and_mine_manually` tx tests migrated to alloy

* migrate(anvil/tests): `can_mine_automatically`, `can_call_greeter_historic` tx tests to alloy

* migrate(anvil/test): tx tests migrated to alloy - TODOs remaining

* migrate transaction::test_tx_access_list to alloy

* nit

* migrate(anvil/tests): transactions::call_past_state

* migrate(anvil/tests): can_handle_multiple_concurrent_deploys_with_same_nonce & can_handle_multiple_concurrent_transactions_with_same_nonce tx tests

* migrate: tx test stream_pending_txs - fix TODO

* start on api

* finish api examples, softly blocked on simulated call overrides - needs some more investigation

* clean up imports

* specify from on contract builder

* finish ganache tests

* wrap up ganache, start on gas

* add gas tests

* considering these tests are ignored is it necessary to keep them around?

* add back ganache and geth

* port geth

* add ipc

* add txpool, missing methods

* migrates(anvil/tests): `fork` tests to alloy - fix TODOs

* migrate(anvil/tests): trace tests to alloy - fix `debug_*` TODO

* bump alloy - satisfy clippy

* bump alloy & migrate sign examples

* fix revm-inspectors

* use latest evm-inspectors version

* start fixing broken test ports

* fix test_tip_above_fee_cap

* fix broken tests, long running websocket / ipc tests still have issues

* add can_call_with_state_override test

* re-enable txpool test body

* add logs:get_past_events test

* add logs:get_all_events

* add logs:watch_events

* pubsub utils

* yash/anvil-to-alloy (#7705)

* migrate(anvil/tests): pubsub

* pubsub tests to alloy

* nit

* nits

* nit:test_sub_new_heads_fast

* fix api:can_get_pending_block

* temporarily change ipc_provider to connect_pubsub, add ignores to breaking tests relying on #389

* fix gas:test_respect_base_fee

* fix api:can_call_on_pending_block

* add note on broken test to revisit, all tests should run now

* add temp attempt at optimism port, not behaving an expected and a lot of conversions

* revert for now

* start porting otterscan

* continue adding otterscan tests

* another otterscan test case

* finish otterscan tests

* clean up imports

* start porting revert tests

* fix(anvil/tests): TODOs

* bump alloy

* nit

* nits

* bump alloy to fix test_fork_uncles_fetch

* fmt nits

* nit

* rm abigen from abi

* nit

* rm unused ethers utils

* finish revert examples

* clean up imports and commits, use dynamic complilation where previously implemented

* port optimism

* lift comment to todo

* clean up imports, start porting leftover ethers references

* inline alloy namespace in foundry-common

* remove runtime_client, unnecessary imports

* fix: test_sub_new_heads_fast using workaround

* port jwt

* update alloy / alloy-core / evm-inspectors

* remove hex dep

* add missing hex

* implement txkind change, issues around test running - spotty

* cast differently, still not working

* rm ignore fork tests

* fix: clippy

* nits

* fix flaky test, make sure block is available by mining it

* fix cargo hack check

* ignore specific ipc error on windows

* append to previous commit, same ipc issue

* http_provider(&handle.http_endpoint()) -> handle.http_provider()

* apply for ws_provider and ipc_provider as well, re-enable can_remove_pool_transactions

* refactor test_sub_new_heads_fast

* remove redundant RpcUrl alias

* temp enable ipc tests for windows with debug

* attempt fix of ipc issue with tempfile, as used in Alloy test suite

* fix(anvil/tests): can_replace_transaction

* explicitly enable mocking for tests

* attempt ipc prefix

* enhance error, ignore failing ipc tests on windows for now

---------

Co-authored-by: Yash Atreya <[email protected]>
fix: set block gas limit to u64::MAX instead of u128::MAX
* Add test

* fix

* fmt
* fix(invariant): shrink when fail-on-revert set to true

* Fix test fmt
Updating git repository `https://github.com/alloy-rs/alloy`
    Updating git repository `https://github.com/paradigmxyz/evm-inspectors`
     Locking 34 packages to latest compatible versions
    Updating ariadne v0.4.0 -> v0.4.1
    Updating async-recursion v1.1.0 -> v1.1.1
    Updating async-task v4.7.0 -> v4.7.1
    Updating aws-config v1.2.0 -> v1.2.1
    Updating aws-sdk-kms v1.21.0 -> v1.22.0
    Updating aws-sdk-sso v1.20.0 -> v1.21.0
    Updating aws-sdk-ssooidc v1.20.0 -> v1.21.0
    Updating aws-sdk-sts v1.20.0 -> v1.21.0
    Updating aws-sigv4 v1.2.0 -> v1.2.1
    Updating blocking v1.5.1 -> v1.6.0
    Updating concurrent-queue v2.4.0 -> v2.5.0
    Updating event-listener-strategy v0.5.1 -> v0.5.2
    Updating fastrand v2.0.2 -> v2.1.0
    Updating flate2 v1.0.28 -> v1.0.29
    Updating libusb1-sys v0.6.4 -> v0.7.0
    Updating lock_api v0.4.11 -> v0.4.12
    Updating parking_lot v0.12.1 -> v0.12.2
    Updating parking_lot_core v0.9.9 -> v0.9.10
      Adding proc-macro-crate v3.1.0
    Updating pulldown-cmark v0.10.2 -> v0.10.3
    Updating pulldown-cmark-escape v0.10.0 -> v0.10.1
      Adding redox_syscall v0.5.1
    Updating rusb v0.9.3 -> v0.9.4
    Updating rustix v0.38.33 -> v0.38.34
    Updating rustls v0.21.11 -> v0.21.12 (latest: v0.23.5)
    Updating rustls-pki-types v1.4.1 -> v1.5.0
    Updating serde v1.0.198 -> v1.0.199
    Updating serde_derive v1.0.198 -> v1.0.199
    Updating serial_test v3.1.0 -> v3.1.1
    Updating serial_test_derive v3.1.0 -> v3.1.1
      Adding toml_edit v0.21.1 (latest: v0.22.12)
    Updating unicode-width v0.1.11 -> v0.1.12
    Updating winapi-util v0.1.6 -> v0.1.8
    Updating winnow v0.6.6 -> v0.6.7
note: pass `--verbose` to see 168 unchanged dependencies behind latest

Co-authored-by: mattsse <[email protected]>
…#7808)

* chore(invariant): deprecate shrink_sequence, code reuse and cleanup

* Split func mod in replay and result

* Update visibility, export only needed
* Fix eth_signTransaction request and response

* fixup! Fix eth_signTransaction request and response

* Hardcode test nonce and fee values

* Fix test signed result
@elfedy elfedy requested review from Karrq, nbaztec and Jrigada July 5, 2024 21:05
@elfedy elfedy marked this pull request as ready for review July 8, 2024 15:18
@elfedy elfedy marked this pull request as draft July 10, 2024 14:32
Base automatically changed from foundry-update-4af6cfa to dev July 22, 2024 13:45
@elfedy elfedy closed this Jul 22, 2024
@elfedy elfedy deleted the elfedy-151 branch July 22, 2024 17:20
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.