Skip to content

Commit

Permalink
feat(anvil): Core types migration (#6808)
Browse files Browse the repository at this point in the history
* here we go again

* wip: storage

* chore: migrate executor, fmt

* wip

* chore: roughly only signers left

* feat: migrate proof, bar trie stuff

* chore: onto tests

* chore: passing most tests

* chore: fix impersonate

* chore: op tests passing

* txenvelope

* chore: some fixes, typed data

* feat(`anvil`): remove old ethers-dependent anvil core types (#6842)

* feat: remove most ethers and old anvil core types

* chore: replace handles for providers constructed on actual tests

* finish moving test providers

* chore: switch to decode_revert

* chore: replace with maybe_decode_revert

* u256::decode

* chore: move all of anvil but tests and block subscriptions off ethers

* re-enable opt

* solve nits

* chore: remove more println

* chore: rename to gen

* chore: update alloy, cleanup

* chore: fix tests

* chore: rename to sign

* chore: fmt

* chore: cleanup

* docs

* chore: more cleanup

* clippy/fmt

* chore: remove ethers from anvil-core, rm fastrlp

* chore: remove fastrlp from exceptions in deny.toml

* chore: rename and cleanup

* directly use type to decode

* address review comments

* feat: onbjerg nits

* chore: fix deny check

* bump alloy

* chore: add to_ethers ext trait for wallets

* chore: update deps, revert changed typed-data tests, set chain id as none when signing typed data

---------

Co-authored-by: Oliver Nordbjerg <[email protected]>
  • Loading branch information
Evalir and onbjerg authored Jan 25, 2024
1 parent 4a64380 commit 4a1ad36
Show file tree
Hide file tree
Showing 59 changed files with 2,328 additions and 5,143 deletions.
85 changes: 55 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ alloy-transport = { git = "https://github.com/alloy-rs/alloy" }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy" }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy" }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy" }
alloy-primitives = "0.6.0"
alloy-dyn-abi = "0.6.0"
alloy-json-abi = "0.6.0"
alloy-sol-types = "0.6.0"
alloy-primitives = "0.6.2"
alloy-dyn-abi = "0.6.2"
alloy-json-abi = "0.6.2"
alloy-sol-types = "0.6.2"
syn-solidity = "0.6.0"

alloy-chains = "0.1.5"
Expand Down
8 changes: 7 additions & 1 deletion crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ vergen = { version = "8", default-features = false, features = ["build", "git",

[dependencies]
# foundry internal
anvil-core = { path = "core", features = ["fastrlp", "serde", "impersonated-tx"] }
anvil-core = { path = "core", features = ["serde", "impersonated-tx"] }
anvil-rpc = { path = "rpc" }
anvil-server = { path = "server" }
foundry-common.workspace = true
Expand All @@ -36,6 +36,12 @@ trie-db = "0.23"
hash-db = "0.15"
memory-db = "0.29"
alloy-primitives = { workspace = true, features = ["serde"] }
alloy-consensus.workspace = true
alloy-network.workspace = true
alloy-rlp.workspace = true
alloy-signer = { workspace = true, features = ["eip712", "mnemonic"] }
alloy-sol-types = { workspace = true, features = ["std"] }
alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
alloy-rpc-types.workspace = true
alloy-rpc-trace-types.workspace = true
alloy-providers.workspace = true
Expand Down
4 changes: 1 addition & 3 deletions crates/anvil/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ alloy-rlp.workspace = true
alloy-eips.workspace = true
alloy-network = { workspace = true, features = ["k256"] }
alloy-consensus.workspace = true
ethers-core = { workspace = true, features = ["optimism"] }
alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
# theses are not used by anvil-core, but are required by ethers, because pulled in via foundry-common
ethers-contract = { workspace = true, features = ["optimism"] }
ethers-providers = { workspace = true, features = ["optimism"] }
Expand All @@ -30,7 +30,6 @@ ethers-middleware = { workspace = true, features = ["optimism"] }
serde = { workspace = true, optional = true }
serde_json.workspace = true
bytes = "1.4"
open-fastrlp = { version = "0.1.4", optional = true }

# trie
hash-db = { version = "0.15", default-features = false }
Expand All @@ -48,5 +47,4 @@ anvil-core = { path = ".", features = ["serde"] }
[features]
default = ["serde"]
impersonated-tx = []
fastrlp = ["dep:open-fastrlp"]
serde = ["dep:serde"]
Loading

0 comments on commit 4a1ad36

Please sign in to comment.