mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
chore: Patch revm to current head commit (#5109)
Co-authored-by: clabby <ben@clab.by> Co-authored-by: rakita <dragan0rakita@gmail.com>
This commit is contained in:
231
Cargo.lock
generated
231
Cargo.lock
generated
@ -523,9 +523,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.73"
|
||||
version = "0.1.74"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
|
||||
checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -573,6 +573,16 @@ dependencies = [
|
||||
"wildmatch",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aurora-engine-modexp"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfacad86e9e138fca0670949eb8ed4ffdf73a55bded8887efe0863cd1a3a6f70"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"num",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "auto_impl"
|
||||
version = "1.1.0"
|
||||
@ -701,7 +711,7 @@ version = "0.66.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"lazy_static",
|
||||
@ -724,7 +734,7 @@ version = "0.68.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"lazy_static",
|
||||
@ -767,9 +777,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
|
||||
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"serde",
|
||||
@ -842,7 +852,7 @@ version = "0.17.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73498e9b2f0aa7db74977afa4d594657611e90587abf0dd564c0b55b4a130163"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"boa_interner",
|
||||
"boa_macros",
|
||||
"indexmap 2.0.2",
|
||||
@ -856,7 +866,7 @@ version = "0.17.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "16377479d5d6d33896e7acdd1cc698d04a8f72004025bbbddf47558cd29146a6"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"boa_ast",
|
||||
"boa_gc",
|
||||
"boa_icu_provider",
|
||||
@ -923,7 +933,7 @@ checksum = "f3e5afa991908cfbe79bd3109b824e473a1dc5f74f31fab91bb44c9e245daa77"
|
||||
dependencies = [
|
||||
"boa_gc",
|
||||
"boa_macros",
|
||||
"hashbrown 0.14.1",
|
||||
"hashbrown 0.14.2",
|
||||
"indexmap 2.0.2",
|
||||
"once_cell",
|
||||
"phf",
|
||||
@ -949,7 +959,7 @@ version = "0.17.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e09afb035377a9044443b598187a7d34cd13164617182a4d7c348522ee3f052"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"boa_ast",
|
||||
"boa_icu_provider",
|
||||
"boa_interner",
|
||||
@ -1456,9 +1466,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.9"
|
||||
version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1"
|
||||
checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
@ -1611,7 +1621,7 @@ version = "0.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"crossterm_winapi",
|
||||
"libc",
|
||||
"mio",
|
||||
@ -1795,10 +1805,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"hashbrown 0.14.1",
|
||||
"hashbrown 0.14.2",
|
||||
"lock_api",
|
||||
"once_cell",
|
||||
"parking_lot_core 0.9.8",
|
||||
"parking_lot_core 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1819,7 +1829,7 @@ version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
|
||||
dependencies = [
|
||||
"uuid 1.4.1",
|
||||
"uuid 1.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2100,9 +2110,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.2"
|
||||
version = "2.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d"
|
||||
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
|
||||
dependencies = [
|
||||
"pkcs8",
|
||||
"signature",
|
||||
@ -2218,7 +2228,7 @@ dependencies = [
|
||||
"log",
|
||||
"rand 0.8.5",
|
||||
"rlp",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"sha3",
|
||||
"zeroize",
|
||||
@ -3029,9 +3039,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.14.1"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12"
|
||||
checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
|
||||
dependencies = [
|
||||
"ahash 0.8.3",
|
||||
"allocator-api2",
|
||||
@ -3269,16 +3279,16 @@ checksum = "71a816c97c42258aa5834d07590b718b4c9a598944cd39a52dc25b351185d678"
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.57"
|
||||
version = "0.1.58"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613"
|
||||
checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"core-foundation-sys",
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"windows 0.48.0",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3537,7 +3547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.14.1",
|
||||
"hashbrown 0.14.2",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@ -3624,7 +3634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"rustix 0.38.19",
|
||||
"rustix 0.38.20",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
@ -3991,9 +4001,9 @@ checksum = "77a1a2647d5b7134127971a6de0d533c49de2159167e7f259c427195f87168a1"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.10"
|
||||
version = "0.4.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
|
||||
checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"scopeguard",
|
||||
@ -4020,7 +4030,7 @@ version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21"
|
||||
dependencies = [
|
||||
"hashbrown 0.14.1",
|
||||
"hashbrown 0.14.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4059,7 +4069,7 @@ dependencies = [
|
||||
"reth-eth-wire",
|
||||
"reth-network",
|
||||
"reth-primitives",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@ -4169,7 +4179,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"procfs",
|
||||
"rlimit",
|
||||
"windows 0.51.1",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4635,7 +4645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core 0.9.8",
|
||||
"parking_lot_core 0.9.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -4654,13 +4664,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.9.8"
|
||||
version = "0.9.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
|
||||
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall 0.3.5",
|
||||
"redox_syscall 0.4.1",
|
||||
"smallvec",
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
@ -5076,7 +5086,7 @@ checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bit-vec",
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"lazy_static",
|
||||
"num-traits",
|
||||
"rand 0.8.5",
|
||||
@ -5303,6 +5313,15 @@ dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.4.3"
|
||||
@ -5316,13 +5335,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.10.1"
|
||||
version = "1.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aaac441002f822bc9705a681810a4dd2963094b9ca0ddc41cb963a4c189189ea"
|
||||
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
||||
dependencies = [
|
||||
"aho-corasick 1.1.2",
|
||||
"memchr",
|
||||
"regex-automata 0.4.2",
|
||||
"regex-automata 0.4.3",
|
||||
"regex-syntax 0.8.2",
|
||||
]
|
||||
|
||||
@ -5337,9 +5356,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5011c7e263a695dc8ca064cddb722af1be54e517a280b12a5356f98366899e5d"
|
||||
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
||||
dependencies = [
|
||||
"aho-corasick 1.1.2",
|
||||
"memchr",
|
||||
@ -5483,7 +5502,7 @@ dependencies = [
|
||||
"reth-tracing",
|
||||
"reth-transaction-pool",
|
||||
"reth-trie",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shellexpand",
|
||||
@ -5611,7 +5630,7 @@ dependencies = [
|
||||
"reth-network",
|
||||
"reth-primitives",
|
||||
"reth-stages",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
@ -5661,7 +5680,7 @@ dependencies = [
|
||||
"reth-nippy-jar",
|
||||
"reth-primitives",
|
||||
"reth-tracing",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
@ -5687,7 +5706,7 @@ dependencies = [
|
||||
"reth-primitives",
|
||||
"reth-tracing",
|
||||
"rlp",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
@ -5709,7 +5728,7 @@ dependencies = [
|
||||
"reth-primitives",
|
||||
"reth-tracing",
|
||||
"schnellru",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_with",
|
||||
"thiserror",
|
||||
@ -5764,7 +5783,7 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"reth-net-common",
|
||||
"reth-primitives",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"sha2",
|
||||
"sha3",
|
||||
"thiserror",
|
||||
@ -5796,7 +5815,7 @@ dependencies = [
|
||||
"reth-metrics",
|
||||
"reth-primitives",
|
||||
"reth-tracing",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"snap",
|
||||
"test-fuzz",
|
||||
@ -5828,7 +5847,7 @@ dependencies = [
|
||||
"reth-primitives",
|
||||
"reth-rpc-types",
|
||||
"revm-primitives",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
@ -5858,7 +5877,7 @@ dependencies = [
|
||||
name = "reth-libmdbx"
|
||||
version = "0.1.0-alpha.10"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"byteorder",
|
||||
"criterion",
|
||||
"derive_more",
|
||||
@ -5968,7 +5987,7 @@ dependencies = [
|
||||
"reth-tasks",
|
||||
"reth-tracing",
|
||||
"reth-transaction-pool",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
@ -6070,7 +6089,7 @@ dependencies = [
|
||||
"reth-primitives",
|
||||
"revm",
|
||||
"revm-primitives",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_with",
|
||||
@ -6202,7 +6221,7 @@ dependencies = [
|
||||
"revm",
|
||||
"revm-primitives",
|
||||
"schnellru",
|
||||
"secp256k1",
|
||||
"secp256k1 0.27.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
@ -6411,7 +6430,7 @@ dependencies = [
|
||||
"assert_matches",
|
||||
"async-trait",
|
||||
"auto_impl",
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"criterion",
|
||||
"fnv",
|
||||
"futures-util",
|
||||
@ -6459,8 +6478,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm"
|
||||
version = "3.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68f4ca8ae0345104523b4af1a8a7ea97cfa1865cdb7a7c25d23c1a18d9b48598"
|
||||
source = "git+https://github.com/bluealloy/revm?rev=df44297bc3949dc9e0cec06594c62dd946708b2a#df44297bc3949dc9e0cec06594c62dd946708b2a"
|
||||
dependencies = [
|
||||
"auto_impl",
|
||||
"revm-interpreter",
|
||||
@ -6470,8 +6488,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-interpreter"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f959cafdf64a7f89b014fa73dc2325001cf654b3d9400260b212d19a2ebe3da0"
|
||||
source = "git+https://github.com/bluealloy/revm?rev=df44297bc3949dc9e0cec06594c62dd946708b2a#df44297bc3949dc9e0cec06594c62dd946708b2a"
|
||||
dependencies = [
|
||||
"revm-primitives",
|
||||
]
|
||||
@ -6479,16 +6496,15 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-precompile"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d360a88223d85709d2e95d4609eb1e19c649c47e28954bfabae5e92bb37e83e"
|
||||
source = "git+https://github.com/bluealloy/revm?rev=df44297bc3949dc9e0cec06594c62dd946708b2a#df44297bc3949dc9e0cec06594c62dd946708b2a"
|
||||
dependencies = [
|
||||
"aurora-engine-modexp",
|
||||
"c-kzg",
|
||||
"k256",
|
||||
"num",
|
||||
"once_cell",
|
||||
"revm-primitives",
|
||||
"ripemd",
|
||||
"secp256k1",
|
||||
"secp256k1 0.28.0",
|
||||
"sha2",
|
||||
"substrate-bn",
|
||||
]
|
||||
@ -6496,17 +6512,17 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "revm-primitives"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51187b852d9e458816a2e19c81f1dd6c924077e1a8fccd16e4f044f865f299d7"
|
||||
source = "git+https://github.com/bluealloy/revm?rev=df44297bc3949dc9e0cec06594c62dd946708b2a#df44297bc3949dc9e0cec06594c62dd946708b2a"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"alloy-rlp",
|
||||
"auto_impl",
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"bitvec",
|
||||
"c-kzg",
|
||||
"derive_more",
|
||||
"enumn",
|
||||
"hashbrown 0.14.1",
|
||||
"hashbrown 0.14.2",
|
||||
"hex",
|
||||
"once_cell",
|
||||
"serde",
|
||||
@ -6694,11 +6710,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.19"
|
||||
version = "0.38.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
|
||||
checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"errno 0.3.5",
|
||||
"libc",
|
||||
"linux-raw-sys 0.4.10",
|
||||
@ -6798,9 +6814,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "scale-info"
|
||||
version = "2.9.0"
|
||||
version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782"
|
||||
checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"derive_more",
|
||||
@ -6810,9 +6826,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "scale-info-derive"
|
||||
version = "2.9.0"
|
||||
version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29"
|
||||
checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@ -6889,10 +6905,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f"
|
||||
dependencies = [
|
||||
"rand 0.8.5",
|
||||
"secp256k1-sys",
|
||||
"secp256k1-sys 0.8.1",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "secp256k1"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5"
|
||||
dependencies = [
|
||||
"secp256k1-sys 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "secp256k1-sys"
|
||||
version = "0.8.1"
|
||||
@ -6902,6 +6927,15 @@ dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "secp256k1-sys"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.9.2"
|
||||
@ -7027,9 +7061,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_with"
|
||||
version = "3.3.0"
|
||||
version = "3.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237"
|
||||
checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23"
|
||||
dependencies = [
|
||||
"base64 0.21.4",
|
||||
"chrono",
|
||||
@ -7044,9 +7078,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_with_macros"
|
||||
version = "3.3.0"
|
||||
version = "3.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c"
|
||||
checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788"
|
||||
dependencies = [
|
||||
"darling 0.20.3",
|
||||
"proc-macro2",
|
||||
@ -7382,7 +7416,7 @@ version = "0.25.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
|
||||
dependencies = [
|
||||
"strum_macros 0.25.2",
|
||||
"strum_macros 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -7400,9 +7434,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.25.2"
|
||||
version = "0.25.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059"
|
||||
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
@ -7468,7 +7502,7 @@ dependencies = [
|
||||
"debugid",
|
||||
"memmap2 0.5.10",
|
||||
"stable_deref_trait",
|
||||
"uuid 1.4.1",
|
||||
"uuid 1.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -7564,7 +7598,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"fastrand 2.0.1",
|
||||
"redox_syscall 0.3.5",
|
||||
"rustix 0.38.19",
|
||||
"rustix 0.38.20",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
@ -7644,18 +7678,18 @@ checksum = "aac81b6fd6beb5884b0cf3321b8117e6e5d47ecb6fc89f414cfdcca8b2fe2dd8"
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.49"
|
||||
version = "1.0.50"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
|
||||
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.49"
|
||||
version = "1.0.50"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
|
||||
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -7947,7 +7981,7 @@ checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"base64 0.21.4",
|
||||
"bitflags 2.4.0",
|
||||
"bitflags 2.4.1",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
@ -7966,7 +8000,7 @@ dependencies = [
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"uuid 1.4.1",
|
||||
"uuid 1.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -7995,9 +8029,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.39"
|
||||
version = "0.1.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
dependencies = [
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
@ -8384,9 +8418,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.4.1"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d"
|
||||
checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
|
||||
dependencies = [
|
||||
"getrandom 0.2.10",
|
||||
]
|
||||
@ -8545,7 +8579,7 @@ dependencies = [
|
||||
"either",
|
||||
"home",
|
||||
"once_cell",
|
||||
"rustix 0.38.19",
|
||||
"rustix 0.38.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -8591,15 +8625,6 @@ version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.48.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
|
||||
dependencies = [
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.51.1"
|
||||
|
||||
@ -108,8 +108,8 @@ reth-eth-wire = { path = "./crates/net/eth-wire" }
|
||||
reth-ecies = { path = "./crates/net/ecies" }
|
||||
reth-tracing = { path = "./crates/tracing" }
|
||||
# revm
|
||||
revm = "3.5.0"
|
||||
revm-primitives = "1.3.0"
|
||||
revm = { git = "https://github.com/bluealloy/revm", rev = "df44297bc3949dc9e0cec06594c62dd946708b2a" }
|
||||
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "df44297bc3949dc9e0cec06594c62dd946708b2a" }
|
||||
|
||||
## eth
|
||||
alloy-primitives = "0.4"
|
||||
@ -130,7 +130,7 @@ boa_gc = "0.17"
|
||||
## misc
|
||||
aquamarine = "0.3"
|
||||
bytes = "1.5"
|
||||
bitflags = "2.3"
|
||||
bitflags = "2.4"
|
||||
clap = "4"
|
||||
eyre = "0.6"
|
||||
tracing = "0.1.0"
|
||||
|
||||
@ -62,7 +62,7 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
|
||||
let basic = match self.cached.accounts.entry(address) {
|
||||
Entry::Occupied(entry) => entry.get().info.clone(),
|
||||
Entry::Vacant(entry) => {
|
||||
entry.insert(CachedAccount::new(self.db.basic(address)?)).info.clone()
|
||||
entry.insert(CachedAccount::new(self.db.basic_ref(address)?)).info.clone()
|
||||
}
|
||||
};
|
||||
Ok(basic)
|
||||
@ -71,7 +71,7 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
|
||||
fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error> {
|
||||
let code = match self.cached.contracts.entry(code_hash) {
|
||||
Entry::Occupied(entry) => entry.get().clone(),
|
||||
Entry::Vacant(entry) => entry.insert(self.db.code_by_hash(code_hash)?).clone(),
|
||||
Entry::Vacant(entry) => entry.insert(self.db.code_by_hash_ref(code_hash)?).clone(),
|
||||
};
|
||||
Ok(code)
|
||||
}
|
||||
@ -83,7 +83,7 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
|
||||
match acc_entry.storage.entry(index) {
|
||||
Entry::Occupied(entry) => Ok(*entry.get()),
|
||||
Entry::Vacant(entry) => {
|
||||
let slot = self.db.storage(address, index)?;
|
||||
let slot = self.db.storage_ref(address, index)?;
|
||||
entry.insert(slot);
|
||||
Ok(slot)
|
||||
}
|
||||
@ -91,9 +91,9 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
|
||||
}
|
||||
Entry::Vacant(acc_entry) => {
|
||||
// acc needs to be loaded for us to access slots.
|
||||
let info = self.db.basic(address)?;
|
||||
let info = self.db.basic_ref(address)?;
|
||||
let (account, value) = if info.is_some() {
|
||||
let value = self.db.storage(address, index)?;
|
||||
let value = self.db.storage_ref(address, index)?;
|
||||
let mut account = CachedAccount::new(info);
|
||||
account.storage.insert(index, value);
|
||||
(account, value)
|
||||
@ -109,7 +109,7 @@ impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
|
||||
fn block_hash(&mut self, number: U256) -> Result<B256, Self::Error> {
|
||||
let code = match self.cached.block_hashes.entry(number) {
|
||||
Entry::Occupied(entry) => *entry.get(),
|
||||
Entry::Vacant(entry) => *entry.insert(self.db.block_hash(number)?),
|
||||
Entry::Vacant(entry) => *entry.insert(self.db.block_hash_ref(number)?),
|
||||
};
|
||||
Ok(code)
|
||||
}
|
||||
@ -127,19 +127,19 @@ pub struct CachedReadsDBRef<'a, DB> {
|
||||
impl<'a, DB: DatabaseRef> DatabaseRef for CachedReadsDBRef<'a, DB> {
|
||||
type Error = <DB as DatabaseRef>::Error;
|
||||
|
||||
fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
|
||||
fn basic_ref(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
|
||||
self.inner.borrow_mut().basic(address)
|
||||
}
|
||||
|
||||
fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error> {
|
||||
fn code_by_hash_ref(&self, code_hash: B256) -> Result<Bytecode, Self::Error> {
|
||||
self.inner.borrow_mut().code_by_hash(code_hash)
|
||||
}
|
||||
|
||||
fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error> {
|
||||
fn storage_ref(&self, address: Address, index: U256) -> Result<U256, Self::Error> {
|
||||
self.inner.borrow_mut().storage(address, index)
|
||||
}
|
||||
|
||||
fn block_hash(&self, number: U256) -> Result<B256, Self::Error> {
|
||||
fn block_hash_ref(&self, number: U256) -> Result<B256, Self::Error> {
|
||||
self.inner.borrow_mut().block_hash(number)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
//! Helpers for deriving contract addresses
|
||||
|
||||
// re-export from revm
|
||||
use crate::{keccak256, Address, U256};
|
||||
pub use revm_primitives::utilities::{create2_address, create_address};
|
||||
|
||||
/// Returns the CREATE2 address of a smart contract as specified in
|
||||
/// [EIP1014](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1014.md)
|
||||
///
|
||||
/// keccak256( 0xff ++ senderAddress ++ salt ++ keccak256(init_code))[12..]
|
||||
///
|
||||
/// where `salt` is always 32 bytes (a stack item).
|
||||
pub fn create2_address_from_code(
|
||||
from: Address,
|
||||
init_code: impl AsRef<[u8]>,
|
||||
salt: U256,
|
||||
) -> Address {
|
||||
let init_code_hash = keccak256(init_code);
|
||||
create2_address(from, init_code_hash, salt)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::hex;
|
||||
|
||||
#[test]
|
||||
fn contract_address() {
|
||||
// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed
|
||||
let from = "6ac7ea33f8831ea9dcc53393aaa88b25a785dbf0".parse::<Address>().unwrap();
|
||||
for (nonce, expected) in [
|
||||
"cd234a471b72ba2f1ccf0a70fcaba648a5eecd8d",
|
||||
"343c43a37d37dff08ae8c4a11544c718abb4fcf8",
|
||||
"f778b86fa74e846c4f0a1fbd1335fe81c00a0c91",
|
||||
"fffd933a0bc612844eaf0c6fe3e5b8e9b6c1d19c",
|
||||
]
|
||||
.iter()
|
||||
.enumerate()
|
||||
{
|
||||
let address = create_address(from, nonce as u64);
|
||||
assert_eq!(address, expected.parse::<Address>().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
// Test vectors from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1014.md#examples
|
||||
#[test]
|
||||
fn test_create2_address() {
|
||||
for (from, salt, init_code, expected) in &[
|
||||
(
|
||||
"0000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"00",
|
||||
"4D1A2e2bB4F88F0250f26Ffff098B0b30B26BF38",
|
||||
),
|
||||
(
|
||||
"deadbeef00000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"00",
|
||||
"B928f69Bb1D91Cd65274e3c79d8986362984fDA3",
|
||||
),
|
||||
(
|
||||
"deadbeef00000000000000000000000000000000",
|
||||
"000000000000000000000000feed000000000000000000000000000000000000",
|
||||
"00",
|
||||
"D04116cDd17beBE565EB2422F2497E06cC1C9833",
|
||||
),
|
||||
(
|
||||
"0000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"deadbeef",
|
||||
"70f2b2914A2a4b783FaEFb75f459A580616Fcb5e",
|
||||
),
|
||||
(
|
||||
"00000000000000000000000000000000deadbeef",
|
||||
"00000000000000000000000000000000000000000000000000000000cafebabe",
|
||||
"deadbeef",
|
||||
"60f3f640a8508fC6a86d45DF051962668E1e8AC7",
|
||||
),
|
||||
(
|
||||
"00000000000000000000000000000000deadbeef",
|
||||
"00000000000000000000000000000000000000000000000000000000cafebabe",
|
||||
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
|
||||
"1d8bfDC5D46DC4f61D6b6115972536eBE6A8854C",
|
||||
),
|
||||
(
|
||||
"0000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"",
|
||||
"E33C0C7F7df4809055C3ebA6c09CFe4BaF1BD9e0",
|
||||
),
|
||||
] {
|
||||
// create2_address()
|
||||
let from = from.parse::<Address>().unwrap();
|
||||
let salt = hex::decode(salt).unwrap();
|
||||
let salt = U256::try_from_be_slice(&salt).unwrap();
|
||||
let init_code = hex::decode(init_code).unwrap();
|
||||
let expected = expected.parse::<Address>().unwrap();
|
||||
assert_eq!(expected, create2_address_from_code(from, init_code.clone(), salt));
|
||||
|
||||
// get_create2_address_from_hash()
|
||||
let init_code_hash = keccak256(init_code);
|
||||
assert_eq!(expected, create2_address(from, init_code_hash, salt))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,6 @@ mod block;
|
||||
mod chain;
|
||||
mod compression;
|
||||
pub mod constants;
|
||||
pub mod contract;
|
||||
pub mod eip4844;
|
||||
mod forkid;
|
||||
pub mod fs;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use reth_primitives::{AccessList, AccessListItem, Address, B256};
|
||||
use revm::{
|
||||
interpreter::{opcode, InstructionResult, Interpreter},
|
||||
interpreter::{opcode, Interpreter},
|
||||
Database, EVMData, Inspector,
|
||||
};
|
||||
use std::collections::{BTreeSet, HashMap, HashSet};
|
||||
@ -61,11 +61,7 @@ impl<DB> Inspector<DB> for AccessListInspector
|
||||
where
|
||||
DB: Database,
|
||||
{
|
||||
fn step(
|
||||
&mut self,
|
||||
interpreter: &mut Interpreter,
|
||||
_data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn step(&mut self, interpreter: &mut Interpreter<'_>, _data: &mut EVMData<'_, DB>) {
|
||||
match interpreter.current_opcode() {
|
||||
opcode::SLOAD | opcode::SSTORE => {
|
||||
if let Ok(slot) = interpreter.stack().peek(0) {
|
||||
@ -98,7 +94,5 @@ where
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,28 +69,18 @@ where
|
||||
DB: Database,
|
||||
INSP: Inspector<DB>,
|
||||
{
|
||||
fn initialize_interp(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn initialize_interp(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
match self {
|
||||
MaybeOwnedInspector::Owned(insp) => {
|
||||
return insp.borrow_mut().initialize_interp(interp, data)
|
||||
}
|
||||
MaybeOwnedInspector::Owned(insp) => insp.borrow_mut().initialize_interp(interp, data),
|
||||
MaybeOwnedInspector::Stacked(_) => {}
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn step(&mut self, interp: &mut Interpreter, data: &mut EVMData<'_, DB>) -> InstructionResult {
|
||||
fn step(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
match self {
|
||||
MaybeOwnedInspector::Owned(insp) => return insp.borrow_mut().step(interp, data),
|
||||
MaybeOwnedInspector::Owned(insp) => insp.borrow_mut().step(interp, data),
|
||||
MaybeOwnedInspector::Stacked(_) => {}
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn log(
|
||||
@ -108,20 +98,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn step_end(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
eval: InstructionResult,
|
||||
) -> InstructionResult {
|
||||
fn step_end(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
match self {
|
||||
MaybeOwnedInspector::Owned(insp) => {
|
||||
return insp.borrow_mut().step_end(interp, data, eval)
|
||||
}
|
||||
MaybeOwnedInspector::Owned(insp) => insp.borrow_mut().step_end(interp, data),
|
||||
MaybeOwnedInspector::Stacked(_) => {}
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn call(
|
||||
|
||||
@ -100,38 +100,16 @@ impl<DB> Inspector<DB> for InspectorStack
|
||||
where
|
||||
DB: Database,
|
||||
{
|
||||
fn initialize_interp(
|
||||
&mut self,
|
||||
interpreter: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn initialize_interp(&mut self, interpreter: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
call_inspectors!(inspector, [&mut self.custom_print_tracer], {
|
||||
let status = inspector.initialize_interp(interpreter, data);
|
||||
|
||||
// Allow inspectors to exit early
|
||||
if status != InstructionResult::Continue {
|
||||
return status
|
||||
}
|
||||
inspector.initialize_interp(interpreter, data);
|
||||
});
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn step(
|
||||
&mut self,
|
||||
interpreter: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn step(&mut self, interpreter: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
call_inspectors!(inspector, [&mut self.custom_print_tracer], {
|
||||
let status = inspector.step(interpreter, data);
|
||||
|
||||
// Allow inspectors to exit early
|
||||
if status != InstructionResult::Continue {
|
||||
return status
|
||||
}
|
||||
inspector.step(interpreter, data);
|
||||
});
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn log(
|
||||
@ -146,22 +124,10 @@ where
|
||||
});
|
||||
}
|
||||
|
||||
fn step_end(
|
||||
&mut self,
|
||||
interpreter: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
eval: InstructionResult,
|
||||
) -> InstructionResult {
|
||||
fn step_end(&mut self, interpreter: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
call_inspectors!(inspector, [&mut self.custom_print_tracer], {
|
||||
let status = inspector.step_end(interpreter, data, eval);
|
||||
|
||||
// Allow inspectors to exit early
|
||||
if status != InstructionResult::Continue {
|
||||
return status
|
||||
}
|
||||
inspector.step_end(interpreter, data);
|
||||
});
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn call(
|
||||
|
||||
@ -193,7 +193,7 @@ impl GethTraceBuilder {
|
||||
if !is_diff {
|
||||
let mut prestate = PreStateMode::default();
|
||||
for (addr, changed_acc) in account_diffs {
|
||||
let db_acc = db.basic(addr)?.unwrap_or_default();
|
||||
let db_acc = db.basic_ref(addr)?.unwrap_or_default();
|
||||
let mut pre_state = AccountState::from_account_info(
|
||||
db_acc.nonce,
|
||||
db_acc.balance,
|
||||
@ -212,7 +212,7 @@ impl GethTraceBuilder {
|
||||
let mut state_diff = DiffMode::default();
|
||||
let mut account_change_kinds = HashMap::with_capacity(account_diffs.len());
|
||||
for (addr, changed_acc) in account_diffs {
|
||||
let db_acc = db.basic(addr)?.unwrap_or_default();
|
||||
let db_acc = db.basic_ref(addr)?.unwrap_or_default();
|
||||
let db_code = db_acc.code.as_ref();
|
||||
let db_code_hash = db_acc.code_hash;
|
||||
|
||||
@ -225,7 +225,7 @@ impl GethTraceBuilder {
|
||||
if db_code_hash == KECCAK_EMPTY {
|
||||
None
|
||||
} else {
|
||||
db.code_by_hash(db_code_hash).ok().map(|code| code.original_bytes())
|
||||
db.code_by_hash_ref(db_code_hash).ok().map(|code| code.original_bytes())
|
||||
}
|
||||
})
|
||||
.map(Into::into);
|
||||
|
||||
@ -381,7 +381,10 @@ impl ParityTraceBuilder {
|
||||
let maybe_memory = if step.memory.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(MemoryDelta { off: step.memory_size, data: step.memory.data().clone().into() })
|
||||
Some(MemoryDelta {
|
||||
off: step.memory_size,
|
||||
data: step.memory.slice(0, step.memory.len()).to_vec().into(),
|
||||
})
|
||||
};
|
||||
|
||||
// Calculate the stack items at this step
|
||||
@ -545,11 +548,11 @@ where
|
||||
|
||||
let addr = addrs.next().expect("there should be an address");
|
||||
|
||||
let db_acc = db.basic(addr)?.unwrap_or_default();
|
||||
let db_acc = db.basic_ref(addr)?.unwrap_or_default();
|
||||
|
||||
let code_hash = if db_acc.code_hash != KECCAK_EMPTY { db_acc.code_hash } else { continue };
|
||||
|
||||
curr_ref.code = db.code_by_hash(code_hash)?.original_bytes();
|
||||
curr_ref.code = db.code_by_hash_ref(code_hash)?.original_bytes();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@ -595,7 +598,7 @@ where
|
||||
}
|
||||
} else {
|
||||
// account already exists, we need to fetch the account from the db
|
||||
let db_acc = db.basic(addr)?.unwrap_or_default();
|
||||
let db_acc = db.basic_ref(addr)?.unwrap_or_default();
|
||||
|
||||
// update _changed_ storage values
|
||||
for (key, slot) in changed_acc.storage.iter().filter(|(_, slot)| slot.is_changed()) {
|
||||
|
||||
@ -20,7 +20,7 @@ use reth_primitives::{Account, Address, Bytes, B256, KECCAK_EMPTY, U256};
|
||||
use revm::{
|
||||
interpreter::{
|
||||
opcode::{PUSH0, PUSH32},
|
||||
Memory, OpCode, Stack,
|
||||
OpCode, SharedMemory, Stack,
|
||||
},
|
||||
primitives::State,
|
||||
};
|
||||
@ -132,14 +132,14 @@ impl StepLog {
|
||||
|
||||
/// Represents the memory object
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct MemoryObj(pub(crate) Memory);
|
||||
pub(crate) struct MemoryObj(pub(crate) SharedMemory);
|
||||
|
||||
impl MemoryObj {
|
||||
pub(crate) fn into_js_object(self, context: &mut Context<'_>) -> JsResult<JsObject> {
|
||||
let obj = JsObject::default();
|
||||
let len = self.0.len();
|
||||
// TODO: add into data <https://github.com/bluealloy/revm/pull/516>
|
||||
let value = to_buf(self.0.data().clone(), context)?;
|
||||
let value = to_buf(self.0.slice(0, len).to_vec(), context)?;
|
||||
|
||||
let length = FunctionObjectBuilder::new(
|
||||
context,
|
||||
|
||||
@ -6,10 +6,7 @@ use boa_engine::{
|
||||
Context, JsArgs, JsError, JsNativeError, JsResult, JsString, JsValue, NativeFunction, Source,
|
||||
};
|
||||
use boa_gc::{empty_trace, Finalize, Trace};
|
||||
use reth_primitives::{
|
||||
contract::{create2_address_from_code, create_address},
|
||||
hex, keccak256, Address, B256, U256,
|
||||
};
|
||||
use reth_primitives::{hex, Address, B256, U256};
|
||||
use std::collections::HashSet;
|
||||
|
||||
/// bigIntegerJS is the minified version of <https://github.com/peterolson/BigInteger.js>.
|
||||
@ -161,11 +158,9 @@ pub(crate) fn to_contract2(
|
||||
|
||||
// Convert the initcode to a byte buffer
|
||||
let code_buf = from_buf(initcode, ctx)?;
|
||||
// Compute the code hash
|
||||
let code_hash = keccak256(code_buf);
|
||||
|
||||
// Compute the contract address
|
||||
let contract_addr = create2_address_from_code(addr, salt, code_hash.into());
|
||||
let contract_addr = addr.create2_from_code(salt, code_buf);
|
||||
|
||||
// Convert the contract address to a byte buffer and return it as an ArrayBuffer
|
||||
to_buf_value(contract_addr.0.to_vec(), ctx)
|
||||
@ -186,7 +181,7 @@ pub(crate) fn to_contract(
|
||||
let addr = bytes_to_address(buf);
|
||||
|
||||
// Compute the contract address
|
||||
let contract_addr = create_address(addr, nonce);
|
||||
let contract_addr = addr.create(nonce);
|
||||
|
||||
// Convert the contract address to a byte buffer and return it as an ArrayBuffer
|
||||
to_buf_value(contract_addr.0.to_vec(), ctx)
|
||||
|
||||
@ -287,9 +287,9 @@ impl<DB> Inspector<DB> for JsInspector
|
||||
where
|
||||
DB: Database,
|
||||
{
|
||||
fn step(&mut self, interp: &mut Interpreter, data: &mut EVMData<'_, DB>) -> InstructionResult {
|
||||
fn step(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
if self.step_fn.is_none() {
|
||||
return InstructionResult::Continue
|
||||
return
|
||||
}
|
||||
|
||||
let db = EvmDb::new(data.journaled_state.state.clone(), self.to_db_service.clone());
|
||||
@ -297,7 +297,7 @@ where
|
||||
let step = StepLog {
|
||||
stack: StackObj(interp.stack.clone()),
|
||||
op: interp.current_opcode().into(),
|
||||
memory: MemoryObj(interp.memory.clone()),
|
||||
memory: MemoryObj(interp.shared_memory.clone()),
|
||||
pc: interp.program_counter() as u64,
|
||||
gas_remaining: interp.gas.remaining(),
|
||||
cost: interp.gas.spend(),
|
||||
@ -308,9 +308,8 @@ where
|
||||
};
|
||||
|
||||
if self.try_step(step, db).is_err() {
|
||||
return InstructionResult::Revert
|
||||
interp.instruction_result = InstructionResult::Revert;
|
||||
}
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn log(
|
||||
@ -322,36 +321,29 @@ where
|
||||
) {
|
||||
}
|
||||
|
||||
fn step_end(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
eval: InstructionResult,
|
||||
) -> InstructionResult {
|
||||
fn step_end(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
if self.step_fn.is_none() {
|
||||
return InstructionResult::Continue
|
||||
return
|
||||
}
|
||||
|
||||
if matches!(eval, return_revert!()) {
|
||||
if matches!(interp.instruction_result, return_revert!()) {
|
||||
let db = EvmDb::new(data.journaled_state.state.clone(), self.to_db_service.clone());
|
||||
|
||||
let step = StepLog {
|
||||
stack: StackObj(interp.stack.clone()),
|
||||
op: interp.current_opcode().into(),
|
||||
memory: MemoryObj(interp.memory.clone()),
|
||||
memory: MemoryObj(interp.shared_memory.clone()),
|
||||
pc: interp.program_counter() as u64,
|
||||
gas_remaining: interp.gas.remaining(),
|
||||
cost: interp.gas.spend(),
|
||||
depth: data.journaled_state.depth(),
|
||||
refund: interp.gas.refunded() as u64,
|
||||
error: Some(format!("{:?}", eval)),
|
||||
error: Some(format!("{:?}", interp.instruction_result)),
|
||||
contract: self.active_call().contract.clone(),
|
||||
};
|
||||
|
||||
let _ = self.try_fault(step, db);
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn call(
|
||||
|
||||
@ -271,14 +271,17 @@ impl TracingInspector {
|
||||
///
|
||||
/// This expects an existing [CallTrace], in other words, this panics if not within the context
|
||||
/// of a call.
|
||||
fn start_step<DB: Database>(&mut self, interp: &Interpreter, data: &EVMData<'_, DB>) {
|
||||
fn start_step<DB: Database>(&mut self, interp: &Interpreter<'_>, data: &EVMData<'_, DB>) {
|
||||
let trace_idx = self.last_trace_idx();
|
||||
let trace = &mut self.traces.arena[trace_idx];
|
||||
|
||||
self.step_stack.push(StackStep { trace_idx, step_idx: trace.trace.steps.len() });
|
||||
|
||||
let memory =
|
||||
self.config.record_memory_snapshots.then(|| interp.memory.clone()).unwrap_or_default();
|
||||
let memory = self
|
||||
.config
|
||||
.record_memory_snapshots
|
||||
.then(|| interp.shared_memory.clone())
|
||||
.unwrap_or_default();
|
||||
let stack =
|
||||
self.config.record_stack_snapshots.then(|| interp.stack.clone()).unwrap_or_default();
|
||||
|
||||
@ -300,7 +303,7 @@ impl TracingInspector {
|
||||
stack,
|
||||
push_stack: None,
|
||||
memory,
|
||||
memory_size: interp.memory.len(),
|
||||
memory_size: interp.shared_memory.len(),
|
||||
gas_remaining: self.gas_inspector.gas_remaining(),
|
||||
gas_refund_counter: interp.gas.refunded() as u64,
|
||||
|
||||
@ -316,9 +319,8 @@ impl TracingInspector {
|
||||
/// Invoked on [Inspector::step_end].
|
||||
fn fill_step_on_step_end<DB: Database>(
|
||||
&mut self,
|
||||
interp: &Interpreter,
|
||||
interp: &Interpreter<'_>,
|
||||
data: &EVMData<'_, DB>,
|
||||
status: InstructionResult,
|
||||
) {
|
||||
let StackStep { trace_idx, step_idx } =
|
||||
self.step_stack.pop().expect("can't fill step without starting a step first");
|
||||
@ -331,8 +333,8 @@ impl TracingInspector {
|
||||
|
||||
if self.config.record_memory_snapshots {
|
||||
// resize memory so opcodes that allocated memory is correctly displayed
|
||||
if interp.memory.len() > step.memory.len() {
|
||||
step.memory.resize(interp.memory.len());
|
||||
if interp.shared_memory.len() > step.memory.len() {
|
||||
step.memory.resize(interp.shared_memory.len());
|
||||
}
|
||||
}
|
||||
if self.config.record_state_diff {
|
||||
@ -371,7 +373,7 @@ impl TracingInspector {
|
||||
step.gas_cost = step.gas_remaining - self.gas_inspector.gas_remaining();
|
||||
|
||||
// set the status
|
||||
step.status = status;
|
||||
step.status = interp.instruction_result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,21 +381,15 @@ impl<DB> Inspector<DB> for TracingInspector
|
||||
where
|
||||
DB: Database,
|
||||
{
|
||||
fn initialize_interp(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn initialize_interp(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
self.gas_inspector.initialize_interp(interp, data)
|
||||
}
|
||||
|
||||
fn step(&mut self, interp: &mut Interpreter, data: &mut EVMData<'_, DB>) -> InstructionResult {
|
||||
fn step(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
if self.config.record_steps {
|
||||
self.gas_inspector.step(interp, data);
|
||||
self.start_step(interp, data);
|
||||
}
|
||||
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn log(
|
||||
@ -414,17 +410,11 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn step_end(
|
||||
&mut self,
|
||||
interp: &mut Interpreter,
|
||||
data: &mut EVMData<'_, DB>,
|
||||
eval: InstructionResult,
|
||||
) -> InstructionResult {
|
||||
fn step_end(&mut self, interp: &mut Interpreter<'_>, data: &mut EVMData<'_, DB>) {
|
||||
if self.config.record_steps {
|
||||
self.gas_inspector.step_end(interp, data, eval);
|
||||
self.fill_step_on_step_end(interp, data, eval);
|
||||
self.gas_inspector.step_end(interp, data);
|
||||
self.fill_step_on_step_end(interp, data);
|
||||
}
|
||||
InstructionResult::Continue
|
||||
}
|
||||
|
||||
fn call(
|
||||
|
||||
@ -2,10 +2,7 @@
|
||||
//!
|
||||
//! See also <https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers>
|
||||
|
||||
use revm::{
|
||||
interpreter::{InstructionResult, Interpreter},
|
||||
Database, EVMData, Inspector,
|
||||
};
|
||||
use revm::{interpreter::Interpreter, Database, EVMData, Inspector};
|
||||
|
||||
/// An inspector that counts all opcodes.
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
@ -25,12 +22,7 @@ impl<DB> Inspector<DB> for OpcodeCountInspector
|
||||
where
|
||||
DB: Database,
|
||||
{
|
||||
fn step(
|
||||
&mut self,
|
||||
_interp: &mut Interpreter,
|
||||
_data: &mut EVMData<'_, DB>,
|
||||
) -> InstructionResult {
|
||||
fn step(&mut self, _interp: &mut Interpreter<'_>, _data: &mut EVMData<'_, DB>) {
|
||||
self.count += 1;
|
||||
InstructionResult::Continue
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ use reth_rpc_types::trace::{
|
||||
},
|
||||
};
|
||||
use revm::interpreter::{
|
||||
opcode, CallContext, CallScheme, CreateScheme, InstructionResult, Memory, OpCode, Stack,
|
||||
opcode, CallContext, CallScheme, CreateScheme, InstructionResult, OpCode, SharedMemory, Stack,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
@ -483,7 +483,7 @@ pub(crate) struct CallTraceStep {
|
||||
/// All allocated memory in a step
|
||||
///
|
||||
/// This will be empty if memory capture is disabled
|
||||
pub(crate) memory: Memory,
|
||||
pub(crate) memory: SharedMemory,
|
||||
/// Size of memory at the beginning of the step
|
||||
pub(crate) memory_size: usize,
|
||||
/// Remaining gas before step execution
|
||||
@ -533,7 +533,7 @@ impl CallTraceStep {
|
||||
}
|
||||
|
||||
if opts.is_memory_enabled() {
|
||||
log.memory = Some(convert_memory(self.memory.data()));
|
||||
log.memory = Some(convert_memory(self.memory.slice(0, self.memory.len())));
|
||||
}
|
||||
|
||||
log
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
//! Util functions for revm related ops
|
||||
|
||||
use reth_primitives::{
|
||||
contract::{create2_address_from_code, create_address},
|
||||
hex, Address,
|
||||
};
|
||||
use reth_primitives::{hex, Address, B256};
|
||||
use revm::{
|
||||
interpreter::CreateInputs,
|
||||
primitives::{CreateScheme, SpecId},
|
||||
@ -32,9 +29,9 @@ pub(crate) fn gas_used(spec: SpecId, spent: u64, refunded: u64) -> u64 {
|
||||
#[inline]
|
||||
pub(crate) fn get_create_address(call: &CreateInputs, nonce: u64) -> Address {
|
||||
match call.scheme {
|
||||
CreateScheme::Create => create_address(call.caller, nonce),
|
||||
CreateScheme::Create => call.caller.create(nonce),
|
||||
CreateScheme::Create2 { salt } => {
|
||||
create2_address_from_code(call.caller, call.init_code.clone(), salt)
|
||||
call.caller.create2_from_code(B256::from(salt), call.init_code.clone())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ impl<DB: StateProvider> Database for StateProviderDatabase<DB> {
|
||||
impl<DB: StateProvider> DatabaseRef for StateProviderDatabase<DB> {
|
||||
type Error = <Self as Database>::Error;
|
||||
|
||||
fn basic(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
|
||||
fn basic_ref(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
|
||||
Ok(self.0.basic_account(address)?.map(|account| AccountInfo {
|
||||
balance: account.balance,
|
||||
nonce: account.nonce,
|
||||
@ -81,7 +81,7 @@ impl<DB: StateProvider> DatabaseRef for StateProviderDatabase<DB> {
|
||||
}))
|
||||
}
|
||||
|
||||
fn code_by_hash(&self, code_hash: B256) -> Result<Bytecode, Self::Error> {
|
||||
fn code_by_hash_ref(&self, code_hash: B256) -> Result<Bytecode, Self::Error> {
|
||||
let bytecode = self.0.bytecode_by_hash(code_hash)?;
|
||||
|
||||
if let Some(bytecode) = bytecode {
|
||||
@ -91,13 +91,13 @@ impl<DB: StateProvider> DatabaseRef for StateProviderDatabase<DB> {
|
||||
}
|
||||
}
|
||||
|
||||
fn storage(&self, address: Address, index: U256) -> Result<U256, Self::Error> {
|
||||
fn storage_ref(&self, address: Address, index: U256) -> Result<U256, Self::Error> {
|
||||
let index = B256::new(index.to_be_bytes());
|
||||
let ret = self.0.storage(address, index)?.unwrap_or_default();
|
||||
Ok(ret)
|
||||
}
|
||||
|
||||
fn block_hash(&self, number: U256) -> Result<B256, Self::Error> {
|
||||
fn block_hash_ref(&self, number: U256) -> Result<B256, Self::Error> {
|
||||
// Note: this unwrap is potentially unsafe
|
||||
Ok(self.0.block_hash(number.try_into().unwrap())?.unwrap_or_default())
|
||||
}
|
||||
|
||||
@ -604,7 +604,7 @@ where
|
||||
match req {
|
||||
JsDbRequest::Basic { address, resp } => {
|
||||
let acc = db
|
||||
.basic(address)
|
||||
.basic_ref(address)
|
||||
.map(|maybe_acc| {
|
||||
maybe_acc.map(|acc| Account {
|
||||
nonce: acc.nonce,
|
||||
@ -617,13 +617,13 @@ where
|
||||
}
|
||||
JsDbRequest::Code { code_hash, resp } => {
|
||||
let code = db
|
||||
.code_by_hash(code_hash)
|
||||
.code_by_hash_ref(code_hash)
|
||||
.map(|code| code.bytecode)
|
||||
.map_err(|err| err.to_string());
|
||||
let _ = resp.send(code);
|
||||
}
|
||||
JsDbRequest::StorageAt { address, index, resp } => {
|
||||
let value = db.storage(address, index).map_err(|err| err.to_string());
|
||||
let value = db.storage_ref(address, index).map_err(|err| err.to_string());
|
||||
let _ = resp.send(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ where
|
||||
if no_code_callee {
|
||||
// simple transfer, check if caller has sufficient funds
|
||||
let available_funds =
|
||||
db.basic(env.tx.caller)?.map(|acc| acc.balance).unwrap_or_default();
|
||||
db.basic_ref(env.tx.caller)?.map(|acc| acc.balance).unwrap_or_default();
|
||||
if env.tx.value > available_funds {
|
||||
return Err(
|
||||
RpcInvalidTransactionError::InsufficientFundsForTransfer.into()
|
||||
@ -378,7 +378,7 @@ where
|
||||
let to = if let Some(to) = request.to {
|
||||
to
|
||||
} else {
|
||||
let nonce = db.basic(from)?.unwrap_or_default().nonce;
|
||||
let nonce = db.basic_ref(from)?.unwrap_or_default().nonce;
|
||||
from.create(nonce)
|
||||
};
|
||||
|
||||
|
||||
@ -39,10 +39,7 @@ use revm::{
|
||||
primitives::{BlockEnv, CfgEnv},
|
||||
Inspector,
|
||||
};
|
||||
use revm_primitives::{
|
||||
db::DatabaseCommit, utilities::create_address, Env, ExecutionResult, ResultAndState, SpecId,
|
||||
State,
|
||||
};
|
||||
use revm_primitives::{db::DatabaseCommit, Env, ExecutionResult, ResultAndState, SpecId, State};
|
||||
|
||||
/// Helper alias type for the state's [CacheDB]
|
||||
pub(crate) type StateCacheDB<'r> = CacheDB<StateProviderDatabase<StateProviderBox<'r>>>;
|
||||
@ -1058,7 +1055,7 @@ pub(crate) fn build_transaction_receipt_with_block_receipts(
|
||||
match tx.transaction.kind() {
|
||||
Create => {
|
||||
res_receipt.contract_address =
|
||||
Some(create_address(transaction.signer(), tx.transaction.nonce()));
|
||||
Some(transaction.signer().create(tx.transaction.nonce()));
|
||||
}
|
||||
Call(addr) => {
|
||||
res_receipt.to = Some(*addr);
|
||||
|
||||
@ -78,8 +78,9 @@ where
|
||||
let env = Env { cfg, block: block_env, tx: TxEnv::default() };
|
||||
let db = CacheDB::new(StateProviderDatabase::new(state));
|
||||
|
||||
let initial_coinbase =
|
||||
DatabaseRef::basic(&db, coinbase)?.map(|acc| acc.balance).unwrap_or_default();
|
||||
let initial_coinbase = DatabaseRef::basic_ref(&db, coinbase)?
|
||||
.map(|acc| acc.balance)
|
||||
.unwrap_or_default();
|
||||
let mut coinbase_balance_before_tx = initial_coinbase;
|
||||
let mut coinbase_balance_after_tx = initial_coinbase;
|
||||
let mut total_gas_used = 0u64;
|
||||
|
||||
@ -522,8 +522,8 @@ where
|
||||
EthApiError: From<<DB as DatabaseRef>::Error>,
|
||||
{
|
||||
// we need to fetch the account via the `DatabaseRef` to not update the state of the account,
|
||||
// which is modified via `Database::basic`
|
||||
let mut account_info = DatabaseRef::basic(db, account)?.unwrap_or_default();
|
||||
// which is modified via `Database::basic_ref`
|
||||
let mut account_info = DatabaseRef::basic_ref(db, account)?.unwrap_or_default();
|
||||
|
||||
if let Some(nonce) = account_override.nonce {
|
||||
account_info.nonce = nonce.to();
|
||||
|
||||
Reference in New Issue
Block a user