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

[wip] feat: provider alloy migration #7106

Merged
merged 71 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
16aebe2
chore: make cast use an alloy provider
Evalir Feb 13, 2024
08a9cca
move initial methods to alloy
Evalir Feb 13, 2024
3de8241
feat(`foundry-common`): NameOrAddress ENS util (#7122)
Evalir Feb 14, 2024
f9d6c99
feat(`cast`): Move non `tx` methods to alloy (#7129)
Evalir Feb 16, 2024
0f98e03
Merge branch 'master' into evalir/cast-provider-mig
Evalir Feb 19, 2024
c983f50
Merge branch 'master' into evalir/cast-provider-mig
klkvr Mar 18, 2024
e482bee
DocumentMut
klkvr Mar 18, 2024
953f915
wip
klkvr Mar 18, 2024
435be40
wip
klkvr Mar 18, 2024
d286ae0
wip: bump alloy
klkvr Mar 18, 2024
04ca105
wip
klkvr Mar 18, 2024
f9fcfd4
wip
klkvr Mar 19, 2024
d1ace73
wip
klkvr Mar 20, 2024
2a723a4
[wip] migrate to alloy providers and signers (#7425)
klkvr Mar 20, 2024
20ce388
fix wallets after alloy bump
klkvr Mar 20, 2024
12fee31
clean up deps
klkvr Mar 21, 2024
7b4e7a5
use serde on consensus types
klkvr Mar 21, 2024
13144ef
update TypedTransaction for anvil
klkvr Mar 22, 2024
3077ad8
make anvil compile
klkvr Mar 22, 2024
2867eac
wip: make script compile
klkvr Mar 22, 2024
dc1df12
fix script
klkvr Mar 22, 2024
9fac722
make forge compile
klkvr Mar 22, 2024
7827988
fix: anvil tests
klkvr Mar 22, 2024
67107c3
bump alloy
klkvr Mar 23, 2024
09ee81f
fix tests
klkvr Mar 23, 2024
1539d37
fix tx builder
klkvr Mar 24, 2024
7889a57
fix cargo.toml
klkvr Mar 24, 2024
b479fa8
fix cargo.toml
klkvr Mar 24, 2024
2d67791
fix script gas price logic
klkvr Mar 25, 2024
323ca27
merge
klkvr Mar 25, 2024
43d19b1
remove ethers from anvil
klkvr Mar 25, 2024
f0a6243
clippy
klkvr Mar 25, 2024
203712e
rm all_derives
klkvr Mar 25, 2024
25276b8
deps
klkvr Mar 27, 2024
a61f4a6
fmt
klkvr Mar 27, 2024
e6e3b57
fix tests
klkvr Mar 27, 2024
aa8fb46
Merge branch 'master' into evalir/cast-provider-mig
klkvr Mar 27, 2024
24f746a
configure clippy
klkvr Mar 27, 2024
5d72ea9
clippy
klkvr Mar 27, 2024
1b762d8
add feature
klkvr Mar 27, 2024
852fa11
fix cargo deny
klkvr Mar 27, 2024
c8781e5
fix persist
klkvr Mar 27, 2024
9760679
fix doctests
klkvr Mar 27, 2024
f93a140
fmt
klkvr Mar 27, 2024
7740eb1
fix clap
klkvr Mar 28, 2024
2800a41
review fixes
klkvr Mar 28, 2024
dc1ce6e
Merge branch 'master' into evalir/cast-provider-mig
klkvr Mar 28, 2024
3ccde5b
fmt
klkvr Mar 28, 2024
3d4373d
bump alloy
klkvr Apr 4, 2024
5204f61
Update cargo.toml
klkvr Apr 4, 2024
c2b404b
Merge branch 'master' into evalir/cast-provider-mig
klkvr Apr 4, 2024
879153a
fmt
klkvr Apr 4, 2024
0431bb3
fixes
klkvr Apr 4, 2024
472d4ff
ethers clean-up
klkvr Apr 5, 2024
ecfcca0
fix(fmt): fix indent closing parenthesis enclosed in { } (#7557)
grandizzy Apr 4, 2024
5efa20e
feat(test): only compile files needed for tests (#7334)
klkvr Apr 4, 2024
398ff1f
fix: do not flood dictionary with data dependent on fuzz inputs (#7552)
klkvr Apr 4, 2024
ec8f6de
Feat: Index cheatcode for Strings (#7539)
kamuik16 Apr 4, 2024
1b846d9
chore: reduce logs in tests (#7566)
DaniPopes Apr 5, 2024
03d900a
fix(script): decode custom error in script fail message (#7563)
grandizzy Apr 5, 2024
3ebf3ab
clippy
klkvr Apr 6, 2024
c734de4
bump alloy
klkvr Apr 6, 2024
1165de0
Merge branch 'master' into evalir/cast-provider-mig
klkvr Apr 6, 2024
26bf989
AnyNetwork
klkvr Apr 7, 2024
50b3bc1
bump alloy
klkvr Apr 7, 2024
4ae360b
add comment
klkvr Apr 7, 2024
6900bef
clippy
klkvr Apr 7, 2024
e8ccb7d
bump alloy
klkvr Apr 9, 2024
f1a95d5
Merge branch 'master' into evalir/cast-provider-mig
klkvr Apr 9, 2024
abd79cf
fixes
klkvr Apr 9, 2024
144dc19
refactor cast logs to use alloy (#7594)
bernard-wagner Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,415 changes: 914 additions & 501 deletions Cargo.lock

Large diffs are not rendered by default.

71 changes: 41 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resolver = "2"
[workspace.package]
version = "0.2.0"
edition = "2021"
rust-version = "1.76" # Remember to update clippy.toml as well
rust-version = "1.76" # Remember to update clippy.toml as well
Copy link
Member

Choose a reason for hiding this comment

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

rm

authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/foundry-rs/foundry"
Expand Down Expand Up @@ -106,9 +106,6 @@ codegen-units = 1
[profile.release.package]
mdbook.opt-level = 1
protobuf.opt-level = 1
rusoto_core.opt-level = 1
rusoto_credential.opt-level = 1
rusoto_kms.opt-level = 1
toml_edit.opt-level = 1
trezor-client.opt-level = 1

Expand Down Expand Up @@ -144,9 +141,9 @@ foundry-compilers = { version = "0.3.13", default-features = false }

## revm
# no default features to avoid c-kzg
revm = { version = "7.1", default-features = false, features = ["std"] }
revm-primitives = { version = "3", default-features = false, features = ["std"] }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "ba0b6ab", features = [
revm = { version = "7.2", default-features = false }
revm-primitives = { version = "3", default-features = false }
revm-inspectors = { git = "https://github.com/klkvr/evm-inspectors", rev = "9ff0c29", features = [
"serde",
] }

Expand All @@ -160,36 +157,43 @@ ethers-signers = { version = "2.0.14", default-features = false }
ethers-middleware = { version = "2.0.14", default-features = false }

## alloy
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-providers = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false }
alloy-primitives = { version = "0.6.3", features = ["getrandom"] }
alloy-dyn-abi = "0.6.3"
alloy-json-abi = "0.6.3"
alloy-sol-types = "0.6.3"
syn-solidity = "0.6.3"
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-signer-aws = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-signer-ledger = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-signer-trezor = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "27a1e36", default-features = false }
alloy-primitives = { version = "0.6.4", features = ["getrandom"] }
alloy-dyn-abi = "0.6.4"
alloy-json-abi = "0.6.4"
alloy-sol-types = "0.6.4"
syn-solidity = "0.6.4"
alloy-chains = "0.1"

alloy-rlp = "0.3.3"
solang-parser = "=0.3.3"

## misc
arrayvec = "0.7"
base64 = "0.22"
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
chrono = { version = "0.4", default-features = false, features = [
"clock",
"std",
] }
color-eyre = "0.6"
derive_more = "0.99"
evm-disassembler = "0.5"
Expand All @@ -215,3 +219,10 @@ axum = "0.6"
hyper = "0.14"
tower = "0.4"
tower-http = "0.4"

[patch.crates-io]
alloy-primitives = { git = "https://github.com/alloy-rs/core", rev = "ff339696fa9b490698cb3edec3d4647fae0bd332" }
alloy-sol-types = { git = "https://github.com/alloy-rs/core", rev = "ff339696fa9b490698cb3edec3d4647fae0bd332" }
alloy-json-abi = { git = "https://github.com/alloy-rs/core", rev = "ff339696fa9b490698cb3edec3d4647fae0bd332" }
alloy-dyn-abi = { git = "https://github.com/alloy-rs/core", rev = "ff339696fa9b490698cb3edec3d4647fae0bd332" }
syn-solidity = { git = "https://github.com/alloy-rs/core", rev = "ff339696fa9b490698cb3edec3d4647fae0bd332" }
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
msrv = "1.76"
ignore-interior-mutability = ["bytes::Bytes", "alloy_primitives::Bytes"]
Copy link
Member

Choose a reason for hiding this comment

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

Where is this used? You should use static instead of const to silence this warning

Copy link
Member

Choose a reason for hiding this comment

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

This is needed to get rid of a mutable_key_type lint for pub type ExpectedCallTracker = HashMap<Address, HashMap<Bytes, (ExpectedCallData, u64)>>

Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be allowed in clippy, please use Vec instead then

Copy link
Member

Choose a reason for hiding this comment

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

Actually this is fine, bytes::Bytes is ignored by default as internal mutability is not exposed. Please add a note for this

8 changes: 4 additions & 4 deletions crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ foundry-evm.workspace = true
# evm support
bytes = "1.4.0"
k256.workspace = true
ethers = { workspace = true, features = ["rustls", "ws", "ipc", "optimism"] }
trie-db = "0.23"
hash-db = "0.15"
memory-db = "0.29"
alloy-primitives = { workspace = true, features = ["serde"] }
alloy-consensus = { workspace = true, features = ["k256", "kzg"] }
alloy-network.workspace = true
alloy-rlp.workspace = true
alloy-signer = { workspace = true, features = ["eip712", "mnemonic"] }
alloy-signer = { workspace = true, features = ["eip712"] }
alloy-signer-wallet = { workspace = true, features = ["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
alloy-provider = { workspace = true, features = ["pubsub"] }
alloy-transport.workspace = true
alloy-chains.workspace = true
alloy-genesis.workspace = true
Expand Down Expand Up @@ -91,7 +91,7 @@ tikv-jemallocator = { workspace = true, optional = true }

[dev-dependencies]
alloy-json-abi.workspace = true
ethers = { workspace = true, features = ["abigen"] }
ethers = { workspace = true, features = ["abigen", "optimism"] }
ethers-core = { workspace = true, features = ["optimism"] }
foundry-compilers = { workspace = true, features = ["project-util", "full"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ alloy-dyn-abi = { workspace = true, features = ["std", "eip712"] }
serde = { workspace = true, optional = true }
serde_json.workspace = true
bytes = "1.4"
c-kzg = { version = "0.4.2", features = ["serde"] }
c-kzg = { version = "1", features = ["serde"] }

# trie
hash-db = { version = "0.15", default-features = false }
Expand Down
3 changes: 1 addition & 2 deletions crates/anvil/core/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ impl From<Header> for PartialHeader {

#[cfg(test)]
mod tests {
use alloy_network::Sealable;
use alloy_primitives::{
b256,
hex::{self, FromHex},
Expand Down Expand Up @@ -257,7 +256,7 @@ mod tests {
excess_blob_gas: None,
parent_beacon_block_root: None,
};
assert_eq!(header.hash(), expected_hash);
assert_eq!(header.hash_slow(), expected_hash);
}

#[test]
Expand Down
Loading
Loading