diff --git a/Cargo.lock b/Cargo.lock index a3b87b9cbd0cd..4ea5ad1880e73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,6 +314,7 @@ dependencies = [ "hash-db", "hyper", "itertools 0.11.0", + "k256", "memory-db", "parking_lot", "pretty_assertions", @@ -2069,8 +2070,8 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -2084,8 +2085,8 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "ethers-core", "once_cell", @@ -2095,8 +2096,8 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -2113,8 +2114,8 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "Inflector", "const-hex", @@ -2136,8 +2137,8 @@ dependencies = [ [[package]] name = "ethers-contract-derive" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "Inflector", "const-hex", @@ -2151,8 +2152,8 @@ dependencies = [ [[package]] name = "ethers-core" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "arrayvec", "bytes", @@ -2180,8 +2181,8 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "chrono", "ethers-core", @@ -2195,8 +2196,8 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "async-trait", "auto_impl", @@ -2220,8 +2221,8 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "async-trait", "auto_impl", @@ -2258,8 +2259,8 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "async-trait", "coins-bip32", @@ -2286,8 +2287,8 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs?rev=b4c366c964106b274e2eb528ac44eebc9bb49551#b4c366c964106b274e2eb528ac44eebc9bb49551" +version = "2.0.11" +source = "git+https://github.com/gakonst/ethers-rs?rev=4e09be88730045dd6c4ed8a4e198a9956931e7bd#4e09be88730045dd6c4ed8a4e198a9956931e7bd" dependencies = [ "cfg-if", "const-hex", diff --git a/Cargo.toml b/Cargo.toml index 697c973d4372f..6952e4ab4fd88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -196,16 +196,16 @@ tower-http = "0.4" #ethers-solc = { path = "../ethers-rs/ethers-solc" } [patch.crates-io] -ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-addressbook = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-contract = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-contract-abigen = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-providers = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-signers = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-middleware = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-etherscan = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } -ethers-solc = { git = "https://github.com/gakonst/ethers-rs", rev = "b4c366c964106b274e2eb528ac44eebc9bb49551" } +ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-addressbook = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-contract = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-contract-abigen = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-providers = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-signers = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-middleware = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-etherscan = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } +ethers-solc = { git = "https://github.com/gakonst/ethers-rs", rev = "4e09be88730045dd6c4ed8a4e198a9956931e7bd" } alloy-dyn-abi = { git = "https://github.com/alloy-rs/core/" } alloy-primitives = { git = "https://github.com/alloy-rs/core/" } @@ -213,4 +213,4 @@ alloy-json-abi = { git = "https://github.com/alloy-rs/core/" } alloy-sol-types = { git = "https://github.com/alloy-rs/core/" } revm = { git = "https://github.com/bluealloy/revm", rev = "1609e07c68048909ad1682c98cf2b9baa76310b5" } -revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "1609e07c68048909ad1682c98cf2b9baa76310b5" } \ No newline at end of file +revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "1609e07c68048909ad1682c98cf2b9baa76310b5" } diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 7a381eaaa7cb6..9ce28ff74f780 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -1341,6 +1341,31 @@ mod tests { ); } + #[test] + fn can_recover_sender_not_normalized() { + let bytes = hex::decode("f85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804").unwrap(); + + let tx: TypedTransaction = rlp::decode(&bytes).expect("decoding TypedTransaction failed"); + let tx = match tx { + TypedTransaction::Legacy(tx) => tx, + _ => panic!("Invalid typed transaction"), + }; + assert_eq!(tx.input, Bytes::from(b"")); + assert_eq!(tx.gas_price, U256::from(0x01u64)); + assert_eq!(tx.gas_limit, U256::from(0x5208u64)); + assert_eq!(tx.nonce, U256::from(0x00u64)); + if let TransactionKind::Call(ref to) = tx.kind { + assert_eq!(*to, "095e7baea6a6c7c4c2dfeb977efac326af552d87".parse().unwrap()); + } else { + panic!(); + } + assert_eq!(tx.value, U256::from(0x0au64)); + assert_eq!( + tx.recover().unwrap(), + "0f65fe9276bc9a24ae7083ae28e2660ef72df99e".parse().unwrap() + ); + } + #[test] #[cfg(feature = "fastrlp")] fn test_decode_fastrlp_create() {