diff --git a/Cargo.lock b/Cargo.lock index 4640a556..3e422f66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -116,19 +116,19 @@ dependencies = [ "num_enum", "proptest", "serde", - "strum 0.27.2", + "strum", ] [[package]] name = "alloy-consensus" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f16daaf7e1f95f62c6c3bf8a3fc3d78b08ae9777810c0bb5e94966c7cd57ef0" +checksum = "e3d64da86c616b5092ea64eea648f311bbd58630a0b384c42d699175d6f9122b" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-trie", "alloy-tx-macros", "arbitrary", @@ -149,15 +149,15 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "118998d9015332ab1b4720ae1f1e3009491966a0349938a1f43ff45a8a4c6299" +checksum = "8fd98696ca3617d3a9ba1a6f2011880cbfd5618228dab6400c9f8bca457859a8" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 2.0.4", "arbitrary", "serde", ] @@ -227,9 +227,9 @@ dependencies = [ [[package]] name = "alloy-eip7928" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b827a6d7784fe3eb3489d40699407a4cdcce74271421a01bdffe60cf573bb16" +checksum = "ec6ae911a2fc304a7cb80a79fb7bed6d1474aed4e7c203df1f8ff538f64fc78d" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -237,7 +237,6 @@ dependencies = [ "borsh", "once_cell", "serde", - "thiserror 2.0.18", ] [[package]] @@ -252,7 +251,30 @@ dependencies = [ "alloy-eip7928", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.8.3", + "auto_impl", + "borsh", + "c-kzg", + "derive_more 2.1.1", + "either", + "serde", + "serde_with", + "sha2 0.10.9", +] + +[[package]] +name = "alloy-eips" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c0456f5f7a4497e9342d20f528e30f5288ddfa0d6a012bd5044afee46cd8a0" +dependencies = [ + "alloy-eip2124", + "alloy-eip2930", + "alloy-eip7702", + "alloy-eip7928", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 2.0.4", "arbitrary", "auto_impl", "borsh", @@ -268,12 +290,12 @@ dependencies = [ [[package]] name = "alloy-evm" -version = "0.26.4" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b99ba7b74a87176f31ee1cd26768f7155b0eeff61ed925f59b13085ffe5f891" +checksum = "c1ceeea6dcbbcd4e546b27700763a6f6c3b3fee30054209884f521078b6fda4f" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-hardforks", "alloy-primitives", "alloy-rpc-types-engine", @@ -281,21 +303,20 @@ dependencies = [ "alloy-sol-types", "auto_impl", "derive_more 2.1.1", - "op-alloy", - "op-revm", "revm", "thiserror 2.0.18", + "tracing", ] [[package]] name = "alloy-genesis" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf9480307b09d22876efb67d30cadd9013134c21f3a17ec9f93fd7536d38024" +checksum = "a71ff8b55d2b8aa05259f474cae7dea0e4991724dc18936b81cb23ec492a0c2a" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-trie", "borsh", "serde", @@ -330,9 +351,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422d110f1c40f1f8d0e5562b0b649c35f345fccb7093d9f02729943dcd1eef71" +checksum = "19e352478b756bad5d7203148e4b461861282ea2ded3da406ba24868b52cd098" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -345,19 +366,19 @@ dependencies = [ [[package]] name = "alloy-network" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7197a66d94c4de1591cdc16a9bcea5f8cccd0da81b865b49aef97b1b4016e0fa" +checksum = "ed08ae169869e08370ed121612e0d3dadac33d1a256e9f2465926b23f0bd7d95" dependencies = [ "alloy-consensus", "alloy-consensus-any", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-json-rpc", "alloy-network-primitives", "alloy-primitives", "alloy-rpc-types-any", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-signer", "alloy-sol-types", "async-trait", @@ -371,14 +392,14 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb82711d59a43fdfd79727c99f270b974c784ec4eb5728a0d0d22f26716c87ef" +checksum = "02e6c7ad28afe348a9a9c5624b67ee5b3607b8de98d5816b3056ecdfa6fa2697" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", - "alloy-serde", + "alloy-serde 2.0.4", "serde", ] @@ -415,13 +436,13 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf6b18b929ef1d078b834c3631e9c925177f3b23ddc6fa08a722d13047205876" +checksum = "93a7c17472b55482d4734154c2f5ed13f72e03f6752cebb927f6a2d8b52e646c" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-json-rpc", "alloy-network", "alloy-network-primitives", @@ -459,9 +480,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad54073131e7292d4e03e1aa2287730f737280eb160d8b579fb31939f558c11" +checksum = "a8d86958b02bca85103d64fa60d7b364a8b017c6e40f2b02c3f50ca22964a738" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -503,9 +524,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fcc9604042ca80bd37aa5e232ea1cd851f337e31e2babbbb345bc0b1c30de3" +checksum = "5beb5c2fe6b960c8e8b038e69fd502a90a2e930afa4770efb748b163b0767729" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -529,22 +550,22 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faad925d3a669ffc15f43b3deec7fbdf2adeb28a4d6f9cf4bc661698c0f8f4b" +checksum = "4ee1257a278f6d293e05c5162c5940a1561b1aa85ded0028b464c81de37ebfa5" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "serde", ] [[package]] name = "alloy-rpc-types-admin" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38080c2b01ad1bacbd3583cf7f6f800e5e0ffc11eaddaad7321225733a2d818" +checksum = "e2144d5b2866e651796eac0a997d3b5a056449c12e0d91be3184129e0c722885" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -554,34 +575,38 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47df51bedb3e6062cb9981187a51e86d0d64a4de66eb0855e9efe6574b044ddf" +checksum = "df32156f085e74eac942b6103744be49b817c302341aaa8cb0c1c88dc29228d9" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "serde", ] [[package]] name = "alloy-rpc-types-any" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3823026d1ed239a40f12364fac50726c8daf1b6ab8077a97212c5123910429ed" +checksum = "6a234bfbdf7a76c3d13808f729af5321852de3dedcaa6fc6d5f54787aaf54c6a" dependencies = [ "alloy-consensus-any", + "alloy-network-primitives", + "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", + "serde", + "serde_json", ] [[package]] name = "alloy-rpc-types-beacon" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f526dbd7bb039327cfd0ccf18c8a29ffd7402616b0c7a0239512bf8417d544c7" +checksum = "296450f5e76bece0116c939b9437b0421a5da9c5d40031bf4cf9b38d3d94e475" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "derive_more 2.1.1", @@ -597,11 +622,12 @@ dependencies = [ [[package]] name = "alloy-rpc-types-debug" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2145138f3214928f08cd13da3cb51ef7482b5920d8ac5a02ecd4e38d1a8f6d1e" +checksum = "0ab075ac1c25bcf697f133b7cd92e2fb26afe213e872ef79fdf77f0d7bcb3793" dependencies = [ "alloy-primitives", + "alloy-rlp", "derive_more 2.1.1", "serde", "serde_with", @@ -609,37 +635,37 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9b97b6e7965679ad22df297dda809b11cebc13405c1b537e5cffecc95834fa" +checksum = "73b12366c96f4013e1aeebc96c6b56e5f33f07853c42ea2f485045c0c157a4a1" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 2.0.4", "derive_more 2.1.1", "ethereum_ssz", "ethereum_ssz_derive", "jsonwebtoken", "rand 0.8.6", "serde", - "strum 0.27.2", + "strum", ] [[package]] name = "alloy-rpc-types-eth" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c095f92c4e1ff4981d89e9aa02d5f98c762a1980ab66bec49c44be11349da2" +checksum = "56a282daf869eeb7383d3d5c2deb35b0b3fb45ecb329513af4090fc61245ee18" dependencies = [ "alloy-consensus", "alloy-consensus-any", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-network-primitives", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-sol-types", "arbitrary", "itertools 0.14.0", @@ -651,28 +677,28 @@ dependencies = [ [[package]] name = "alloy-rpc-types-mev" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eae9c65ff60dcc262247b6ebb5ad391ddf36d09029802c1768c5723e0cfa2f4" +checksum = "7adc1243d55744a66b3a6cbbbba96436e8df5d248f2ee8186bef4238ef704ec7" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "serde", "serde_json", ] [[package]] name = "alloy-rpc-types-trace" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5a4d010f86cd4e01e5205ec273911e538e1738e76d8bafe9ecd245910ea5a3" +checksum = "6184b5d14152b68b0bb8beb621339d94f0b761a37958bb365fbf7c00922125c2" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "serde", "serde_json", "thiserror 2.0.18", @@ -680,13 +706,13 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942d26a2ca8891b26de4a8529d21091e21c1093e27eb99698f1a86405c76b1ff" +checksum = "f00b631c361e7c7baaf4f1f5a9877730f3507fed2acb9d4b34841b8184b2ec28" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "serde", ] @@ -695,6 +721,17 @@ name = "alloy-serde" version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11ece63b89294b8614ab3f483560c08d016930f842bf36da56bf0b764a15c11e" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eada2558e921b39dfcead33c487364df9b31374f5733c1c9d2c891c4529933" dependencies = [ "alloy-primitives", "arbitrary", @@ -704,9 +741,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f447aefab0f1c0649f71edc33f590992d4e122bc35fb9cdbbf67d4421ace85" +checksum = "41eb29f7a8adcd8941fbb8e134022a133e6f8dfd345f2e3b7109599f8a7dca08" dependencies = [ "alloy-primitives", "async-trait", @@ -719,9 +756,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f721f4bf2e4812e5505aaf5de16ef3065a8e26b9139ac885862d00b5a55a659a" +checksum = "bef839e7ce9b59aa60fa9a175e97986c6145c888d643b0f1fb0a3e7b8e56a2e2" dependencies = [ "alloy-consensus", "alloy-network", @@ -808,9 +845,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8098f965442a9feb620965ba4b4be5e2b320f4ec5a3fff6bfa9e1ff7ef42bed1" +checksum = "3ac7a80c0bac3e44559d53d002e34c461dc2f23262b42cafec019bc70551abbe" dependencies = [ "alloy-json-rpc", "auto_impl", @@ -831,9 +868,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8597d36d546e1dab822345ad563243ec3920e199322cb554ce56c8ef1a1e2e7" +checksum = "eed3ed3300a998f88639ed619fdbbd88bd82865e00c6a8ecb796c99eb12358f6" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -847,9 +884,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1bd98c3870b8a44b79091dde5216a81d58ffbc1fd8ed61b776f9fee0f3bdf20" +checksum = "1075d9d30fd4d71e50000fd4afb19ed2664ceab20c2a29f3889a6e988329e02d" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -867,9 +904,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3ab7a72b180992881acc112628b7668337a19ce15293ee974600ea7b693691" +checksum = "0e3bff84b2b2a46eb34cc522dc3f889a2867c70be90a377421429b662b3ec4ce" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -878,7 +915,7 @@ dependencies = [ "rustls 0.23.40", "serde_json", "tokio", - "tokio-tungstenite 0.28.0", + "tokio-tungstenite", "tracing", "url", "ws_stream_wasm", @@ -906,9 +943,9 @@ dependencies = [ [[package]] name = "alloy-tx-macros" -version = "1.8.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69722eddcdf1ce096c3ab66cf8116999363f734eb36fe94a148f4f71c85da84" +checksum = "99fce0350197dcd4ba4e9a7dd43915d908c0eb0e7352755791709a705e1c76b6" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -1013,6 +1050,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "archery" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e0a5f99dfebb87bb342d0f53bb92c81842e100bbb915223e38349580e5441d" + [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -1474,6 +1517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" dependencies = [ "aws-lc-sys", + "untrusted 0.7.1", "zeroize", ] @@ -1511,7 +1555,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -1575,24 +1619,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.11.1", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.117", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -1672,6 +1698,12 @@ dependencies = [ "serde_core", ] +[[package]] +name = "bitmaps" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d084b0137aaa901caf9f1e8b21daa6aa24d41cd806e111335541eff9683bd6" + [[package]] name = "bitvec" version = "1.0.1" @@ -1685,6 +1717,20 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake3" +version = "1.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures 0.3.0", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -1972,7 +2018,7 @@ name = "bsc-ef-tests" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-genesis", "alloy-primitives", "alloy-rlp", @@ -1987,7 +2033,6 @@ dependencies = [ "reth-ethereum-primitives", "reth-evm", "reth-evm-ethereum", - "reth-primitives", "reth-primitives-traits", "reth-provider", "reth-revm", @@ -2160,12 +2205,6 @@ dependencies = [ "thiserror 2.0.18", ] -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - [[package]] name = "castaway" version = "0.2.4" @@ -2177,9 +2216,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.62" +version = "1.2.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" dependencies = [ "find-msvc-tools", "jobserver", @@ -2225,7 +2264,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -2497,16 +2536,16 @@ version = "7.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958c5d6ecf1f214b4c2bbbbf6ab9523a864bd136dcf71a7e8904799acfe1ad47" dependencies = [ - "crossterm 0.29.0", + "crossterm", "unicode-segmentation", - "unicode-width 0.2.0", + "unicode-width", ] [[package]] name = "compact_str" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" +checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" dependencies = [ "castaway", "cfg-if", @@ -2552,7 +2591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20d9a563d167a9cce0f94153382b33cb6eded6dfabff03c69ad65a28ea1514e0" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "proptest", "serde_core", ] @@ -2590,6 +2629,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + [[package]] name = "contracts" version = "0.6.7" @@ -2657,6 +2702,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc" version = "3.4.0" @@ -2716,26 +2770,19 @@ dependencies = [ ] [[package]] -name = "crossbeam-utils" -version = "0.8.21" +name = "crossbeam-queue" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] [[package]] -name = "crossterm" -version = "0.28.1" +name = "crossbeam-utils" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags 2.11.1", - "crossterm_winapi", - "mio", - "parking_lot", - "rustix 0.38.44", - "signal-hook", - "signal-hook-mio", - "winapi", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crossterm" @@ -2745,9 +2792,13 @@ checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ "bitflags 2.11.1", "crossterm_winapi", + "derive_more 2.1.1", "document-features", + "mio", "parking_lot", - "rustix 1.1.4", + "rustix", + "signal-hook", + "signal-hook-mio", "winapi", ] @@ -2818,7 +2869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", @@ -2940,12 +2991,14 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ + "arbitrary", "cfg-if", "crossbeam-utils", "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", + "serde", ] [[package]] @@ -3147,15 +3200,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys", -] - [[package]] name = "dirs-next" version = "2.0.0" @@ -3166,18 +3210,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.5.2", - "windows-sys 0.61.2", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -3185,15 +3217,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users 0.4.6", + "redox_users", "winapi", ] [[package]] name = "discv5" version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7999df38d0bd8f688212e1a4fae31fd2fea6d218649b9cd7c40bf3ec1318fc" +source = "git+https://github.com/sigp/discv5?rev=7663c00#7663c00ee0837ea98547caaedede95d9d6736f4d" dependencies = [ "aes", "aes-gcm", @@ -3528,11 +3559,11 @@ dependencies = [ [[package]] name = "ethereum_hashing" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c853bd72c9e5787f8aafc3df2907c2ed03cff3150c3acd94e2e53a98ab70a8ab" +checksum = "5aa93f58bb1eb3d1e556e4f408ef1dac130bad01ac37db4e7ade45de40d1c86a" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", "ring", "sha2 0.10.9", ] @@ -3552,13 +3583,13 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dcddb2554d19cde19b099fadddde576929d7a4d0c1cd3512d1fd95cf174375c" +checksum = "368a4a4e4273b0135111fe9464e35465067766a8f664615b5a86338b73864407" dependencies = [ "alloy-primitives", "ethereum_serde_utils", - "itertools 0.13.0", + "itertools 0.14.0", "serde", "serde_derive", "smallvec", @@ -3567,11 +3598,11 @@ dependencies = [ [[package]] name = "ethereum_ssz_derive" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a657b6b3b7e153637dc6bdc6566ad9279d9ee11a15b12cfb24a2e04360637e9f" +checksum = "f2cd82c68120c89361e1a457245cf212f7d9f541bffaffed530c8f2d54a160b2" dependencies = [ - "darling 0.20.11", + "darling 0.23.0", "proc-macro2", "quote", "syn 2.0.117", @@ -3688,12 +3719,13 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.28" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5b2eef6fafbf69f877e55509ce5b11a760690ac9700a2921be067aa6afaef6" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", + "libredox", ] [[package]] @@ -3709,6 +3741,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41c7aa69c00ebccf06c3fa7ffe2a6cf26a58b5fe4deabfe646285ff48136a8f" dependencies = [ "equivalent", + "rapidhash", + "typeid", ] [[package]] @@ -3968,7 +4002,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows-link", + "windows-link 0.2.1", "windows-result 0.4.1", ] @@ -4238,9 +4272,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.17.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" [[package]] name = "hashlink" @@ -4530,7 +4564,6 @@ dependencies = [ "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.7", ] [[package]] @@ -4740,6 +4773,31 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "imbl" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e525189e5f603908d0c6e0d402cb5de9c4b2c8866151fabc4ebd771ed2630a2e" +dependencies = [ + "archery", + "bitmaps", + "imbl-sized-chunks", + "rand_core 0.9.5", + "rand_xoshiro", + "serde_core", + "version_check", + "wide", +] + +[[package]] +name = "imbl-sized-chunks" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4241005618a62f8d57b2febd02510fb96e0137304728543dfc5fd6f052c22d" +dependencies = [ + "bitmaps", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -4804,7 +4862,7 @@ checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "arbitrary", "equivalent", - "hashbrown 0.17.1", + "hashbrown 0.17.0", "serde", "serde_core", ] @@ -4986,6 +5044,36 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link 0.2.1", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "simd_cesu8", + "syn 2.0.117", +] + [[package]] name = "jni-sys" version = "0.3.1" @@ -5069,7 +5157,7 @@ dependencies = [ "pin-project", "rustls 0.23.40", "rustls-pki-types", - "rustls-platform-verifier", + "rustls-platform-verifier 0.5.3", "soketto", "thiserror 2.0.18", "tokio", @@ -5121,7 +5209,7 @@ dependencies = [ "jsonrpsee-core", "jsonrpsee-types", "rustls 0.23.40", - "rustls-platform-verifier", + "rustls-platform-verifier 0.5.3", "serde", "serde_json", "thiserror 2.0.18", @@ -5210,16 +5298,18 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "9.3.1" +version = "10.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" +checksum = "0529410abe238729a60b108898784df8984c87f6054c9c4fcacc47e4803c1ce1" dependencies = [ + "aws-lc-rs", "base64 0.22.1", + "getrandom 0.2.17", "js-sys", "pem", - "ring", "serde", "serde_json", + "signature 2.2.0", "simple_asn1", ] @@ -5238,13 +5328,24 @@ dependencies = [ "signature 2.2.0", ] +[[package]] +name = "kasuari" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899" +dependencies = [ + "hashbrown 0.16.1", + "portable-atomic", + "thiserror 2.0.18", +] + [[package]] name = "keccak" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -5284,9 +5385,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285efcf12ef41bec907b3000d5ffaeb54191d4d9d83c0d6157e6cbc2db255e64" +checksum = "a7b65860415f949f23fa882e669f2dbd4a0f0eeb1acdd56790b30494afd7da2f" dependencies = [ "bitflags 2.11.1", "libc", @@ -5323,9 +5424,9 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libgit2-sys" -version = "0.18.4+1.9.3" +version = "0.18.3+1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b26f66f35e1871b22efcf7191564123d2a446ca0538cde63c23adfefa9b15b7" +checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" dependencies = [ "cc", "libc", @@ -5340,7 +5441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -5374,7 +5475,7 @@ version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a54ad7278b8bc5301d5ffd2a94251c004feb971feba96c971ea4063645990757" dependencies = [ - "bindgen 0.72.1", + "bindgen", "errno", "libc", ] @@ -5385,7 +5486,10 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" dependencies = [ + "bitflags 2.11.1", "libc", + "plain", + "redox_syscall 0.7.5", ] [[package]] @@ -5394,7 +5498,7 @@ version = "0.17.3+10.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef2a00ee60fe526157c9023edab23943fae1ce2ab6f4abb2a807c1746835de9" dependencies = [ - "bindgen 0.72.1", + "bindgen", "bzip2-sys", "cc", "libc", @@ -5417,10 +5521,19 @@ dependencies = [ ] [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "line-clipping" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "3f50e8f47623268b5407192d26876c4d7f89d686ca130fdc53bced4814cd29f8" +dependencies = [ + "bitflags 2.11.1", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" @@ -5432,12 +5545,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -5530,9 +5637,9 @@ dependencies = [ [[package]] name = "lz4_flex" -version = "0.11.6" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373f5eceeeab7925e0c1098212f2fbc4d416adec9d35051a6ab251e824c1854a" +checksum = "98c23545df7ecf1b16c303910a69b079e8e251d60f7dd2cc9b4177f2afaf1746" [[package]] name = "mach2" @@ -5642,7 +5749,7 @@ dependencies = [ "mach2", "metrics", "once_cell", - "procfs 0.18.0", + "procfs", "rlimit", "windows 0.62.2", ] @@ -5725,9 +5832,9 @@ dependencies = [ [[package]] name = "modular-bitfield" -version = "0.11.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +checksum = "2956e537fc68236d2aa048f55704f231cc93f1c4de42fe1ecb5bd7938061fc4a" dependencies = [ "modular-bitfield-impl", "static_assertions", @@ -5735,13 +5842,13 @@ dependencies = [ [[package]] name = "modular-bitfield-impl" -version = "0.11.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +checksum = "59b43b4fd69e3437618106f7754f34021b831a514f9e1a98ae863cabcd8d8dad" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -6021,6 +6128,25 @@ dependencies = [ "smallvec", ] +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.1", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" +dependencies = [ + "libc", + "objc2-core-foundation", +] + [[package]] name = "object" version = "0.37.3" @@ -6046,122 +6172,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" -[[package]] -name = "op-alloy" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b8fee21003dd4f076563de9b9d26f8c97840157ef78593cd7f262c5ca99848" -dependencies = [ - "op-alloy-consensus", - "op-alloy-network", - "op-alloy-provider", - "op-alloy-rpc-types", - "op-alloy-rpc-types-engine", -] - -[[package]] -name = "op-alloy-consensus" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736381a95471d23e267263cfcee9e1d96d30b9754a94a2819148f83379de8a86" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-network", - "alloy-primitives", - "alloy-rlp", - "alloy-rpc-types-eth", - "alloy-serde", - "arbitrary", - "derive_more 2.1.1", - "serde", - "serde_with", - "thiserror 2.0.18", -] - -[[package]] -name = "op-alloy-network" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4034183dca6bff6632e7c24c92e75ff5f0eabb58144edb4d8241814851334d47" -dependencies = [ - "alloy-consensus", - "alloy-network", - "alloy-primitives", - "alloy-provider", - "alloy-rpc-types-eth", - "alloy-signer", - "op-alloy-consensus", - "op-alloy-rpc-types", -] - -[[package]] -name = "op-alloy-provider" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6753d90efbaa8ea8bcb89c1737408ca85fa60d7adb875049d3f382c063666f86" -dependencies = [ - "alloy-network", - "alloy-primitives", - "alloy-provider", - "alloy-rpc-types-engine", - "alloy-transport", - "async-trait", - "op-alloy-rpc-types-engine", -] - -[[package]] -name = "op-alloy-rpc-types" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd87c6b9e5b6eee8d6b76f41b04368dca0e9f38d83338e5b00e730c282098a4" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-network-primitives", - "alloy-primitives", - "alloy-rpc-types-eth", - "alloy-serde", - "derive_more 2.1.1", - "op-alloy-consensus", - "serde", - "serde_json", - "thiserror 2.0.18", -] - -[[package]] -name = "op-alloy-rpc-types-engine" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77727699310a18cdeed32da3928c709e2704043b6584ed416397d5da65694efc" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-rpc-types-engine", - "alloy-serde", - "derive_more 2.1.1", - "ethereum_ssz", - "ethereum_ssz_derive", - "op-alloy-consensus", - "serde", - "sha2 0.10.9", - "snap", - "thiserror 2.0.18", -] - -[[package]] -name = "op-revm" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c92b75162c2ed1661849fa51683b11254a5b661798360a2c24be918edafd40" -dependencies = [ - "auto_impl", - "revm", - "serde", -] - [[package]] name = "opaque-debug" version = "0.2.3" @@ -6278,12 +6288,6 @@ dependencies = [ "thiserror 2.0.18", ] -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "p256" version = "0.13.2" @@ -6318,7 +6322,6 @@ version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ - "arbitrary", "arrayvec", "bitvec", "byte-slice-cast", @@ -6366,9 +6369,9 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.18", "smallvec", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -6603,6 +6606,12 @@ version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "plain_hasher" version = "0.2.3" @@ -6619,7 +6628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "opaque-debug 0.3.1", "universal-hash", ] @@ -6734,40 +6743,17 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "procfs" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" -dependencies = [ - "bitflags 2.11.1", - "chrono", - "flate2", - "hex 0.4.3", - "procfs-core 0.17.0", - "rustix 0.38.44", -] - [[package]] name = "procfs" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25485360a54d6861439d60facef26de713b1e126bf015ec8f98239467a2b82f7" -dependencies = [ - "bitflags 2.11.1", - "procfs-core 0.18.0", - "rustix 1.1.4", -] - -[[package]] -name = "procfs-core" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ "bitflags 2.11.1", "chrono", - "hex 0.4.3", + "flate2", + "procfs-core", + "rustix", ] [[package]] @@ -6777,6 +6763,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6401bf7b6af22f78b563665d15a22e9aef27775b79b149a66ca022468a4e405" dependencies = [ "bitflags 2.11.1", + "chrono", "hex 0.4.3", ] @@ -6999,6 +6986,7 @@ version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ + "aws-lc-rs", "bytes 1.11.1", "getrandom 0.3.4", "lru-slab", @@ -7188,23 +7176,65 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.29.0" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1ce67fb8ba4446454d1c8dbaeda0557ff5e94d39d5e5ed7f10a65eb4c8266bc" +dependencies = [ + "instability", + "ratatui-core", + "ratatui-crossterm", + "ratatui-widgets", +] + +[[package]] +name = "ratatui-core" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" +checksum = "5ef8dea09a92caaf73bff7adb70b76162e5937524058a7e5bff37869cbbec293" dependencies = [ "bitflags 2.11.1", - "cassowary", "compact_str", - "crossterm 0.28.1", + "hashbrown 0.16.1", "indoc", - "instability", - "itertools 0.13.0", - "lru 0.12.5", - "paste", - "strum 0.26.3", + "itertools 0.14.0", + "kasuari", + "lru 0.16.4", + "strum", + "thiserror 2.0.18", "unicode-segmentation", "unicode-truncate", - "unicode-width 0.2.0", + "unicode-width", +] + +[[package]] +name = "ratatui-crossterm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577c9b9f652b4c121fb25c6a391dd06406d3b092ba68827e6d2f09550edc54b3" +dependencies = [ + "cfg-if", + "crossterm", + "instability", + "ratatui-core", +] + +[[package]] +name = "ratatui-widgets" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7dbfa023cd4e604c2553483820c5fe8aa9d71a42eea5aa77c6e7f35756612db" +dependencies = [ + "bitflags 2.11.1", + "hashbrown 0.16.1", + "indoc", + "instability", + "itertools 0.14.0", + "line-clipping", + "ratatui-core", + "strum", + "time", + "unicode-segmentation", + "unicode-width", ] [[package]] @@ -7252,25 +7282,23 @@ dependencies = [ ] [[package]] -name = "redox_users" -version = "0.4.6" +name = "redox_syscall" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "4666a1a60d8412eab19d94f6d13dcc9cea0a5ef4fdf6a5db306537413c661b1b" dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 1.0.69", + "bitflags 2.11.1", ] [[package]] name = "redox_users" -version = "0.5.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.17", "libredox", - "thiserror 2.0.18", + "thiserror 1.0.69", ] [[package]] @@ -7410,16 +7438,13 @@ dependencies = [ "sync_wrapper 1.0.2", "tokio", "tokio-rustls 0.26.4", - "tokio-util", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", - "webpki-roots 1.0.7", ] [[package]] @@ -7430,26 +7455,37 @@ checksum = "62e0021ea2c22aed41653bc7e1419abb2c97e038ff2c33d0e1309e49a97deec0" dependencies = [ "base64 0.22.1", "bytes 1.11.1", + "futures-channel", "futures-core", + "futures-util", "http 1.4.0", "http-body 1.0.1", "http-body-util", "hyper 1.9.0", + "hyper-rustls 0.27.9", "hyper-util", "js-sys", "log", "percent-encoding", "pin-project-lite", + "quinn", + "rustls 0.23.40", + "rustls-pki-types", + "rustls-platform-verifier 0.7.0", "serde", "serde_json", + "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", + "tokio-rustls 0.26.4", + "tokio-util", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", ] @@ -7461,13 +7497,13 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ + "alloy-primitives", "alloy-rpc-types", "aquamarine", "clap", - "eyre", "reth-chainspec", "reth-cli-runner", "reth-cli-util", @@ -7477,7 +7513,6 @@ dependencies = [ "reth-ethereum-cli", "reth-ethereum-payload-builder", "reth-ethereum-primitives", - "reth-evm", "reth-network", "reth-network-api", "reth-node-api", @@ -7487,10 +7522,8 @@ dependencies = [ "reth-node-metrics", "reth-payload-builder", "reth-payload-primitives", - "reth-primitives", + "reth-primitives-traits", "reth-provider", - "reth-ress-protocol", - "reth-ress-provider", "reth-revm", "reth-rpc", "reth-rpc-api", @@ -7499,25 +7532,24 @@ dependencies = [ "reth-rpc-eth-types", "reth-rpc-server-types", "reth-tasks", - "reth-tokio-util", "reth-transaction-pool", - "tokio", "tracing", ] [[package]] name = "reth-basic-payload-builder" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "futures-core", "futures-util", "metrics", "reth-chain-state", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-execution-cache", + "reth-metrics 2.2.0", "reth-payload-builder", "reth-payload-builder-primitives", "reth-payload-primitives", @@ -7525,17 +7557,19 @@ dependencies = [ "reth-revm", "reth-storage-api", "reth-tasks", + "reth-trie-parallel", + "serde", "tokio", "tracing", ] [[package]] name = "reth-chain-state" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-signer", "alloy-signer-local", @@ -7544,11 +7578,12 @@ dependencies = [ "parking_lot", "pin-project", "rand 0.9.4", + "rayon", "reth-chainspec", "reth-errors", "reth-ethereum-primitives", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-storage-api", "reth-trie", @@ -7563,12 +7598,12 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-genesis", "alloy-primitives", @@ -7583,8 +7618,8 @@ dependencies = [ [[package]] name = "reth-cli" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-genesis", "clap", @@ -7592,24 +7627,24 @@ dependencies = [ "reth-cli-runner", "reth-db", "serde_json", - "shellexpand", ] [[package]] name = "reth-cli-commands" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "arbitrary", "backon", + "blake3", "clap", "comfy-table", - "crossterm 0.28.1", + "crossterm", "eyre", "fdlimit", "futures", @@ -7618,10 +7653,12 @@ dependencies = [ "itertools 0.14.0", "lz4", "metrics", + "parking_lot", "proptest", "proptest-arbitrary-interop", "ratatui", - "reqwest 0.12.28", + "rayon", + "reqwest 0.13.3", "reth-chainspec", "reth-cli", "reth-cli-runner", @@ -7664,6 +7701,7 @@ dependencies = [ "reth-stages-types", "reth-static-file", "reth-static-file-types", + "reth-storage-api", "reth-tasks", "reth-trie", "reth-trie-common", @@ -7675,7 +7713,7 @@ dependencies = [ "tar", "tokio", "tokio-stream", - "toml 0.8.23", + "toml 0.9.12+spec-1.1.0", "tracing", "url", "zstd", @@ -7683,8 +7721,8 @@ dependencies = [ [[package]] name = "reth-cli-runner" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "reth-tasks", "tokio", @@ -7693,10 +7731,10 @@ dependencies = [ [[package]] name = "reth-cli-util" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "cfg-if", "eyre", @@ -7706,23 +7744,24 @@ dependencies = [ "secp256k1 0.30.0", "serde", "thiserror 2.0.18", + "tikv-jemalloc-sys", "tikv-jemallocator", ] [[package]] name = "reth-codecs" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "0.3.1" +source = "git+https://github.com/bnb-chain/reth-core.git?branch=v0.3.1-v2#2b45bde5fcf8a0f5acec927d568ffb934b179dc4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-genesis", "alloy-primitives", "alloy-trie", "arbitrary", "bytes 1.11.1", "modular-bitfield", - "op-alloy-consensus", + "parity-scale-codec", "reth-codecs-derive", "reth-zstd-compressors", "serde", @@ -7731,8 +7770,8 @@ dependencies = [ [[package]] name = "reth-codecs-derive" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "0.3.1" +source = "git+https://github.com/bnb-chain/reth-core.git?branch=v0.3.1-v2#2b45bde5fcf8a0f5acec927d568ffb934b179dc4" dependencies = [ "proc-macro2", "quote", @@ -7741,8 +7780,8 @@ dependencies = [ [[package]] name = "reth-config" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "eyre", "humantime-serde", @@ -7751,14 +7790,14 @@ dependencies = [ "reth-stages-types", "reth-static-file-types", "serde", - "toml 0.8.23", + "toml 0.9.12+spec-1.1.0", "url", ] [[package]] name = "reth-consensus" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -7770,11 +7809,12 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", + "alloy-primitives", "reth-chainspec", "reth-consensus", "reth-primitives-traits", @@ -7782,11 +7822,11 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-json-rpc", "alloy-primitives", "alloy-provider", @@ -7796,7 +7836,7 @@ dependencies = [ "derive_more 2.1.1", "eyre", "futures", - "reqwest 0.12.28", + "reqwest 0.13.3", "reth-node-api", "reth-primitives-traits", "reth-tracing", @@ -7808,49 +7848,50 @@ dependencies = [ [[package]] name = "reth-db" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "derive_more 2.1.1", "eyre", + "libc", "metrics", "page_size", "parking_lot", + "quanta", "reth-db-api", "reth-fs-util", "reth-libmdbx", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-nippy-jar", "reth-static-file-types", "reth-storage-errors", "reth-tracing", "rustc-hash", - "strum 0.27.2", + "strum", "sysinfo", "tempfile", "thiserror 2.0.18", + "tracing", ] [[package]] name = "reth-db-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-genesis", "alloy-primitives", "arbitrary", + "arrayvec", "bytes 1.11.1", "derive_more 2.1.1", "metrics", "modular-bitfield", - "parity-scale-codec", "proptest", "reth-codecs", "reth-db-models", "reth-ethereum-primitives", - "reth-optimism-primitives", "reth-primitives-traits", "reth-prune-types", "reth-stages-types", @@ -7862,8 +7903,8 @@ dependencies = [ [[package]] name = "reth-db-common" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -7896,10 +7937,10 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "arbitrary", "bytes 1.11.1", @@ -7911,8 +7952,8 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -7936,8 +7977,8 @@ dependencies = [ [[package]] name = "reth-discv5" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -7950,7 +7991,7 @@ dependencies = [ "rand 0.9.4", "reth-chainspec", "reth-ethereum-forks", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-peers", "secp256k1 0.30.0", "thiserror 2.0.18", @@ -7960,15 +8001,15 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", + "dashmap 6.1.0", "data-encoding", "enr", "hickory-resolver", "linked_hash_set", - "parking_lot", "reth-ethereum-forks", "reth-network-peers", "reth-tokio-util", @@ -7984,11 +8025,11 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "async-compression", @@ -8001,7 +8042,7 @@ dependencies = [ "reth-config", "reth-consensus", "reth-ethereum-primitives", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-p2p", "reth-network-peers", "reth-primitives-traits", @@ -8019,8 +8060,8 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "aes", "alloy-primitives", @@ -8047,8 +8088,8 @@ dependencies = [ [[package]] name = "reth-engine-local" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8070,11 +8111,11 @@ dependencies = [ [[package]] name = "reth-engine-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "auto_impl", @@ -8093,47 +8134,23 @@ dependencies = [ "tokio", ] -[[package]] -name = "reth-engine-service" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "futures", - "pin-project", - "reth-chainspec", - "reth-consensus", - "reth-engine-primitives", - "reth-engine-tree", - "reth-ethereum-primitives", - "reth-evm", - "reth-network-p2p", - "reth-node-types", - "reth-payload-builder", - "reth-provider", - "reth-prune", - "reth-stages-api", - "reth-tasks", - "reth-trie-db", -] - [[package]] name = "reth-engine-tree" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-eip7928", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-primitives", "alloy-rlp", "alloy-rpc-types-engine", "crossbeam-channel", - "dashmap 6.1.0", "derive_more 2.1.1", "futures", + "indexmap 2.14.0", "metrics", - "mini-moka", "moka", "parking_lot", "rayon", @@ -8145,8 +8162,9 @@ dependencies = [ "reth-errors", "reth-ethereum-primitives", "reth-evm", + "reth-execution-cache", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-p2p", "reth-payload-builder", "reth-payload-primitives", @@ -8165,7 +8183,6 @@ dependencies = [ "reth-trie-db", "reth-trie-parallel", "reth-trie-sparse", - "reth-trie-sparse-parallel", "revm", "revm-primitives", "rust-eth-triedb", @@ -8173,7 +8190,6 @@ dependencies = [ "rust-eth-triedb-pathdb", "rust-eth-triedb-state-trie", "schnellru", - "smallvec", "thiserror 2.0.18", "tokio", "tracing", @@ -8181,8 +8197,8 @@ dependencies = [ [[package]] name = "reth-engine-util" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", @@ -8209,29 +8225,30 @@ dependencies = [ [[package]] name = "reth-era" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "ethereum_ssz", "ethereum_ssz_derive", + "sha2 0.10.9", "snap", "thiserror 2.0.18", ] [[package]] name = "reth-era-downloader" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "bytes 1.11.1", "eyre", "futures-util", - "reqwest 0.12.28", + "reqwest 0.13.3", "reth-era", "reth-fs-util", "sha2 0.10.9", @@ -8240,8 +8257,8 @@ dependencies = [ [[package]] name = "reth-era-utils" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8262,8 +8279,8 @@ dependencies = [ [[package]] name = "reth-errors" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -8273,8 +8290,8 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-chains", "alloy-primitives", @@ -8288,7 +8305,7 @@ dependencies = [ "reth-ecies", "reth-eth-wire-types", "reth-ethereum-forks", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-peers", "reth-primitives-traits", "serde", @@ -8302,12 +8319,13 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips", + "alloy-eip7928", + "alloy-eips 2.0.4", "alloy-hardforks", "alloy-primitives", "alloy-rlp", @@ -8326,8 +8344,8 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "clap", "eyre", @@ -8342,17 +8360,18 @@ dependencies = [ "reth-node-ethereum", "reth-node-metrics", "reth-rpc-server-types", + "reth-tasks", "reth-tracing", "tracing", ] [[package]] name = "reth-ethereum-consensus" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "reth-chainspec", "reth-consensus", @@ -8364,26 +8383,24 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", - "alloy-rlp", "alloy-rpc-types-engine", "reth-engine-primitives", "reth-ethereum-primitives", "reth-payload-primitives", "reth-primitives-traits", "serde", - "sha2 0.10.9", "thiserror 2.0.18", ] [[package]] name = "reth-ethereum-forks" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-eip2124", "alloy-hardforks", @@ -8396,11 +8413,11 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "alloy-rpc-types-engine", @@ -8411,6 +8428,7 @@ dependencies = [ "reth-ethereum-primitives", "reth-evm", "reth-evm-ethereum", + "reth-execution-cache", "reth-payload-builder", "reth-payload-builder-primitives", "reth-payload-primitives", @@ -8425,28 +8443,22 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", - "alloy-rlp", "alloy-rpc-types-eth", - "alloy-serde", - "arbitrary", - "modular-bitfield", "reth-codecs", "reth-primitives-traits", - "reth-zstd-compressors", "serde", - "serde_with", ] [[package]] name = "reth-etl" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "rayon", "reth-db-api", @@ -8455,11 +8467,11 @@ dependencies = [ [[package]] name = "reth-evm" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-primitives", "auto_impl", @@ -8469,7 +8481,7 @@ dependencies = [ "rayon", "reth-execution-errors", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-storage-api", "reth-storage-errors", @@ -8480,16 +8492,14 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more 2.1.1", - "parking_lot", "reth-chainspec", "reth-ethereum-forks", "reth-ethereum-primitives", @@ -8500,10 +8510,28 @@ dependencies = [ "revm", ] +[[package]] +name = "reth-execution-cache" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" +dependencies = [ + "alloy-primitives", + "fixed-cache", + "metrics", + "parking_lot", + "reth-errors", + "reth-metrics 2.2.0", + "reth-primitives-traits", + "reth-provider", + "reth-revm", + "reth-trie", + "tracing", +] + [[package]] name = "reth-execution-errors" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-evm", "alloy-primitives", @@ -8515,13 +8543,14 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-primitives", + "alloy-rlp", "derive_more 2.1.1", "reth-ethereum-primitives", "reth-primitives-traits", @@ -8533,11 +8562,11 @@ dependencies = [ [[package]] name = "reth-exex" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "eyre", "futures", @@ -8551,7 +8580,7 @@ dependencies = [ "reth-evm", "reth-exex-types", "reth-fs-util", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-node-api", "reth-node-core", "reth-payload-builder", @@ -8571,10 +8600,10 @@ dependencies = [ [[package]] name = "reth-exex-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "reth-chain-state", "reth-execution-types", @@ -8585,8 +8614,8 @@ dependencies = [ [[package]] name = "reth-fs-util" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "serde", "serde_json", @@ -8595,8 +8624,8 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8623,8 +8652,8 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "bytes 1.11.1", "futures", @@ -8643,11 +8672,12 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "bitflags 2.11.1", "byteorder", + "crossbeam-queue", "dashmap 6.1.0", "derive_more 2.1.1", "parking_lot", @@ -8659,17 +8689,17 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "bindgen 0.71.1", + "bindgen", "cc", ] [[package]] name = "reth-metrics" version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +source = "git+https://github.com/bnb-chain/reth.git#95d649fe0b75ba06e23c317fd75e07b422fdebd0" dependencies = [ "futures", "metrics", @@ -8680,20 +8710,21 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git#95d649fe0b75ba06e23c317fd75e07b422fdebd0" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "futures", "metrics", "metrics-derive", + "reth-primitives-traits", "tokio", "tokio-util", ] [[package]] name = "reth-net-banlist" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "ipnet", @@ -8701,12 +8732,12 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "futures-util", "if-addrs", - "reqwest 0.12.28", + "reqwest 0.13.3", "serde_with", "thiserror 2.0.18", "tokio", @@ -8715,11 +8746,11 @@ dependencies = [ [[package]] name = "reth-network" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "aquamarine", @@ -8745,8 +8776,9 @@ dependencies = [ "reth-eth-wire-types", "reth-ethereum-forks", "reth-ethereum-primitives", + "reth-evm-ethereum", "reth-fs-util", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-net-banlist", "reth-network-api", "reth-network-p2p", @@ -8762,6 +8794,7 @@ dependencies = [ "secp256k1 0.30.0", "serde", "smallvec", + "socket2 0.6.3", "thiserror 2.0.18", "tokio", "tokio-stream", @@ -8771,8 +8804,8 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -8796,11 +8829,11 @@ dependencies = [ [[package]] name = "reth-network-p2p" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "auto_impl", "derive_more 2.1.1", @@ -8819,8 +8852,8 @@ dependencies = [ [[package]] name = "reth-network-peers" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8834,8 +8867,8 @@ dependencies = [ [[package]] name = "reth-network-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -8848,8 +8881,8 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "anyhow", "bincode", @@ -8865,8 +8898,8 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -8889,11 +8922,11 @@ dependencies = [ [[package]] name = "reth-node-builder" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-provider", "alloy-rpc-types", @@ -8918,7 +8951,6 @@ dependencies = [ "reth-downloaders", "reth-engine-local", "reth-engine-primitives", - "reth-engine-service", "reth-engine-tree", "reth-engine-util", "reth-evm", @@ -8960,11 +8992,11 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "clap", @@ -8991,7 +9023,6 @@ dependencies = [ "reth-network-p2p", "reth-network-peers", "reth-primitives-traits", - "reth-provider", "reth-prune-types", "reth-rpc-convert", "reth-rpc-eth-types", @@ -8999,15 +9030,15 @@ dependencies = [ "reth-stages-types", "reth-storage-api", "reth-storage-errors", + "reth-tasks", "reth-tracing", "reth-tracing-otlp", "reth-transaction-pool", "secp256k1 0.30.0", "serde", - "shellexpand", - "strum 0.27.2", + "strum", "thiserror 2.0.18", - "toml 0.8.23", + "toml 0.9.12+spec-1.1.0", "tracing", "url", "vergen", @@ -9016,10 +9047,10 @@ dependencies = [ [[package]] name = "reth-node-ethereum" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-network", "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -9054,8 +9085,8 @@ dependencies = [ [[package]] name = "reth-node-ethstats" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -9071,18 +9102,18 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "tokio-tungstenite 0.26.2", + "tokio-tungstenite", "tracing", "url", ] [[package]] name = "reth-node-events" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "derive_more 2.1.1", @@ -9102,8 +9133,8 @@ dependencies = [ [[package]] name = "reth-node-metrics" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "bytes 1.11.1", "eyre", @@ -9114,9 +9145,9 @@ dependencies = [ "metrics-exporter-prometheus", "metrics-process", "metrics-util", - "procfs 0.17.0", - "reqwest 0.12.28", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "procfs", + "reqwest 0.13.3", + "reth-metrics 2.2.0", "reth-tasks", "tikv-jemalloc-ctl", "tokio", @@ -9126,8 +9157,8 @@ dependencies = [ [[package]] name = "reth-node-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "reth-chainspec", "reth-db-api", @@ -9136,37 +9167,25 @@ dependencies = [ "reth-primitives-traits", ] -[[package]] -name = "reth-optimism-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "op-alloy-consensus", - "reth-primitives-traits", - "serde", - "serde_with", -] - [[package]] name = "reth-payload-builder" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rpc-types", + "derive_more 2.1.1", "futures-util", "metrics", "reth-chain-state", "reth-ethereum-engine-primitives", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-execution-cache", + "reth-metrics 2.2.0", "reth-payload-builder-primitives", "reth-payload-primitives", "reth-primitives-traits", + "reth-trie-parallel", "tokio", "tokio-stream", "tracing", @@ -9174,8 +9193,8 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "pin-project", "reth-payload-primitives", @@ -9186,16 +9205,16 @@ dependencies = [ [[package]] name = "reth-payload-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", + "alloy-rlp", "alloy-rpc-types-engine", "auto_impl", "either", - "op-alloy-rpc-types-engine", "reth-chain-state", "reth-chainspec", "reth-errors", @@ -9203,56 +9222,43 @@ dependencies = [ "reth-primitives-traits", "reth-trie-common", "serde", + "sha2 0.10.9", "thiserror 2.0.18", "tokio", ] [[package]] name = "reth-payload-validator" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-rpc-types-engine", "reth-primitives-traits", ] -[[package]] -name = "reth-primitives" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "alloy-consensus", - "c-kzg", - "once_cell", - "reth-ethereum-forks", - "reth-ethereum-primitives", - "reth-primitives-traits", - "reth-static-file-types", -] - [[package]] name = "reth-primitives-traits" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "0.3.1" +source = "git+https://github.com/bnb-chain/reth-core.git?branch=v0.3.1-v2#2b45bde5fcf8a0f5acec927d568ffb934b179dc4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-genesis", "alloy-primitives", "alloy-rlp", "alloy-rpc-types-eth", "alloy-trie", "arbitrary", - "auto_impl", "byteorder", "bytes 1.11.1", + "dashmap 6.1.0", "derive_more 2.1.1", "modular-bitfield", "once_cell", - "op-alloy-consensus", "proptest", "proptest-arbitrary-interop", + "quanta", "rayon", "reth-codecs", "revm-bytecode", @@ -9260,20 +9266,19 @@ dependencies = [ "revm-state", "secp256k1 0.30.0", "serde", - "serde_with", "thiserror 2.0.18", ] [[package]] name = "reth-provider" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", + "alloy-genesis", "alloy-primitives", "alloy-rpc-types-engine", - "dashmap 6.1.0", "eyre", "itertools 0.14.0", "metrics", @@ -9289,7 +9294,8 @@ dependencies = [ "reth-ethereum-engine-primitives", "reth-ethereum-primitives", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-fs-util", + "reth-metrics 2.2.0", "reth-nippy-jar", "reth-node-types", "reth-primitives-traits", @@ -9298,24 +9304,26 @@ dependencies = [ "reth-static-file-types", "reth-storage-api", "reth-storage-errors", + "reth-tasks", "reth-trie", "reth-trie-db", "revm-database", "revm-state", + "rocksdb", "rust-eth-triedb", "rust-eth-triedb-common", - "strum 0.27.2", + "strum", "tokio", "tracing", ] [[package]] name = "reth-prune" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "itertools 0.14.0", "metrics", @@ -9324,12 +9332,13 @@ dependencies = [ "reth-db-api", "reth-errors", "reth-exex-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-provider", "reth-prune-types", "reth-stages-types", "reth-static-file-types", + "reth-storage-api", "reth-tokio-util", "rustc-hash", "thiserror 2.0.18", @@ -9339,8 +9348,8 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "arbitrary", @@ -9348,62 +9357,19 @@ dependencies = [ "modular-bitfield", "reth-codecs", "serde", - "strum 0.27.2", + "strum", "thiserror 2.0.18", -] - -[[package]] -name = "reth-ress-protocol" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "alloy-consensus", - "alloy-primitives", - "alloy-rlp", - "futures", - "reth-eth-wire", - "reth-ethereum-primitives", - "reth-network", - "reth-network-api", - "reth-storage-errors", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "reth-ress-provider" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "alloy-consensus", - "alloy-primitives", - "eyre", - "futures", - "parking_lot", - "reth-chain-state", - "reth-errors", - "reth-ethereum-primitives", - "reth-evm", - "reth-node-api", - "reth-primitives-traits", - "reth-ress-protocol", - "reth-revm", - "reth-storage-api", - "reth-tasks", - "reth-tokio-util", - "reth-trie", - "schnellru", - "tokio", "tracing", ] [[package]] name = "reth-revm" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", + "alloy-rlp", + "alloy-rpc-types-debug", "reth-primitives-traits", "reth-storage-api", "reth-storage-errors", @@ -9413,13 +9379,12 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-dyn-abi", - "alloy-eip7928", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-genesis", "alloy-network", @@ -9435,20 +9400,16 @@ dependencies = [ "alloy-rpc-types-mev", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-signer", "alloy-signer-local", "async-trait", "derive_more 2.1.1", "dyn-clone", "futures", - "http 1.4.0", - "http-body 1.0.1", - "hyper 1.9.0", "itertools 0.14.0", "jsonrpsee", "jsonrpsee-types", - "jsonwebtoken", "parking_lot", "pin-project", "reth-chain-state", @@ -9462,7 +9423,7 @@ dependencies = [ "reth-evm", "reth-evm-ethereum", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-api", "reth-network-peers", "reth-network-types", @@ -9477,6 +9438,7 @@ dependencies = [ "reth-rpc-server-types", "reth-storage-api", "reth-tasks", + "reth-tracing", "reth-transaction-pool", "reth-trie-common", "revm", @@ -9489,18 +9451,16 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tokio-stream", - "tower", "tracing", "tracing-futures", ] [[package]] name = "reth-rpc-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eip7928", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-genesis", "alloy-json-rpc", "alloy-primitives", @@ -9514,20 +9474,21 @@ dependencies = [ "alloy-rpc-types-mev", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", - "alloy-serde", + "alloy-serde 2.0.4", "jsonrpsee", "reth-chain-state", "reth-engine-primitives", "reth-network-peers", "reth-rpc-eth-api", "reth-trie-common", + "serde", "serde_json", ] [[package]] name = "reth-rpc-builder" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-network", "alloy-provider", @@ -9542,12 +9503,14 @@ dependencies = [ "reth-engine-primitives", "reth-evm", "reth-ipc", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-api", "reth-node-core", + "reth-payload-primitives", "reth-primitives-traits", "reth-rpc", "reth-rpc-api", + "reth-rpc-engine-api", "reth-rpc-eth-api", "reth-rpc-eth-types", "reth-rpc-layer", @@ -9567,8 +9530,8 @@ dependencies = [ [[package]] name = "reth-rpc-convert" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-evm", @@ -9576,24 +9539,24 @@ dependencies = [ "alloy-network", "alloy-primitives", "alloy-rpc-types-eth", - "alloy-signer", "auto_impl", "dyn-clone", "jsonrpsee-types", - "reth-ethereum-primitives", "reth-evm", "reth-primitives-traits", + "reth-rpc-traits", "serde", "thiserror 2.0.18", ] [[package]] name = "reth-rpc-engine-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", + "alloy-rlp", "alloy-rpc-types-engine", "async-trait", "jsonrpsee-core", @@ -9601,7 +9564,7 @@ dependencies = [ "metrics", "reth-chainspec", "reth-engine-primitives", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-api", "reth-payload-builder", "reth-payload-builder-primitives", @@ -9619,12 +9582,13 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-dyn-abi", - "alloy-eips", + "alloy-eip7928", + "alloy-eips 2.0.4", "alloy-evm", "alloy-json-rpc", "alloy-network", @@ -9632,7 +9596,7 @@ dependencies = [ "alloy-rlp", "alloy-rpc-types-eth", "alloy-rpc-types-mev", - "alloy-serde", + "alloy-serde 2.0.4", "async-trait", "auto_impl", "dyn-clone", @@ -9659,17 +9623,18 @@ dependencies = [ "revm", "revm-inspectors", "rust-eth-triedb", + "serde_json", "tokio", "tracing", ] [[package]] name = "reth-rpc-eth-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-network", "alloy-primitives", @@ -9684,14 +9649,14 @@ dependencies = [ "jsonrpsee-types", "metrics", "rand 0.9.4", - "reqwest 0.12.28", + "reqwest 0.13.3", "reth-chain-state", "reth-chainspec", "reth-errors", "reth-ethereum-primitives", "reth-evm", "reth-execution-types", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-revm", "reth-rpc-convert", @@ -9713,8 +9678,8 @@ dependencies = [ [[package]] name = "reth-rpc-layer" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-rpc-types-engine", "http 1.4.0", @@ -9727,10 +9692,10 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "jsonrpsee-core", @@ -9738,25 +9703,40 @@ dependencies = [ "reth-errors", "reth-network-api", "serde", - "strum 0.27.2", + "strum", +] + +[[package]] +name = "reth-rpc-traits" +version = "0.3.1" +source = "git+https://github.com/bnb-chain/reth-core.git?branch=v0.3.1-v2#2b45bde5fcf8a0f5acec927d568ffb934b179dc4" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-signer", + "reth-primitives-traits", + "thiserror 2.0.18", ] [[package]] name = "reth-stages" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", + "alloy-rlp", "alloy-trie", - "bincode", "eyre", "futures-util", "itertools 0.14.0", "num-traits", + "page_size", "rayon", - "reqwest 0.12.28", + "reqwest 0.13.3", "reth-chainspec", "reth-codecs", "reth-config", @@ -9772,6 +9752,7 @@ dependencies = [ "reth-execution-types", "reth-exex", "reth-fs-util", + "reth-libmdbx", "reth-network-p2p", "reth-primitives-traits", "reth-provider", @@ -9782,6 +9763,7 @@ dependencies = [ "reth-static-file-types", "reth-storage-api", "reth-storage-errors", + "reth-tasks", "reth-testing-utils", "reth-trie", "reth-trie-common", @@ -9795,18 +9777,19 @@ dependencies = [ [[package]] name = "reth-stages-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "aquamarine", "auto_impl", "futures-util", "metrics", + "reth-codecs", "reth-consensus", "reth-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network-p2p", "reth-primitives-traits", "reth-provider", @@ -9822,8 +9805,8 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "arbitrary", @@ -9836,8 +9819,8 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "parking_lot", @@ -9856,24 +9839,26 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "clap", "derive_more 2.1.1", "fixed-map", + "reth-stages-types", "serde", - "strum 0.27.2", + "strum", + "tracing", ] [[package]] name = "reth-storage-api" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rpc-types-engine", "auto_impl", @@ -9893,13 +9878,14 @@ dependencies = [ [[package]] name = "reth-storage-errors" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "derive_more 2.1.1", + "reth-codecs", "reth-primitives-traits", "reth-prune-types", "reth-static-file-types", @@ -9910,17 +9896,20 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ - "auto_impl", - "dyn-clone", + "crossbeam-utils", + "dashmap 6.1.0", "futures-util", + "libc", "metrics", + "parking_lot", "pin-project", "rayon", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "thiserror 2.0.18", + "thread-priority", "tokio", "tracing", "tracing-futures", @@ -9928,11 +9917,11 @@ dependencies = [ [[package]] name = "reth-testing-utils" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-genesis", "alloy-primitives", "rand 0.8.6", @@ -9944,8 +9933,8 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "tokio", "tokio-stream", @@ -9954,8 +9943,8 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "clap", "eyre", @@ -9969,8 +9958,8 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "clap", "eyre", @@ -9987,17 +9976,18 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "aquamarine", "auto_impl", "bitflags 2.11.1", "futures-util", + "imbl", "metrics", "parking_lot", "paste", @@ -10007,12 +9997,15 @@ dependencies = [ "reth-chainspec", "reth-eth-wire-types", "reth-ethereum-primitives", + "reth-evm", + "reth-evm-ethereum", "reth-execution-types", "reth-fs-util", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-storage-api", "reth-tasks", + "revm", "revm-interpreter", "revm-primitives", "rustc-hash", @@ -10028,11 +10021,11 @@ dependencies = [ [[package]] name = "reth-trie" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-primitives", "alloy-rlp", "alloy-trie", @@ -10041,7 +10034,7 @@ dependencies = [ "metrics", "parking_lot", "reth-execution-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-stages-types", "reth-storage-errors", @@ -10054,14 +10047,14 @@ dependencies = [ [[package]] name = "reth-trie-common" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rlp", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 2.0.4", "alloy-trie", "arbitrary", "arrayvec", @@ -10083,15 +10076,15 @@ dependencies = [ [[package]] name = "reth-trie-db" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "metrics", "parking_lot", "reth-db-api", "reth-execution-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-stages-types", "reth-storage-api", @@ -10104,70 +10097,57 @@ dependencies = [ [[package]] name = "reth-trie-parallel" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ + "alloy-eip7928", + "alloy-evm", "alloy-primitives", "alloy-rlp", "crossbeam-channel", - "dashmap 6.1.0", + "crossbeam-utils", "derive_more 2.1.1", "itertools 0.14.0", "metrics", "rayon", "reth-execution-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", + "reth-primitives-traits", "reth-provider", "reth-storage-errors", + "reth-tasks", "reth-trie", - "reth-trie-common", "reth-trie-sparse", + "revm-state", "thiserror 2.0.18", - "tokio", "tracing", ] [[package]] name = "reth-trie-sparse" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "2.2.0" +source = "git+https://github.com/bnb-chain/reth.git?rev=485e37b738754f96603391f42ee529f9364b47a4#485e37b738754f96603391f42ee529f9364b47a4" dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-trie", - "auto_impl", "metrics", "rayon", "reth-execution-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-primitives-traits", "reth-trie-common", - "smallvec", - "tracing", -] - -[[package]] -name = "reth-trie-sparse-parallel" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "alloy-trie", - "metrics", - "rayon", - "reth-execution-errors", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", - "reth-trie-common", - "reth-trie-sparse", + "serde", + "serde_json", + "slotmap", "smallvec", "tracing", ] [[package]] name = "reth-zstd-compressors" -version = "1.10.2" -source = "git+https://github.com/bnb-chain/reth.git?branch=develop#507fb3544fd753ced523f5a47679959a4ad5cda3" +version = "0.3.1" +source = "git+https://github.com/bnb-chain/reth-core.git?branch=v0.3.1-v2#2b45bde5fcf8a0f5acec927d568ffb934b179dc4" dependencies = [ "zstd", ] @@ -10180,7 +10160,7 @@ dependencies = [ "alloy-chains", "alloy-consensus", "alloy-dyn-abi", - "alloy-eips", + "alloy-eips 2.0.4", "alloy-evm", "alloy-genesis", "alloy-json-abi", @@ -10236,6 +10216,7 @@ dependencies = [ "reth-cli", "reth-cli-commands", "reth-cli-util", + "reth-codecs", "reth-db", "reth-discv4", "reth-engine-local", @@ -10251,7 +10232,7 @@ dependencies = [ "reth-evm-ethereum", "reth-execution-types", "reth-ipc", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git?branch=develop)", + "reth-metrics 2.2.0", "reth-network", "reth-network-api", "reth-network-p2p", @@ -10261,7 +10242,6 @@ dependencies = [ "reth-node-ethereum", "reth-payload-builder-primitives", "reth-payload-primitives", - "reth-primitives", "reth-primitives-traits", "reth-provider", "reth-revm", @@ -10274,11 +10254,16 @@ dependencies = [ "reth-trie-common", "reth-trie-db", "revm", - "revm-context-interface", + "revm-bytecode", "revm-database", + "revm-database-interface", + "revm-interpreter", + "revm-primitives", + "revm-state", "rust-eth-triedb", "rust-eth-triedb-common", "rust-eth-triedb-pathdb", + "rust-eth-triedb-state-trie", "schnellru", "scrypt 0.11.0", "secp256k1 0.30.0", @@ -10300,9 +10285,9 @@ dependencies = [ [[package]] name = "revm" -version = "34.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2aabdebaa535b3575231a88d72b642897ae8106cf6b0d12eafc6bfdf50abfc7" +checksum = "91202d39dbe8e8d10e9e8f2b76c30da68ecd1d25be69ba6d853ad0d03a3a398a" dependencies = [ "revm-bytecode", "revm-context", @@ -10319,11 +10304,12 @@ dependencies = [ [[package]] name = "revm-bytecode" -version = "8.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d1e5c1eaa44d39d537f668bc5c3409dc01e5c8be954da6c83370bbdf006457" +checksum = "bdbb3a3d735efa94c91f2ef6bf20a35f99a77bc78f3e25bd758336901bdf9661" dependencies = [ "bitvec", + "paste", "phf 0.13.1", "revm-primitives", "serde", @@ -10331,9 +10317,9 @@ dependencies = [ [[package]] name = "revm-context" -version = "13.0.0" +version = "16.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "892ff3e6a566cf8d72ffb627fdced3becebbd9ba64089c25975b9b028af326a5" +checksum = "c5f68d928d8b228e0faeb1c6ed75c4fde7d124f1ddf9119b67e7a0ad4041237d" dependencies = [ "bitvec", "cfg-if", @@ -10348,9 +10334,9 @@ dependencies = [ [[package]] name = "revm-context-interface" -version = "14.0.0" +version = "17.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57f61cc6d23678c4840af895b19f8acfbbd546142ec8028b6526c53cc1c16c98" +checksum = "1f3758e6167c4ba7a59a689c519a047edaefcd4c37d74f279b93ed87bc8aece4" dependencies = [ "alloy-eip2930", "alloy-eip7702", @@ -10364,11 +10350,11 @@ dependencies = [ [[package]] name = "revm-database" -version = "10.0.0" +version = "13.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529528d0b05fe646be86223032c3e77aa8b05caa2a35447d538c55965956a511" +checksum = "c281a1f11d3bcb8c0bba1199ed6bcb001d1aeb3d4fb366819e14f88723989a4e" dependencies = [ - "alloy-eips", + "alloy-eips 1.8.3", "revm-bytecode", "revm-database-interface", "revm-primitives", @@ -10378,9 +10364,9 @@ dependencies = [ [[package]] name = "revm-database-interface" -version = "9.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bf93ac5b91347c057610c0d96e923db8c62807e03f036762d03e981feddc1d" +checksum = "d89efb9832a4e3742bb4ded5f7fe5bf905e8860e69427d4dfec153484fc6d304" dependencies = [ "auto_impl", "either", @@ -10392,9 +10378,9 @@ dependencies = [ [[package]] name = "revm-handler" -version = "15.0.0" +version = "18.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd0e43e815a85eded249df886c4badec869195e70cdd808a13cfca2794622d2" +checksum = "783e903d6922b7f5f9a940d1bb229530502d2924b1aed9d5ca5a94ebf065d460" dependencies = [ "auto_impl", "derive-where", @@ -10411,9 +10397,9 @@ dependencies = [ [[package]] name = "revm-inspector" -version = "15.0.0" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3ccad59db91ef93696536a0dbaf2f6f17cfe20d4d8843ae118edb7e97947ef" +checksum = "8216ad58422090d0daa9eb430e0a081f7ad07e7fd30681dee71f8420c99624e0" dependencies = [ "auto_impl", "either", @@ -10429,9 +10415,9 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.34.3" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e341d9777b1903a8428bc6f8fe7a8f80671d2249837c9749566e61328ef14125" +checksum = "731b682530a732ef9c189ef831589128e2ce34d4a306c956322ae2dffe009715" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -10449,9 +10435,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "32.0.0" +version = "35.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11406408597bc249392d39295831c4b641b3a6f5c471a7c41104a7a1e3564c07" +checksum = "1ece9f41b69658c15d748288a4dbdfc06a63f3ce93d983af440de3f1631dce6a" dependencies = [ "revm-bytecode", "revm-context-interface", @@ -10462,9 +10448,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "32.1.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ec11f45deec71e4945e1809736bb20d454285f9167ab53c5159dae1deb603f" +checksum = "a346a8cc6c8c39bd65306641c692191299c0a7b63d38810e39e8fe9b92378660" dependencies = [ "ark-bls12-381 0.5.0", "ark-bn254", @@ -10473,11 +10459,13 @@ dependencies = [ "ark-serialize 0.5.0", "arrayref", "aurora-engine-modexp", + "aws-lc-rs", "blst", "c-kzg", "cfg-if", "k256", "p256", + "revm-context-interface", "revm-primitives", "ripemd", "secp256k1 0.31.1", @@ -10486,9 +10474,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "22.1.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfb5ce6cf18b118932bcdb7da05cd9c250f2cb9f64131396b55f3fe3537c35" +checksum = "0c99bda77d9661521ba0b4bc04558c6692074f01e65dd420fa3b893033d9b8a2" dependencies = [ "alloy-primitives", "num_enum", @@ -10498,9 +10486,9 @@ dependencies = [ [[package]] name = "revm-state" -version = "9.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311720d4f0f239b041375e7ddafdbd20032a33b7bae718562ea188e188ed9fd3" +checksum = "c32490ed687dba31c3c882beb8c20408bdd30ef96690d8f145b0ee9a87040bfe" dependencies = [ "alloy-eip7928", "bitflags 2.11.1", @@ -10529,15 +10517,15 @@ dependencies = [ "cfg-if", "getrandom 0.2.17", "libc", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] [[package]] name = "ringbuffer" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df6368f71f205ff9c33c076d170dd56ebf68e8161c733c0caa07a7a5509ed53" +checksum = "57b0b88a509053cbfd535726dcaaceee631313cef981266119527a1d110f6d2b" [[package]] name = "ripemd" @@ -10610,9 +10598,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.12" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e8d2cfa184d94d0726d650a9f4a1be7f9b76ac9fdb954219878dc00c1c1e7b" +checksum = "1dedc5658c6ecb3bdb5ef5f3295bb9253f42dcf3fd1402c03f6b1f7659c3c4a9" dependencies = [ "bytemuck", "byteorder", @@ -10688,7 +10676,7 @@ dependencies = [ "metrics", "once_cell", "rayon", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git)", + "reth-metrics 1.10.2", "rust-eth-triedb-common", "rust-eth-triedb-pathdb", "rust-eth-triedb-state-trie", @@ -10719,7 +10707,7 @@ dependencies = [ "alloy-trie", "metrics", "mini-moka", - "reth-metrics 1.10.2 (git+https://github.com/bnb-chain/reth.git)", + "reth-metrics 1.10.2", "rocksdb", "rust-eth-triedb-common", "schnellru", @@ -10737,6 +10725,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-trie", + "arbitrary", "auto_impl", "hex 0.4.3", "rand 0.8.6", @@ -10796,19 +10785,6 @@ dependencies = [ "semver 1.0.28", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.11.1", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" @@ -10818,7 +10794,7 @@ dependencies = [ "bitflags 2.11.1", "errno", "libc", - "linux-raw-sys 0.12.1", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -10901,7 +10877,7 @@ checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", - "jni", + "jni 0.21.1", "log", "once_cell", "rustls 0.23.40", @@ -10914,6 +10890,27 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni 0.22.4", + "log", + "once_cell", + "rustls 0.23.40", + "rustls-native-certs 0.8.3", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.13", + "security-framework 3.7.0", + "security-framework-sys", + "webpki-root-certs 1.0.7", + "windows-sys 0.61.2", +] + [[package]] name = "rustls-platform-verifier-android" version = "0.1.1" @@ -10927,7 +10924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -10939,7 +10936,7 @@ dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -10972,6 +10969,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + [[package]] name = "salsa20" version = "0.10.2" @@ -11077,7 +11083,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -11311,6 +11317,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -11325,12 +11340,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.20.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72c1c2cb7b223fafb600a619537a871c2818583d619401b785e7c0b746ccde2" +checksum = "f05839ce67618e14a09b286535c0d9c94e85ef25469b0e13cb4f844e5593eb19" dependencies = [ "base64 0.22.1", - "bs58", "chrono", "hex 0.4.3", "indexmap 1.9.3", @@ -11345,9 +11359,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.20.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90c488738ecb4fb0262f41f43bc40efc5868d9fb744319ddf5f5317f417bfac" +checksum = "cf2ebbe86054f9b45bc3881e865683ccfaccce97b9b4cb53f3039d67f355a334" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -11372,7 +11386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.10.7", ] @@ -11396,7 +11410,7 @@ checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.9.0", "opaque-debug 0.3.1", ] @@ -11408,7 +11422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.10.7", ] @@ -11454,15 +11468,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shellexpand" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" -dependencies = [ - "dirs", -] - [[package]] name = "shlex" version = "1.3.0" @@ -11522,6 +11527,22 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version 0.4.1", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "simple_asn1" version = "0.6.4" @@ -11567,6 +11588,15 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + [[package]] name = "small_btree" version = "0.1.0" @@ -11656,35 +11686,13 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros 0.26.4", -] - [[package]] name = "strum" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ - "strum_macros 0.27.2", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.117", + "strum_macros", ] [[package]] @@ -11800,15 +11808,16 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.33.1" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +checksum = "92ab6a2f8bfe508deb3c6406578252e491d299cbbf3bc0529ecc3313aee4a52f" dependencies = [ - "core-foundation-sys", "libc", "memchr", "ntapi", - "windows 0.57.0", + "objc2-core-foundation", + "objc2-io-kit", + "windows 0.62.2", ] [[package]] @@ -11870,7 +11879,7 @@ dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] @@ -11979,6 +11988,20 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "thread-priority" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2210811179577da3d54eb69ab0b50490ee40491a25d95b8c6011ba40771cb721" +dependencies = [ + "bitflags 2.11.1", + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.61.3", +] + [[package]] name = "thread_local" version = "1.1.9" @@ -12089,9 +12112,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.52.3" +version = "1.52.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +checksum = "110a78583f19d5cdb2c5ccf321d1290344e71313c6c37d43520d386027d18386" dependencies = [ "bytes 1.11.1", "libc", @@ -12147,22 +12170,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "tokio-tungstenite" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" -dependencies = [ - "futures-util", - "log", - "rustls 0.23.40", - "rustls-native-certs 0.8.3", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.4", - "tungstenite 0.26.2", -] - [[package]] name = "tokio-tungstenite" version = "0.28.0" @@ -12172,10 +12179,11 @@ dependencies = [ "futures-util", "log", "rustls 0.23.40", + "rustls-native-certs 0.8.3", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", - "tungstenite 0.28.0", + "tungstenite", "webpki-roots 0.26.11", ] @@ -12210,11 +12218,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", - "serde_spanned", + "serde_spanned 0.6.9", "toml_datetime 0.6.11", "toml_edit 0.22.27", ] +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap 2.14.0", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + [[package]] name = "toml_datetime" version = "0.6.11" @@ -12224,6 +12247,15 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + [[package]] name = "toml_datetime" version = "1.1.1+spec-1.1.0" @@ -12241,7 +12273,7 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap 2.14.0", "serde", - "serde_spanned", + "serde_spanned 0.6.9", "toml_datetime 0.6.11", "toml_write", "winnow 0.7.15", @@ -12274,6 +12306,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + [[package]] name = "tonic" version = "0.14.6" @@ -12510,9 +12548,9 @@ dependencies = [ [[package]] name = "tree_hash" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee44f4cef85f88b4dea21c0b1f58320bdf35715cf56d840969487cff00613321" +checksum = "f7fd51aa83d2eb83b04570808430808b5d24fdbf479a4d5ac5dee4a2e2dd2be4" dependencies = [ "alloy-primitives", "ethereum_hashing", @@ -12523,11 +12561,11 @@ dependencies = [ [[package]] name = "tree_hash_derive" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bee2ea1551f90040ab0e34b6fb7f2fa3bad8acc925837ac654f2c78a13e3089" +checksum = "8840ad4d852e325d3afa7fde8a50b2412f89dce47d7eb291c0cc7f87cd040f38" dependencies = [ - "darling 0.20.11", + "darling 0.23.0", "proc-macro2", "quote", "syn 2.0.117", @@ -12557,9 +12595,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.26.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" +checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" dependencies = [ "bytes 1.11.1", "data-encoding", @@ -12575,23 +12613,10 @@ dependencies = [ ] [[package]] -name = "tungstenite" -version = "0.28.0" +name = "typeid" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" -dependencies = [ - "bytes 1.11.1", - "data-encoding", - "http 1.4.0", - "httparse", - "log", - "rand 0.9.4", - "rustls 0.23.40", - "rustls-pki-types", - "sha1", - "thiserror 2.0.18", - "utf-8", -] +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" @@ -12655,26 +12680,20 @@ checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" [[package]] name = "unicode-truncate" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +checksum = "16b380a1238663e5f8a691f9039c73e1cdae598a30e9855f541d29b08b53e9a5" dependencies = [ - "itertools 0.13.0", + "itertools 0.14.0", "unicode-segmentation", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -12698,6 +12717,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -12969,9 +12994,9 @@ dependencies = [ [[package]] name = "wasm-streams" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" dependencies = [ "futures-util", "js-sys", @@ -13062,6 +13087,16 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + [[package]] name = "widestring" version = "1.2.1" @@ -13101,12 +13136,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.57.0" +version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.6", + "windows-collections 0.2.0", + "windows-core 0.61.2", + "windows-future 0.2.1", + "windows-link 0.1.3", + "windows-numerics 0.2.0", ] [[package]] @@ -13115,10 +13153,19 @@ version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ - "windows-collections", + "windows-collections 0.3.2", "windows-core 0.62.2", - "windows-future", - "windows-numerics", + "windows-future 0.3.2", + "windows-numerics 0.3.1", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", ] [[package]] @@ -13132,14 +13179,15 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.57.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.57.0", - "windows-interface 0.57.0", - "windows-result 0.1.2", - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", ] [[package]] @@ -13148,33 +13196,33 @@ version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", - "windows-link", + "windows-implement", + "windows-interface", + "windows-link 0.2.1", "windows-result 0.4.1", - "windows-strings", + "windows-strings 0.5.1", ] [[package]] name = "windows-future" -version = "0.3.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core 0.62.2", - "windows-link", - "windows-threading", + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading 0.1.0", ] [[package]] -name = "windows-implement" -version = "0.57.0" +name = "windows-future" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", ] [[package]] @@ -13190,9 +13238,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.57.0" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -13200,15 +13248,10 @@ dependencies = [ ] [[package]] -name = "windows-interface" -version = "0.59.3" +name = "windows-link" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-link" @@ -13216,6 +13259,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + [[package]] name = "windows-numerics" version = "0.3.1" @@ -13223,7 +13276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ "windows-core 0.62.2", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -13232,18 +13285,18 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link", + "windows-link 0.2.1", "windows-result 0.4.1", - "windows-strings", + "windows-strings 0.5.1", ] [[package]] name = "windows-result" -version = "0.1.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-targets 0.52.6", + "windows-link 0.1.3", ] [[package]] @@ -13252,7 +13305,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", ] [[package]] @@ -13261,7 +13323,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -13315,7 +13377,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -13370,7 +13432,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link", + "windows-link 0.2.1", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -13381,13 +13443,22 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + [[package]] name = "windows-threading" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -13739,7 +13810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "rustix 1.1.4", + "rustix", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 40f8a848..3d221bc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,95 +16,100 @@ name = "reth-bsc" path = "src/main.rs" [dependencies] -reth = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-cli = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-cli-commands = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-basic-payload-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-engine-local = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-engine-tree = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-node-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-cli-util = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-discv4 = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [ +reth = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-cli = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-cli-commands = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-basic-payload-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-engine-local = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-engine-tree = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-node-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-cli-util = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-discv4 = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [ "test-utils", ] } -reth-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [ +reth-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [ "serde", ] } -reth-ethereum-payload-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-payload-builder-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-chain-state = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-eth-wire = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-eth-wire-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-evm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-execution-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ipc = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-metrics = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-node-core = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-revm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-network = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [ +reth-ethereum-payload-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-payload-builder-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-chain-state = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-eth-wire = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-eth-wire-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-evm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-execution-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ipc = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-metrics = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-node-core = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-revm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-network = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [ "test-utils", ] } -reth-network-p2p = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-network-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-node-ethereum = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [ +reth-network-p2p = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-network-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-node-ethereum = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [ "test-utils", ] } -reth-network-peers = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-payload-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-primitives-traits = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-provider = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [ +reth-network-peers = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-payload-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-primitives-traits = { git = "https://github.com/bnb-chain/reth-core.git", branch = "v0.3.1-v2", default-features = false } +reth-codecs = { git = "https://github.com/bnb-chain/reth-core.git", branch = "v0.3.1-v2" } +reth-provider = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [ "test-utils", ] } -reth-rpc-eth-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-rpc-convert = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-rpc-engine-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-rpc-server-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-trie-common = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-tasks = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-transaction-pool = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } +reth-rpc-eth-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-rpc-convert = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-rpc-engine-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-rpc-server-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-trie-common = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-tasks = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-transaction-pool = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } # triedb dependencies rust-eth-triedb = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop" } rust-eth-triedb-common = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-common" } rust-eth-triedb-pathdb = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-pathdb" } +rust-eth-triedb-state-trie = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-state-trie" } -revm = "34.0.0" -revm-context-interface = "14.0.0" -revm-database = "10.0.0" +revm = "38.0.0" +revm-database = "13.0.0" +revm-bytecode = "10.0.0" +revm-state = "11.0.0" +revm-primitives = { version = "23.0.0", default-features = false } +revm-interpreter = "35.0.0" +revm-database-interface = "11.0.0" # alloy dependencies -alloy-evm = "0.26.3" - -alloy-genesis = "1.1.3" -alloy-consensus = "1.1.3" -alloy-eips = "1.1.3" -alloy-network = "1.1.3" -alloy-rpc-types = { version = "1.1.3", features = ["engine"] } -alloy-rpc-types-eth = "1.1.3" -alloy-rpc-types-engine = "1.1.3" -alloy-rpc-types-mev = "1.1.3" -alloy-signer = "1.1.3" - -alloy-chains = "0.2.23" -alloy-rlp = { version = "0.3.12", default-features = false, features = [ +alloy-evm = { version = "0.34.0", features = ["rpc"] } + +alloy-genesis = "2.0.4" +alloy-consensus = "2.0.4" +alloy-eips = "2.0.4" +alloy-network = "2.0.4" +alloy-rpc-types = { version = "2.0.4", features = ["eth"] } +alloy-rpc-types-eth = "2.0.4" +alloy-rpc-types-engine = "2.0.4" +alloy-rpc-types-mev = "2.0.4" +alloy-signer = "2.0.4" + +alloy-chains = "0.2.33" +alloy-rlp = { version = "0.3.13", default-features = false, features = [ "core-net", ] } -alloy-dyn-abi = "1.4.1" -alloy-json-abi = { version = "1.4.1", default-features = false } -alloy-primitives = { version = "1.4.1", default-features = false, features = [ +alloy-dyn-abi = "1.5.6" +alloy-json-abi = { version = "1.5.6", default-features = false } +alloy-primitives = { version = "1.5.6", default-features = false, features = [ "map-foldhash", ] } -alloy-sol-macro = "1.4.1" -alloy-sol-types = { version = "1.4.1", default-features = false } +alloy-sol-macro = "1.5.6" +alloy-sol-types = { version = "1.5.6", default-features = false } jsonrpsee = { version = "0.26.0", features = ["server", "client", "macros"] } jsonrpsee-core = { version = "0.26.0", features = ["server"] } @@ -182,7 +187,6 @@ dev = ["reth-cli-commands/arbitrary", "reth/dev", "revm/dev"] asm-keccak = [ "reth/asm-keccak", "reth-node-core/asm-keccak", - "reth-primitives/asm-keccak", "reth-node-ethereum/asm-keccak", ] diff --git a/src/chainspec/bsc.rs b/src/chainspec/bsc.rs index 78eedcd0..8e7bab43 100644 --- a/src/chainspec/bsc.rs +++ b/src/chainspec/bsc.rs @@ -4,7 +4,7 @@ use alloy_primitives::BlockHash; use reth_chainspec::{ make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain, }; -use reth_primitives::SealedHeader; +use reth_primitives_traits::SealedHeader; use std::str::FromStr; pub fn bsc_mainnet() -> ChainSpec { diff --git a/src/chainspec/bsc_chapel.rs b/src/chainspec/bsc_chapel.rs index 75eafa68..fb0d252b 100644 --- a/src/chainspec/bsc_chapel.rs +++ b/src/chainspec/bsc_chapel.rs @@ -4,7 +4,7 @@ use alloy_primitives::{BlockHash, B256, U256}; use reth_chainspec::{ make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain, }; -use reth_primitives::SealedHeader; +use reth_primitives_traits::SealedHeader; use std::str::FromStr; pub fn bsc_testnet() -> ChainSpec { diff --git a/src/chainspec/bsc_rialto.rs b/src/chainspec/bsc_rialto.rs index c3fde534..b4eae32f 100644 --- a/src/chainspec/bsc_rialto.rs +++ b/src/chainspec/bsc_rialto.rs @@ -3,7 +3,7 @@ use alloy_primitives::{BlockHash, U256, B256}; use reth_chainspec::{ make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, }; -use reth_primitives::SealedHeader; +use reth_primitives_traits::SealedHeader; use std::str::FromStr; pub const RIALTO_CHAIN_ID: u64 = 714; diff --git a/src/chainspec/local.rs b/src/chainspec/local.rs index e8fc11bf..1ade751f 100644 --- a/src/chainspec/local.rs +++ b/src/chainspec/local.rs @@ -3,7 +3,7 @@ use crate::hardforks::bsc::BscHardfork; use reth_chainspec::{ make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain, }; -use reth_primitives::SealedHeader; +use reth_primitives_traits::SealedHeader; pub fn bsc_local() -> ChainSpec { let genesis = serde_json::from_str(include_str!("genesis_local.json")) diff --git a/src/consensus/parlia/snapshot.rs b/src/consensus/parlia/snapshot.rs index acd18ed1..53263db1 100644 --- a/src/consensus/parlia/snapshot.rs +++ b/src/consensus/parlia/snapshot.rs @@ -4,8 +4,7 @@ use super::vote::{VoteAddress, VoteAttestation, VoteData}; use crate::metrics::BscVoteMetrics; use alloy_primitives::{Address, BlockHash, BlockNumber}; use once_cell::sync::Lazy; -use reth_db::table::{Compress, Decompress}; -use reth_db::DatabaseError; +use reth_codecs::{Compress, Decompress, DecompressError}; use serde::{Deserialize, Serialize}; /// Number of blocks after which we persist snapshots to DB. @@ -498,8 +497,8 @@ impl Compress for Snapshot { } impl Decompress for Snapshot { - fn decompress(value: &[u8]) -> Result { - serde_cbor::from_slice(value).map_err(|_| DatabaseError::Decode) + fn decompress(value: &[u8]) -> Result { + serde_cbor::from_slice(value).map_err(DecompressError::new) } } @@ -652,6 +651,12 @@ mod tests { fn requests_hash(&self) -> Option { None } + fn block_access_list_hash(&self) -> Option { + None + } + fn slot_number(&self) -> Option { + None + } } impl alloy_primitives::Sealable for MockHeader { diff --git a/src/consensus/parlia/validation.rs b/src/consensus/parlia/validation.rs index 6df9838d..28a78007 100644 --- a/src/consensus/parlia/validation.rs +++ b/src/consensus/parlia/validation.rs @@ -7,11 +7,11 @@ use crate::consensus::eip4844::is_blob_eligible_block; use super::{Parlia, EMPTY_WITHDRAWALS_HASH}; use alloy_consensus::{Header, Transaction, EMPTY_OMMER_ROOT_HASH}; use alloy_primitives::B256; -use reth_primitives::GotExpected; +use reth_primitives_traits::GotExpected; use alloy_eips::eip4844::{DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK_DENCUN}; use crate::BscBlock; use reth_primitives_traits::Block; -use std::time::SystemTime; +use std::{sync::Arc, time::SystemTime}; const MAX_RLP_BLOCK_SIZE_OSAKA: usize = 8 * 1024 * 1024; @@ -51,11 +51,11 @@ pub fn validate_4844_header_of_bsc( // BEP-657: After Mendel, non-eligible blocks must have blob_gas_used == 0 if !is_blob_eligible_block(chain_spec, header.number, header.timestamp) && blob_gas_used != 0 { - return Err(ConsensusError::Other(format!( + return Err(ConsensusError::Other(Arc::new(std::io::Error::other(format!( "blob transactions not allowed in block {} (N % {} != 0)", header.number, crate::consensus::eip4844::BLOB_ELIGIBLE_BLOCK_INTERVAL - ))); + ))))); } if blob_gas_used > MAX_DATA_GAS_PER_BLOCK_DENCUN { @@ -114,16 +114,16 @@ fn validate_mix_digest_for_parlia( ) -> Result<(), ConsensusError> { if !lorentz_active { if header.mix_hash != B256::ZERO { - return Err(ConsensusError::Other("non-zero mix digest".to_string())); + return Err(ConsensusError::Other(Arc::new(std::io::Error::other("non-zero mix digest")))); } return Ok(()); } // In Lorentz+, mix digest carries the millisecond remainder. It must not overflow seconds. if calculate_millisecond_timestamp(header) / 1000 != header.timestamp { - return Err(ConsensusError::Other( - "invalid mix digest milliseconds component".to_string(), - )); + return Err(ConsensusError::Other(Arc::new(std::io::Error::other( + "invalid mix digest milliseconds component", + )))); } Ok(()) } @@ -172,7 +172,7 @@ impl SealedHeader { RethSealedHeader::new(header, B256::ZERO) diff --git a/src/evm/api/mod.rs b/src/evm/api/mod.rs index a647a3d6..01f9ab1c 100644 --- a/src/evm/api/mod.rs +++ b/src/evm/api/mod.rs @@ -16,7 +16,7 @@ use revm::{ primitives::hardfork::SpecId, Context, Inspector, Journal, }; -use revm_context_interface::journaled_state::account::JournaledAccountTr; +use revm::context_interface::journaled_state::account::JournaledAccountTr; mod exec; @@ -379,7 +379,7 @@ mod tests { false, false, ); - mismatched.inner.instruction = EthInstructions::new_mainnet(); + mismatched.inner.instruction = EthInstructions::new_mainnet_with_spec(SpecId::default()); let mismatched_result = mismatched .transact_one(tx) @@ -565,7 +565,7 @@ mod tests { beneficiary: Address, ) -> U256 { use revm::context::{ContextTr, JournalTr}; - use revm_context_interface::journaled_state::account::JournaledAccountTr; + use revm::context_interface::journaled_state::account::JournaledAccountTr; *evm.journal_mut() .load_account_mut(beneficiary) .expect("beneficiary account should load") diff --git a/src/evm/handler.rs b/src/evm/handler.rs index 631c6fb8..14cff363 100644 --- a/src/evm/handler.rs +++ b/src/evm/handler.rs @@ -17,13 +17,13 @@ use revm::{ transaction::TransactionType, Cfg, ContextError, ContextTr, LocalContextTr, Transaction, }, - context_interface::{transaction::eip7702::AuthorizationTr, Block, JournalTr}, + context_interface::{result::ResultGas, transaction::eip7702::AuthorizationTr, Block, JournalTr}, handler::{EthFrame, EvmTr, FrameResult, Handler, MainnetHandler}, inspector::{Inspector, InspectorHandler}, interpreter::{interpreter::EthInterpreter, Host, InitialAndFloorGas, SuccessOrHalt}, primitives::hardfork::SpecId, }; -use revm_context_interface::journaled_state::account::JournaledAccountTr; +use revm::context_interface::journaled_state::account::JournaledAccountTr; use crate::consensus::SYSTEM_ADDRESS; pub struct BscHandler { @@ -79,7 +79,7 @@ impl Handler for BscHandler { // https://github.com/bluealloy/revm/blob/df467931c4b1b8b620ff2cb9f62501c7abc3ea03/crates/handler/src/pre_execution.rs#L186 // with slight modifications to support BSC specific validation. // https://github.com/bnb-chain/bsc/blob/develop/core/state_transition.go#L593 - fn apply_eip7702_auth_list(&self, evm: &mut Self::Evm) -> Result { + fn apply_eip7702_auth_list(&self, evm: &mut Self::Evm, _init_and_floor_gas: &mut InitialAndFloorGas) -> Result { let ctx = evm.ctx_ref(); let tx = ctx.tx(); @@ -204,7 +204,7 @@ impl Handler for BscHandler { )); let res = if is_system_tx { - Ok(InitialAndFloorGas { initial_gas: 0, floor_gas: 0 }) + Ok(InitialAndFloorGas::new(0, 0)) } else { self.mainnet.validate_initial_tx_gas(evm) }; @@ -231,7 +231,7 @@ impl Handler for BscHandler { let effective_gas_price = ctx.effective_gas_price(); let gas = exec_result.gas(); - let mut tx_fee = U256::from(gas.spent() - gas.refunded() as u64) * effective_gas_price; + let mut tx_fee = U256::from(gas.spent_sub_refunded()) * effective_gas_price; // EIP-4844 let is_cancun = SpecId::from(*ctx.cfg().spec()).is_enabled_in(SpecId::CANCUN); @@ -249,6 +249,7 @@ impl Handler for BscHandler { &mut self, evm: &mut Self::Evm, result: FrameResult, + mut result_gas: ResultGas, ) -> Result, Self::Error> { // Ensure we always pop the trace context, even on early returns. struct PrecompileTracePopGuard; @@ -265,15 +266,12 @@ impl Handler for BscHandler { Ok(_) => (), } - // used gas with refund calculated. - let raw_gas_refunded = result.gas().refunded() as u64; - let raw_gas_spent = result.gas().spent(); - let is_system_tx = { - let ctx = evm.ctx_ref(); - ctx.tx().is_system_transaction - }; - let gas_refunded = if is_system_tx { 0 } else { raw_gas_refunded }; - let final_gas_used = raw_gas_spent - gas_refunded; + // System transactions never get a gas refund in BSC. + let is_system_tx = evm.ctx_ref().tx().is_system_transaction; + if is_system_tx { + result_gas.set_refunded(0); + } + let output = result.output(); let instruction_result = result.into_interpreter_result(); @@ -283,16 +281,15 @@ impl Handler for BscHandler { let result = match SuccessOrHalt::from(instruction_result.result) { SuccessOrHalt::Success(reason) => ExecutionResult::Success { reason, - gas_used: final_gas_used, - gas_refunded, + gas: result_gas, logs, output, }, SuccessOrHalt::Revert => { - ExecutionResult::Revert { gas_used: final_gas_used, output: output.into_data() } + ExecutionResult::Revert { gas: result_gas, logs, output: output.into_data() } } SuccessOrHalt::Halt(reason) => { - ExecutionResult::Halt { reason, gas_used: final_gas_used } + ExecutionResult::Halt { reason, gas: result_gas, logs } } // Only two internal return flags. flag @ (SuccessOrHalt::FatalExternalError | SuccessOrHalt::Internal(_)) => { diff --git a/src/evm/precompiles/bls.rs b/src/evm/precompiles/bls.rs index 02de02d8..3952a016 100644 --- a/src/evm/precompiles/bls.rs +++ b/src/evm/precompiles/bls.rs @@ -3,7 +3,7 @@ use alloy_primitives::Bytes; use bls_on_arkworks as bls; use revm::precompile::{ - u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, + u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use std::{borrow::Cow, vec::Vec}; @@ -22,13 +22,13 @@ const BLS_DST: &[u8] = bls::DST_ETHEREUM.as_bytes(); /// The input is encoded as follows: /// | msg_hash | signature | [{bls pubkey}] | /// | 32 | 96 | [{48}] | -fn bls_signature_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResult { +fn bls_signature_validation_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { let cost = calc_gas_cost(input); if cost > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } - let revert = || Ok(PrecompileOutput::new_reverted(cost, Default::default())); + let revert = || Ok(PrecompileOutput::revert(cost, Default::default(), reservoir)); let msg_and_sig_length = BLS_MSG_HASH_LENGTH + BLS_SIGNATURE_LENGTH; let input_length = input.len() as u64; @@ -73,7 +73,7 @@ fn bls_signature_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResul output = Bytes::from(vec![]); } - Ok(PrecompileOutput::new(cost, output)) + Ok(PrecompileOutput::new(cost, output, reservoir)) } fn calc_gas_cost(input: &[u8]) -> u64 { @@ -111,7 +111,7 @@ mod tests { input.extend_from_slice(&pub_key); let excepted_output = Bytes::from(vec![1]); - let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { + let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { Ok(o) => o.bytes, Err(e) => panic!("BLS signature validation failed, {e:?}"), }; @@ -127,7 +127,7 @@ mod tests { input.extend_from_slice(&pub_key); let excepted_output = Bytes::from(vec![]); - let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { + let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { Ok(o) => o.bytes, Err(e) => panic!("BLS signature validation failed, {e:?}"), }; @@ -142,8 +142,8 @@ mod tests { input.extend_from_slice(&signature); input.extend_from_slice(&pub_key); - match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { - Ok(res) => assert_eq!(res, PrecompileOutput::new_reverted(4500, Default::default())), + match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { + Ok(res) => assert_eq!(res, PrecompileOutput::revert(4500, Default::default(), 0)), Err(e) => panic!("BLS signature validation failed, expect error"), } @@ -156,8 +156,8 @@ mod tests { input.extend_from_slice(&signature); input.extend_from_slice(&pub_key); - match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { - Ok(res) => assert_eq!(res, PrecompileOutput::new_reverted(4500, Default::default())), + match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { + Ok(res) => assert_eq!(res, PrecompileOutput::revert(4500, Default::default(), 0)), Err(e) => panic!("BLS signature validation failed, expect error"), } } @@ -177,7 +177,7 @@ mod tests { input.extend_from_slice(&pub_key3); let excepted_output = Bytes::from(vec![1]); - let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { + let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { Ok(o) => o.bytes, Err(e) => panic!("BLS signature validation failed, {e:?}"), }; @@ -196,7 +196,7 @@ mod tests { input.extend_from_slice(&pub_key2); input.extend_from_slice(&pub_key3); let excepted_output = Bytes::from(vec![]); - let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { + let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { Ok(o) => o.bytes, Err(e) => panic!("BLS signature validation failed, {e:?}"), }; @@ -215,8 +215,8 @@ mod tests { input.extend_from_slice(&pub_key2); input.extend_from_slice(&pub_key3); - match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { - Ok(res) => assert_eq!(res, PrecompileOutput::new_reverted(11500, Default::default())), + match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { + Ok(res) => assert_eq!(res, PrecompileOutput::revert(11500, Default::default(), 0)), Err(e) => panic!("BLS signature validation failed, expect error"), } @@ -233,8 +233,8 @@ mod tests { input.extend_from_slice(&pub_key2); input.extend_from_slice(&pub_key3); - match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { - Ok(res) => assert_eq!(res, PrecompileOutput::new_reverted(11500, Default::default())), + match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { + Ok(res) => assert_eq!(res, PrecompileOutput::revert(11500, Default::default(), 0)), Err(e) => panic!("BLS signature validation failed, expect error"), } @@ -251,7 +251,7 @@ mod tests { input.extend_from_slice(&pub_key2); input.extend_from_slice(&pub_key3); let excepted_output = Bytes::from(vec![]); - let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) { + let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000, 0) { Ok(o) => o.bytes, Err(e) => panic!("BLS signature validation failed, {e:?}"), }; diff --git a/src/evm/precompiles/cometbft.rs b/src/evm/precompiles/cometbft.rs index e3ad05eb..bcdbf79c 100644 --- a/src/evm/precompiles/cometbft.rs +++ b/src/evm/precompiles/cometbft.rs @@ -14,7 +14,7 @@ use cometbft_light_client_verifier::{ use cometbft_proto::types::v1::LightBlock as TmLightBlock; use prost::Message; use revm::precompile::{ - u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, + u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use std::{borrow::{Cow, ToOwned}, string::String, vec::Vec}; @@ -46,46 +46,61 @@ const MAX_CONSENSUS_STATE_LENGTH: u64 = CHAIN_ID_LENGTH + VALIDATOR_SET_HASH_LENGTH + 99 * SINGLE_VALIDATOR_BYTES_LENGTH; -fn cometbft_light_block_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResult { - cometbft_light_block_validation_run_inner(input, gas_limit, true) +fn cometbft_light_block_validation_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + cometbft_light_block_validation_run_inner(input, gas_limit, reservoir, true) } fn cometbft_light_block_validation_run_before_hertz( input: &[u8], gas_limit: u64, + reservoir: u64, ) -> PrecompileResult { - cometbft_light_block_validation_run_inner(input, gas_limit, false) + cometbft_light_block_validation_run_inner(input, gas_limit, reservoir, false) } fn cometbft_light_block_validation_run_inner( input: &[u8], gas_limit: u64, + reservoir: u64, is_hertz: bool, ) -> PrecompileResult { const COMETBFT_LIGHT_BLOCK_VALIDATION_BASE: u64 = 3_000; if COMETBFT_LIGHT_BLOCK_VALIDATION_BASE > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } - let (mut consensus_state, tm_light_block) = decode_light_block_validation_input(input)?; + let (mut consensus_state, tm_light_block) = match decode_light_block_validation_input(input) { + Ok(v) => v, + Err(h) => return Ok(PrecompileOutput::halt(h, reservoir)), + }; - let light_block = convert_light_block_from_proto(&tm_light_block)?; + let light_block = match convert_light_block_from_proto(&tm_light_block) { + Ok(v) => v, + Err(h) => return Ok(PrecompileOutput::halt(h, reservoir)), + }; - let mut validator_set_changed = consensus_state.apply_light_block(&light_block)?; + let mut validator_set_changed = match consensus_state.apply_light_block(&light_block) { + Ok(v) => v, + Err(h) => return Ok(PrecompileOutput::halt(h, reservoir)), + }; if !is_hertz { validator_set_changed = false; } - let consensus_state_bytes = consensus_state.encode()?; + let consensus_state_bytes = match consensus_state.encode() { + Ok(v) => v, + Err(h) => return Ok(PrecompileOutput::halt(h, reservoir)), + }; Ok(PrecompileOutput::new( COMETBFT_LIGHT_BLOCK_VALIDATION_BASE, encode_light_block_validation_result(validator_set_changed, consensus_state_bytes), + reservoir, )) } -type ConvertLightBlockResult = Result; +type ConvertLightBlockResult = Result; fn convert_light_block_from_proto(light_block_proto: &TmLightBlock) -> ConvertLightBlockResult { let signed_header = match SignedHeader::try_from(light_block_proto.signed_header.as_ref().unwrap().clone()) { @@ -104,7 +119,7 @@ fn convert_light_block_from_proto(light_block_proto: &TmLightBlock) -> ConvertLi Ok(LightBlock::new(signed_header, validator_set, next_validator_set, peer_id)) } -type DecodeLightBlockResult = Result<(ConsensusState, TmLightBlock), PrecompileError>; +type DecodeLightBlockResult = Result<(ConsensusState, TmLightBlock), PrecompileHalt>; fn decode_light_block_validation_input(input: &[u8]) -> DecodeLightBlockResult { let input_length = input.len() as u64; if input_length < CONSENSUS_STATE_LENGTH_BYTES_LENGTH { @@ -162,7 +177,7 @@ impl ConsensusState { Self { chain_id, height, next_validator_set_hash, validators } } - fn apply_light_block(&mut self, light_block: &LightBlock) -> Result { + fn apply_light_block(&mut self, light_block: &LightBlock) -> Result { if light_block.height().value() <= self.height { return Err(BscPrecompileError::InvalidInput.into()); } @@ -232,7 +247,7 @@ impl ConsensusState { Ok(validator_set_changed) } - fn encode(&self) -> Result { + fn encode(&self) -> Result { let validator_set_length = self.validators.validators().len(); let serialize_length = (CHAIN_ID_LENGTH + HEIGHT_LENGTH + @@ -290,7 +305,7 @@ impl ConsensusState { } } -type DecodeConsensusStateResult = Result; +type DecodeConsensusStateResult = Result; /// input: /// | chainID | height | nextValidatorSetHash | [{validator pubkey, voting power, relayer address, relayer bls pubkey}] | /// | 32 bytes | 8 bytes | 32 bytes | [{32 bytes, 8 bytes, 20 bytes, 48 bytes}] @@ -397,14 +412,11 @@ mod tests { "000000000000000000000000000000000000000000000000000000000000018c677265656e6669656c645f393030302d3132310000000000000000000000000000000000000000023c350cd55b99dc6c2b7da9bef5410fbfb869fede858e7b95bf7ca294e228bb40e33f6e876d63791ebd05ff617a1b4f4ad1aa2ce65e3c3a9cdfb33e0ffa7e8423000000000098968015154514f68ce65a0d9eecc578c0ab12da0a2a28a0805521b5b7ae56eb3fb24555efbfe59e1622bfe9f7be8c9022e9b3f2442739c1ce870b9adee169afe60f674edd7c86451c5363d89052fde8351895eeea166ce5373c36e31b518ed191d0c599aa0f5b0000000000989680432f6c4908a9aa5f3444421f466b11645235c99b831b2a2de9e504d7ea299e52a202ce529808618eb3bfc0addf13d8c5f2df821d81e18f9bc61583510b322d067d46323b0a572635c06a049c0a2a929e3c8184a50cf6a8b95708c25834ade456f399015a0000000000989680864cb9828254d712f8e59b164fc6a9402dc4e6c59065e38cff24f5323c8c5da888a0f97e5ee4ba1e11b0674b0a0d06204c1dfa247c370cd4be3e799fc4f6f48d977ac7ca" )); - let result = cometbft_light_block_validation_run(&input, 100_000); - let PrecompileOutput { gas_used, bytes, reverted, .. } = match result { - Ok(output) => output, - Err(_) => panic!("cometbft_light_block_validation_run failed"), - }; - assert_eq!(gas_used, 3_000); - assert_eq!(bytes, except_output); - assert!(!reverted); + let result = cometbft_light_block_validation_run(&input, 100_000, 0); + let output = result.expect("cometbft_light_block_validation_run failed"); + assert_eq!(output.gas_used, 3_000); + assert_eq!(output.bytes, except_output); + assert!(output.is_success()); } // apply light block failed { @@ -412,9 +424,9 @@ mod tests { "0000000000000000000000000000000000000000000000000000000000000264677265656e6669656c645f393030302d313734310000000000000000000000000000000000000001af6b801dda578dddfa4da1d5d67fd1b32510db24ec271346fc573e9242b01c9a112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647500000000000003e84202722cf6a34d727be762b46825b0d26b6263a0a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156448e2b2f7d9a3e7b668757d9cc0bbd28cd674c34ed1c2ed75c5de3b6a8f8cad4600000000000003e8668a0acd8f6db5cae959a0e02132f4d6a672c4d7a4726b542012cc8023ee07b29ab3971cc999d8751bbd16f23413968afcdb070ed66ab47e6e1842bf875bef21dfc5b8af6813bfd82860d361e339bd1ae2f801b6d6ee46b8497a3d51c80b50b6160ea1cc00000000000003e80dfa99423d3084c596c5e3bd6bcb4f654516517b8d4786703c56b300b70f085c0d0482e5d6a3c7208883f0ec8abd2de893f71d18e8f919e7ab198499201d87f92c57ebce83ed2b763bb872e9bc148fb216fd5c93b18819670d9a946ae4b3075672d726b800000000000003e824aab6f85470ff73e3048c64083a09e980d4cb7f8146d231a7b2051c5f7a9c07ab6e6bfe277bd5f4a94f901fe6ee7a6b6bd8479e9e5e448de4b1b33d5ddd74194c86b3852cc140a3f08a9c4149efd45643202f8bef2ad7eecf53e58951c6df6fd932004b00000000000003e84998f6ef8d999a0f36a851bfa29dbcf0364dd65695c286deb3f1657664859d59876bf1ec5a288f6e66e18b37b8a2a1e6ee4a3ef8fa50784d8b758d0c3e70a7cdfe65ab5d0ad7080adf030a02080b1214677265656e6669656c645f393030302d3137343118f7fdbd01220c08dca092aa0610e79ba49c012a480a209cda416227712ec137b852d1de0fbb957045e6bf7e541bb595d7f5391b481360122408011220fbb48c3c7cbbe68becfd80e7dcdcee8b8737afdbdc2e484cdc8fd52a659215e932207ddc7495ef0d0c1229ae33348d7907d90459ecccf6dcb3415724b41c0b4d1b7c3a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855422003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce04a2003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce05220eceb4055624b9f678278a2706ca2f43e11f31a641580d5aacf2f4383d8edef7e5a206796260ff3744ac8f8a5007a23408c72abe018d65df767b71290aac5da68d5ba6220694a73ea799423215418f2390a3f56f23b31391fbbab0de7a8f5b3c4822257906a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85572144b7d2bc2f5c3381c9bbf55edface8747722bc9d07a4050a45d04cd3d64ee8bc00bd5842e8ee2458001e0dcb6fc78bb1f44271ebca04ea65c689c6776582962c27492a5850e80a919a98d889d21ecfa83c54f15c4de0812f20408f7fdbd011a480a202585ab3a1bc673b3c68cc77e08b8190667641f30edffa89ae5ddfc2e1f53d60b122408011220c55ae2ca75b9705b4a486067b088c275919a6c3fc2de51cf09973232457a16042268080212144b7d2bc2f5c3381c9bbf55edface8747722bc9d01a0c08dea092aa0610eca4d6a6012240243914b3cf5be06bc69a6c34f2fc41928c1043b5a7d1bff80fd567b27398c3ce890be932958ec0d2a2083c393afbd4c75776ce84c881ec58a73b1022fcb63a0a226808031214793cee4b478e537592c40ecfb2148ebe32b8f6051a0c08dea092aa0610dcdbcfd701224000c586fe47dc655b38e7f62c913f4dd217ce16fa143e9295e146918ad361c2ed777512de15ed65eefb479864a89eebe55e38ebb8644a3887f46970bda9472203226808031214d742fa5318dc3986e075e2b050529a22c6fa3b8b1a0c08dea092aa0610ec9dd2d701224007e0f3e5a3d209a75c5db60f1502880cf25c5fddad0717e4ecaa8bbd95ebf28e78ea3229e88d741a44d534f08ac283dc587a28ced5c25b9cc64657a5bc5ce50c226808031214f0f07dc2f5e159a35b9662553c6b4e51868502f71a0c08dea092aa0610b7c186d7012240546fbdcc448af86aa932a05d8db2e4bc99816b7035b00c494ffe514d562190a68c214e5468c16d7d3a8c2fa52a6165ce870f8fc2dd93fa7cee40f3fa74e118082268080312145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f81a0c08dea092aa0610f2d4efd50122400fe7c2eb23f4e2b6e57722c79ead12b2180e87bc618fc26cceccb891107be796fe8242c700fb61eeac6936659503354dc1a66874725b80f316252820e308d90f220f08011a0b088092b8c398feffffff0112df070a91010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a00a88010a14793cee4b478e537592c40ecfb2148ebe32b8f60512220a206813bfd82860d361e339bd1ae2f801b6d6ee46b8497a3d51c80b50b6160ea1cc1889082089082a308d4786703c56b300b70f085c0d0482e5d6a3c7208883f0ec8abd2de893f71d18e8f919e7ab198499201d87f92c57ebce32140dfa99423d3084c596c5e3bd6bcb4f654516517b0a88010a14d742fa5318dc3986e075e2b050529a22c6fa3b8b12220a2083ed2b763bb872e9bc148fb216fd5c93b18819670d9a946ae4b3075672d726b818fe0720fe072a308146d231a7b2051c5f7a9c07ab6e6bfe277bd5f4a94f901fe6ee7a6b6bd8479e9e5e448de4b1b33d5ddd74194c86b385321424aab6f85470ff73e3048c64083a09e980d4cb7f0a88010a14f0f07dc2f5e159a35b9662553c6b4e51868502f712220a202cc140a3f08a9c4149efd45643202f8bef2ad7eecf53e58951c6df6fd932004b18fc0720fc072a3095c286deb3f1657664859d59876bf1ec5a288f6e66e18b37b8a2a1e6ee4a3ef8fa50784d8b758d0c3e70a7cdfe65ab5d32144998f6ef8d999a0f36a851bfa29dbcf0364dd6560a88010a145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f812220a2048e2b2f7d9a3e7b668757d9cc0bbd28cd674c34ed1c2ed75c5de3b6a8f8cad4618f60720f6072a30a4726b542012cc8023ee07b29ab3971cc999d8751bbd16f23413968afcdb070ed66ab47e6e1842bf875bef21dfc5b8af3214668a0acd8f6db5cae959a0e02132f4d6a672c4d70a88010a1455b2b6281b02e991dd9cc790bc1e6cff9db1e2c612220a2057fef603948fe010f4410a27272fcf867287b3d8421eff0afd67a157b6facf3918e90720e9072a30acf60b4cfffda7d6b120cd513bfe39e0392b1a1c433f2bb6ec1fc9200ea8f4d0c44815d4d3872e2c685371f877454284321407e201acb9f7d331a37d52ab7ad246f5c8cd1ac11291010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a0" )); - let result = cometbft_light_block_validation_run(&input, 100_000); - let expected = Err(BscPrecompileError::CometBftApplyBlockFailed.into()); - assert_eq!(result, expected); + let result = cometbft_light_block_validation_run(&input, 100_000, 0); + let output = result.expect("should not return fatal error"); + assert!(output.is_halt()); } // consensus height >= light block height { @@ -422,9 +434,9 @@ mod tests { "0000000000000000000000000000000000000000000000000000000000000264677265656e6669656c645f393030302d3137343100000000000000000000000000000000128d987caf6b801dda578dddfa4da1d5d67fd1b32510db24ec271346fc573e9242b01c9a112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647500000000000003e84202722cf6a34d727be762b46825b0d26b6263a0a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156448e2b2f7d9a3e7b668757d9cc0bbd28cd674c34ed1c2ed75c5de3b6a8f8cad4600000000000003e8668a0acd8f6db5cae959a0e02132f4d6a672c4d7a4726b542012cc8023ee07b29ab3971cc999d8751bbd16f23413968afcdb070ed66ab47e6e1842bf875bef21dfc5b8af6813bfd82860d361e339bd1ae2f801b6d6ee46b8497a3d51c80b50b6160ea1cc00000000000003e80dfa99423d3084c596c5e3bd6bcb4f654516517b8d4786703c56b300b70f085c0d0482e5d6a3c7208883f0ec8abd2de893f71d18e8f919e7ab198499201d87f92c57ebce83ed2b763bb872e9bc148fb216fd5c93b18819670d9a946ae4b3075672d726b800000000000003e824aab6f85470ff73e3048c64083a09e980d4cb7f8146d231a7b2051c5f7a9c07ab6e6bfe277bd5f4a94f901fe6ee7a6b6bd8479e9e5e448de4b1b33d5ddd74194c86b3852cc140a3f08a9c4149efd45643202f8bef2ad7eecf53e58951c6df6fd932004b00000000000003e84998f6ef8d999a0f36a851bfa29dbcf0364dd65695c286deb3f1657664859d59876bf1ec5a288f6e66e18b37b8a2a1e6ee4a3ef8fa50784d8b758d0c3e70a7cdfe65ab5d0ad7080adf030a02080b1214677265656e6669656c645f393030302d3137343118f7fdbd01220c08dca092aa0610e79ba49c012a480a209cda416227712ec137b852d1de0fbb957045e6bf7e541bb595d7f5391b481360122408011220fbb48c3c7cbbe68becfd80e7dcdcee8b8737afdbdc2e484cdc8fd52a659215e932207ddc7495ef0d0c1229ae33348d7907d90459ecccf6dcb3415724b41c0b4d1b7c3a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855422003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce04a2003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce05220eceb4055624b9f678278a2706ca2f43e11f31a641580d5aacf2f4383d8edef7e5a206796260ff3744ac8f8a5007a23408c72abe018d65df767b71290aac5da68d5ba6220694a73ea799423215418f2390a3f56f23b31391fbbab0de7a8f5b3c4822257906a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85572144b7d2bc2f5c3381c9bbf55edface8747722bc9d07a4050a45d04cd3d64ee8bc00bd5842e8ee2458001e0dcb6fc78bb1f44271ebca04ea65c689c6776582962c27492a5850e80a919a98d889d21ecfa83c54f15c4de0812f20408f7fdbd011a480a202585ab3a1bc673b3c68cc77e08b8190667641f30edffa89ae5ddfc2e1f53d60b122408011220c55ae2ca75b9705b4a486067b088c275919a6c3fc2de51cf09973232457a16042268080212144b7d2bc2f5c3381c9bbf55edface8747722bc9d01a0c08dea092aa0610eca4d6a6012240243914b3cf5be06bc69a6c34f2fc41928c1043b5a7d1bff80fd567b27398c3ce890be932958ec0d2a2083c393afbd4c75776ce84c881ec58a73b1022fcb63a0a226808031214793cee4b478e537592c40ecfb2148ebe32b8f6051a0c08dea092aa0610dcdbcfd701224000c586fe47dc655b38e7f62c913f4dd217ce16fa143e9295e146918ad361c2ed777512de15ed65eefb479864a89eebe55e38ebb8644a3887f46970bda9472203226808031214d742fa5318dc3986e075e2b050529a22c6fa3b8b1a0c08dea092aa0610ec9dd2d701224007e0f3e5a3d209a75c5db60f1502880cf25c5fddad0717e4ecaa8bbd95ebf28e78ea3229e88d741a44d534f08ac283dc587a28ced5c25b9cc64657a5bc5ce50c226808031214f0f07dc2f5e159a35b9662553c6b4e51868502f71a0c08dea092aa0610b7c186d7012240546fbdcc448af86aa932a05d8db2e4bc99816b7035b00c494ffe514d562190a68c214e5468c16d7d3a8c2fa52a6165ce870f8fc2dd93fa7cee40f3fa74e118082268080312145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f81a0c08dea092aa0610f2d4efd50122400fe7c2eb23f4e2b6e57722c79ead12b2180e87bc618fc26cceccb891107be796fe8242c700fb61eeac6936659503354dc1a66874725b80f316252820e308d90f220f08011a0b088092b8c398feffffff0112df070a91010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a00a88010a14793cee4b478e537592c40ecfb2148ebe32b8f60512220a206813bfd82860d361e339bd1ae2f801b6d6ee46b8497a3d51c80b50b6160ea1cc1889082089082a308d4786703c56b300b70f085c0d0482e5d6a3c7208883f0ec8abd2de893f71d18e8f919e7ab198499201d87f92c57ebce32140dfa99423d3084c596c5e3bd6bcb4f654516517b0a88010a14d742fa5318dc3986e075e2b050529a22c6fa3b8b12220a2083ed2b763bb872e9bc148fb216fd5c93b18819670d9a946ae4b3075672d726b818fe0720fe072a308146d231a7b2051c5f7a9c07ab6e6bfe277bd5f4a94f901fe6ee7a6b6bd8479e9e5e448de4b1b33d5ddd74194c86b385321424aab6f85470ff73e3048c64083a09e980d4cb7f0a88010a14f0f07dc2f5e159a35b9662553c6b4e51868502f712220a202cc140a3f08a9c4149efd45643202f8bef2ad7eecf53e58951c6df6fd932004b18fc0720fc072a3095c286deb3f1657664859d59876bf1ec5a288f6e66e18b37b8a2a1e6ee4a3ef8fa50784d8b758d0c3e70a7cdfe65ab5d32144998f6ef8d999a0f36a851bfa29dbcf0364dd6560a88010a145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f812220a2048e2b2f7d9a3e7b668757d9cc0bbd28cd674c34ed1c2ed75c5de3b6a8f8cad4618f60720f6072a30a4726b542012cc8023ee07b29ab3971cc999d8751bbd16f23413968afcdb070ed66ab47e6e1842bf875bef21dfc5b8af3214668a0acd8f6db5cae959a0e02132f4d6a672c4d70a88010a1455b2b6281b02e991dd9cc790bc1e6cff9db1e2c612220a2057fef603948fe010f4410a27272fcf867287b3d8421eff0afd67a157b6facf3918e90720e9072a30acf60b4cfffda7d6b120cd513bfe39e0392b1a1c433f2bb6ec1fc9200ea8f4d0c44815d4d3872e2c685371f877454284321407e201acb9f7d331a37d52ab7ad246f5c8cd1ac11291010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a0" )); - let result = cometbft_light_block_validation_run(&input, 100_000); - let expected = Err(BscPrecompileError::InvalidInput.into()); - assert_eq!(result, expected); + let result = cometbft_light_block_validation_run(&input, 100_000, 0); + let output = result.expect("should not return fatal error"); + assert!(output.is_halt()); } // chain id mismatch { @@ -432,9 +444,9 @@ mod tests { "00000000000000000000000000000000000000000000000000000000000004ec677265656e6669656c645f353630302d31000000000000000000000000000000000000000000000001c6ca63d82177ae8b4f8533bec2d4dc45a34ba3a49b720545ca48e8c6ea829a33e043df137dfc0ea134be6fae019c746c7e92bbac1641e0752557f1d30306881300000000000003e82fcbd94e02d0de3e58a4cd20dd545340b9ce990a8a9910093c8c5da624dc842eb31117b548609680bae2d1940743256c121e397ff8ead4f5582910bf329c9406ac2d83186a6ae749f288a4ce711186d2606bf4e18ae3c06fbd560d0bd2fd8ab532486e3300000000000003e8b6202c3a1620e48b9458ed75b533f37ace46398fac693b30853e3a5fa3ea18d1df5c41e94f0060cb4ecf5f3483528c525ed317d5f3441adb984431556f5d2202bf77586940affc7c57c8bf533c80569e4874de92cd406468c62b14812bbe99f3e0a14e6d00000000000003e81eb931cc754eefb3ebda912fb3bb67b32b64c1a89469c75de5a4dde7ecd8de85f1ba5acee07454cb900585354a2fda279dd115c8946dffddee2e48234e10dd785fdd7f182c6de7b46dbe53aecafcbda7c7439b6a851d9933ee8963a08335bbacd8ef710500000000000003e8bacea9f5f6f5521afc9a4d9245432f4074ce67c38de9dac5bccbfef36c3d78d743fa36c06d2ade58cfecaa8903770d7793a4bf8e9e705b4b6daf7a10b29d1190b0eef5c5ceeecd09ea4f481b37562e25264de176566582032d4c7912945fd43ae5c7f82e00000000000003e85379299a1a093c824c70629894620050ac18798e90242b34c53205728de8e81ef36b17d0e49b30f039d9c224f952410ad9a9fe1d07a001e60e92070f4082875070a4a0b688c92507b2ce3f073fe1169345544501ee11b5e495b4b2c230db9cfb25cad2de00000000000003e896931f9918e930d3e48c77aaa479349805dbcdcd85a874ce490ea46e3ed8883544496c8852de074094185ad5d881df95df71287c7a837da79b9e4e2aa5cee0d23ccff22fe17d86788d73a0d4af8a9b63d9b2b7c3bc8c3ba81871e4ba3f77be43aa8510b600000000000003e8cbe5cd96be693071413f313cc76bf085eed1806ab3f99d1a867d6710e5a9227009d45568b4a34e0355594c85d1f7330c10b706301127c39e130f02e53789e511147f550786125621c641b3344c7aa286673073cc72abac17790545ea2770f5e8be04b15500000000000003e830db54e9bd6c32580b3f01256e9ecbf97a2ea57191ef0170f22bbc666291be47e2b4ce933ceb3a4a547794ebe12097152c750068a32afeff9cfb32d89cc597e27dd6e0f20bcc4c8635134d01c17590af47838723d8246bf005ff6e74155b0a8671c1bdee00000000000003e8ebfc660e51646a77b37731c31dd46fa5ca92671eb0224a76a44eb32d778421d39726aebd29ceac9ab368aafdb51e7c19bdbf46b7e17a3f372c9b0ee842f5b37e683c47d697aa82c1183da679f69c741da4509f94490a364132958a1f0356967e6d73183300000000000003e80c2201ebc288e539dcbc8221652c719f3ee2edb38d3293a19d0e86b79ad6b5eb5bf50ca2361e5e68338db543de2551b4e1d3f48ba0e75586a5ab394b8d739ebdfd548f0a11fb80525fbe947284e9415615b58725e55876a00f0ee1d20b8b0e70dcde5bce00000000000003e8aeee47645498286d615b8850764f55985b8a643ea8c70c061865d6307e34bfd26e9b61bdcc0ae35f6cacc04eaa766f4b76ec354b99cd62fdb599e62a6cfe1e652ddf83500ad7080adf030a02080b1214677265656e6669656c645f393030302d3137343118f7fdbd01220c08dca092aa0610e79ba49c012a480a209cda416227712ec137b852d1de0fbb957045e6bf7e541bb595d7f5391b481360122408011220fbb48c3c7cbbe68becfd80e7dcdcee8b8737afdbdc2e484cdc8fd52a659215e932207ddc7495ef0d0c1229ae33348d7907d90459ecccf6dcb3415724b41c0b4d1b7c3a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855422003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce04a2003ebb95f12cb304c52484a0821ba13f4e73468f3139f45e168f8c11d9ba74ce05220eceb4055624b9f678278a2706ca2f43e11f31a641580d5aacf2f4383d8edef7e5a206796260ff3744ac8f8a5007a23408c72abe018d65df767b71290aac5da68d5ba6220694a73ea799423215418f2390a3f56f23b31391fbbab0de7a8f5b3c4822257906a20e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85572144b7d2bc2f5c3381c9bbf55edface8747722bc9d07a4050a45d04cd3d64ee8bc00bd5842e8ee2458001e0dcb6fc78bb1f44271ebca04ea65c689c6776582962c27492a5850e80a919a98d889d21ecfa83c54f15c4de0812f20408f7fdbd011a480a202585ab3a1bc673b3c68cc77e08b8190667641f30edffa89ae5ddfc2e1f53d60b122408011220c55ae2ca75b9705b4a486067b088c275919a6c3fc2de51cf09973232457a16042268080212144b7d2bc2f5c3381c9bbf55edface8747722bc9d01a0c08dea092aa0610eca4d6a6012240243914b3cf5be06bc69a6c34f2fc41928c1043b5a7d1bff80fd567b27398c3ce890be932958ec0d2a2083c393afbd4c75776ce84c881ec58a73b1022fcb63a0a226808031214793cee4b478e537592c40ecfb2148ebe32b8f6051a0c08dea092aa0610dcdbcfd701224000c586fe47dc655b38e7f62c913f4dd217ce16fa143e9295e146918ad361c2ed777512de15ed65eefb479864a89eebe55e38ebb8644a3887f46970bda9472203226808031214d742fa5318dc3986e075e2b050529a22c6fa3b8b1a0c08dea092aa0610ec9dd2d701224007e0f3e5a3d209a75c5db60f1502880cf25c5fddad0717e4ecaa8bbd95ebf28e78ea3229e88d741a44d534f08ac283dc587a28ced5c25b9cc64657a5bc5ce50c226808031214f0f07dc2f5e159a35b9662553c6b4e51868502f71a0c08dea092aa0610b7c186d7012240546fbdcc448af86aa932a05d8db2e4bc99816b7035b00c494ffe514d562190a68c214e5468c16d7d3a8c2fa52a6165ce870f8fc2dd93fa7cee40f3fa74e118082268080312145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f81a0c08dea092aa0610f2d4efd50122400fe7c2eb23f4e2b6e57722c79ead12b2180e87bc618fc26cceccb891107be796fe8242c700fb61eeac6936659503354dc1a66874725b80f316252820e308d90f220f08011a0b088092b8c398feffffff0112df070a91010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a00a88010a14793cee4b478e537592c40ecfb2148ebe32b8f60512220a206813bfd82860d361e339bd1ae2f801b6d6ee46b8497a3d51c80b50b6160ea1cc1889082089082a308d4786703c56b300b70f085c0d0482e5d6a3c7208883f0ec8abd2de893f71d18e8f919e7ab198499201d87f92c57ebce32140dfa99423d3084c596c5e3bd6bcb4f654516517b0a88010a14d742fa5318dc3986e075e2b050529a22c6fa3b8b12220a2083ed2b763bb872e9bc148fb216fd5c93b18819670d9a946ae4b3075672d726b818fe0720fe072a308146d231a7b2051c5f7a9c07ab6e6bfe277bd5f4a94f901fe6ee7a6b6bd8479e9e5e448de4b1b33d5ddd74194c86b385321424aab6f85470ff73e3048c64083a09e980d4cb7f0a88010a14f0f07dc2f5e159a35b9662553c6b4e51868502f712220a202cc140a3f08a9c4149efd45643202f8bef2ad7eecf53e58951c6df6fd932004b18fc0720fc072a3095c286deb3f1657664859d59876bf1ec5a288f6e66e18b37b8a2a1e6ee4a3ef8fa50784d8b758d0c3e70a7cdfe65ab5d32144998f6ef8d999a0f36a851bfa29dbcf0364dd6560a88010a145fa8b3f3fcd4a3ea2495e11dd5dbd399b3d8d4f812220a2048e2b2f7d9a3e7b668757d9cc0bbd28cd674c34ed1c2ed75c5de3b6a8f8cad4618f60720f6072a30a4726b542012cc8023ee07b29ab3971cc999d8751bbd16f23413968afcdb070ed66ab47e6e1842bf875bef21dfc5b8af3214668a0acd8f6db5cae959a0e02132f4d6a672c4d70a88010a1455b2b6281b02e991dd9cc790bc1e6cff9db1e2c612220a2057fef603948fe010f4410a27272fcf867287b3d8421eff0afd67a157b6facf3918e90720e9072a30acf60b4cfffda7d6b120cd513bfe39e0392b1a1c433f2bb6ec1fc9200ea8f4d0c44815d4d3872e2c685371f877454284321407e201acb9f7d331a37d52ab7ad246f5c8cd1ac11291010a144b7d2bc2f5c3381c9bbf55edface8747722bc9d012220a20112b51dda2d336246bdc0cc51407ba0cb0e5087be0db5f1cdc3285bbaa8e647518d0ca1e209ed8ffffffffffffff012a30a9355ebf3c24bedac5a357a56feeb2cd8b6fed9f14cca15c3091f523b9fb21183b4bb31eb482a0321885e3f57072156432144202722cf6a34d727be762b46825b0d26b6263a0" )); - let result = cometbft_light_block_validation_run(&input, 100_000); - let expected = Err(BscPrecompileError::InvalidInput.into()); - assert_eq!(result, expected); + let result = cometbft_light_block_validation_run(&input, 100_000, 0); + let output = result.expect("should not return fatal error"); + assert!(output.is_halt()); } } @@ -683,13 +695,10 @@ mod tests { "000000000000000000000000000000000000000000000000000000000000018c677265656e6669656c645f393030302d3132310000000000000000000000000000000000000000023c350cd55b99dc6c2b7da9bef5410fbfb869fede858e7b95bf7ca294e228bb40e33f6e876d63791ebd05ff617a1b4f4ad1aa2ce65e3c3a9cdfb33e0ffa7e8423000000000098968015154514f68ce65a0d9eecc578c0ab12da0a2a28a0805521b5b7ae56eb3fb24555efbfe59e1622bfe9f7be8c9022e9b3f2442739c1ce870b9adee169afe60f674edd7c86451c5363d89052fde8351895eeea166ce5373c36e31b518ed191d0c599aa0f5b0000000000989680432f6c4908a9aa5f3444421f466b11645235c99b831b2a2de9e504d7ea299e52a202ce529808618eb3bfc0addf13d8c5f2df821d81e18f9bc61583510b322d067d46323b0a572635c06a049c0a2a929e3c8184a50cf6a8b95708c25834ade456f399015a0000000000989680864cb9828254d712f8e59b164fc6a9402dc4e6c59065e38cff24f5323c8c5da888a0f97e5ee4ba1e11b0674b0a0d06204c1dfa247c370cd4be3e799fc4f6f48d977ac7ca" )); - let result = cometbft_light_block_validation_run_before_hertz(&input, 100_000); - let PrecompileOutput { gas_used, bytes, reverted, .. } = match result { - Ok(output) => output, - Err(_) => panic!("cometbft_light_block_validation_run failed"), - }; - assert_eq!(gas_used, 3_000); - assert_eq!(bytes, except_output_after_hertz); - assert!(!reverted); + let result = cometbft_light_block_validation_run_before_hertz(&input, 100_000, 0); + let output = result.expect("cometbft_light_block_validation_run failed"); + assert_eq!(output.gas_used, 3_000); + assert_eq!(output.bytes, except_output_after_hertz); + assert!(output.is_success()); } } diff --git a/src/evm/precompiles/double_sign.rs b/src/evm/precompiles/double_sign.rs index 86ca0226..61049cf2 100644 --- a/src/evm/precompiles/double_sign.rs +++ b/src/evm/precompiles/double_sign.rs @@ -5,7 +5,7 @@ use alloy_primitives::{keccak256, BlockNumber, Bytes, ChainId, B256, B512, U256} use alloy_rlp::{Decodable, RlpDecodable, RlpEncodable}; use core::cmp::Ordering; use revm::precompile::{ - secp256k1, u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, + secp256k1, u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use std::borrow::Cow; @@ -74,15 +74,15 @@ pub(crate) struct SealContent { /// signer address| evidence height| /// /// 20 bytes | 32 bytes | -fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResult { +fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { const DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE: u64 = 10_000; if DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } let revert = || { - Ok(PrecompileOutput::new_reverted(DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE, Default::default())) + Ok(PrecompileOutput::revert(DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE, Default::default(), reservoir)) }; let Ok(evidence) = DoubleSignEvidence::decode(&mut input.iter().as_ref()) else { @@ -95,23 +95,23 @@ fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64) -> Precompi // basic check if header1.number.to_be_bytes().len() > 32 || header2.number.to_be_bytes().len() > 32 { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } if header1.number != header2.number { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } if header1.parent_hash.cmp(&header2.parent_hash) != Ordering::Equal { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } if header1.extra.len() < EXTRA_SEAL_LENGTH || header2.extra.len() < EXTRA_SEAL_LENGTH { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } let sig1 = &header1.extra[header1.extra.len() - EXTRA_SEAL_LENGTH..]; let sig2 = &header2.extra[header2.extra.len() - EXTRA_SEAL_LENGTH..]; if sig1.eq(sig2) { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } // check signature @@ -119,7 +119,7 @@ fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64) -> Precompi let msg_hash2 = seal_hash(&header2, evidence.chain_id); if msg_hash1.eq(&msg_hash2) { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } let recid1 = sig1[64]; @@ -131,7 +131,7 @@ fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64) -> Precompi let Ok(addr2) = secp256k1::ecrecover(sig2, recid2, &msg_hash2) else { return revert() }; if !addr1.eq(&addr2) { - return Err(BscPrecompileError::DoubleSignInvalidEvidence.into()); + return Ok(PrecompileOutput::halt(BscPrecompileError::DoubleSignInvalidEvidence.into(), reservoir)); } let mut res = [0; 52]; @@ -139,7 +139,7 @@ fn double_sign_evidence_validation_run(input: &[u8], gas_limit: u64) -> Precompi res[..20].clone_from_slice(signer); res[52 - header1.number.to_be_bytes().len()..].clone_from_slice(&header1.number.to_be_bytes()); - Ok(PrecompileOutput::new(DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE, Bytes::copy_from_slice(&res))) + Ok(PrecompileOutput::new(DOUBLE_SIGN_EVIDENCE_VALIDATION_BASE, Bytes::copy_from_slice(&res), reservoir)) } fn seal_hash(header: &Header, chain_id: ChainId) -> B256 { @@ -175,7 +175,7 @@ mod tests { fn test_double_sign_evidence_validation_run() { let input = hex::decode("f906278202cab9030ff9030ca01062d3d5015b9242bc193a9b0769f3d3780ecb55f97f40a752ae26d0b68cd0d8a0fae1a05fcb14bfd9b8a9f2b65007a9b6c2000de0627a73be644dd993d32342c494976ea74026e726554db657fa54763abd0c3a0aa9a0f385cc58ed297ff0d66eb5580b02853d3478ba418b1819ac659ee05df49b9794a0bf88464af369ed6b8cf02db00f0b9556ffa8d49cd491b00952a7f83431446638a00a6d0870e586a76278fbfdcedf76ef6679af18fc1f9137cfad495f434974ea81b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001820cdf830f4240830f4240846555fa64b90111d983010301846765746888676f312e32302e378664617277696e00007abd731ef8ae07b86091cb8836d58f5444b883422a18825d899035d3e6ea39ad1a50069bf0b86da8b5573dde1cb4a0a34f19ce94e0ef78ff7518c80265b8a3ca56e3c60167523590d4e8dcc324900559465fc0fa403774096614e135de280949b58a45cc96f2ba9e17f848820d41a08429d0d8b33ee72a84f750fefea846cbca54e487129c7961c680bb72309ca888820d42a08c9db14d938b19f9e2261bbeca2679945462be2b58103dfff73665d0d150fb8a804ae755e0fe64b59753f4db6308a1f679747bce186aa2c62b95fa6eeff3fbd08f3b0667e45428a54ade15bad19f49641c499b431b36f65803ea71b379e6b61de501a0232c9ba2d41b40d36ed794c306747bcbc49bf61a0f37409c18bfe2b5bef26a2d880000000000000000b9030ff9030ca01062d3d5015b9242bc193a9b0769f3d3780ecb55f97f40a752ae26d0b68cd0d8a0b2789a5357827ed838335283e15c4dcc42b9bebcbf2919a18613246787e2f96094976ea74026e726554db657fa54763abd0c3a0aa9a071ce4c09ee275206013f0063761bc19c93c13990582f918cc57333634c94ce89a00e095703e5c9b149f253fe89697230029e32484a410b4b1f2c61442d73c3095aa0d317ae19ede7c8a2d3ac9ef98735b049bcb7278d12f48c42b924538b60a25e12b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001820cdf830f4240830f4240846555fa64b90111d983010301846765746888676f312e32302e378664617277696e00007abd731ef8ae07b86091cb8836d58f5444b883422a18825d899035d3e6ea39ad1a50069bf0b86da8b5573dde1cb4a0a34f19ce94e0ef78ff7518c80265b8a3ca56e3c60167523590d4e8dcc324900559465fc0fa403774096614e135de280949b58a45cc96f2ba9e17f848820d41a08429d0d8b33ee72a84f750fefea846cbca54e487129c7961c680bb72309ca888820d42a08c9db14d938b19f9e2261bbeca2679945462be2b58103dfff73665d0d150fb8a80c0b17bfe88534296ff064cb7156548f6deba2d6310d5044ed6485f087dc6ef232e051c28e1909c2b50a3b4f29345d66681c319bef653e52e5d746480d5a3983b00a0b56228685be711834d0f154292d07826dea42a0fad3e4f56c31470b7fbfbea26880000000000000000").unwrap(); - let res = double_sign_evidence_validation_run(&Bytes::from(input), 10_000).unwrap(); + let res = double_sign_evidence_validation_run(&Bytes::from(input), 10_000, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 10_000u64); @@ -222,20 +222,19 @@ mod tests { let input = alloy_rlp::encode(evidence); // Run validation - let result = double_sign_evidence_validation_run(&input, 10_000); + let result = double_sign_evidence_validation_run(&input, 10_000, 0); - // Should return DoubleSignInvalidEvidence error - assert!(matches!( - result, - Err(PrecompileError::Other(s)) if s == "double sign invalid evidence" - )); + // Should return DoubleSignInvalidEvidence halt + let output = result.expect("should not return fatal error"); + assert!(output.is_halt()); + assert!(matches!(output.halt_reason(), Some(PrecompileHalt::Other(s)) if s == "double sign invalid evidence")); } #[test] fn test_double_sign_evidence_validation_run_invalid_evidence() { let input = hex::decode("f9066b38b90332f9032fa01062d3d5015b9242bc193a9b0769f3d3780ecb55f97f40a752ae26d0b68cd0d8a0fae1a05fcb14bfd9b8a9f2b65007a9b6c2000de0627a73be644dd993d32342c494df87f0e2b8519ea2dd4abd8b639cdd628497ed25a0f385cc58ed297ff0d66eb5580b02853d3478ba418b1819ac659ee05df49b9794a0bf88464af369ed6b8cf02db00f0b9556ffa8d49cd491b00952a7f83431446638a00a6d0870e586a76278fbfdcedf76ef6679af18fc1f9137cfad495f434974ea81b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a1010000000000000000000000000000000000000000000000000000000000000000830f4240830f42408465bc6996b90115d983010306846765746889676f312e32302e3131856c696e7578000053474aa9f8b25fb860b0844a5082bfaa2299d2a23f076e2f6b17b15f839cc3e7d5a875656f6733fd4b87ba3401f906d15f3dea263cd9a6076107c7db620a4630dd3832c4a4b57eb8f497e28a3d69e5c03b30205c4b45675747d513e1accd66329770f3c35b18c9d023f84c84023a5ad6a086a28d985d9a6c8e7f9a4feadd5ace0adba9818e1e1727edca755fcc0bd8344684023a5ad7a0bc3492196b2e68b8e6ceea87cfa7588b4d590089eb885c4f2c1e9d9fb450f7b980988e1b9d0beb91dab063e04879a24c43d33baae3759dee41fd62ffa83c77fd202bea27a829b49e8025bdd198393526dd12b223ab16052fd26a43f3aabf63e76901a0232c9ba2d41b40d36ed794c306747bcbc49bf61a0f37409c18bfe2b5bef26a2d880000000000000000b90332f9032fa01062d3d5015b9242bc193a9b0769f3d3780ecb55f97f40a752ae26d0b68cd0d8a0b2789a5357827ed838335283e15c4dcc42b9bebcbf2919a18613246787e2f96094df87f0e2b8519ea2dd4abd8b639cdd628497ed25a071ce4c09ee275206013f0063761bc19c93c13990582f918cc57333634c94ce89a00e095703e5c9b149f253fe89697230029e32484a410b4b1f2c61442d73c3095aa0d317ae19ede7c8a2d3ac9ef98735b049bcb7278d12f48c42b924538b60a25e12b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a1010000000000000000000000000000000000000000000000000000000000000000830f4240830f42408465bc6996b90115d983010306846765746889676f312e32302e3131856c696e7578000053474aa9f8b25fb860b0844a5082bfaa2299d2a23f076e2f6b17b15f839cc3e7d5a875656f6733fd4b87ba3401f906d15f3dea263cd9a6076107c7db620a4630dd3832c4a4b57eb8f497e28a3d69e5c03b30205c4b45675747d513e1accd66329770f3c35b18c9d023f84c84023a5ad6a086a28d985d9a6c8e7f9a4feadd5ace0adba9818e1e1727edca755fcc0bd8344684023a5ad7a0bc3492196b2e68b8e6ceea87cfa7588b4d590089eb885c4f2c1e9d9fb450f7b9804c71ed015dd0c5c2d7393b68c2927f83f0a5da4c66f761f09e2f950cc610832c7876144599368404096ddef0eadacfde57717e2c7d23982b927285b797d41bfa00a0b56228685be711834d0f154292d07826dea42a0fad3e4f56c31470b7fbfbea26880000000000000000").unwrap(); - let res = double_sign_evidence_validation_run(&Bytes::from(input), 10_000); - assert_eq!(res, Ok(PrecompileOutput::new_reverted(10_000, Default::default()))); + let res = double_sign_evidence_validation_run(&Bytes::from(input), 10_000, 0); + assert_eq!(res, Ok(PrecompileOutput::revert(10_000, Default::default(), 0))); } } diff --git a/src/evm/precompiles/error.rs b/src/evm/precompiles/error.rs index 24d2e902..0f333ad0 100644 --- a/src/evm/precompiles/error.rs +++ b/src/evm/precompiles/error.rs @@ -1,4 +1,5 @@ -use revm::precompile::PrecompileError; +use std::borrow::Cow; +use revm::precompile::PrecompileHalt; /// BSC specific precompile errors. #[derive(Debug, PartialEq)] @@ -13,18 +14,18 @@ pub enum BscPrecompileError { DoubleSignInvalidEvidence, } -impl From for PrecompileError { +impl From for PrecompileHalt { fn from(error: BscPrecompileError) -> Self { match error { - BscPrecompileError::InvalidInput => PrecompileError::Other("invalid input".into()), + BscPrecompileError::InvalidInput => PrecompileHalt::Other(Cow::Borrowed("invalid input")), BscPrecompileError::CometBftApplyBlockFailed => { - PrecompileError::Other("apply block failed".into()) + PrecompileHalt::Other(Cow::Borrowed("apply block failed")) } BscPrecompileError::CometBftEncodeConsensusStateFailed => { - PrecompileError::Other("encode consensus state failed".into()) + PrecompileHalt::Other(Cow::Borrowed("encode consensus state failed")) } BscPrecompileError::DoubleSignInvalidEvidence => { - PrecompileError::Other("double sign invalid evidence".into()) + PrecompileHalt::Other(Cow::Borrowed("double sign invalid evidence")) } } } diff --git a/src/evm/precompiles/iavl.rs b/src/evm/precompiles/iavl.rs index 82d0108d..4879fc75 100644 --- a/src/evm/precompiles/iavl.rs +++ b/src/evm/precompiles/iavl.rs @@ -1,7 +1,7 @@ use alloy_primitives::Bytes; use parity_bytes::BytesRef; use revm::precompile::{ - u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, + u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use std::borrow::Cow; use tendermint::lite::iavl_proof; @@ -27,34 +27,35 @@ pub(crate) const IAVL_PROOF_VALIDATION_PLATO: Precompile = Precompile::new(PrecompileId::Custom(Cow::Borrowed("IAVL_MERKLE_PROOF_VALIDATE_PLATO")), u64_to_address(101), iavl_proof_validation_run_plato); /// Run Iavl proof validation. -fn iavl_proof_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResult { - iavl_proof_validation_run_inner(input, gas_limit, false, false, false) +fn iavl_proof_validation_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + iavl_proof_validation_run_inner(input, gas_limit, reservoir, false, false, false) } /// Run Iavl proof validation with Nano hardfork. -fn iavl_proof_validation_run_nano(_input: &[u8], _gas_limit: u64) -> PrecompileResult { - Err(PrecompileError::other("suspended")) +fn iavl_proof_validation_run_nano(_input: &[u8], _gas_limit: u64, reservoir: u64) -> PrecompileResult { + Ok(PrecompileOutput::halt(PrecompileHalt::other("suspended"), reservoir)) } /// Run Iavl proof validation with Moran hardfork. -fn iavl_proof_validation_run_moran(input: &[u8], gas_limit: u64) -> PrecompileResult { - iavl_proof_validation_run_inner(input, gas_limit, true, false, false) +fn iavl_proof_validation_run_moran(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + iavl_proof_validation_run_inner(input, gas_limit, reservoir, true, false, false) } /// Run Iavl proof validation with Planck hardfork. -fn iavl_proof_validation_run_planck(input: &[u8], gas_limit: u64) -> PrecompileResult { - iavl_proof_validation_run_inner(input, gas_limit, false, true, false) +fn iavl_proof_validation_run_planck(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + iavl_proof_validation_run_inner(input, gas_limit, reservoir, false, true, false) } /// Run Iavl proof validation with Plato hardfork. -fn iavl_proof_validation_run_plato(input: &[u8], gas_limit: u64) -> PrecompileResult { - iavl_proof_validation_run_inner(input, gas_limit, false, false, true) +fn iavl_proof_validation_run_plato(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + iavl_proof_validation_run_inner(input, gas_limit, reservoir, false, false, true) } /// Run Iavl proof validation with given hardfork toggles. fn iavl_proof_validation_run_inner( input: &[u8], gas_limit: u64, + reservoir: u64, is_moran: bool, is_planck: bool, is_plato: bool, @@ -62,7 +63,7 @@ fn iavl_proof_validation_run_inner( const IAVL_PROOF_VALIDATION_BASE: u64 = 3_000; if IAVL_PROOF_VALIDATION_BASE > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } let mut output = [0u8; 32]; @@ -72,8 +73,9 @@ fn iavl_proof_validation_run_inner( Ok(()) => Ok(PrecompileOutput::new( IAVL_PROOF_VALIDATION_BASE, Bytes::copy_from_slice(&output[..]), + reservoir, )), - Err(str) => Err(PrecompileError::other(str)), + Err(str) => Ok(PrecompileOutput::halt(PrecompileHalt::other(str), reservoir)), } } @@ -86,7 +88,7 @@ mod tests { #[test] fn test_iavl_proof_validation_run() { let input = hex::decode("00000000000000000000000000000000000000000000000000000000000007306163630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d000000000000000000000000000000000000000000000000000000000000007b4bdc4c270a750a148a4e2eb018bdf98a8f53ec755740ffc728637a1d12110a0941544348412d3733301080f69bf321120b0a03424e4210e8baeb8d44120f0a075050432d303041108094ebdc031a26eb5ae98721031c199c92e5b0080967da99be27cf2da53317441b4a663e6d9c6caf02be1fdbdc20d7962b28152c69c314b4de5c8035253c8bc0771d9ca17b1b23a57c0c6d068b57579791cae20add070a066961766c3a76121c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d1ab407b2070aaf070a2d081810cdfd2b188096a82222209f223f804e2d94ac51c4321b0687397012e6d95eb9783b03bc790da631004c7c0a2d081710adb31a18f395a8222a20d2a38865de82383ccce0140513b65cec1bf2ae6cd7dfeb22eb6faadb4e26b26f0a2d081510b2990b18f395a82222208a02bbd5a695dfc772627ac8744aa9cf30ae26575bdce8c96a9a0d0999175b430a2d081410e6ff0418f395a8222a20d39619c779be909e67f23499fb74eb2c19afd7f21523401d4ccf7e917db5cd600a2d081210e3fe0118f395a8222a20a10cc73843f889d9e03a463eb135e928bb980e19734344cba0fbf4e8a4c5258b0a2c081010dd6518f395a8222a2007fd15843a2fd3f58d021b0e072a6c70742d7a3d993a922445e3491e1c14ee8e0a2c080f10cc2a18eda6a7222a20088942d7b30abd021d8e9505cc41313fad87c8c10a799f3b51018b7b2cfe4ad90a2c080d10b70d18eda6a7222a2091a37bc44d0c61e3752ddc59eb390355ab65e8a9fb453be4f0acec537f1ca14f0a2c080c10890818eda6a72222201cfc317855a06667c45812fe36efe33af05671dfe0d9b56b02662011af2e79e30a2c080b10ac0318c4b0ee212220aeb454a4b3243b6269a2fd8841dca9a951c53b30f1e27da91063dae7224402c70a2c080910e40118c4b0ee212a20441340a4de6498f861b97b3f3ad9603af055e5af51a0d96fff2ae28e3c5c6c9a0a2c0808108d0118c4b0ee212220ae32ea4b9ab7b53571da320e2815fd8b2c278124961cca4a1849a799842424450a2b0807104d18c4b0ee212220e2804c9b7f045ec0b4ab20920a937b82fda8b7a9ddd12b21637335b915cfda550a2b0806102418a5f4c7192a20ec85f22addedfc82c771af5b4c77544b7c1d7c5bbac33f2712dfba1045ebdbd00a2b0805101118a5f4c7192a2071ade34dcc447a0ba8adc603080633d15c06f3525830c86ebce35eca0a4921fc0a2b0804100c18a5f4c7192a205190bce93993e65b266a3417ed511df8897a812cb4b62569e5afcfbec10b69cd0a2b0803100618a5f4c7192220b76c6884f1d412ac10bfb3987fb7d26f0330b2a85539509ebc5c6bdec2f95d520a2b0802100418a5f4c71922206a285b4a4f9d1c687bbafa1f3649b6a6e32b1a85dd0402421210683e846cf0020a2b0801100218a5f4c7192220033b3f7c6dcb258b6e55545e7a4f51539447cd595eb8a2e373ba0015502da1051a450a1c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d12201a272295e94cf1d8090bdb019dde48e9dab026ad2c3e43aaa7e61cc954a9245d18a5f4c7190ab6040a0a6d756c746973746f726512036163631aa204a0040a9d040a300a0364657812290a27088496a822122038fc49f49648fec62acc434151a51eaa378c1b20a730a749548e36f1529422500a300a03676f7612290a27088496a8221220a78ce489bdf08b9ee869c184876e1623dc38b3e64a5cf1a0005f97976c64deac0a380a0b61746f6d69635f7377617012290a27088496a8221220544c2fa38f61e10a39ec00b3e724d5834761268bb455cdbf5843bcf1531f8fbc0a300a0376616c12290a27088496a82212201f71082c9f6f45fb456b2c00b41e50d2f662f2dfec3cb6965f19d214bf02f3980a0f0a046d61696e12070a05088496a8220a320a057374616b6512290a27088496a82212200dd467343c718f240e50b4feac42970fc8c1c69a018be955f9c27913ac1f8b3c0a300a0361636312290a27088496a8221220270c19ccc9c40c5176b3dfbd8af734c97a307e0dbd8df9e286dcd5d709f973ed0a330a06746f6b656e7312290a27088496a8221220c4f96eedf50c83964de9df013afec2e545012d92528b643a5166c828774187b60a320a05706169727312290a27088496a8221220351c55cfda84596ecd22ebc77013662aba97f81f19d9ef3d150213bb07c823060a360a0974696d655f6c6f636b12290a27088496a8221220e7adf5bd30ce022decf0e9341bf05c464ed70cdbc97423bd2bab8f3571e5179b0a330a06706172616d7312290a27088496a822122042a9dfc356ca435db131eb41fb1975c8482f2434537918665e530b0b4633b5f9").unwrap(); - let res = iavl_proof_validation_run(&Bytes::from(input), 3_000u64).unwrap(); + let res = iavl_proof_validation_run(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); @@ -98,7 +100,7 @@ mod tests { #[test] fn test_iavl_proof_validation_run_moran() { let input = hex::decode("00000000000000000000000000000000000000000000000000000000000007306163630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d000000000000000000000000000000000000000000000000000000000000007b4bdc4c270a750a148a4e2eb018bdf98a8f53ec755740ffc728637a1d12110a0941544348412d3733301080f69bf321120b0a03424e4210e8baeb8d44120f0a075050432d303041108094ebdc031a26eb5ae98721031c199c92e5b0080967da99be27cf2da53317441b4a663e6d9c6caf02be1fdbdc20d7962b28152c69c314b4de5c8035253c8bc0771d9ca17b1b23a57c0c6d068b57579791cae20add070a066961766c3a76121c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d1ab407b2070aaf070a2d081810cdfd2b188096a82222209f223f804e2d94ac51c4321b0687397012e6d95eb9783b03bc790da631004c7c0a2d081710adb31a18f395a8222a20d2a38865de82383ccce0140513b65cec1bf2ae6cd7dfeb22eb6faadb4e26b26f0a2d081510b2990b18f395a82222208a02bbd5a695dfc772627ac8744aa9cf30ae26575bdce8c96a9a0d0999175b430a2d081410e6ff0418f395a8222a20d39619c779be909e67f23499fb74eb2c19afd7f21523401d4ccf7e917db5cd600a2d081210e3fe0118f395a8222a20a10cc73843f889d9e03a463eb135e928bb980e19734344cba0fbf4e8a4c5258b0a2c081010dd6518f395a8222a2007fd15843a2fd3f58d021b0e072a6c70742d7a3d993a922445e3491e1c14ee8e0a2c080f10cc2a18eda6a7222a20088942d7b30abd021d8e9505cc41313fad87c8c10a799f3b51018b7b2cfe4ad90a2c080d10b70d18eda6a7222a2091a37bc44d0c61e3752ddc59eb390355ab65e8a9fb453be4f0acec537f1ca14f0a2c080c10890818eda6a72222201cfc317855a06667c45812fe36efe33af05671dfe0d9b56b02662011af2e79e30a2c080b10ac0318c4b0ee212220aeb454a4b3243b6269a2fd8841dca9a951c53b30f1e27da91063dae7224402c70a2c080910e40118c4b0ee212a20441340a4de6498f861b97b3f3ad9603af055e5af51a0d96fff2ae28e3c5c6c9a0a2c0808108d0118c4b0ee212220ae32ea4b9ab7b53571da320e2815fd8b2c278124961cca4a1849a799842424450a2b0807104d18c4b0ee212220e2804c9b7f045ec0b4ab20920a937b82fda8b7a9ddd12b21637335b915cfda550a2b0806102418a5f4c7192a20ec85f22addedfc82c771af5b4c77544b7c1d7c5bbac33f2712dfba1045ebdbd00a2b0805101118a5f4c7192a2071ade34dcc447a0ba8adc603080633d15c06f3525830c86ebce35eca0a4921fc0a2b0804100c18a5f4c7192a205190bce93993e65b266a3417ed511df8897a812cb4b62569e5afcfbec10b69cd0a2b0803100618a5f4c7192220b76c6884f1d412ac10bfb3987fb7d26f0330b2a85539509ebc5c6bdec2f95d520a2b0802100418a5f4c71922206a285b4a4f9d1c687bbafa1f3649b6a6e32b1a85dd0402421210683e846cf0020a2b0801100218a5f4c7192220033b3f7c6dcb258b6e55545e7a4f51539447cd595eb8a2e373ba0015502da1051a450a1c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d12201a272295e94cf1d8090bdb019dde48e9dab026ad2c3e43aaa7e61cc954a9245d18a5f4c7190ab6040a0a6d756c746973746f726512036163631aa204a0040a9d040a300a0364657812290a27088496a822122038fc49f49648fec62acc434151a51eaa378c1b20a730a749548e36f1529422500a300a03676f7612290a27088496a8221220a78ce489bdf08b9ee869c184876e1623dc38b3e64a5cf1a0005f97976c64deac0a380a0b61746f6d69635f7377617012290a27088496a8221220544c2fa38f61e10a39ec00b3e724d5834761268bb455cdbf5843bcf1531f8fbc0a300a0376616c12290a27088496a82212201f71082c9f6f45fb456b2c00b41e50d2f662f2dfec3cb6965f19d214bf02f3980a0f0a046d61696e12070a05088496a8220a320a057374616b6512290a27088496a82212200dd467343c718f240e50b4feac42970fc8c1c69a018be955f9c27913ac1f8b3c0a300a0361636312290a27088496a8221220270c19ccc9c40c5176b3dfbd8af734c97a307e0dbd8df9e286dcd5d709f973ed0a330a06746f6b656e7312290a27088496a8221220c4f96eedf50c83964de9df013afec2e545012d92528b643a5166c828774187b60a320a05706169727312290a27088496a8221220351c55cfda84596ecd22ebc77013662aba97f81f19d9ef3d150213bb07c823060a360a0974696d655f6c6f636b12290a27088496a8221220e7adf5bd30ce022decf0e9341bf05c464ed70cdbc97423bd2bab8f3571e5179b0a330a06706172616d7312290a27088496a822122042a9dfc356ca435db131eb41fb1975c8482f2434537918665e530b0b4633b5f9").unwrap(); - let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64).unwrap(); + let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); @@ -110,9 +112,9 @@ mod tests { #[test] fn test_iavl_proof_validation_run_absence_proof_moran() { let input = hex::decode("00000000000000000000000000000000000000000000000000000000000007306163630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d000000000000000000000000000000000000000000000000000000000000007b4bdc4c270a750a148a4e2eb018bdf98a8f53ec755740ffc728637a1d12110a0941544348412d3733301080f69bf321120b0a03424e4210e8baeb8d44120f0a075050432d303041108094ebdc031a26eb5ae98721031c199c92e5b0080967da99be27cf2da53317441b4a663e6d9c6caf02be1fdbdc20d7962b28152c69c314b4de5c8035253c8bc0771d9ca17b1b23a57c0c6d068b57579791cae20add070a066961766c3a61121c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d1ab407b2070aaf070a2d081810cdfd2b188096a82222209f223f804e2d94ac51c4321b0687397012e6d95eb9783b03bc790da631004c7c0a2d081710adb31a18f395a8222a20d2a38865de82383ccce0140513b65cec1bf2ae6cd7dfeb22eb6faadb4e26b26f0a2d081510b2990b18f395a82222208a02bbd5a695dfc772627ac8744aa9cf30ae26575bdce8c96a9a0d0999175b430a2d081410e6ff0418f395a8222a20d39619c779be909e67f23499fb74eb2c19afd7f21523401d4ccf7e917db5cd600a2d081210e3fe0118f395a8222a20a10cc73843f889d9e03a463eb135e928bb980e19734344cba0fbf4e8a4c5258b0a2c081010dd6518f395a8222a2007fd15843a2fd3f58d021b0e072a6c70742d7a3d993a922445e3491e1c14ee8e0a2c080f10cc2a18eda6a7222a20088942d7b30abd021d8e9505cc41313fad87c8c10a799f3b51018b7b2cfe4ad90a2c080d10b70d18eda6a7222a2091a37bc44d0c61e3752ddc59eb390355ab65e8a9fb453be4f0acec537f1ca14f0a2c080c10890818eda6a72222201cfc317855a06667c45812fe36efe33af05671dfe0d9b56b02662011af2e79e30a2c080b10ac0318c4b0ee212220aeb454a4b3243b6269a2fd8841dca9a951c53b30f1e27da91063dae7224402c70a2c080910e40118c4b0ee212a20441340a4de6498f861b97b3f3ad9603af055e5af51a0d96fff2ae28e3c5c6c9a0a2c0808108d0118c4b0ee212220ae32ea4b9ab7b53571da320e2815fd8b2c278124961cca4a1849a799842424450a2b0807104d18c4b0ee212220e2804c9b7f045ec0b4ab20920a937b82fda8b7a9ddd12b21637335b915cfda550a2b0806102418a5f4c7192a20ec85f22addedfc82c771af5b4c77544b7c1d7c5bbac33f2712dfba1045ebdbd00a2b0805101118a5f4c7192a2071ade34dcc447a0ba8adc603080633d15c06f3525830c86ebce35eca0a4921fc0a2b0804100c18a5f4c7192a205190bce93993e65b266a3417ed511df8897a812cb4b62569e5afcfbec10b69cd0a2b0803100618a5f4c7192220b76c6884f1d412ac10bfb3987fb7d26f0330b2a85539509ebc5c6bdec2f95d520a2b0802100418a5f4c71922206a285b4a4f9d1c687bbafa1f3649b6a6e32b1a85dd0402421210683e846cf0020a2b0801100218a5f4c7192220033b3f7c6dcb258b6e55545e7a4f51539447cd595eb8a2e373ba0015502da1051a450a1c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d12201a272295e94cf1d8090bdb019dde48e9dab026ad2c3e43aaa7e61cc954a9245d18a5f4c7190ab6040a0a6d756c746973746f726512036163631aa204a0040a9d040a300a0364657812290a27088496a822122038fc49f49648fec62acc434151a51eaa378c1b20a730a749548e36f1529422500a300a03676f7612290a27088496a8221220a78ce489bdf08b9ee869c184876e1623dc38b3e64a5cf1a0005f97976c64deac0a380a0b61746f6d69635f7377617012290a27088496a8221220544c2fa38f61e10a39ec00b3e724d5834761268bb455cdbf5843bcf1531f8fbc0a300a0376616c12290a27088496a82212201f71082c9f6f45fb456b2c00b41e50d2f662f2dfec3cb6965f19d214bf02f3980a0f0a046d61696e12070a05088496a8220a320a057374616b6512290a27088496a82212200dd467343c718f240e50b4feac42970fc8c1c69a018be955f9c27913ac1f8b3c0a300a0361636312290a27088496a8221220270c19ccc9c40c5176b3dfbd8af734c97a307e0dbd8df9e286dcd5d709f973ed0a330a06746f6b656e7312290a27088496a8221220c4f96eedf50c83964de9df013afec2e545012d92528b643a5166c828774187b60a320a05706169727312290a27088496a8221220351c55cfda84596ecd22ebc77013662aba97f81f19d9ef3d150213bb07c823060a360a0974696d655f6c6f636b12290a27088496a8221220e7adf5bd30ce022decf0e9341bf05c464ed70cdbc97423bd2bab8f3571e5179b0a330a06706172616d7312290a27088496a822122042a9dfc356ca435db131eb41fb1975c8482f2434537918665e530b0b4633b5f9").unwrap(); - let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64); + let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64, 0); - assert_eq!(res.err(), Some(PrecompileError::other("invalid merkle proof"))); + assert!(res.expect("should not return fatal error").is_halt()); } #[test] @@ -127,24 +129,24 @@ mod tests { let testcases = vec![bytest1, bytest2]; testcases.into_iter().for_each(|t| { - let res = iavl_proof_validation_run(&Bytes::from(t.clone()), 3_000u64); + let res = iavl_proof_validation_run(&Bytes::from(t.clone()), 3_000u64, 0); assert_eq!(res.err(), None); - let res = iavl_proof_validation_run_moran(&Bytes::from(t.clone()), 3_000u64); + let res = iavl_proof_validation_run_moran(&Bytes::from(t.clone()), 3_000u64, 0); - assert_eq!(res.err(), Some(PrecompileError::other("invalid merkle proof"))); + assert!(res.expect("should not return fatal error").is_halt()); }); let input = hex::decode("00000000000000000000000000000000000000000000000000000000000007306163630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d000000000000000000000000000000000000000000000000000000000000007b4bdc4c270a750a148a4e2eb018bdf98a8f53ec755740ffc728637a1d12110a0941544348412d3733301080f69bf321120b0a03424e4210e8baeb8d44120f0a075050432d303041108094ebdc031a26eb5ae98721031c199c92e5b0080967da99be27cf2da53317441b4a663e6d9c6caf02be1fdbdc20d7962b28152c69c314b4de5c8035253c8bc0771d9ca17b1b23a57c0c6d068b57579791cae20add070a066961766c3a61121c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d1ab407b2070aaf070a2d081810cdfd2b188096a82222209f223f804e2d94ac51c4321b0687397012e6d95eb9783b03bc790da631004c7c0a2d081710adb31a18f395a8222a20d2a38865de82383ccce0140513b65cec1bf2ae6cd7dfeb22eb6faadb4e26b26f0a2d081510b2990b18f395a82222208a02bbd5a695dfc772627ac8744aa9cf30ae26575bdce8c96a9a0d0999175b430a2d081410e6ff0418f395a8222a20d39619c779be909e67f23499fb74eb2c19afd7f21523401d4ccf7e917db5cd600a2d081210e3fe0118f395a8222a20a10cc73843f889d9e03a463eb135e928bb980e19734344cba0fbf4e8a4c5258b0a2c081010dd6518f395a8222a2007fd15843a2fd3f58d021b0e072a6c70742d7a3d993a922445e3491e1c14ee8e0a2c080f10cc2a18eda6a7222a20088942d7b30abd021d8e9505cc41313fad87c8c10a799f3b51018b7b2cfe4ad90a2c080d10b70d18eda6a7222a2091a37bc44d0c61e3752ddc59eb390355ab65e8a9fb453be4f0acec537f1ca14f0a2c080c10890818eda6a72222201cfc317855a06667c45812fe36efe33af05671dfe0d9b56b02662011af2e79e30a2c080b10ac0318c4b0ee212220aeb454a4b3243b6269a2fd8841dca9a951c53b30f1e27da91063dae7224402c70a2c080910e40118c4b0ee212a20441340a4de6498f861b97b3f3ad9603af055e5af51a0d96fff2ae28e3c5c6c9a0a2c0808108d0118c4b0ee212220ae32ea4b9ab7b53571da320e2815fd8b2c278124961cca4a1849a799842424450a2b0807104d18c4b0ee212220e2804c9b7f045ec0b4ab20920a937b82fda8b7a9ddd12b21637335b915cfda550a2b0806102418a5f4c7192a20ec85f22addedfc82c771af5b4c77544b7c1d7c5bbac33f2712dfba1045ebdbd00a2b0805101118a5f4c7192a2071ade34dcc447a0ba8adc603080633d15c06f3525830c86ebce35eca0a4921fc0a2b0804100c18a5f4c7192a205190bce93993e65b266a3417ed511df8897a812cb4b62569e5afcfbec10b69cd0a2b0803100618a5f4c7192220b76c6884f1d412ac10bfb3987fb7d26f0330b2a85539509ebc5c6bdec2f95d520a2b0802100418a5f4c71922206a285b4a4f9d1c687bbafa1f3649b6a6e32b1a85dd0402421210683e846cf0020a2b0801100218a5f4c7192220033b3f7c6dcb258b6e55545e7a4f51539447cd595eb8a2e373ba0015502da1051a450a1c6163636f756e743a8a4e2eb018bdf98a8f53ec755740ffc728637a1d12201a272295e94cf1d8090bdb019dde48e9dab026ad2c3e43aaa7e61cc954a9245d18a5f4c7190ab6040a0a6d756c746973746f726512036163631aa204a0040a9d040a300a0364657812290a27088496a822122038fc49f49648fec62acc434151a51eaa378c1b20a730a749548e36f1529422500a300a03676f7612290a27088496a8221220a78ce489bdf08b9ee869c184876e1623dc38b3e64a5cf1a0005f97976c64deac0a380a0b61746f6d69635f7377617012290a27088496a8221220544c2fa38f61e10a39ec00b3e724d5834761268bb455cdbf5843bcf1531f8fbc0a300a0376616c12290a27088496a82212201f71082c9f6f45fb456b2c00b41e50d2f662f2dfec3cb6965f19d214bf02f3980a0f0a046d61696e12070a05088496a8220a320a057374616b6512290a27088496a82212200dd467343c718f240e50b4feac42970fc8c1c69a018be955f9c27913ac1f8b3c0a300a0361636312290a27088496a8221220270c19ccc9c40c5176b3dfbd8af734c97a307e0dbd8df9e286dcd5d709f973ed0a330a06746f6b656e7312290a27088496a8221220c4f96eedf50c83964de9df013afec2e545012d92528b643a5166c828774187b60a320a05706169727312290a27088496a8221220351c55cfda84596ecd22ebc77013662aba97f81f19d9ef3d150213bb07c823060a360a0974696d655f6c6f636b12290a27088496a8221220e7adf5bd30ce022decf0e9341bf05c464ed70cdbc97423bd2bab8f3571e5179b0a330a06706172616d7312290a27088496a822122042a9dfc356ca435db131eb41fb1975c8482f2434537918665e530b0b4633b5f9").unwrap(); - let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64); + let res = iavl_proof_validation_run_moran(&Bytes::from(input), 3_000u64, 0); - assert_eq!(res.err(), Some(PrecompileError::other("invalid merkle proof"))); + assert!(res.expect("should not return fatal error").is_halt()); } #[test] fn test_iavl_proof_validation_run_valid_proof_moran() { let input = hex::decode("00000000000000000000000000000000000000000000000000000000000005086962630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000100380200000000010dd9ac0000000000000000000000000000000000000000000000000000000000000093000000000000000000000000000000000000000000000000000000000000000000f870a0424e4200000000000000000000000000000000000000000000000000000000009400000000000000000000000000000000000000008ad3c21bcecceda100000094489a8756c18c0b8b24ec2a2b9ff3d4d447f79bec94489a8756c18c0b8b24ec2a2b9ff3d4d447f79bec846553f10072cda827a83531ca0fd7ac917a6b65649719aab0836722caafe0603147a523180a8d020a066961766c3a76120e00000100380200000000010dd9ac1af201f0010aed010a2b0802100318b091c73422200c10f902d266c238a4ca9e26fa9bc36483cd3ebee4e263012f5e7f40c22ee4d20a4d0801100218b091c7342220e4fd47bffd1c06e67edad92b2bf9ca63631978676288a2aa99f95c459436ef632a20121a1f9c4eca726c725796c5375fc4158986ced08e498dc8268ef94d8ed1891612001a370a0e0000010038020000000000000002122011056c6919f02d966991c10721684a8d1542e44003f9ffb47032c18995d4ac7f18b091c7341a340a0e00000100380200000000010dd9ac12202c3a561458f8527b002b5ec3cab2d308662798d6245d4588a4e6a80ebdfe30ac18010ad4050a0a6d756c746973746f726512036962631ac005be050abb050a110a066f7261636c6512070a0508b891c7340a0f0a046d61696e12070a0508b891c7340a350a08736c617368696e6712290a2708b891c7341220c8ccf341e6e695e7e1cb0ce4bf347eea0cc16947d8b4e934ec400b57c59d6f860a380a0b61746f6d69635f7377617012290a2708b891c734122042d4ecc9468f71a70288a95d46564bfcaf2c9f811051dcc5593dbef152976b010a110a0662726964676512070a0508b891c7340a300a0364657812290a2708b891c73412201773be443c27f61075cecdc050ce22eb4990c54679089e90afdc4e0e88182a230a2f0a02736312290a2708b891c7341220df7a0484b7244f76861b1642cfb7a61d923794bd2e076c8dbd05fc4ee29f3a670a330a06746f6b656e7312290a2708b891c734122064958c2f76fec1fa5d1828296e51264c259fa264f499724795a740f48fc4731b0a320a057374616b6512290a2708b891c734122015d2c302143bdf029d58fe381cc3b54cedf77ecb8834dfc5dc3e1555d68f19ab0a330a06706172616d7312290a2708b891c734122050abddcb7c115123a5a4247613ab39e6ba935a3d4f4b9123c4fedfa0895c040a0a300a0361636312290a2708b891c734122079fb5aecc4a9b87e56231103affa5e515a1bdf3d0366490a73e087980b7f1f260a0e0a0376616c12070a0508b891c7340a300a0369626312290a2708b891c7341220e09159530585455058cf1785f411ea44230f39334e6e0f6a3c54dbf069df2b620a300a03676f7612290a2708b891c7341220db85ddd37470983b14186e975a175dfb0bf301b43de685ced0aef18d28b4e0420a320a05706169727312290a2708b891c7341220a78b556bc9e73d86b4c63ceaf146db71b12ac80e4c10dd0ce6eb09c99b0c7cfe0a360a0974696d655f6c6f636b12290a2708b891c73412204775dbe01d41cab018c21ba5c2af94720e4d7119baf693670e70a40ba2a52143").unwrap(); - let res = iavl_proof_validation_run(&Bytes::from(input), 3_000u64).unwrap(); + let res = iavl_proof_validation_run(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); @@ -156,7 +158,7 @@ mod tests { #[test] fn test_iavl_proof_validation_run_valid_proof_plank() { let input = hex::decode("000000000000000000000000000000000000000000000000000000000000015b6962630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000477696e640000000000000000000000000000000000000000000000000000000000000005626c6f7773ae6d1123fc362b3297bfb19c9f9fabbcbd1e2555b923dead261905b8a2ff6db60a300a0a69637332333a6961766c120477696e641a1c0a1a0a0477696e641205626c6f77731a0b0801180120012a030002040a9d010a0c69637332333a73696d706c6512036962631a87010a84010a036962631220141acb8632cfb808f293f2649cb9aabaca74fc18640900ffd0d48e2994b2a1521a090801180120012a0100222708011201011a205f0ba08283de309300409486e978a3ea59d82bccc838b07c7d39bd87c16a5034222708011201011a20455b81ef5591150bd24d3e57a769f65518b16de93487f0fab02271b3d69e2852").unwrap(); - let res = iavl_proof_validation_run_planck(&Bytes::from(input), 3_000u64).unwrap(); + let res = iavl_proof_validation_run_planck(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); @@ -168,7 +170,7 @@ mod tests { #[test] fn test_iavl_proof_validation_run_valid_proof_plato() { let input = hex::decode("000000000000000000000000000000000000000000000000000000000000015b6962630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000477696e640000000000000000000000000000000000000000000000000000000000000005626c6f7773ae6d1123fc362b3297bfb19c9f9fabbcbd1e2555b923dead261905b8a2ff6db60a300a0a69637332333a6961766c120477696e641a1c0a1a0a0477696e641205626c6f77731a0b0801180120012a030002040a9d010a0c69637332333a73696d706c6512036962631a87010a84010a036962631220141acb8632cfb808f293f2649cb9aabaca74fc18640900ffd0d48e2994b2a1521a090801180120012a0100222708011201011a205f0ba08283de309300409486e978a3ea59d82bccc838b07c7d39bd87c16a5034222708011201011a20455b81ef5591150bd24d3e57a769f65518b16de93487f0fab02271b3d69e2852").unwrap(); - let res = iavl_proof_validation_run_plato(&Bytes::from(input), 3_000u64).unwrap(); + let res = iavl_proof_validation_run_plato(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); diff --git a/src/evm/precompiles/mod.rs b/src/evm/precompiles/mod.rs index ccd48fdb..c6b4cd25 100644 --- a/src/evm/precompiles/mod.rs +++ b/src/evm/precompiles/mod.rs @@ -9,7 +9,7 @@ use revm::{ handler::EthPrecompiles, precompile::{ bls12_381, kzg_point_evaluation, modexp, secp256r1, u64_to_address, Precompile, PrecompileError, PrecompileFn, - PrecompileId, PrecompileOutput, PrecompileResult, Precompiles, + PrecompileId, PrecompileResult, Precompiles, }, primitives::{hardfork::SpecId, Address as RevmAddress}, }; @@ -28,7 +28,7 @@ mod tm_secp256k1; #[derive(Clone, Debug)] struct PrecompileTraceEntry { id: PrecompileId, - original: PrecompileFn, + original: Precompile, } #[derive(Clone, Debug, Default)] @@ -200,7 +200,7 @@ fn log_precompile_call( precompile_input_len = input_len, precompile_gas_used = output.gas_used, precompile_gas_refunded = output.gas_refunded, - precompile_reverted = output.reverted, + precompile_reverted = !output.is_success(), precompile_output_len = output.bytes.len(), "Precompile executed" ); @@ -227,7 +227,7 @@ fn log_precompile_call( } } -fn traced_precompile_call(address: RevmAddress, input: &[u8], gas_limit: u64) -> PrecompileResult { +fn traced_precompile_call(address: RevmAddress, input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { let ctx = current_precompile_trace_context(); let entry = if let Some(ctx) = &ctx { @@ -237,10 +237,10 @@ fn traced_precompile_call(address: RevmAddress, input: &[u8], gas_limit: u64) -> }; let Some(entry) = entry else { - return Err(PrecompileError::other("missing original precompile function")); + return Err(PrecompileError::Fatal("missing original precompile function".to_string())); }; - let result = (entry.original)(input, gas_limit); + let result = entry.original.execute(input, gas_limit, reservoir); if let Some(ctx) = &ctx { if should_trace_precompiles(ctx) { @@ -272,8 +272,8 @@ const PRECOMPILE_ADDR_105: RevmAddress = u64_to_address(105); macro_rules! traced_wrapper { ($name:ident, $addr:ident) => { - fn $name(input: &[u8], gas_limit: u64) -> PrecompileResult { - traced_precompile_call($addr, input, gas_limit) + fn $name(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { + traced_precompile_call($addr, input, gas_limit, reservoir) } }; } @@ -327,8 +327,9 @@ fn install_precompile_tracing(precompiles: &mut Precompiles) -> PrecompileTraceM continue; }; - let (id, address, original) = precompile.into(); - trace_map.insert(address, PrecompileTraceEntry { id: id.clone(), original }); + let id = precompile.id().clone(); + let address = *precompile.address(); + trace_map.insert(address, PrecompileTraceEntry { id: id.clone(), original: precompile }); if let Some(wrapper) = traced_wrapper_for_address(address) { precompiles.extend([Precompile::new(id, address, wrapper)]); diff --git a/src/evm/precompiles/tendermint.rs b/src/evm/precompiles/tendermint.rs index bfbf7b10..ab4a5620 100644 --- a/src/evm/precompiles/tendermint.rs +++ b/src/evm/precompiles/tendermint.rs @@ -3,7 +3,7 @@ use alloy_primitives::Bytes; use parity_bytes::BytesRef; use revm::precompile::{ - u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, + u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use std::borrow::Cow; use tendermint::lite::light_client; @@ -17,24 +17,24 @@ pub(crate) const TENDERMINT_HEADER_VALIDATION_NANO: Precompile = Precompile::new(PrecompileId::Custom(Cow::Borrowed("HEADER_VALIDATE_NANO")), u64_to_address(100), tendermint_header_validation_run_nano); /// Run the Tendermint header validation precompile after Nano hardfork. -fn tendermint_header_validation_run_nano(input: &[u8], _gas_limit: u64) -> PrecompileResult { - Err(PrecompileError::other("suspended")) +fn tendermint_header_validation_run_nano(_input: &[u8], _gas_limit: u64, reservoir: u64) -> PrecompileResult { + Ok(PrecompileOutput::halt(PrecompileHalt::other("suspended"), reservoir)) } /// Run the Tendermint header validation precompile. -fn tendermint_header_validation_run(input: &[u8], gas_limit: u64) -> PrecompileResult { +fn tendermint_header_validation_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { const TENDERMINT_HEADER_VALIDATION_BASE: u64 = 3_000; if TENDERMINT_HEADER_VALIDATION_BASE > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } let mut output = vec![0u8, 0, 0]; let mut bytes = BytesRef::Flexible(&mut output); let res = light_client::TmHeaderVerifier::execute(input, &mut bytes); match res { - Ok(()) => Ok(PrecompileOutput::new(TENDERMINT_HEADER_VALIDATION_BASE, Bytes::from(output))), - Err(str) => Err(PrecompileError::other(str)), + Ok(()) => Ok(PrecompileOutput::new(TENDERMINT_HEADER_VALIDATION_BASE, Bytes::from(output), reservoir)), + Err(str) => Ok(PrecompileOutput::halt(PrecompileHalt::other(str), reservoir)), } } @@ -46,7 +46,7 @@ mod tests { #[test] fn test_tendermint_header_validation_run() { let input = hex::decode("0000000000000000000000000000000000000000000000000000000000001325000000000000000000000000000000000000000000000000000000000000022042696e616e63652d436861696e2d4e696c6500000000000000000000000000000000000003fc05e2b7029751d2a6581efc2f79712ec44d8b4981850325a7feadaa58ef4ddaa18a9380d9ab0fc10d18ca0e0832d5f4c063c5489ec1443dfb738252d038a82131b27ae17cbe9c20cdcfdf876b3b12978d3264a007fcaaa71c4cdb701d9ebc0323f44f000000174876e800184e7b103d34c41003f9b864d5f8c1adda9bd0436b253bb3c844bc739c1e77c9000000174876e8004d420aea843e92a0cfe69d89696dff6827769f9cb52a249af537ce89bf2a4b74000000174876e800bd03de9f8ab29e2800094e153fac6f696cfa512536c9c2f804dcb2c2c4e4aed6000000174876e8008f4a74a07351895ddf373057b98fae6dfaf2cd21f37a063e19601078fe470d53000000174876e8004a5d4753eb79f92e80efe22df7aca4f666a4f44bf81c536c4a09d4b9c5b654b5000000174876e800c80e9abef7ff439c10c68fe8f1303deddfc527718c3b37d8ba6807446e3c827a000000174876e8009142afcc691b7cc05d26c7b0be0c8b46418294171730e079f384fde2fa50bafc000000174876e80049b288e4ebbb3a281c2d546fc30253d5baf08993b6e5d295fb787a5b314a298e000000174876e80004224339688f012e649de48e241880092eaa8f6aa0f4f14bfcf9e0c76917c0b6000000174876e8004034b37ceda8a0bf13b1abaeee7a8f9383542099a554d219b93d0ce69e3970e8000000174876e800e3210a92130abb020a02080a121242696e616e63652d436861696e2d4e696c6518e38bf01f220c08e191aef20510f5f4e4c70230dae0c7173a480a20102b54820dd8fb5bc2c4e875ee573fa294d9b7b7ceb362aa8fd21b33dee41b1c12240801122082f341511f3e6b89d6177fd31f8a106013ba09d6e12ef40a7dec885d81b687634220b1b77e6977e0cd0177e3102a78833c9e152aa646ed4fb5a77e8af58c9867eec0522080d9ab0fc10d18ca0e0832d5f4c063c5489ec1443dfb738252d038a82131b27a5a2080d9ab0fc10d18ca0e0832d5f4c063c5489ec1443dfb738252d038a82131b27a6220294d8fbd0b94b767a7eba9840f299a3586da7fe6b5dead3b7eecba193c400f936a20a3e248bc209955054d880e4d89ff3c0419c0cd77681f4b4c6649ead5545054b982011462633d9db7ed78e951f79913fdc8231aa77ec12b12d1100a480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be212b601080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510cebfe23e321406fd60078eb4c2356137dd50036597db267cf61642409276f20ad4b152f91c344bd63ac691bad66e04e228a8b58dca293ff0bd10f8aef6dfbcecae49e32b09d89e10b771a6c01628628596a95e126b04763560c66c0f12b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510a4caa532321418e69cc672973992bb5f76d049a5b2c5ddf77436380142409ed2b74fa835296d552e68c439dd4ee3fa94fb197282edcc1cc815c863ca42a2c9a73475ff6be9064371a61655a3c31d2f0acc89c3a4489ad4c2671aef52360512b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510a69eca2f3214344c39bb8f4512d6cab1f6aafac1811ef9d8afdf38024240de2768ead90011bcbb1914abc1572749ab7b81382eb81cff3b41c56edc12470a7b8a4d61f8b4ca7b2cb7e24706edd219455796b4db74cd36965859f91dc8910312b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510dcdd833b321437ef19af29679b368d2b9e9de3f8769b357866763803424072ddfe0aeb13616b3f17eb60b19a923ec51fcc726625094aa069255c829c8cdd9e242080a1e559b0030fe9a0db19fd34e392bd78df12a9caff9f2b811bc1ac0a12b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510e9f2f859321462633d9db7ed78e951f79913fdc8231aa77ec12b38044240f5f61c640ab2402b44936de0d24e7b439df78bc3ef15467ecb29b92ece4aa0550790d5ce80761f2ac4b0e3283969725c42343749d9b44b179b2d4fced66c5d0412b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510ff90f55532147b343e041ca130000a8bc00c35152bd7e774003738054240df6e298b3efd42eb536e68a0210bc921e8b5dc145fe965f63f4d3490064f239f2a54a6db16c96086e4ae52280c04ad8b32b44f5ff3d41f0c364949ccb628c50312b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510cad7c931321491844d296bd8e591448efc65fd6ad51a888d58fa3806424030298627da1afd28229aac150f553724b594989e59136d6a175d84e45a4dee344ff9e0eeb69fdf29abb6d833adc3e1ccdc87b2a65019ef5fb627c44d9d132c0012b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510c8c296323214b3727172ce6473bc780298a2d66c12f1a14f5b2a38074240918491100730b4523f0c85409f6d1cca9ebc4b8ca6df8d55fe3d85158fa43286608693c50332953e1d3b93e3e78b24e158d6a2275ce8c6c7c07a7a646a19200312b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef2051086f1a2403214b6f20c7faa2b2f6f24518fa02b71cb5f4a09fba338084240ca59c9fc7f6ab660e9970fc03e5ed588ccb8be43fe5a3e8450287b726f29d039e53fe888438f178ac63c3d2ca969cd8c2fbc8606f067634339b6a94a7382960212b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef2051080efbb543214e0dd72609cc106210d1aa13936cb67b93a0aee2138094240e787a21f5cb7052624160759a9d379dd9db144f2b498bca026375c9ce8ecdc2a0936af1c309b3a0f686c92bf5578b595a4ca99036a19c9fc50d3718fd454b30012b801080210e38bf01f22480a207eaabf7df1081377e06e08efe7ad17974049380bdd65a9b053c099ef80ff6e6f122408011220d153cc308d9cb96ca43ffeceaae1ee85794c83d17408ff76cfee92f5e91d0be22a0b08e291aef20510ddf8d85a3214fc3108dc3814888f4187452182bc1baf83b71bc9380a4240d51ea31f6449eed71de22339722af1edbb0b21401037d85882b32a2ed8ae9127f2df4d1da2092729e582812856227ed6cdf98a3f60203d1ff80bd635fb03bb0912a4070a4f0a1406fd60078eb4c2356137dd50036597db267cf61612251624de6420e17cbe9c20cdcfdf876b3b12978d3264a007fcaaa71c4cdb701d9ebc0323f44f1880d0dbc3f4022080e0ebdaf2e2ffffff010a4b0a1418e69cc672973992bb5f76d049a5b2c5ddf7743612251624de6420184e7b103d34c41003f9b864d5f8c1adda9bd0436b253bb3c844bc739c1e77c91880d0dbc3f4022080d0dbc3f4020a4b0a14344c39bb8f4512d6cab1f6aafac1811ef9d8afdf12251624de64204d420aea843e92a0cfe69d89696dff6827769f9cb52a249af537ce89bf2a4b741880d0dbc3f4022080d0dbc3f4020a4b0a1437ef19af29679b368d2b9e9de3f8769b3578667612251624de6420bd03de9f8ab29e2800094e153fac6f696cfa512536c9c2f804dcb2c2c4e4aed61880d0dbc3f4022080d0dbc3f4020a4b0a1462633d9db7ed78e951f79913fdc8231aa77ec12b12251624de64208f4a74a07351895ddf373057b98fae6dfaf2cd21f37a063e19601078fe470d531880d0dbc3f4022080d0dbc3f4020a4b0a147b343e041ca130000a8bc00c35152bd7e774003712251624de64204a5d4753eb79f92e80efe22df7aca4f666a4f44bf81c536c4a09d4b9c5b654b51880d0dbc3f4022080d0dbc3f4020a4b0a1491844d296bd8e591448efc65fd6ad51a888d58fa12251624de6420c80e9abef7ff439c10c68fe8f1303deddfc527718c3b37d8ba6807446e3c827a1880d0dbc3f4022080d0dbc3f4020a4b0a14b3727172ce6473bc780298a2d66c12f1a14f5b2a12251624de64209142afcc691b7cc05d26c7b0be0c8b46418294171730e079f384fde2fa50bafc1880d0dbc3f4022080d0dbc3f4020a4b0a14b6f20c7faa2b2f6f24518fa02b71cb5f4a09fba312251624de642049b288e4ebbb3a281c2d546fc30253d5baf08993b6e5d295fb787a5b314a298e1880d0dbc3f4022080d0dbc3f4020a4b0a14e0dd72609cc106210d1aa13936cb67b93a0aee2112251624de642004224339688f012e649de48e241880092eaa8f6aa0f4f14bfcf9e0c76917c0b61880d0dbc3f4022080d0dbc3f4020a4b0a14fc3108dc3814888f4187452182bc1baf83b71bc912251624de64204034b37ceda8a0bf13b1abaeee7a8f9383542099a554d219b93d0ce69e3970e81880d0dbc3f4022080d0dbc3f402124f0a1406fd60078eb4c2356137dd50036597db267cf61612251624de6420e17cbe9c20cdcfdf876b3b12978d3264a007fcaaa71c4cdb701d9ebc0323f44f1880d0dbc3f4022080e0ebdaf2e2ffffff011aa4070a4f0a1406fd60078eb4c2356137dd50036597db267cf61612251624de6420e17cbe9c20cdcfdf876b3b12978d3264a007fcaaa71c4cdb701d9ebc0323f44f1880d0dbc3f4022080e0ebdaf2e2ffffff010a4b0a1418e69cc672973992bb5f76d049a5b2c5ddf7743612251624de6420184e7b103d34c41003f9b864d5f8c1adda9bd0436b253bb3c844bc739c1e77c91880d0dbc3f4022080d0dbc3f4020a4b0a14344c39bb8f4512d6cab1f6aafac1811ef9d8afdf12251624de64204d420aea843e92a0cfe69d89696dff6827769f9cb52a249af537ce89bf2a4b741880d0dbc3f4022080d0dbc3f4020a4b0a1437ef19af29679b368d2b9e9de3f8769b3578667612251624de6420bd03de9f8ab29e2800094e153fac6f696cfa512536c9c2f804dcb2c2c4e4aed61880d0dbc3f4022080d0dbc3f4020a4b0a1462633d9db7ed78e951f79913fdc8231aa77ec12b12251624de64208f4a74a07351895ddf373057b98fae6dfaf2cd21f37a063e19601078fe470d531880d0dbc3f4022080d0dbc3f4020a4b0a147b343e041ca130000a8bc00c35152bd7e774003712251624de64204a5d4753eb79f92e80efe22df7aca4f666a4f44bf81c536c4a09d4b9c5b654b51880d0dbc3f4022080d0dbc3f4020a4b0a1491844d296bd8e591448efc65fd6ad51a888d58fa12251624de6420c80e9abef7ff439c10c68fe8f1303deddfc527718c3b37d8ba6807446e3c827a1880d0dbc3f4022080d0dbc3f4020a4b0a14b3727172ce6473bc780298a2d66c12f1a14f5b2a12251624de64209142afcc691b7cc05d26c7b0be0c8b46418294171730e079f384fde2fa50bafc1880d0dbc3f4022080d0dbc3f4020a4b0a14b6f20c7faa2b2f6f24518fa02b71cb5f4a09fba312251624de642049b288e4ebbb3a281c2d546fc30253d5baf08993b6e5d295fb787a5b314a298e1880d0dbc3f4022080d0dbc3f4020a4b0a14e0dd72609cc106210d1aa13936cb67b93a0aee2112251624de642004224339688f012e649de48e241880092eaa8f6aa0f4f14bfcf9e0c76917c0b61880d0dbc3f4022080d0dbc3f4020a4b0a14fc3108dc3814888f4187452182bc1baf83b71bc912251624de64204034b37ceda8a0bf13b1abaeee7a8f9383542099a554d219b93d0ce69e3970e81880d0dbc3f4022080d0dbc3f402124f0a1406fd60078eb4c2356137dd50036597db267cf61612251624de6420e17cbe9c20cdcfdf876b3b12978d3264a007fcaaa71c4cdb701d9ebc0323f44f1880d0dbc3f4022080e0ebdaf2e2ffffff01").unwrap(); - let res = tendermint_header_validation_run(&Bytes::from(input), 3_000u64).unwrap(); + let res = tendermint_header_validation_run(&Bytes::from(input), 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); diff --git a/src/evm/precompiles/tm_secp256k1.rs b/src/evm/precompiles/tm_secp256k1.rs index 0d5c50ac..8f88915b 100644 --- a/src/evm/precompiles/tm_secp256k1.rs +++ b/src/evm/precompiles/tm_secp256k1.rs @@ -2,7 +2,7 @@ use alloy_primitives::Bytes; use revm::precompile::{ - u64_to_address, PrecompileError, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, + u64_to_address, PrecompileHalt, PrecompileOutput, PrecompileResult, Precompile, PrecompileId, }; use secp256k1::{ecdsa, Message, PublicKey}; use std::borrow::Cow; @@ -23,23 +23,23 @@ const SECP256K1_SIGNATURE_MSGHASH_LENGTH: usize = 32; /// | PubKey | Signature | SignatureMsgHash | /// /// | 33 bytes | 64 bytes | 32 bytes | -fn tm_secp256k1_signature_recover_run(input: &[u8], gas_limit: u64) -> PrecompileResult { +fn tm_secp256k1_signature_recover_run(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileResult { const TM_SECP256K1_SIGNATURE_RECOVER_BASE: u64 = 3_000; if TM_SECP256K1_SIGNATURE_RECOVER_BASE > gas_limit { - return Err(PrecompileError::OutOfGas); + return Ok(PrecompileOutput::halt(PrecompileHalt::OutOfGas, reservoir)); } let input_length = input.len(); if input_length != SECP256K1_PUBKEY_LENGTH + SECP256K1_SIGNATURE_LENGTH + SECP256K1_SIGNATURE_MSGHASH_LENGTH { - return Err(PrecompileError::other("invalid input")); + return Ok(PrecompileOutput::halt(PrecompileHalt::other("invalid input"), reservoir)); } let public_key = match PublicKey::from_slice(&input[..SECP256K1_PUBKEY_LENGTH]) { Ok(pk) => pk, - Err(_) => return Err(PrecompileError::other("invalid pubkey")), + Err(_) => return Ok(PrecompileOutput::halt(PrecompileHalt::other("invalid pubkey"), reservoir)), }; let message = Message::from_digest( @@ -50,24 +50,25 @@ fn tm_secp256k1_signature_recover_run(input: &[u8], gas_limit: u64) -> Precompil &input[SECP256K1_PUBKEY_LENGTH..SECP256K1_PUBKEY_LENGTH + SECP256K1_SIGNATURE_LENGTH], ) { Ok(s) => s, - Err(_) => return Err(PrecompileError::other("invalid signature")), + Err(_) => return Ok(PrecompileOutput::halt(PrecompileHalt::other("invalid signature"), reservoir)), }; let res = sig.verify(&message, &public_key).is_ok(); if !res { - return Err(PrecompileError::other("invalid signature")); + return Ok(PrecompileOutput::halt(PrecompileHalt::other("invalid signature"), reservoir)); } let tm_pub_key = match public_key::PublicKey::from_raw_secp256k1(&input[..SECP256K1_PUBKEY_LENGTH]) { Some(pk) => pk, - None => return Err(PrecompileError::other("invalid pubkey")), + None => return Ok(PrecompileOutput::halt(PrecompileHalt::other("invalid pubkey"), reservoir)), }; Ok(PrecompileOutput::new( TM_SECP256K1_SIGNATURE_RECOVER_BASE, Bytes::copy_from_slice(account::Id::from(tm_pub_key).as_bytes()), + reservoir, )) } @@ -94,7 +95,7 @@ mod tests { input.extend(msg_hash); let input = Bytes::copy_from_slice(&input); - let res = tm_secp256k1_signature_recover_run(&input, 3_000u64).unwrap(); + let res = tm_secp256k1_signature_recover_run(&input, 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); @@ -121,7 +122,7 @@ mod tests { input.extend(msg_hash); let input = Bytes::copy_from_slice(&input); - let res = tm_secp256k1_signature_recover_run(&input, 3_000u64).unwrap(); + let res = tm_secp256k1_signature_recover_run(&input, 3_000u64, 0).unwrap(); let gas = res.gas_used; assert_eq!(gas, 3_000u64); diff --git a/src/evm/transaction.rs b/src/evm/transaction.rs index 184dc86a..a085bdcc 100644 --- a/src/evm/transaction.rs +++ b/src/evm/transaction.rs @@ -1,7 +1,8 @@ use alloy_evm::{rpc::TryIntoTxEnv, EvmEnv}; use alloy_rpc_types_eth::{AccessList, TransactionRequest}; -use reth_evm::{FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, TransactionEnv}; -use reth_primitives::TransactionSigned; +use alloy_evm::TransactionEnvMut; +use reth_evm::{FromRecoveredTx, FromTxWithEncoded, IntoTxEnv}; +use reth_ethereum_primitives::TransactionSigned; use revm::{ context::TxEnv, context_interface::transaction::Transaction, @@ -110,26 +111,22 @@ impl FromRecoveredTx for BscTxEnv { impl FromTxWithEncoded for BscTxEnv { fn from_encoded_tx(tx: &TransactionSigned, sender: Address, _encoded: Bytes) -> Self { let base = match tx.clone().into_typed_transaction() { - reth_primitives::Transaction::Legacy(tx) => TxEnv::from_recovered_tx(&tx, sender), - reth_primitives::Transaction::Eip2930(tx) => TxEnv::from_recovered_tx(&tx, sender), - reth_primitives::Transaction::Eip1559(tx) => TxEnv::from_recovered_tx(&tx, sender), - reth_primitives::Transaction::Eip4844(tx) => TxEnv::from_recovered_tx(&tx, sender), - reth_primitives::Transaction::Eip7702(tx) => TxEnv::from_recovered_tx(&tx, sender), + reth_ethereum_primitives::Transaction::Legacy(tx) => TxEnv::from_recovered_tx(&tx, sender), + reth_ethereum_primitives::Transaction::Eip2930(tx) => TxEnv::from_recovered_tx(&tx, sender), + reth_ethereum_primitives::Transaction::Eip1559(tx) => TxEnv::from_recovered_tx(&tx, sender), + reth_ethereum_primitives::Transaction::Eip4844(tx) => TxEnv::from_recovered_tx(&tx, sender), + reth_ethereum_primitives::Transaction::Eip7702(tx) => TxEnv::from_recovered_tx(&tx, sender), }; Self { base, is_system_transaction: false } } } -impl TransactionEnv for BscTxEnv { +impl TransactionEnvMut for BscTxEnv { fn set_gas_limit(&mut self, gas_limit: u64) { self.base.set_gas_limit(gas_limit); } - fn nonce(&self) -> u64 { - TransactionEnv::nonce(&self.base) - } - fn set_nonce(&mut self, nonce: u64) { self.base.set_nonce(nonce); } @@ -157,15 +154,19 @@ impl SystemCallTx for BscTxEnv { } } -impl TryIntoTxEnv for TransactionRequest { - type Err = >::Err; +impl TryIntoTxEnv + for TransactionRequest +{ + type Err = >::Err; - fn try_into_tx_env( + fn try_into_tx_env( self, - evm_env: &EvmEnv, - ) -> Result>::Err> { + evm_env: &EvmEnv, + ) -> Result { Ok(BscTxEnv { - base: >::try_into_tx_env(self, evm_env)?, + base: >::try_into_tx_env( + self, evm_env, + )?, is_system_transaction: false, }) } diff --git a/src/node/consensus.rs b/src/node/consensus.rs index 075c9126..b32554fa 100644 --- a/src/node/consensus.rs +++ b/src/node/consensus.rs @@ -17,7 +17,7 @@ use crate::{ use alloy_consensus::{Header, TxReceipt}; use alloy_eips::Encodable2718; use alloy_primitives::{Bytes, B256}; -use alloy_rpc_types::engine::{ForkchoiceState, PayloadStatusEnum}; +use alloy_rpc_types_engine::{ForkchoiceState, PayloadStatusEnum}; use reth::{ api::FullNodeTypes, beacon_consensus::EthBeaconConsensus, @@ -32,8 +32,7 @@ use reth::{ use reth_chainspec::EthChainSpec; use reth_engine_primitives::ConsensusEngineHandle; use reth_ethereum_primitives::Receipt; -use reth_payload_primitives::EngineApiMessageVersion; -use reth_primitives::{gas_spent_by_transactions, GotExpected}; +use reth_primitives_traits::{receipt::gas_spent_by_transactions, GotExpected}; use reth_primitives_traits::constants::{GAS_LIMIT_BOUND_DIVISOR, MINIMUM_GAS_LIMIT}; use reth_provider::{BlockNumReader, HeaderProvider}; use std::sync::Arc; @@ -87,10 +86,10 @@ fn validate_bsc_gas_limit_against_parent( ) -> Result<(), ConsensusError> { // Keep parity with go-bsc's Parlia checks. if header.gas_limit > GAS_LIMIT_CAPACITY { - return Err(ConsensusError::Other(format!( + return Err(ConsensusError::Other(Arc::new(std::io::Error::other(format!( "invalid gasLimit: have {}, max {}", header.gas_limit, GAS_LIMIT_CAPACITY - ))); + ))))); } if header.gas_used > header.gas_limit { @@ -110,12 +109,12 @@ fn validate_bsc_gas_limit_against_parent( let limit = parent.gas_limit / bound_divisor; if diff >= limit || header.gas_limit < MINIMUM_GAS_LIMIT { - return Err(ConsensusError::Other(format!( + return Err(ConsensusError::Other(Arc::new(std::io::Error::other(format!( "invalid gas limit: have {}, want {} += {}", header.gas_limit, parent.gas_limit, limit.saturating_sub(1) - ))); + ))))); } Ok(()) @@ -375,15 +374,15 @@ mod tests { fn sealed_header( &self, _number: u64, - ) -> reth_provider::ProviderResult>> { + ) -> reth_provider::ProviderResult>> { Ok(None) } fn sealed_headers_while( &self, _range: impl core::ops::RangeBounds, - _predicate: impl FnMut(&reth_primitives::SealedHeader) -> bool, - ) -> reth_provider::ProviderResult>> { + _predicate: impl FnMut(&reth_primitives_traits::SealedHeader) -> bool, + ) -> reth_provider::ProviderResult>> { Ok(Vec::new()) } } @@ -1256,7 +1255,7 @@ where match self .engine_handle - .fork_choice_updated(state, None, EngineApiMessageVersion::default()) + .fork_choice_updated(state, None) .await { Ok(response) => match response.payload_status.status { diff --git a/src/node/engine.rs b/src/node/engine.rs index 64f5a4c8..26a81418 100644 --- a/src/node/engine.rs +++ b/src/node/engine.rs @@ -22,7 +22,8 @@ use reth_chain_state::ExecutedBlock; use reth_evm::ConfigureEvm; use reth_payload_builder_primitives::Events; use reth_payload_primitives::BuiltPayload; -use reth_primitives::{SealedBlock, TransactionSigned}; +use reth_primitives_traits::SealedBlock; +use reth_ethereum_primitives::TransactionSigned; use std::sync::Arc; use std::time::Duration; use tokio::sync::{broadcast, mpsc}; @@ -122,7 +123,7 @@ where let chain_spec_clone = Arc::new(ctx.config().chain.clone().as_ref().clone()); let task_executor_clone = ctx.task_executor().clone(); - ctx.task_executor().spawn_critical("bsc-miner-initializer", async move { + ctx.task_executor().spawn_critical_task("bsc-miner-initializer", async move { info!("Waiting for consensus module to initialize snapshot provider..."); let mut attempts = 0; let snapshot_provider = loop { @@ -164,7 +165,7 @@ where let _ = crate::shared::set_payload_events_tx(events_tx.clone()); // Handle payload service commands (keep minimal compatibility but with shared events channel) - ctx.task_executor().spawn_critical("payload-service-handler", async move { + ctx.task_executor().spawn_critical_task("payload-service-handler", async move { while let Some(message) = rx.recv().await { match message { PayloadServiceCommand::Subscribe(tx) => { diff --git a/src/node/engine_api/mod.rs b/src/node/engine_api/mod.rs index c05eec63..b9d404cf 100644 --- a/src/node/engine_api/mod.rs +++ b/src/node/engine_api/mod.rs @@ -8,8 +8,6 @@ use alloy_rpc_types_engine::{ForkchoiceState, PayloadStatusEnum}; #[cfg(feature = "bench-test")] use jsonrpsee_types::ErrorObjectOwned; #[cfg(feature = "bench-test")] -use reth_payload_primitives::EngineApiMessageVersion; -#[cfg(feature = "bench-test")] use reth_node_ethereum::engine::EthPayloadAttributes; @@ -68,7 +66,6 @@ impl IntoEngineApiRpcModule for BscEngineApi { .fork_choice_updated( forkchoice_state, payload_attrs, - EngineApiMessageVersion::V1, ) .await { diff --git a/src/node/engine_api/payload.rs b/src/node/engine_api/payload.rs index 684d829a..65748a12 100644 --- a/src/node/engine_api/payload.rs +++ b/src/node/engine_api/payload.rs @@ -1,8 +1,5 @@ use crate::node::{engine::BscBuiltPayload, engine_api::validator::BscExecutionData}; -use reth::{ - payload::EthPayloadBuilderAttributes, - primitives::{NodePrimitives, SealedBlock}, -}; +use reth::primitives::{NodePrimitives, SealedBlock}; use reth_node_ethereum::engine::EthPayloadAttributes; use reth_payload_primitives::{BuiltPayload, PayloadTypes}; @@ -14,7 +11,6 @@ pub struct BscPayloadTypes; impl PayloadTypes for BscPayloadTypes { type BuiltPayload = BscBuiltPayload; type PayloadAttributes = EthPayloadAttributes; - type PayloadBuilderAttributes = EthPayloadBuilderAttributes; type ExecutionData = BscExecutionData; fn block_to_payload( diff --git a/src/node/engine_api/validator.rs b/src/node/engine_api/validator.rs index a3b02171..bb09cbce 100644 --- a/src/node/engine_api/validator.rs +++ b/src/node/engine_api/validator.rs @@ -14,7 +14,7 @@ use reth::{ }; use reth_engine_primitives::{ExecutionPayload, PayloadValidator}; use reth_payload_primitives::NewPayloadError; -use reth_primitives::{RecoveredBlock, SealedBlock}; +use reth_primitives_traits::{RecoveredBlock, SealedBlock}; use reth_primitives_traits::Block; use reth_trie_common::HashedPostState; use serde::{Deserialize, Serialize}; @@ -141,6 +141,14 @@ impl ExecutionPayload for BscExecutionData { self.block.header.gas_used() } + fn gas_limit(&self) -> u64 { + self.block.header.gas_limit() + } + + fn slot_number(&self) -> Option { + None + } + fn transaction_count(&self) -> usize { self.block.body.inner.transactions.len() } diff --git a/src/node/evm/assembler.rs b/src/node/evm/assembler.rs index 63f5c269..0d15f3da 100644 --- a/src/node/evm/assembler.rs +++ b/src/node/evm/assembler.rs @@ -176,6 +176,8 @@ where blob_gas_used, excess_blob_gas, requests_hash, + block_access_list_hash: Default::default(), + slot_number: None, }; tracing::debug!( @@ -233,10 +235,13 @@ where let logs_bloom = logs_bloom(receipts.iter().flat_map(|r| &r.logs)); let block_number = evm_env.block_env.number().saturating_to(); - let withdrawals = self + let withdrawals: Option = self .chain_spec .is_shanghai_active_at_timestamp(timestamp) - .then(|| eth_ctx.withdrawals.clone().map(|w| w.into_owned()).unwrap_or_default()); + .then(|| { + let v = eth_ctx.withdrawals.clone().map(|w| w.into_owned()).unwrap_or_default(); + Withdrawals::new(v) + }); let withdrawals_root = withdrawals.as_deref().map(|w| proofs::calculate_withdrawals_root(w)); @@ -293,6 +298,8 @@ where blob_gas_used, excess_blob_gas, requests_hash, + block_access_list_hash: Default::default(), + slot_number: None, }; { // finalize_new_header diff --git a/src/node/evm/builder.rs b/src/node/evm/builder.rs index cc54c7a2..79aeb0b3 100644 --- a/src/node/evm/builder.rs +++ b/src/node/evm/builder.rs @@ -10,7 +10,7 @@ use crate::{ BscPrimitives, }; use alloy_consensus::BlockHeader as _; -use alloy_evm::block::BlockExecutor; +use alloy_evm::block::{BlockExecutor, GasOutput}; use alloy_evm::eth::receipt_builder::ReceiptBuilder; use alloy_primitives::BlockHash; use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks}; @@ -94,15 +94,14 @@ where fn execute_transaction_with_commit_condition( &mut self, tx: impl ExecutorTx, - f: impl FnOnce( - &revm::context::result::ExecutionResult<<::Evm as alloy_evm::Evm>::HaltReason>, - ) -> alloy_evm::block::CommitChanges, - ) -> Result, BlockExecutionError> { - if let Some(gas_used) = - self.executor.execute_transaction_with_commit_condition(tx.as_executable(), f)? + f: impl FnOnce(&::Result) -> alloy_evm::block::CommitChanges, + ) -> Result, BlockExecutionError> { + let (tx_env, recovered) = tx.into_parts(); + if let Some(gas_output) = + self.executor.execute_transaction_with_commit_condition((tx_env, &recovered), f)? { - self.transactions.push(tx.into_recovered()); - Ok(Some(gas_used)) + self.transactions.push(recovered); + Ok(Some(gas_output)) } else { Ok(None) } @@ -112,6 +111,7 @@ where fn finish( self, state: impl StateProvider, + _state_root_precomputed: Option<(alloy_primitives::B256, TrieUpdates)>, ) -> Result, BlockExecutionError> { Ok(self.finish_with_difflayer(state)?.inner) } diff --git a/src/node/evm/config.rs b/src/node/evm/config.rs index d3727760..25c47d05 100644 --- a/src/node/evm/config.rs +++ b/src/node/evm/config.rs @@ -1,5 +1,6 @@ use super::{ - assembler::BscBlockAssembler, builder::BscBlockBuilder, executor::BscBlockExecutor, + assembler::BscBlockAssembler, builder::BscBlockBuilder, + executor::{BscBlockExecutor, BscTxResult}, factory::BscEvmFactory, }; use crate::{ @@ -25,7 +26,8 @@ use reth_evm::{ NextBlockEnvAttributes, }; use reth_evm_ethereum::RethReceiptBuilder; -use reth_primitives::{BlockTy, HeaderTy, SealedBlock, SealedHeader, TransactionSigned}; +use reth_primitives_traits::{BlockTy, HeaderTy, SealedBlock, SealedHeader}; +use reth_ethereum_primitives::TransactionSigned; use reth_primitives_traits::constants::MAX_TX_GAS_LIMIT_OSAKA; use reth_revm::State; use reth_rpc_eth_api::helpers::pending_block::BuildPendingEnv; @@ -229,23 +231,25 @@ where BscTxEnv: IntoTxEnv<::Tx>, { type EvmFactory = EvmF; + type TxExecutionResult = BscTxResult<::HaltReason>; type ExecutionCtx<'a> = BscBlockExecutionCtx<'a>; type Transaction = TransactionSigned; type Receipt = R::Receipt; + type Executor<'a, DB: alloy_evm::block::StateDB, I: Inspector<::Context>> = + BscBlockExecutor<'a, ::Evm, Spec, R>; fn evm_factory(&self) -> &Self::EvmFactory { &self.evm_factory } - #[allow(refining_impl_trait)] fn create_executor<'a, DB, I>( &'a self, - evm: ::Evm<&'a mut State, I>, + evm: ::Evm, ctx: Self::ExecutionCtx<'a>, - ) -> BscBlockExecutor<'a, ::Evm<&'a mut State, I>, Spec, R> + ) -> Self::Executor<'a, DB, I> where - DB: alloy_evm::Database + 'a, - I: Inspector<::Context<&'a mut State>> + 'a, + DB: alloy_evm::block::StateDB, + I: Inspector<::Context>, { BscBlockExecutor::new( evm, @@ -329,6 +333,7 @@ where gas_limit: header.gas_limit(), basefee: header.base_fee_per_gas().unwrap_or_default(), blob_excess_gas_and_price, + slot_num: 0, }; Ok(EvmEnv { cfg_env, block_env }) @@ -408,6 +413,7 @@ where basefee: basefee.unwrap_or_default(), // calculate excess gas based on parent block's blob gas usage blob_excess_gas_and_price, + slot_num: 0, }; Ok(EvmEnv { cfg_env, block_env }) @@ -423,8 +429,9 @@ where parent_hash: block.header().parent_hash, parent_beacon_block_root: block.header().parent_beacon_block_root, ommers: &block.body().ommers, - withdrawals: block.body().withdrawals.as_ref().map(Cow::Borrowed), + withdrawals: block.body().withdrawals.as_ref().map(|w| Cow::Borrowed(w.as_slice())), extra_data: block.header().extra_data.clone(), + slot_number: None, }, header: Some(block.header().clone()), header_hash: Some(block.hash()), @@ -448,8 +455,9 @@ where parent_hash: parent.hash(), parent_beacon_block_root: attributes.inner.parent_beacon_block_root, ommers: &[], - withdrawals: attributes.inner.withdrawals.map(Cow::Owned), + withdrawals: attributes.inner.withdrawals.map(|w| Cow::Owned(w.into_inner())), extra_data: attributes.inner.extra_data, + slot_number: attributes.inner.slot_number, }, header: None, // No header available for next block context header_hash: None, @@ -469,7 +477,7 @@ where ctx: ::ExecutionCtx<'a>, ) -> impl BlockBuilder< Primitives = Self::Primitives, - Executor: BlockExecutorFor<'a, Self::BlockExecutorFactory, DB, I>, + Executor = BlockExecutorFor<'a, Self::BlockExecutorFactory, &'a mut State, I>, > where DB: Database, @@ -522,8 +530,9 @@ where parent_hash: block.header.parent_hash(), parent_beacon_block_root: block.header.parent_beacon_block_root, ommers: &block.body.inner.ommers, - withdrawals: block.body.inner.withdrawals.as_ref().map(Cow::Borrowed), + withdrawals: block.body.inner.withdrawals.as_ref().map(|w| Cow::Borrowed(w.as_slice())), extra_data: block.header.extra_data.clone(), + slot_number: None, }, header: Some(block.header.clone()), header_hash: Some(payload.block_hash_cached()), diff --git a/src/node/evm/error.rs b/src/node/evm/error.rs index 1945c30d..bfc96206 100644 --- a/src/node/evm/error.rs +++ b/src/node/evm/error.rs @@ -4,7 +4,7 @@ use alloy_primitives::{Address, BlockHash, BlockNumber, B256, U256}; use crate::consensus::parlia::error::ParliaConsensusError; use reth_evm::execute::{BlockExecutionError, BlockValidationError}; use reth_provider::ProviderError; -use reth_primitives::{GotExpected, GotExpectedBoxed}; +use reth_primitives_traits::{GotExpected, GotExpectedBoxed}; /// BSC specific block validation error #[derive(thiserror::Error, Debug, Clone)] diff --git a/src/node/evm/executor.rs b/src/node/evm/executor.rs index cf20de55..15512425 100644 --- a/src/node/evm/executor.rs +++ b/src/node/evm/executor.rs @@ -1,39 +1,72 @@ +use super::config::{revm_spec_by_timestamp_and_block_number, BscBlockExecutionCtx}; use super::patch::HertzPatchManager; +use crate::consensus::parlia::SnapshotProvider; use crate::{ - consensus::{SYSTEM_ADDRESS, parlia::{Parlia, Snapshot, VoteAddress}}, evm::{precompiles, transaction::BscTxEnv}, hardforks::BscHardforks, metrics::{BscBlockchainMetrics, BscConsensusMetrics, BscExecutorMetrics, BscRewardsMetrics, BscVoteMetrics}, node::evm::config::BscExecutionSharedCtx, system_contracts::{ - SystemContract, feynman_fork::ValidatorElectionInfo, get_upgrade_system_contracts, is_system_transaction - } + consensus::{ + parlia::{Parlia, Snapshot, VoteAddress}, + SYSTEM_ADDRESS, + }, + evm::{precompiles, transaction::BscTxEnv}, + hardforks::BscHardforks, + metrics::{ + BscBlockchainMetrics, BscConsensusMetrics, BscExecutorMetrics, BscRewardsMetrics, + BscVoteMetrics, + }, + node::evm::config::BscExecutionSharedCtx, + system_contracts::{ + feynman_fork::ValidatorElectionInfo, get_upgrade_system_contracts, is_system_transaction, + SystemContract, + }, }; -use alloy_consensus::{Header, Transaction, TxReceipt}; +use alloy_consensus::{Header, TxReceipt, TxType}; +use alloy_eips::eip2935::{HISTORY_STORAGE_ADDRESS, HISTORY_STORAGE_CODE}; use alloy_eips::{eip7685::Requests, Encodable2718}; -use alloy_evm::{block::{ExecutableTx, StateChangeSource}, eth::receipt_builder::ReceiptBuilderCtx}; -use alloy_primitives::{hex, uint, Address, U256, BlockNumber, Bytes}; +use alloy_evm::{ + block::{ExecutableTx, GasOutput, StateChangeSource, TxResult}, + eth::receipt_builder::ReceiptBuilderCtx, +}; +use alloy_primitives::keccak256; +use alloy_primitives::{hex, uint, Address, BlockNumber, Bytes, U256}; use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks}; -use super::config::{BscBlockExecutionCtx, revm_spec_by_timestamp_and_block_number}; +use reth_ethereum_primitives::TransactionSigned; use reth_evm::{ - block::{BlockValidationError, CommitChanges}, + block::BlockValidationError, eth::receipt_builder::ReceiptBuilder, execute::{BlockExecutionError, BlockExecutor}, system_calls::SystemCaller, - Database, Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, OnStateHook, RecoveredTx, + Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, OnStateHook, }; -use reth_primitives::TransactionSigned; use reth_provider::BlockExecutionResult; -use reth_revm::State; +use revm::Database as _; use revm::{ - context::{ - result::{ExecutionResult, ResultAndState}, - - }, + context::result::{ExecutionResult, Output, ResultAndState, ResultGas, SuccessReason}, context_interface::block::Block, - state::Bytecode, + state::{Account as RevmAccount, Bytecode, EvmState}, DatabaseCommit, }; -use tracing::{error, warn, info, debug, trace}; -use alloy_eips::eip2935::{HISTORY_STORAGE_ADDRESS, HISTORY_STORAGE_CODE}; -use alloy_primitives::keccak256; use std::{collections::HashMap, sync::Arc}; -use crate::consensus::parlia::SnapshotProvider; +use tracing::{debug, error, info, trace, warn}; + +/// Result of executing a single BSC transaction. +pub struct BscTxResult { + pub inner: ResultAndState, + pub blob_gas_used: u64, + pub tx_type: TxType, + pub tx: TransactionSigned, + pub is_system: bool, +} + +impl TxResult for BscTxResult { + type HaltReason = H; + + fn result(&self) -> &ResultAndState { + &self.inner + } + + fn into_result(self) -> ResultAndState { + self.inner + } +} /// Helper type for the input of post execution. #[allow(clippy::type_complexity)] #[derive(Debug, Clone)] @@ -91,13 +124,14 @@ where pub(super) executor_metrics: BscExecutorMetrics, /// Rewards metrics for tracking reward distributions. pub(super) rewards_metrics: BscRewardsMetrics, + /// Deferred error from commit_transaction (e.g. hertz patch), returned from finish(). + pub(super) deferred_error: Option, } -impl<'a, DB, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> +impl<'a, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> where - DB: Database + 'a, EVM: Evm< - DB = &'a mut State, + DB: alloy_evm::block::StateDB, Tx: FromRecoveredTx + FromRecoveredTx + FromTxWithEncoded, @@ -121,15 +155,19 @@ where ) -> Self { let is_mainnet = spec.chain().id() == 56; // BSC mainnet chain ID let hertz_patch_manager = HertzPatchManager::new(is_mainnet); - + trace!("Succeed to new block executor, header: {:?}", ctx.header); if let Some(ref header) = ctx.header { crate::node::evm::util::HEADER_CACHE_READER .lock() .unwrap() .insert_header_to_cache_with_hash(header.clone(), ctx.header_hash); - } else if !ctx.is_miner { // miner has no current header. - warn!("No header found in the context, block_number: {:?}", evm.block().number().to::()); + } else if !ctx.is_miner { + // miner has no current header. + warn!( + "No header found in the context, block_number: {:?}", + evm.block().number().to::() + ); } let parlia = Arc::new(Parlia::new(Arc::new(spec.clone()), 200)); @@ -163,25 +201,17 @@ where vote_metrics: BscVoteMetrics::default(), executor_metrics: BscExecutorMetrics::default(), rewards_metrics: BscRewardsMetrics::default(), + deferred_error: None, } } - /// Accumulate blob gas used for Cancun blocks. - fn accumulate_blob_gas_used(&mut self, tx: &T) { - if !BscHardforks::is_cancun_active_at_timestamp( - &self.spec, - self.evm.block().number().to::(), - self.evm.block().timestamp().to::(), - ) { - return; - } - - self.blob_gas_used = - self.blob_gas_used.saturating_add(tx.blob_gas_used().unwrap_or_default()); - } - /// Applies system contract upgrades if the Feynman fork is not yet active. - fn upgrade_contracts(&mut self, block_number: BlockNumber, block_timestamp: u64, parent_timestamp: u64) -> Result<(), BlockExecutionError> { + fn upgrade_contracts( + &mut self, + block_number: BlockNumber, + block_timestamp: u64, + parent_timestamp: u64, + ) -> Result<(), BlockExecutionError> { trace!( target: "bsc::executor::upgrade", block_number, @@ -189,7 +219,7 @@ where parent_timestamp, "Calling get_upgrade_system_contracts" ); - + let contracts = get_upgrade_system_contracts( &self.spec, block_number, @@ -215,7 +245,13 @@ where } /// Mimics Geth-BSC's TryUpdateBuildInSystemContract function - fn try_update_build_in_system_contract(&mut self, block_number: BlockNumber, block_timestamp: u64, parent_timestamp: u64, at_block_begin: bool) -> Result<(), BlockExecutionError> { + fn try_update_build_in_system_contract( + &mut self, + block_number: BlockNumber, + block_timestamp: u64, + parent_timestamp: u64, + at_block_begin: bool, + ) -> Result<(), BlockExecutionError> { if at_block_begin { // Upgrade system contracts before Feynman at block begin if !self.spec.is_feynman_active_at_timestamp(block_number, parent_timestamp) { @@ -227,10 +263,14 @@ where ); self.upgrade_contracts(block_number, block_timestamp, parent_timestamp)?; } - + // HistoryStorageAddress is a special system contract in BSC, which can't be upgraded // This must be done at block begin when Prague activates - if self.spec.is_prague_transition_at_block_and_timestamp(block_number, block_timestamp, parent_timestamp) { + if self.spec.is_prague_transition_at_block_and_timestamp( + block_number, + block_timestamp, + parent_timestamp, + ) { info!( target: "bsc::executor::prague", block_number, @@ -272,7 +312,7 @@ where beneficiary: Address, ) -> Result<(), BlockExecutionError> { let txs = self.system_contracts.genesis_contracts_txs(); - for tx in txs { + for tx in txs { self.transact_system_tx(tx.into(), beneficiary)?; } Ok(()) @@ -284,15 +324,15 @@ where address: Address, code: Bytecode, ) -> Result<(), BlockExecutionError> { - let account = - self.evm.db_mut().load_cache_account(address).map_err(BlockExecutionError::other)?; - - let mut info = account.account_info().unwrap_or_default(); + let db = self.evm.db_mut(); + let mut info = db.basic(address).map_err(BlockExecutionError::other)?.unwrap_or_default(); info.code_hash = code.hash_slow(); info.code = Some(code); - - let transition = account.change(info, Default::default()); - self.evm.db_mut().apply_transition(vec![(address, transition)]); + let mut account = RevmAccount::from(info); + account.mark_touch(); + let mut changes: EvmState = Default::default(); + changes.insert(address, account); + db.commit(changes); Ok(()) } @@ -307,7 +347,8 @@ where "Deploying HistoryStorageAddress contract (Prague transition)" ); - let account = self.evm.db_mut().load_cache_account(HISTORY_STORAGE_ADDRESS).map_err(|err| { + let db = self.evm.db_mut(); + let old_info = db.basic(HISTORY_STORAGE_ADDRESS).map_err(|err| { error!( target: "bsc::executor::prague", block_number, @@ -316,8 +357,6 @@ where ); BlockExecutionError::other(err) })?; - - let old_info = account.account_info(); debug!( target: "bsc::executor::prague", block_number, @@ -326,15 +365,17 @@ where "HistoryStorageAddress account before deployment" ); - let mut new_info = account.account_info().unwrap_or_default(); + let mut new_info = old_info.unwrap_or_default(); new_info.code_hash = keccak256(HISTORY_STORAGE_CODE.clone()); new_info.code = Some(Bytecode::new_raw(Bytes::from_static(&HISTORY_STORAGE_CODE))); new_info.nonce = 1_u64; new_info.balance = U256::ZERO; + let mut account = RevmAccount::from(new_info); + account.mark_touch(); + let mut changes: EvmState = Default::default(); + changes.insert(HISTORY_STORAGE_ADDRESS, account); + db.commit(changes); - let transition = account.change(new_info, Default::default()); - self.evm.db_mut().apply_transition(vec![(HISTORY_STORAGE_ADDRESS, transition)]); - info!( target: "bsc::executor::prague", block_number, @@ -344,11 +385,10 @@ where } } -impl<'a, DB, E, Spec, R> BlockExecutor for BscBlockExecutor<'a, E, Spec, R> +impl<'a, E, Spec, R> BlockExecutor for BscBlockExecutor<'a, E, Spec, R> where - DB: Database + 'a, E: Evm< - DB = &'a mut State, + DB: alloy_evm::block::StateDB, Tx: FromRecoveredTx + FromRecoveredTx + FromTxWithEncoded, @@ -364,16 +404,17 @@ where type Transaction = TransactionSigned; type Receipt = R::Receipt; type Evm = E; + type Result = BscTxResult; fn apply_pre_execution_changes(&mut self) -> Result<(), BlockExecutionError> { let block_env = self.evm.block().clone(); trace!( - target: "bsc::executor", + target: "bsc::executor", block_id = %block_env.number(), is_miner = self.ctx.is_miner, "Start to apply_pre_execution_changes" ); - + // Update current block height and header height metrics let block_number = block_env.number().to::(); self.consensus_metrics.current_block_height.set(block_number as f64); @@ -384,23 +425,19 @@ where } else { self.check_new_block(&block_env)?; } - - // set state clear flag if the block is after the Spurious Dragon hardfork. - let block_number = self.evm.block().number().to::(); - let state_clear_flag = self.spec.is_spurious_dragon_active_at_block(block_number); - self.evm.db_mut().set_state_clear_flag(state_clear_flag); + let parent_timestamp = self.inner_ctx.parent_header.as_ref().unwrap().timestamp; self.try_update_build_in_system_contract( - self.evm.block().number().to::(), - self.evm.block().timestamp().to::(), - parent_timestamp, - true + self.evm.block().number().to::(), + self.evm.block().timestamp().to::(), + parent_timestamp, + true, )?; - + // Apply historical block hashes if Prague is active if self.spec.is_prague_active_at_block_and_timestamp( - self.evm.block().number().to::(), - self.evm.block().timestamp().to::() + self.evm.block().number().to::(), + self.evm.block().timestamp().to::(), ) { trace!( target: "bsc::executor::prague", @@ -418,123 +455,78 @@ where fn execute_transaction_without_commit( &mut self, tx: impl ExecutableTx, - ) -> Result::HaltReason>, BlockExecutionError> { - let block_available_gas = self.evm.block().gas_limit() - self.gas_used; - if tx.tx().gas_limit() > block_available_gas { - return Err(BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas { - transaction_gas_limit: tx.tx().gas_limit(), - block_available_gas, - } - .into()); - } + ) -> Result, BlockExecutionError> { + use alloy_evm::RecoveredTx as _; - let tx_hash = tx.tx().trie_hash(); - let block_number = self.evm.block().number().to::(); - let timestamp = self.evm.block().timestamp().to::(); - let spec = revm_spec_by_timestamp_and_block_number(self.spec.clone(), timestamp, block_number); - let (to, selector, input_len) = { - let to = tx.tx().to(); - let input = tx.tx().input(); - let selector = if input.len() >= 4 { - Some(hex::encode(&input[..4])) - } else { - None - }; - (to, selector, input.len()) - }; + let (tx_env, recovered) = tx.into_parts(); + let signer = *recovered.signer(); + let tx_signed: TransactionSigned = recovered.tx().clone(); + let tx_type = tx_signed.tx_type(); - precompiles::push_precompile_trace_context(precompiles::PrecompileTraceContext::from_parts( - block_number, - spec, - false, - Some(tx_hash), - to, - selector, - input_len, - )); - struct PrecompileTracePopGuard; - impl Drop for PrecompileTracePopGuard { - fn drop(&mut self) { - precompiles::pop_precompile_trace_context(); - } + // Detect system transactions: skip EVM execution, accumulate for later. + let is_system = is_system_transaction(&tx_signed, signer, self.evm.block().beneficiary()); + if is_system { + self.system_txs.push(tx_signed.clone()); + let dummy = ResultAndState { + result: ExecutionResult::Success { + reason: SuccessReason::Stop, + gas: ResultGas::default(), + logs: vec![], + output: Output::Call(Bytes::new()), + }, + state: Default::default(), + }; + return Ok(BscTxResult { + inner: dummy, + blob_gas_used: 0, + tx_type, + tx: tx_signed, + is_system: true, + }); } - let _precompile_trace_pop_guard = PrecompileTracePopGuard; - - self.evm - .transact(&tx) - .map_err(|err| BlockExecutionError::evm(err, tx_hash)) - } - - fn commit_transaction( - &mut self, - output: ResultAndState<::HaltReason>, - tx: impl ExecutableTx, - ) -> Result { - let ResultAndState { result, state } = output; - - let mut temp_state = state.clone(); - temp_state.remove(&SYSTEM_ADDRESS); - self.system_caller - .on_state(StateChangeSource::Transaction(self.receipts.len()), &temp_state); - - let gas_used = result.gas_used(); - self.gas_used += gas_used; - self.accumulate_blob_gas_used(tx.tx()); - self.receipts.push(self.receipt_builder.build_receipt(ReceiptBuilderCtx { - tx: tx.tx(), - evm: &self.evm, - result, - state: &state, - cumulative_gas_used: self.gas_used, - })); - - self.evm.db_mut().commit(state); - - Ok(gas_used) - } + // Apply hertz patch before tx (validation only, not mining). + if !self.ctx.is_miner { + self.hertz_patch_manager.patch_before_tx(&tx_signed, self.evm.db_mut())?; + } - fn execute_transaction_with_commit_condition( - &mut self, - tx: impl ExecutableTx, - f: impl FnOnce(&ExecutionResult<::HaltReason>) -> CommitChanges, - ) -> Result, BlockExecutionError> { - // The sum of the transaction's gas limit, Tg, and the gas utilized in this block prior, - // must be no greater than the block's gasLimit. let block_available_gas = self.evm.block().gas_limit() - self.gas_used; - - if tx.tx().gas_limit() > block_available_gas { + let tx_gas_limit = { + use alloy_consensus::Transaction as _; + tx_signed.gas_limit() + }; + if tx_gas_limit > block_available_gas { return Err(BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas { - transaction_gas_limit: tx.tx().gas_limit(), + transaction_gas_limit: tx_gas_limit, block_available_gas, } .into()); } - let tx_hash = tx.tx().trie_hash(); + let tx_hash = tx_signed.trie_hash(); let block_number = self.evm.block().number().to::(); let timestamp = self.evm.block().timestamp().to::(); - let spec = revm_spec_by_timestamp_and_block_number(self.spec.clone(), timestamp, block_number); + let spec = + revm_spec_by_timestamp_and_block_number(self.spec.clone(), timestamp, block_number); let (to, selector, input_len) = { - let to = tx.tx().to(); - let input = tx.tx().input(); - let selector = if input.len() >= 4 { - Some(hex::encode(&input[..4])) - } else { - None - }; + use alloy_consensus::Transaction as _; + let to = tx_signed.to(); + let input = tx_signed.input(); + let selector = if input.len() >= 4 { Some(hex::encode(&input[..4])) } else { None }; (to, selector, input.len()) }; - precompiles::push_precompile_trace_context(precompiles::PrecompileTraceContext::from_parts( - block_number, - spec, - false, - Some(tx_hash), - to, - selector, - input_len, - )); + precompiles::push_precompile_trace_context( + precompiles::PrecompileTraceContext::from_parts( + block_number, + spec, + false, + Some(tx_hash), + to, + selector, + input_len, + ), + ); struct PrecompileTracePopGuard; impl Drop for PrecompileTracePopGuard { fn drop(&mut self) { @@ -543,133 +535,69 @@ where } let _precompile_trace_pop_guard = PrecompileTracePopGuard; - // Execute transaction. - let ResultAndState { result, state } = self - .evm - .transact(&tx) - .map_err(|err| BlockExecutionError::evm(err, tx_hash))?; + let blob_gas_used = + if BscHardforks::is_cancun_active_at_timestamp(&self.spec, block_number, timestamp) { + use alloy_consensus::Transaction as _; + tx_signed.blob_gas_used().unwrap_or_default() + } else { + 0 + }; + + let inner = + self.evm.transact(tx_env).map_err(|err| BlockExecutionError::evm(err, tx_hash))?; + + Ok(BscTxResult { inner, blob_gas_used, tx_type, tx: tx_signed, is_system: false }) + } - if !f(&result).should_commit() { - return Ok(None); + fn commit_transaction( + &mut self, + output: BscTxResult, + ) -> GasOutput { + if output.is_system { + return GasOutput::new(0); } + let ResultAndState { result, state } = output.inner; + let mut temp_state = state.clone(); temp_state.remove(&SYSTEM_ADDRESS); self.system_caller .on_state(StateChangeSource::Transaction(self.receipts.len()), &temp_state); - let gas_used = result.gas_used(); - - // append gas used + let gas_used = result.tx_gas_used(); self.gas_used += gas_used; - self.accumulate_blob_gas_used(tx.tx()); + self.blob_gas_used = self.blob_gas_used.saturating_add(output.blob_gas_used); - // Push transaction changeset and calculate header bloom filter for receipt. self.receipts.push(self.receipt_builder.build_receipt(ReceiptBuilderCtx { - tx: tx.tx(), + tx_type: output.tx_type, evm: &self.evm, result, state: &state, cumulative_gas_used: self.gas_used, })); - // Commit the state changes. self.evm.db_mut().commit(state); - Ok(Some(gas_used)) - } - - fn execute_transaction_with_result_closure( - &mut self, - tx: impl ExecutableTx - + IntoTxEnv<::Tx> - + RecoveredTx, - f: impl for<'b> FnOnce(&'b ExecutionResult<::HaltReason>), - ) -> Result { - let signer = tx.signer(); - let is_system = is_system_transaction(tx.tx(), *signer, self.evm.block().beneficiary()); - if is_system { - self.system_txs.push(tx.tx().clone()); - return Ok(0); - } - - self.hertz_patch_manager.patch_before_tx(tx.tx(), self.evm.db_mut())?; - - let block_available_gas = self.evm.block().gas_limit() - self.gas_used; - if tx.tx().gas_limit() > block_available_gas { - return Err(BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas { - transaction_gas_limit: tx.tx().gas_limit(), - block_available_gas, + // Apply hertz patch after tx (validation only, not mining). + // commit_transaction cannot return errors in the new API, so defer any error to finish(). + if !self.ctx.is_miner { + if let Err(e) = self.hertz_patch_manager.patch_after_tx(&output.tx, self.evm.db_mut()) { + self.deferred_error = Some(e); } - .into()); } - let tx_hash = tx.tx().trie_hash(); - let block_number = self.evm.block().number().to::(); - let timestamp = self.evm.block().timestamp().to::(); - let spec = revm_spec_by_timestamp_and_block_number(self.spec.clone(), timestamp, block_number); - let (to, selector, input_len) = { - let to = tx.tx().to(); - let input = tx.tx().input(); - let selector = if input.len() >= 4 { - Some(hex::encode(&input[..4])) - } else { - None - }; - (to, selector, input.len()) - }; - - precompiles::push_precompile_trace_context(precompiles::PrecompileTraceContext::from_parts( - block_number, - spec, - false, - Some(tx_hash), - to, - selector, - input_len, - )); - struct PrecompileTracePopGuard; - impl Drop for PrecompileTracePopGuard { - fn drop(&mut self) { - precompiles::pop_precompile_trace_context(); - } - } - let _precompile_trace_pop_guard = PrecompileTracePopGuard; - - let tx_ref = tx.tx().clone(); - let result_and_state = - self.evm.transact(tx).map_err(|err| BlockExecutionError::evm(err, tx_hash))?; - let ResultAndState { result, state } = result_and_state; - - f(&result); - - let mut temp_state = state.clone(); - temp_state.remove(&SYSTEM_ADDRESS); - self.system_caller.on_state(StateChangeSource::Transaction(self.receipts.len()), &temp_state); - - let gas_used = result.gas_used(); - self.gas_used += gas_used; - self.accumulate_blob_gas_used(&tx_ref); - self.receipts.push(self.receipt_builder.build_receipt(ReceiptBuilderCtx { - tx: &tx_ref, - evm: &self.evm, - result, - state: &state, - cumulative_gas_used: self.gas_used, - })); - self.evm.db_mut().commit(state); - - self.hertz_patch_manager.patch_after_tx(&tx_ref, self.evm.db_mut())?; - Ok(gas_used) + GasOutput::new(gas_used) } - fn finish( mut self, ) -> Result<(Self::Evm, BlockExecutionResult), BlockExecutionError> { + if let Some(err) = self.deferred_error.take() { + return Err(err); + } let block_env = self.evm.block().clone(); debug!( - target: "bsc::executor", + target: "bsc::executor", block_id = %block_env.number(), is_miner = self.ctx.is_miner, "Start to finish" @@ -677,17 +605,17 @@ where let parent_timestamp = self.inner_ctx.parent_header.as_ref().unwrap().timestamp; self.try_update_build_in_system_contract( - self.evm.block().number().to::(), - self.evm.block().timestamp().to::(), - parent_timestamp, - false + self.evm.block().number().to::(), + self.evm.block().timestamp().to::(), + parent_timestamp, + false, )?; // Initialize Feynman contracts on transition block if self.spec.is_feynman_transition_at_timestamp( - self.evm.block().number().to::(), - self.evm.block().timestamp().to::(), - parent_timestamp + self.evm.block().number().to::(), + self.evm.block().timestamp().to::(), + parent_timestamp, ) { info!( target: "bsc::executor::feynman", @@ -715,23 +643,25 @@ where // Update receipt height metric let block_number = self.evm.block().number().to::(); self.blockchain_metrics.current_receipt_height.set(block_number as f64); - + // Update block execution metrics self.executor_metrics.executed_blocks_total.increment(1); - + // Update block insert metrics // Calculate total transaction size in bytes (simplified estimation) - // Each receipt contributes approximately: + // Each receipt contributes approximately: // - Base tx overhead: ~100 bytes // - Per log: ~100 bytes (address + topics + data average) - let tx_size_bytes: usize = self.receipts.iter() + let tx_size_bytes: usize = self + .receipts + .iter() .map(|r| { let logs_count = r.logs().len(); 100 + logs_count * 100 // Base + logs estimation }) .sum(); self.blockchain_metrics.block_tx_size_bytes.set(tx_size_bytes as f64); - + // Calculate block receive time difference // This is the difference between current block timestamp and parent block timestamp let current_timestamp = self.evm.block().timestamp().to::(); @@ -740,7 +670,7 @@ where let time_diff = (current_timestamp as i64) - (parent_timestamp as i64); self.blockchain_metrics.block_receive_time_diff_seconds.set(time_diff as f64); } - + // Note: For gas-related metrics, use reth's ExecutorMetrics: // - sync.execution.gas_used_histogram // - sync.execution.gas_per_second (can be converted to MGas/s) @@ -772,5 +702,4 @@ where fn receipts(&self) -> &[Self::Receipt] { &self.receipts } - } diff --git a/src/node/evm/mod.rs b/src/node/evm/mod.rs index c73ec559..7d9f03df 100644 --- a/src/node/evm/mod.rs +++ b/src/node/evm/mod.rs @@ -20,7 +20,7 @@ use reth_evm::{precompiles::PrecompilesMap, Database, Evm, EvmEnv}; use revm::{ context::{ result::{EVMError, HaltReason, ResultAndState}, - BlockEnv, + BlockEnv, CfgEnv, }, Context, ExecuteEvm, InspectEvm, Inspector, SystemCallEvm, }; @@ -54,6 +54,10 @@ where type Precompiles = PrecompilesMap; type Inspector = I; + fn cfg_env(&self) -> &CfgEnv { + &self.inner.ctx.cfg + } + fn chain_id(&self) -> u64 { self.cfg.chain_id } diff --git a/src/node/evm/patch/mod.rs b/src/node/evm/patch/mod.rs index dd124557..8eda7b65 100644 --- a/src/node/evm/patch/mod.rs +++ b/src/node/evm/patch/mod.rs @@ -1,8 +1,7 @@ use alloy_primitives::{address, b256, Address, B256, U256}; use reth_evm::block::BlockExecutionError; use reth_primitives_traits::SignedTransaction; -use reth_revm::{db::states::StorageSlot, State}; -use revm::Database; +use revm::{state::{Account, EvmState, EvmStorageSlot}, Database, DatabaseCommit}; use std::{collections::HashMap, str::FromStr, sync::LazyLock}; use tracing::trace; @@ -676,100 +675,94 @@ static CHAPEL_PATCHES_AFTER_TX: LazyLock> = LazyLock pub(crate) fn patch_mainnet_before_tx( transaction: &T, - state: &mut State, + db: &mut DB, ) -> Result<(), BlockExecutionError> where T: SignedTransaction, - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, { let tx_hash = transaction.tx_hash(); if let Some(patch) = MAINNET_PATCHES_BEFORE_TX.get(tx_hash) { trace!("patch evm state for mainnet before tx {:?}", tx_hash); - - apply_patch(state, patch.address, &patch.storage)?; + apply_patch(db, patch.address, &patch.storage)?; } Ok(()) } pub(crate) fn patch_mainnet_after_tx( transaction: &T, - state: &mut State, + db: &mut DB, ) -> Result<(), BlockExecutionError> where - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, T: SignedTransaction, { let tx_hash = transaction.tx_hash(); if let Some(patch) = MAINNET_PATCHES_AFTER_TX.get(tx_hash) { trace!("patch evm state for mainnet after tx {:?}", tx_hash); - - apply_patch(state, patch.address, &patch.storage)?; + apply_patch(db, patch.address, &patch.storage)?; } Ok(()) } pub(crate) fn patch_chapel_before_tx( transaction: &T, - state: &mut State, + db: &mut DB, ) -> Result<(), BlockExecutionError> where T: SignedTransaction, - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, { let tx_hash = transaction.tx_hash(); if let Some(patch) = CHAPEL_PATCHES_BEFORE_TX.get(tx_hash) { trace!("patch evm state for chapel testnet before tx {:?}", tx_hash); - - apply_patch(state, patch.address, &patch.storage)?; + apply_patch(db, patch.address, &patch.storage)?; } Ok(()) } pub(crate) fn patch_chapel_after_tx( transaction: &T, - state: &mut State, + db: &mut DB, ) -> Result<(), BlockExecutionError> where - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, T: SignedTransaction, { let tx_hash = transaction.tx_hash(); if let Some(patch) = CHAPEL_PATCHES_AFTER_TX.get(tx_hash) { trace!("patch evm state for chapel testnet after tx {:?}", tx_hash); - - apply_patch(state, patch.address, &patch.storage)?; + apply_patch(db, patch.address, &patch.storage)?; } Ok(()) } fn apply_patch( - state: &mut State, + db: &mut DB, address: Address, storage: &HashMap, ) -> Result<(), BlockExecutionError> where - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, { - let account = state.load_cache_account(address).map_err(BlockExecutionError::other)?; - let account_change = account.change( - account.account_info().unwrap_or_default(), - storage - .iter() - .map(|(key, value)| { - ( - *key, - StorageSlot { previous_or_original_value: U256::ZERO, present_value: *value }, - ) - }) - .collect(), - ); - - state.apply_transition(vec![(address, account_change)]); + let info = db.basic(address).map_err(BlockExecutionError::other)?.unwrap_or_default(); + let mut account = Account::from(info); + account.mark_touch(); + for (&key, &value) in storage.iter() { + let original = if value == U256::ZERO { U256::from(1) } else { U256::ZERO }; + account.storage.insert( + key, + EvmStorageSlot { original_value: original, present_value: value, transaction_id: 0, is_cold: false }, + ); + } + let mut changes: EvmState = Default::default(); + changes.insert(address, account); + db.commit(changes); Ok(()) } @@ -784,31 +777,31 @@ impl HertzPatchManager { Self { is_mainnet } } - pub fn patch_before_tx(&self, transaction: &T, state: &mut State) -> Result<(), BlockExecutionError> + pub fn patch_before_tx(&self, transaction: &T, db: &mut DB) -> Result<(), BlockExecutionError> where T: SignedTransaction, - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, { if self.is_mainnet { - patch_mainnet_before_tx(transaction, state)?; + patch_mainnet_before_tx(transaction, db)?; } else { - patch_chapel_before_tx(transaction, state)?; + patch_chapel_before_tx(transaction, db)?; } Ok(()) } - + /// Apply patches after transaction execution - pub fn patch_after_tx(&self, transaction: &T, state: &mut State) -> Result<(), BlockExecutionError> + pub fn patch_after_tx(&self, transaction: &T, db: &mut DB) -> Result<(), BlockExecutionError> where T: SignedTransaction, - DB: Database, - ::Error: Sync + Send + 'static, + DB: Database + DatabaseCommit, + ::Error: std::error::Error + Send + Sync + 'static, { if self.is_mainnet { - patch_mainnet_after_tx(transaction, state)?; + patch_mainnet_after_tx(transaction, db)?; } else { - patch_chapel_after_tx(transaction, state)?; + patch_chapel_after_tx(transaction, db)?; } Ok(()) } diff --git a/src/node/evm/post_execution.rs b/src/node/evm/post_execution.rs index 599b61d9..75807831 100644 --- a/src/node/evm/post_execution.rs +++ b/src/node/evm/post_execution.rs @@ -12,17 +12,16 @@ use crate::evm::precompiles; use crate::evm::transaction::BscTxEnv; use crate::system_contracts::{SLASH_CONTRACT, SYSTEM_REWARD_CONTRACT, STAKE_HUB_CONTRACT, feynman_fork::{ValidatorElectionInfo, get_top_validators_by_voting_power, ElectedValidators}}; use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks}; -use reth_evm::{eth::receipt_builder::{ReceiptBuilder, ReceiptBuilderCtx}, execute::BlockExecutionError, Database, Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, block::StateChangeSource}; -use reth_primitives::{TransactionSigned, Transaction}; -use reth_revm::State; +use reth_evm::{eth::receipt_builder::{ReceiptBuilder, ReceiptBuilderCtx}, execute::BlockExecutionError, Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, block::StateChangeSource}; +use reth_ethereum_primitives::{TransactionSigned, Transaction}; use crate::node::evm::ResultAndState; use revm::{ context::{BlockEnv, TxEnv}, context_interface::block::Block, - Database as RevmDatabase, + Database as _, DatabaseCommit, + state::{Account as RevmAccount, EvmState}, }; -use revm_database::DatabaseCommitExt; use alloy_consensus::{Header, TxReceipt, Transaction as AlloyTransaction, SignableTransaction}; use alloy_primitives::{Address, BlockNumber, TxKind, U256, hex}; use std::collections::HashMap; @@ -39,11 +38,10 @@ fn turn_length_matches(turn_length_from_header: Option, expected_turn_length } -impl<'a, DB, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> +impl<'a, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> where - DB: Database + 'a, EVM: Evm< - DB = &'a mut State, + DB: alloy_evm::block::StateDB, Tx: FromRecoveredTx + FromRecoveredTx + FromTxWithEncoded, @@ -414,20 +412,24 @@ where } let _precompile_trace_pop_guard = PrecompileTracePopGuard; - let result_and_state = self.evm.transact(tx_env).map_err(BlockExecutionError::other)?; + let result_and_state = self.evm.transact(tx_env.into_tx_env()).map_err(BlockExecutionError::other)?; let ResultAndState { result, state } = result_and_state; let mut temp_state = state.clone(); temp_state.remove(&SYSTEM_ADDRESS); self.system_caller.on_state(StateChangeSource::Transaction(self.receipts.len()), &temp_state); - let gas_used = result.gas_used(); + let gas_used = result.tx_gas_used(); self.gas_used += gas_used; - + // Record system transaction gas usage self.executor_metrics.system_tx_gas_used_total.increment(gas_used); + let tx_type = { + use alloy_consensus::TxType; + signed_tx.as_ref().map(|tx| tx.tx_type()).unwrap_or(TxType::Legacy) + }; self.receipts.push(self.receipt_builder.build_receipt(ReceiptBuilderCtx { - tx: signed_tx.as_ref().unwrap(), + tx_type, evm: &self.evm, result, state: &state, @@ -446,27 +448,37 @@ where &mut self, validator: Address, ) -> Result<(), BlockExecutionError> { - let system_account = self - .evm - .db_mut() - .load_cache_account(SYSTEM_ADDRESS) - .map_err(BlockExecutionError::other)?; + let system_info = self.evm.db_mut().basic(SYSTEM_ADDRESS) + .map_err(BlockExecutionError::other)? + .unwrap_or_default(); + let mut block_reward = system_info.balance.to::(); - if system_account.account.is_none() || - system_account.account.as_ref().unwrap().info.balance == U256::ZERO - { + if block_reward == 0 { return Ok(()); } - let (mut block_reward, mut transition) = system_account.drain_balance(); - transition.info = None; - self.evm.db_mut().apply_transition(vec![(SYSTEM_ADDRESS, transition)]); - let balance_increment = vec![(validator, block_reward)]; + // Zero out SYSTEM_ADDRESS balance + { + let mut system_account = RevmAccount::from(system_info); + system_account.mark_touch(); + system_account.info.balance = U256::ZERO; + let mut changes: EvmState = Default::default(); + changes.insert(SYSTEM_ADDRESS, system_account); + self.evm.db_mut().commit(changes); + } - self.evm - .db_mut() - .increment_balances(balance_increment) - .map_err(BlockExecutionError::other)?; + // Credit validator with the block reward + { + let validator_info = self.evm.db_mut().basic(validator) + .map_err(BlockExecutionError::other)? + .unwrap_or_default(); + let mut validator_account = RevmAccount::from(validator_info); + validator_account.mark_touch(); + validator_account.info.balance = validator_account.info.balance.saturating_add(U256::from(block_reward)); + let mut changes: EvmState = Default::default(); + changes.insert(validator, validator_account); + self.evm.db_mut().commit(changes); + } let system_reward_balance = self .evm @@ -491,7 +503,7 @@ where // Track system rewards distribution self.rewards_metrics.system_rewards_distributed_total.increment(1); // Note: Truncating to u64 for metrics (large rewards unlikely) - self.rewards_metrics.system_rewards_amount_wei_total.increment(reward_to_system.min(u128::from(u64::MAX)) as u64); + self.rewards_metrics.system_rewards_amount_wei_total.increment(reward_to_system.min(u64::MAX as u128) as u64); } block_reward -= reward_to_system; @@ -505,7 +517,7 @@ where // Track validator rewards distribution self.rewards_metrics.validator_rewards_distributed_total.increment(1); // Note: Truncating to u64 for metrics (large rewards unlikely) - self.rewards_metrics.validator_rewards_amount_wei_total.increment(block_reward.min(u128::from(u64::MAX)) as u64); + self.rewards_metrics.validator_rewards_amount_wei_total.increment(block_reward.min(u64::MAX as u128) as u64); Ok(()) } diff --git a/src/node/evm/pre_execution.rs b/src/node/evm/pre_execution.rs index f3a79b31..982389a5 100644 --- a/src/node/evm/pre_execution.rs +++ b/src/node/evm/pre_execution.rs @@ -2,9 +2,8 @@ use super::executor::BscBlockExecutor; use crate::evm::transaction::BscTxEnv; use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks}; -use reth_evm::{eth::receipt_builder::ReceiptBuilder, execute::BlockExecutionError, Database, Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv}; -use reth_primitives::TransactionSigned; -use reth_revm::State; +use reth_evm::{eth::receipt_builder::ReceiptBuilder, execute::BlockExecutionError, Evm, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv}; +use reth_ethereum_primitives::TransactionSigned; use revm::{ context::{BlockEnv, TxEnv}, context_interface::block::Block, @@ -20,7 +19,7 @@ use crate::node::evm::util::HEADER_CACHE_READER; use crate::system_contracts::feynman_fork::ValidatorElectionInfo; use std::{collections::HashMap, sync::{LazyLock, Mutex}}; use schnellru::{ByLength, LruMap}; -use reth_primitives::GotExpected; +use reth_primitives_traits::GotExpected; use blst::{ min_pk::{PublicKey, Signature}, BLST_ERROR, @@ -41,11 +40,10 @@ pub static TURN_LENGTH_CACHE: LazyLock> = LazyLock::new(| Mutex::new(LruMap::new(ByLength::new(1024))) }); -impl<'a, DB, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> +impl<'a, EVM, Spec, R: ReceiptBuilder> BscBlockExecutor<'a, EVM, Spec, R> where - DB: Database + 'a, EVM: Evm< - DB = &'a mut State, + DB: alloy_evm::block::StateDB, Tx: FromRecoveredTx + FromRecoveredTx + FromTxWithEncoded, @@ -232,7 +230,7 @@ where is_system_transaction: true, }; - let result_and_state = self.evm.transact(tx_env).map_err(BlockExecutionError::other)?; + let result_and_state = self.evm.transact(tx_env.into_tx_env()).map_err(BlockExecutionError::other)?; if !result_and_state.result.is_success() { tracing::error!("Failed to eth call, to: {:?}, data: {:?}", to, data); return Err(BlockExecutionError::msg("ETH call failed")); diff --git a/src/node/evm/util.rs b/src/node/evm/util.rs index b3c4cb34..e1052db8 100644 --- a/src/node/evm/util.rs +++ b/src/node/evm/util.rs @@ -1,4 +1,4 @@ -use reth_primitives::Transaction; +use reth_ethereum_primitives::Transaction; use alloy_consensus::{Header, BlockHeader}; use alloy_primitives::{B256, BlockHash, BlockNumber}; use schnellru::{ByLength, LruMap}; diff --git a/src/node/miner/bid_simulator.rs b/src/node/miner/bid_simulator.rs index c1f8805f..a7c72a5e 100644 --- a/src/node/miner/bid_simulator.rs +++ b/src/node/miner/bid_simulator.rs @@ -15,7 +15,7 @@ use alloy_evm::Evm; use alloy_primitives::U256; use alloy_primitives::{Address, B256}; use parking_lot::RwLock; -use reth::payload::EthPayloadBuilderAttributes; +use reth_node_ethereum::engine::EthPayloadAttributes; use reth::transaction_pool::BestTransactionsAttributes; use reth_chainspec::EthChainSpec; use reth_ethereum_payload_builder::EthereumBuilderConfig; @@ -24,12 +24,12 @@ use reth_evm::execute::BlockBuilderOutcome; use reth_evm::execute::{BlockExecutionError, BlockValidationError}; use reth_evm::{ConfigureEvm, NextBlockEnvAttributes}; use reth_execution_types::BlockExecutionOutput; -use reth_payload_primitives::PayloadBuilderAttributes; use reth_payload_primitives::{BuiltPayloadExecutedBlock, PayloadBuilderError}; +use alloy_eips::eip4895::Withdrawals; use either::Either; -use revm_context_interface::Block as EvmBlock; -use reth_primitives::SealedHeader; -use reth_primitives::TransactionSigned; +use revm::context_interface::Block as EvmBlock; +use reth_primitives_traits::SealedHeader; +use reth_ethereum_primitives::TransactionSigned; use reth_primitives_traits::SignerRecoverable; use reth_provider::StateProviderFactory; use reth_provider::{BlockHashReader, HeaderProvider}; @@ -51,7 +51,7 @@ pub struct Bid { pub builder: Address, pub block_number: u64, pub parent_hash: B256, - pub txs: Vec, + pub txs: Vec, pub blob_sidecars: HashMap, pub un_revertible: Vec, pub gas_used: u64, @@ -79,6 +79,7 @@ pub struct BidSimulator { parlia: Arc>, pool: Pool, validator_address: Address, + task_executor: reth_tasks::TaskExecutor, // Each map has its own lock for fine-grained concurrency control // This avoids writer starvation when one operation needs write access @@ -117,12 +118,14 @@ where snapshot_provider: Arc, validator_commission: u64, greedy_merge: bool, + task_executor: reth_tasks::TaskExecutor, ) -> Self { Self { client, parlia, pool, validator_address, + task_executor, chain_spec, snapshot_provider, best_bid_to_run: Arc::new(RwLock::new(HashMap::new())), @@ -313,7 +316,7 @@ where &self, _bid: &Bid, _validator_commission: u64, - attributes: EthPayloadBuilderAttributes, + attributes: EthPayloadAttributes, mining_ctx: MiningContext, ) -> Result, Box> { let mut runtime = BidRuntime::new( @@ -419,6 +422,7 @@ where parent_header.state_root(), path_db, Some(difflayers), + self.task_executor.clone(), ) .ok() }); @@ -442,13 +446,14 @@ where &parent_header, BscNextBlockEnvAttributes { inner: NextBlockEnvAttributes { - timestamp: attributes.timestamp(), - suggested_fee_recipient: attributes.suggested_fee_recipient(), - prev_randao: attributes.prev_randao(), + timestamp: attributes.timestamp, + suggested_fee_recipient: attributes.suggested_fee_recipient, + prev_randao: attributes.prev_randao, gas_limit, - parent_beacon_block_root: attributes.parent_beacon_block_root(), - withdrawals: Some(attributes.withdrawals().clone()), + parent_beacon_block_root: attributes.parent_beacon_block_root, + withdrawals: attributes.withdrawals.as_ref().map(|w| Withdrawals::new(w.clone())), extra_data: builder_config.extra_data.clone(), + slot_number: None, }, parent_difflayers: triedb_env_difflayers, triedb_prefetcher, @@ -703,7 +708,7 @@ pub struct BidRuntime { pool: Pool, evm_config: EvmConfig, parent_header: SealedHeader, - attributes: EthPayloadBuilderAttributes, + attributes: EthPayloadAttributes, builder_config: EthereumBuilderConfig, chain_spec: Arc, pub bsc_payload: Option, @@ -733,7 +738,7 @@ where bid: Bid, pool: Pool, evm_config: EvmConfig, - attributes: EthPayloadBuilderAttributes, + attributes: EthPayloadAttributes, chain_spec: Arc, mining_ctx: MiningContext, ) -> Self { @@ -807,7 +812,7 @@ where B::Primitives: reth_primitives_traits::NodePrimitives, { let base_fee: u64 = builder.evm().block().basefee(); - let blob_params = self.chain_spec.blob_params_at_timestamp(self.attributes.timestamp()); + let blob_params = self.chain_spec.blob_params_at_timestamp(self.attributes.timestamp); let header = self.mining_ctx.header.as_ref().unwrap(); let blob_eligible = is_blob_eligible_block(&self.chain_spec, header.number, header.timestamp); let mut max_blob_count = @@ -927,13 +932,13 @@ where } } - self.gas_used += tx_gas_used; + self.gas_used += tx_gas_used.tx_gas_used(); let tx_effective_gas_price = recovered_tx .effective_tip_per_gas(base_fee) .expect("fee is always valid; execution succeeded"); self.gas_fee += (U256::from(tx_effective_gas_price) + U256::from(base_fee)) - * U256::from(tx_gas_used); - self.system_balance += U256::from(tx_effective_gas_price) * U256::from(tx_gas_used); + * U256::from(tx_gas_used.tx_gas_used()); + self.system_balance += U256::from(tx_effective_gas_price) * U256::from(tx_gas_used.tx_gas_used()); } Ok(()) @@ -959,7 +964,7 @@ where fn fill_tx_from_pool( &mut self, builder: &mut B, - bid_txs: Vec, + bid_txs: Vec, block_gas_limit: u64, delay_ms: u64, ) -> Result<(), Box> diff --git a/src/node/miner/bsc_miner.rs b/src/node/miner/bsc_miner.rs index a8eab2b3..4e1b5b68 100644 --- a/src/node/miner/bsc_miner.rs +++ b/src/node/miner/bsc_miner.rs @@ -33,7 +33,8 @@ use reth_chainspec::EthChainSpec; use reth_ethereum_payload_builder::EthereumBuilderConfig; use reth_network::message::NewBlockMessage; use reth_payload_primitives::BuiltPayload; -use reth_primitives::{SealedHeader, TransactionSigned}; +use reth_primitives_traits::SealedHeader; +use reth_ethereum_primitives::TransactionSigned; use reth_primitives_traits::BlockBody; use reth_provider::{ BlockNumReader, CanonStateNotification, CanonStateSubscriptions, HeaderProvider, @@ -53,8 +54,8 @@ const RECENT_MINED_BLOCKS_CACHE_SIZE: usize = 100; #[derive(Clone, Debug)] pub struct MiningContext { - pub header: Option, // tmp header for payload building. - pub parent_header: reth_primitives::SealedHeader, + pub header: Option, // tmp header for payload building. + pub parent_header: reth_primitives_traits::SealedHeader, pub parent_snapshot: Arc, pub is_inturn: bool, pub cached_reads: Option, @@ -399,7 +400,7 @@ where } } - fn get_tip_header_at_startup(&self) -> Option { + fn get_tip_header_at_startup(&self) -> Option { let best_number = self.provider.best_block_number().ok()?; let tip_header = self.provider.sealed_header(best_number).ok()??; Some(tip_header) @@ -560,6 +561,7 @@ pub struct MainWorkWorker { simulator: Arc>, // No outer RwLock, each map has its own lock desired_gas_limit: u64, desired_min_gas_tip: u128, + task_executor: reth_tasks::TaskExecutor, } impl MainWorkWorker @@ -588,6 +590,7 @@ where payload_tx: mpsc::UnboundedSender, desired_gas_limit: u64, desired_min_gas_tip: u128, + task_executor: reth_tasks::TaskExecutor, ) -> Self { Self { pool, @@ -602,6 +605,7 @@ where payload_job_join_set: JoinSet::new(), desired_gas_limit, desired_min_gas_tip, + task_executor, } } @@ -715,10 +719,11 @@ where self.chain_spec.clone(), self.parlia.clone(), mining_ctx.clone(), + self.task_executor.clone(), ); let build_args = BscBuildArguments { cached_reads: mining_ctx.cached_reads.clone().unwrap_or_default(), - config: PayloadConfig::new(Arc::new(mining_ctx.parent_header.clone()), attributes), + config: PayloadConfig::new(Arc::new(mining_ctx.parent_header.clone()), attributes, alloy_rpc_types_engine::PayloadId::new([0u8; 8])), cancel: ManualCancel::default(), trace_id: crate::node::miner::payload::generate_trace_id(), min_gas_tip: crate::shared::get_miner_gas_tip() @@ -1271,6 +1276,7 @@ where snapshot_provider.clone(), mining_config.validator_commission.unwrap_or(100), mining_config.greedy_merge, + task_executor.clone(), )); let main_work_worker = MainWorkWorker::new( validator_address, @@ -1283,6 +1289,7 @@ where payload_tx, desired_gas_limit, desired_min_gas_tip, + task_executor.clone(), ); let result_work_worker = ResultWorkWorker::new( @@ -1317,10 +1324,10 @@ where } fn spawn_workers(self) -> Result<(), Box> { - self.task_executor.spawn_critical("mev_work_worker", self.mev_work_worker.run()); - self.task_executor.spawn_critical("new_work_worker", self.new_work_worker.run()); - self.task_executor.spawn_critical("main_work_worker", self.main_work_worker.run()); - self.task_executor.spawn_critical("result_work_worker", self.result_work_worker.run()); + self.task_executor.spawn_critical_task("mev_work_worker", self.mev_work_worker.run()); + self.task_executor.spawn_critical_task("new_work_worker", self.new_work_worker.run()); + self.task_executor.spawn_critical_task("main_work_worker", self.main_work_worker.run()); + self.task_executor.spawn_critical_task("result_work_worker", self.result_work_worker.run()); info!("Succeed to start mining, address: {}", self.validator_address); Ok(()) } diff --git a/src/node/miner/payload.rs b/src/node/miner/payload.rs index 65742672..aff062e1 100644 --- a/src/node/miner/payload.rs +++ b/src/node/miner/payload.rs @@ -18,7 +18,7 @@ use alloy_consensus::{BlockHeader, Transaction}; use alloy_evm::block::BlockExecutor; use alloy_evm::Evm; use alloy_primitives::U256; -use reth::payload::EthPayloadBuilderAttributes; +use reth_node_ethereum::engine::EthPayloadAttributes; use reth::transaction_pool::error::Eip4844PoolTransactionError; use reth::transaction_pool::error::InvalidPoolTransactionError; use reth::transaction_pool::BestTransactionsAttributes; @@ -31,14 +31,14 @@ use reth_evm::execute::BlockBuilder; use reth_evm::execute::BlockBuilderOutcome; use reth_evm::{ConfigureEvm, NextBlockEnvAttributes}; use reth_execution_types::BlockExecutionOutput; -use reth_payload_primitives::PayloadBuilderAttributes; use reth_payload_primitives::{BuiltPayload, BuiltPayloadExecutedBlock, PayloadBuilderError}; +use alloy_eips::eip4895::Withdrawals; use either::Either; use once_cell::sync::Lazy; -use revm_context_interface::Block as EvmBlock; -use reth_primitives::{HeaderTy, SealedHeader}; -use reth_primitives::InvalidTransactionError; -use reth_primitives::TransactionSigned; +use revm::context_interface::Block as EvmBlock; +use reth_primitives_traits::{HeaderTy, SealedHeader}; +use reth_primitives_traits::transaction::error::InvalidTransactionError; +use reth_ethereum_primitives::TransactionSigned; use reth_primitives_traits::{BlockBody, RecoveredBlock, SignerRecoverable}; use reth_provider::StateProviderFactory; use reth_revm::cached::CachedReads; @@ -306,6 +306,8 @@ pub struct BscPayloadBuilder { parlia: Arc>, // Mining context containing header information for blob fee calculation ctx: MiningContext, + /// Task executor for spawning blocking tasks (e.g., trie prefetcher). + task_executor: reth_tasks::TaskExecutor, } impl BscPayloadBuilder @@ -320,7 +322,8 @@ where >, Pool: TransactionPool> + 'static, { - pub const fn new( + #[allow(clippy::too_many_arguments)] + pub fn new( client: Client, pool: Pool, evm_config: EvmConfig, @@ -328,8 +331,9 @@ where chain_spec: Arc, parlia: Arc>, ctx: MiningContext, + task_executor: reth_tasks::TaskExecutor, ) -> Self { - Self { client, pool, evm_config, builder_config, chain_spec, parlia, ctx } + Self { client, pool, evm_config, builder_config, chain_spec, parlia, ctx, task_executor } } /// Builds a payload with the given arguments. @@ -349,11 +353,11 @@ where /// Returns a `Result` containing the built payload or an error. pub async fn build_payload( &self, - args: BscBuildArguments, + args: BscBuildArguments, ) -> Result> { let build_start = std::time::Instant::now(); let BscBuildArguments { mut cached_reads, config, cancel, trace_id, min_gas_tip, parent_difflayers } = args; - let PayloadConfig { parent_header, attributes } = config; + let PayloadConfig { parent_header, attributes, payload_id: _ } = config; let parent_hash = parent_header.hash_slow(); // Parent difflayers were fetched once at job start; reuse across all retry attempts. @@ -397,7 +401,7 @@ where let triedb_prefetcher = triedb_parent_difflayers.clone().and_then(|difflayers| { let mut triedb = get_global_triedb(); let path_db = triedb.get_mut_path_db_ref().clone(); - MinerTrieDbPrefetcher::new(parent_header.state_root(), path_db, Some(difflayers)).ok() + MinerTrieDbPrefetcher::new(parent_header.state_root(), path_db, Some(difflayers), self.task_executor.clone()).ok() }); // Sinks transport current_validators / turn_length from the builder (which is consumed by @@ -409,15 +413,16 @@ where let next_env_attributes = BscNextBlockEnvAttributes { inner: NextBlockEnvAttributes { - timestamp: attributes.timestamp(), - suggested_fee_recipient: attributes.suggested_fee_recipient(), - prev_randao: attributes.prev_randao(), + timestamp: attributes.timestamp, + suggested_fee_recipient: attributes.suggested_fee_recipient, + prev_randao: attributes.prev_randao, gas_limit: self.builder_config.gas_limit(parent_header.gas_limit), - parent_beacon_block_root: attributes.parent_beacon_block_root(), - withdrawals: Some(attributes.withdrawals().clone()), + parent_beacon_block_root: attributes.parent_beacon_block_root, + withdrawals: attributes.withdrawals.as_ref().map(|w| Withdrawals::new(w.clone())), extra_data: crate::shared::get_miner_extra() .filter(|b| !b.is_empty()) .unwrap_or_else(|| self.builder_config.extra_data.clone()), + slot_number: None, }, parent_difflayers: triedb_parent_difflayers.clone(), triedb_prefetcher: triedb_prefetcher.clone(), @@ -477,7 +482,7 @@ where let mut block_blob_count = 0; let mut blob_fee = None; - let blob_params = self.chain_spec.blob_params_at_timestamp(attributes.timestamp()); + let blob_params = self.chain_spec.blob_params_at_timestamp(attributes.timestamp); let header = self.ctx.header.as_ref().ok_or_else(|| { Box::new(std::io::Error::other("Missing header in mining context")) as Box @@ -609,7 +614,7 @@ where if BscHardforks::is_cancun_active_at_timestamp( &self.chain_spec, parent_header.number + 1, - attributes.timestamp(), + attributes.timestamp, ) { let left = max_blob_count - block_blob_count; if left < blob_tx.tx().blob_gas_used().unwrap_or(0) / BLOB_TX_BLOB_GAS_PER_BLOB @@ -736,8 +741,8 @@ where let miner_fee = tx .effective_tip_per_gas(base_fee) .expect("fee is always valid; execution succeeded"); - total_fees += U256::from(miner_fee) * U256::from(gas_used); - cumulative_gas_used += gas_used; + total_fees += U256::from(miner_fee) * U256::from(gas_used.tx_gas_used()); + cumulative_gas_used += gas_used.tx_gas_used(); let tx_duration = tx_start.elapsed(); if tx_duration.as_micros() > 3000 { @@ -876,12 +881,12 @@ where /// Only contains system transactions (if any) pub async fn build_empty_payload( &self, - args: BscBuildArguments, + args: BscBuildArguments, ) -> Result> { let build_start = std::time::Instant::now(); let BscBuildArguments { mut cached_reads, config, cancel: _, trace_id, min_gas_tip: _, parent_difflayers } = args; - let PayloadConfig { parent_header, attributes } = config; + let PayloadConfig { parent_header, attributes, payload_id: _ } = config; let parent_hash = parent_header.hash_slow(); // Parent difflayers were fetched once at job start; reuse across all retry attempts. @@ -923,7 +928,7 @@ where let triedb_prefetcher = triedb_parent_difflayers.clone().and_then(|difflayers| { let mut triedb = get_global_triedb(); let path_db = triedb.get_mut_path_db_ref().clone(); - MinerTrieDbPrefetcher::new(parent_header.state_root(), path_db, Some(difflayers)).ok() + MinerTrieDbPrefetcher::new(parent_header.state_root(), path_db, Some(difflayers), self.task_executor.clone()).ok() }); // Sinks for empty-payload builds (same delayed-seal mechanism as normal builds). @@ -938,15 +943,16 @@ where &parent_header, BscNextBlockEnvAttributes { inner: NextBlockEnvAttributes { - timestamp: attributes.timestamp(), - suggested_fee_recipient: attributes.suggested_fee_recipient(), - prev_randao: attributes.prev_randao(), + timestamp: attributes.timestamp, + suggested_fee_recipient: attributes.suggested_fee_recipient, + prev_randao: attributes.prev_randao, gas_limit: self.builder_config.gas_limit(parent_header.gas_limit), - parent_beacon_block_root: attributes.parent_beacon_block_root(), - withdrawals: Some(attributes.withdrawals().clone()), + parent_beacon_block_root: attributes.parent_beacon_block_root, + withdrawals: attributes.withdrawals.as_ref().map(|w| Withdrawals::new(w.clone())), extra_data: crate::shared::get_miner_extra() .filter(|b| !b.is_empty()) .unwrap_or_else(|| self.builder_config.extra_data.clone()), + slot_number: None, }, parent_difflayers: triedb_parent_difflayers.clone(), triedb_prefetcher: triedb_prefetcher.clone(), @@ -1129,7 +1135,7 @@ where /// Potential payloads vector for selecting the best one potential_payloads: Vec, /// Current build arguments - build_args: BscBuildArguments, + build_args: BscBuildArguments, /// Retry count for payload building retries: u32, /// JoinSet for managing build tasks @@ -1176,7 +1182,7 @@ where parlia: Arc>, mining_ctx: MiningContext, builder: BscPayloadBuilder, - build_args: BscBuildArguments, + build_args: BscBuildArguments, simulator: Arc>, // No outer RwLock needed result_tx: mpsc::UnboundedSender, ) -> (Self, BscPayloadJobHandle) { @@ -2309,7 +2315,7 @@ mod tests { }; use alloy_primitives::{Address, B256, U256}; use reth::transaction_pool::error::Eip4844PoolTransactionError; - use reth_primitives::SealedHeader; + use reth_primitives_traits::SealedHeader; use std::sync::Arc; use std::time::Duration; diff --git a/src/node/miner/signer.rs b/src/node/miner/signer.rs index ed326932..03781081 100644 --- a/src/node/miner/signer.rs +++ b/src/node/miner/signer.rs @@ -1,6 +1,6 @@ use once_cell::sync::OnceCell; use std::sync::Arc; -use reth_primitives::{Transaction, TransactionSigned}; +use reth_ethereum_primitives::{Transaction, TransactionSigned}; // reth signing helper avoided to not materialize a B256 from secret use alloy_primitives::B256; use alloy_consensus::{SignableTransaction, Header}; @@ -128,7 +128,7 @@ mod tests { use alloy_consensus::Header; use alloy_primitives::{keccak256, Address, Bytes, TxKind, U256}; use alloy_consensus::TxLegacy; - use reth_primitives::Transaction; + use reth_ethereum_primitives::Transaction; use reth_primitives_traits::SignerRecoverable; use secp256k1::{ecdsa::RecoverableSignature, ecdsa::RecoveryId}; diff --git a/src/node/miner/util.rs b/src/node/miner/util.rs index 13712c87..452d206f 100644 --- a/src/node/miner/util.rs +++ b/src/node/miner/util.rs @@ -17,9 +17,9 @@ use crate::node::miner::bsc_miner::MiningContext; use crate::node::miner::signer::{seal_header_with_global_signer, SignerError}; use alloy_consensus::{BlockHeader, Header}; use alloy_primitives::{Address, Bytes, B256}; -use reth::payload::EthPayloadBuilderAttributes; +use reth_node_ethereum::engine::EthPayloadAttributes; use reth_chainspec::EthChainSpec; -use reth_primitives::SealedHeader; +use reth_primitives_traits::SealedHeader; use std::sync::Arc; fn resolve_epoch_validators( @@ -79,7 +79,7 @@ pub fn prepare_new_attributes( parlia: Arc>, parent_header: &SealedHeader, signer: Address, -) -> EthPayloadBuilderAttributes { +) -> EthPayloadAttributes { let mut new_header = prepare_new_header(parlia.clone(), parent_header, signer); // Cache the planned millisecond timestamp so finalize_new_header can reuse it verbatim. ctx.block_timestamp_ms = @@ -97,12 +97,13 @@ pub fn prepare_new_attributes( // Ethereum PoS). The validation path in BscEvmConfig::evm_env sets // `prevrandao = header.difficulty()`, so the building path must match. let difficulty = calculate_difficulty(&ctx.parent_snapshot, signer); - let mut attributes = EthPayloadBuilderAttributes { - parent: new_header.parent_hash, + let mut attributes = EthPayloadAttributes { timestamp: new_header.timestamp, suggested_fee_recipient: new_header.beneficiary, prev_randao: difficulty.into(), - ..Default::default() + withdrawals: None, + parent_beacon_block_root: None, + slot_number: None, }; if BscHardforks::is_bohr_active_at_timestamp( &parlia.spec, diff --git a/src/node/mod.rs b/src/node/mod.rs index 38743b3e..55fe7f1b 100644 --- a/src/node/mod.rs +++ b/src/node/mod.rs @@ -29,7 +29,7 @@ use reth_engine_local::LocalPayloadAttributesBuilder; use reth_engine_primitives::ConsensusEngineHandle; use reth_payload_primitives::{PayloadAttributesBuilder, PayloadTypes}; -use reth_primitives::BlockBody; +use reth_ethereum_primitives::BlockBody; use std::sync::Arc; use tokio::sync::{oneshot, Mutex}; use tracing::trace; diff --git a/src/node/network/block_import/fork_recover.rs b/src/node/network/block_import/fork_recover.rs index 6dba7430..9f33c903 100644 --- a/src/node/network/block_import/fork_recover.rs +++ b/src/node/network/block_import/fork_recover.rs @@ -4,7 +4,7 @@ use std::{sync::Arc, time::Duration}; use alloy_primitives::B256; -use alloy_rpc_types::engine::PayloadStatusEnum; +use alloy_rpc_types_engine::PayloadStatusEnum; use futures::future::BoxFuture; use parking_lot::Mutex; use reth::network::cache::LruCache; @@ -605,14 +605,14 @@ mod tests { fn sealed_header( &self, _number: u64, - ) -> Result>, ProviderError> { + ) -> Result>, ProviderError> { Ok(None) } fn sealed_headers_while( &self, _range: impl core::ops::RangeBounds, - _predicate: impl FnMut(&reth_primitives::SealedHeader) -> bool, - ) -> Result>, ProviderError> { + _predicate: impl FnMut(&reth_primitives_traits::SealedHeader) -> bool, + ) -> Result>, ProviderError> { Ok(vec![]) } } diff --git a/src/node/network/block_import/mod.rs b/src/node/network/block_import/mod.rs index 38097095..3b32defa 100644 --- a/src/node/network/block_import/mod.rs +++ b/src/node/network/block_import/mod.rs @@ -4,7 +4,7 @@ use reth_engine_primitives::EngineTypes; use reth_network::import::{BlockImport, BlockImportOutcome, NewBlockEvent}; use reth_network_peers::PeerId; use reth_payload_primitives::{BuiltPayload, PayloadTypes}; -use reth_primitives::NodePrimitives; +use reth_primitives_traits::NodePrimitives; use service::{BlockMsg, ImportEvent, Outcome}; use std::{ fmt, diff --git a/src/node/network/block_import/service.rs b/src/node/network/block_import/service.rs index 70c37b66..c6304276 100644 --- a/src/node/network/block_import/service.rs +++ b/src/node/network/block_import/service.rs @@ -12,7 +12,7 @@ use crate::{ use alloy_consensus::{BlockBody, Header}; use alloy_eips::BlockNumberOrTag; use alloy_primitives::{B256, U128}; -use alloy_rpc_types::engine::{ForkchoiceState, PayloadStatusEnum}; +use alloy_rpc_types_engine::{ForkchoiceState, PayloadStatusEnum}; use futures::{future::Either, stream::FuturesUnordered, StreamExt}; use parking_lot::RwLock; use reth::consensus::HeaderValidator; @@ -32,8 +32,8 @@ use reth_network::{ use reth_network_api::{PeerId, Peers, ReputationChangeKind}; use reth_node_ethereum::EthEngineTypes; use reth_payload_builder_primitives::Events; -use reth_payload_primitives::{BuiltPayload, EngineApiMessageVersion, PayloadTypes}; -use reth_primitives::NodePrimitives; +use reth_payload_primitives::{BuiltPayload, PayloadTypes}; +use reth_primitives_traits::NodePrimitives; use reth_primitives_traits::{AlloyBlockHeader, Block}; use reth_provider::{BlockHashReader, BlockNumReader, BlockReaderIdExt, HeaderProvider}; use std::{ @@ -523,8 +523,7 @@ where return; } - let local_tip = - self.forkchoice_engine.provider.best_block_number().unwrap_or(0); + let local_tip = self.forkchoice_engine.provider.best_block_number().unwrap_or(0); let block_number = block.block.0.block.header.number; let delta = block_number.saturating_sub(local_tip); if delta > PIPELINE_TRIGGER_DELTA { @@ -538,13 +537,7 @@ where "NewBlock far ahead of local tip; routing to pipeline instead of fork_recover" ); self.processed_blocks.insert(block.hash); - self.spawn_pipeline_trigger_fcu( - peer_id, - block.hash, - block_number, - local_tip, - delta, - ); + self.spawn_pipeline_trigger_fcu(peer_id, block.hash, block_number, local_tip, delta); return; } @@ -735,7 +728,7 @@ where safe_block_hash: B256::ZERO, finalized_block_hash: B256::ZERO, }; - match engine.fork_choice_updated(state, None, EngineApiMessageVersion::V1).await { + match engine.fork_choice_updated(state, None).await { Ok(ret) => tracing::info!( target: "bsc::block_import", %head_hash, @@ -974,8 +967,9 @@ mod tests { use reth_chainspec::ChainInfo; use reth_engine_primitives::{BeaconEngineMessage, OnForkChoiceUpdated}; use reth_eth_wire::NewBlock; + use reth_ethereum_primitives::Block; use reth_node_ethereum::EthEngineTypes; - use reth_primitives::{Block, SealedHeader}; + use reth_primitives_traits::SealedHeader; use reth_provider::ProviderError; use schnellru::{ByLength, LruMap}; use std::{ @@ -1391,12 +1385,7 @@ mod tests { tx.send(Ok(PayloadStatus::new(responses.new_payload.clone(), None))) .unwrap(); } - BeaconEngineMessage::ForkchoiceUpdated { - state: _, - payload_attrs: _, - version: _, - tx, - } => { + BeaconEngineMessage::ForkchoiceUpdated { state: _, payload_attrs: _, tx } => { tx.send(Ok(OnForkChoiceUpdated::valid(PayloadStatus::new( responses.fcu.clone(), None, @@ -1434,12 +1423,7 @@ mod tests { let _ = np_tx.send(()); let _ = tx.send(Ok(PayloadStatus::new(PayloadStatusEnum::Valid, None))); } - BeaconEngineMessage::ForkchoiceUpdated { - state, - payload_attrs: _, - version: _, - tx, - } => { + BeaconEngineMessage::ForkchoiceUpdated { state, payload_attrs: _, tx } => { let _ = fcu_tx.send(state); let _ = tx.send(Ok(OnForkChoiceUpdated::valid(PayloadStatus::new( PayloadStatusEnum::Valid, diff --git a/src/node/network/blocks_by_range.rs b/src/node/network/blocks_by_range.rs index b796b47e..c07db84f 100644 --- a/src/node/network/blocks_by_range.rs +++ b/src/node/network/blocks_by_range.rs @@ -205,7 +205,7 @@ mod tests { use crate::BscBlockBody; use alloy_consensus::Header; use alloy_rlp::RlpDecodable; - use reth_primitives::TransactionSigned; + use reth_ethereum_primitives::TransactionSigned; use bytes::BytesMut; use std::collections::HashMap; diff --git a/src/node/network/mod.rs b/src/node/network/mod.rs index bbbb0841..516c1be9 100644 --- a/src/node/network/mod.rs +++ b/src/node/network/mod.rs @@ -23,7 +23,7 @@ use reth_network::{NetworkConfig, NetworkHandle, NetworkManager, PeersConfig, Se use reth_network_api::PeersInfo; use reth_network_peers::NodeRecord; use reth_provider::{BlockNumReader, HeaderProvider, StateProviderFactory}; -use reth_primitives::TransactionSigned; +use reth_ethereum_primitives::TransactionSigned; use std::{sync::Arc, time::Duration}; use tokio::sync::{mpsc, oneshot, Mutex}; use tracing::{debug, info, warn}; @@ -60,7 +60,7 @@ mod rlp { use alloy_primitives::U128; use alloy_rlp::{RlpDecodable, RlpEncodable}; use alloy_rpc_types::Withdrawals; - use reth_primitives::TransactionSigned; + use reth_ethereum_primitives::TransactionSigned; use std::borrow::Cow; #[derive(RlpEncodable, RlpDecodable)] @@ -324,7 +324,7 @@ impl BscNetworkBuilder { } // Spawn the critical ImportService task exactly like the official implementation - ctx.task_executor().spawn_critical("block import", async move { + ctx.task_executor().spawn_critical_task("block import", async move { let handle = engine_handle_rx .lock() .await @@ -473,7 +473,7 @@ fn spawn_evn_sync_watcher( .unwrap_or(30); let provider = ctx.provider().clone(); let chain_spec = ctx.chain_spec().clone(); - ctx.task_executor().spawn_critical("evn-sync-watcher", async move { + ctx.task_executor().spawn_critical_task("evn-sync-watcher", async move { use std::time::{SystemTime, UNIX_EPOCH, Duration}; use alloy_consensus::BlockHeader; @@ -557,7 +557,7 @@ async fn register_nodeids_actions( let mut signed_batch: Vec = Vec::new(); if !to_add.is_empty() { let (_to, data) = crate::system_contracts::encode_add_node_ids_call(to_add.clone()); - let mut tx = reth_primitives::Transaction::Legacy(alloy_consensus::TxLegacy { + let mut tx = reth_ethereum_primitives::Transaction::Legacy(alloy_consensus::TxLegacy { chain_id: Some(chain_id), nonce: next_nonce, gas_price: 1000000000, @@ -572,7 +572,7 @@ async fn register_nodeids_actions( let gas = crate::shared::ipc_estimate_gas(req, None, None).await?; let gas_limit = std::cmp::min(gas, U256::from(u64::MAX / 2)).to::(); debug!(target: "bsc::evn", "Estimated gas for transaction, to_add: {:?}, gas: {}, gas_limit: {}", to_add, gas, gas_limit); - if let reth_primitives::Transaction::Legacy(inner) = &mut tx { + if let reth_ethereum_primitives::Transaction::Legacy(inner) = &mut tx { inner.gas_limit = gas_limit; } let signed = sign_system_transaction(tx)?; @@ -584,7 +584,7 @@ async fn register_nodeids_actions( if !to_remove.is_empty() { let (_to, data) = crate::system_contracts::encode_remove_node_ids_call(to_remove.clone()); - let mut tx = reth_primitives::Transaction::Legacy(alloy_consensus::TxLegacy { + let mut tx = reth_ethereum_primitives::Transaction::Legacy(alloy_consensus::TxLegacy { chain_id: Some(chain_id), nonce: next_nonce, gas_price: 1000000000, @@ -599,7 +599,7 @@ async fn register_nodeids_actions( let gas = crate::shared::ipc_estimate_gas(req, None, None).await?; let gas_limit = std::cmp::min(gas, U256::from(u64::MAX / 2)).to::(); debug!(target: "bsc::evn", "Estimated gas for transaction, to_remove: {:?}, gas: {}, gas_limit: {}", to_remove, gas, gas_limit); - if let reth_primitives::Transaction::Legacy(inner) = &mut tx { + if let reth_ethereum_primitives::Transaction::Legacy(inner) = &mut tx { inner.gas_limit = gas_limit; } let signed = sign_system_transaction(tx)?; diff --git a/src/node/pool/mod.rs b/src/node/pool/mod.rs index 45e733be..62493dc2 100644 --- a/src/node/pool/mod.rs +++ b/src/node/pool/mod.rs @@ -13,6 +13,7 @@ use reth::builder::{ }; use reth_chainspec::{EthChainSpec, EthereumHardforks, ForkCondition, Hardforks}; use reth_ethereum_primitives::TransactionSigned as EthTxSigned; +use reth_evm::ConfigureEvm; use reth_payload_primitives::PayloadTypes; use reth_primitives_traits::SignedTransaction; use reth_primitives_traits::constants::MAX_TX_GAS_LIMIT_OSAKA; @@ -70,6 +71,7 @@ where V: TransactionValidator + Send + Sync + 'static, { type Transaction = ::Transaction; + type Block = ::Block; async fn validate_transaction( &self, @@ -109,54 +111,7 @@ where self.inner.validate_transaction(origin, transaction).await } - async fn validate_transactions( - &self, - transactions: Vec<(TransactionOrigin, Self::Transaction)>, - ) -> Vec> { - let outcomes = self.inner.validate_transactions(transactions).await; - let mut mapped: Vec> = - Vec::with_capacity(outcomes.len()); - for outcome in outcomes { - let new_outcome: TransactionValidationOutcome = match outcome { - TransactionValidationOutcome::Valid { - balance, - state_nonce, - bytecode_hash, - transaction, - propagate, - authorities, - } => { - if blacklist::check_tx_basic_blacklist( - transaction.transaction().sender(), - transaction.transaction().to(), - ) { - tracing::debug!(target: "bsc::txpool", "Blacklisted transaction: {:?}", transaction.hash()); - TransactionValidationOutcome::Invalid( - transaction.into_transaction(), - InvalidPoolTransactionError::other(BlacklistedAddressError()), - ) - } else { - TransactionValidationOutcome::Valid { - balance, - state_nonce, - bytecode_hash, - transaction, - propagate, - authorities, - } - } - } - other => other, - }; - mapped.push(new_outcome); - } - mapped - } - - fn on_new_head_block(&self, new_tip_block: &reth_primitives_traits::SealedBlock) - where - B: reth_primitives_traits::Block, - { + fn on_new_head_block(&self, new_tip_block: &reth_primitives_traits::SealedBlock) { if let Some(osaka_ts) = self.osaka_timestamp { self.osaka_activated.store( new_tip_block.header().timestamp() >= osaka_ts, @@ -172,7 +127,7 @@ where #[non_exhaustive] pub struct BscPoolBuilder; -impl PoolBuilder for BscPoolBuilder +impl PoolBuilder for BscPoolBuilder where Node: FullNodeTypes, Types: NodeTypes< @@ -183,16 +138,22 @@ where ::Payload: PayloadTypes, EthPooledTransaction: reth_transaction_pool::EthPoolTransaction, EthPooledTransaction: PoolTransaction, + Evm: ConfigureEvm< + Primitives: NodePrimitives< + BlockHeader = <::Primitives as NodePrimitives>::BlockHeader, + Block = <::Primitives as NodePrimitives>::Block, + >, + > + Clone + Send + Sync + 'static, { type Pool = Pool< TransactionValidationTaskExecutor< - BscTxValidator>, + BscTxValidator>, >, CoinbaseTipOrdering, DiskFileBlobStore, >; - async fn build_pool(self, ctx: &BuilderContext) -> eyre::Result { + async fn build_pool(self, ctx: &BuilderContext, evm_config: Evm) -> eyre::Result { // Disable the upstream protocol base fee check (MIN_PROTOCOL_BASE_FEE = 7 wei) // because BSC handles min gas price dynamically via miner_setGasPrice RPC // and enforces it in BscTxValidator instead. @@ -223,8 +184,7 @@ where // Build default Ethereum validator executor // BSC rejected EIP-7594 (PeerDAS), so we disable EIP-7594 sidecar support to always // use v0 (legacy) blob sidecars and reject v1 (EIP-7594) sidecars. - let validator = TransactionValidationTaskExecutor::eth_builder(ctx.provider().clone()) - .with_head_timestamp(ctx.head().timestamp) + let validator = TransactionValidationTaskExecutor::eth_builder(ctx.provider().clone(), evm_config) .with_max_tx_input_bytes(ctx.config().txpool.max_tx_input_bytes) .kzg_settings(ctx.kzg_settings()?) .with_local_transactions_config(pool_config.local_transactions_config.clone()) diff --git a/src/node/primitives.rs b/src/node/primitives.rs index fdf99a97..060d1618 100644 --- a/src/node/primitives.rs +++ b/src/node/primitives.rs @@ -1,10 +1,10 @@ #![allow(clippy::owned_cow)] use alloy_consensus::{BlobTransactionSidecar, Header}; +use alloy_eips::eip4895::Withdrawals; use alloy_primitives::B256; use alloy_rlp::{Decodable, Encodable}; -use reth_ethereum_primitives::{BlockBody, Receipt}; -use reth_primitives::{NodePrimitives, TransactionSigned}; -use reth_primitives_traits::{Block, BlockBody as BlockBodyTrait, InMemorySize}; +use reth_ethereum_primitives::{BlockBody, Receipt, TransactionSigned}; +use reth_primitives_traits::{Block, BlockBody as BlockBodyTrait, InMemorySize, NodePrimitives}; use serde::{Deserialize, Serialize}; use std::borrow::Cow; @@ -149,7 +149,7 @@ impl BlockBodyTrait for BscBlockBody { self.inner.into_transactions() } - fn withdrawals(&self) -> Option<&alloy_rpc_types::Withdrawals> { + fn withdrawals(&self) -> Option<&Withdrawals> { self.inner.withdrawals() } @@ -330,58 +330,12 @@ mod rlp { } } -pub mod serde_bincode_compat { - use super::*; - use reth_primitives_traits::serde_bincode_compat::{BincodeReprFor, SerdeBincodeCompat}; - - #[derive(Debug, Serialize, Deserialize)] - pub struct BscBlockBodyBincode<'a> { - inner: BincodeReprFor<'a, BlockBody>, - sidecars: Option>>, - } - - #[derive(Debug, Serialize, Deserialize)] - pub struct BscBlockBincode<'a> { - header: BincodeReprFor<'a, Header>, - body: BincodeReprFor<'a, BscBlockBody>, - } - - impl SerdeBincodeCompat for BscBlockBody { - type BincodeRepr<'a> = BscBlockBodyBincode<'a>; - - fn as_repr(&self) -> Self::BincodeRepr<'_> { - BscBlockBodyBincode { - inner: self.inner.as_repr(), - sidecars: self.sidecars.as_ref().map(Cow::Borrowed), - } - } - - fn from_repr(repr: Self::BincodeRepr<'_>) -> Self { - let BscBlockBodyBincode { inner, sidecars } = repr; - Self { inner: BlockBody::from_repr(inner), sidecars: sidecars.map(|s| s.into_owned()) } - } - } - - impl SerdeBincodeCompat for BscBlock { - type BincodeRepr<'a> = BscBlockBincode<'a>; - - fn as_repr(&self) -> Self::BincodeRepr<'_> { - BscBlockBincode { header: self.header.as_repr(), body: self.body.as_repr() } - } - - fn from_repr(repr: Self::BincodeRepr<'_>) -> Self { - let BscBlockBincode { header, body } = repr; - Self { header: Header::from_repr(header), body: BscBlockBody::from_repr(body) } - } - } -} #[cfg(test)] mod tests { use super::*; use alloy_consensus::Header; use alloy_eips::eip4895::Withdrawals; - use reth_primitives_traits::Block; fn create_test_header() -> Header { Header::default() diff --git a/src/rpc/eth_config.rs b/src/rpc/eth_config.rs index ba2a9736..31c68390 100644 --- a/src/rpc/eth_config.rs +++ b/src/rpc/eth_config.rs @@ -2,7 +2,7 @@ use alloy_eips::eip7910::{EthConfig, EthForkConfig, SystemContract}; use jsonrpsee::core::RpcResult; use reth_chainspec::{ChainSpecProvider, EthereumHardforks, Hardforks}; use reth_evm::ConfigureEvm; -use reth_primitives::NodePrimitives; +use reth_primitives_traits::NodePrimitives; use reth_primitives_traits::header::HeaderMut; use reth_provider::BlockReaderIdExt; use reth_rpc_eth_api::helpers::config::{EthConfigApiServer, EthConfigHandler}; diff --git a/src/rpc/mev.rs b/src/rpc/mev.rs index 8a86bc3c..afd2c01c 100644 --- a/src/rpc/mev.rs +++ b/src/rpc/mev.rs @@ -11,7 +11,7 @@ use alloy_primitives::{Bytes, B256, U256, U64}; use jsonrpsee::core::RpcResult; use jsonrpsee::proc_macros::rpc; use reth_chainspec::EthChainSpec; -use reth_primitives::TransactionSigned; +use reth_ethereum_primitives::TransactionSigned; use reth_primitives_traits::SignerRecoverable; use std::collections::HashSet; use std::sync::{Arc, RwLock}; diff --git a/src/shared.rs b/src/shared.rs index 2d838e54..1519c49e 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -19,7 +19,7 @@ use reth_network::NetworkHandle; use reth_network_api::PeerId; use reth_provider::providers::BlockchainProvider; use reth_payload_builder_primitives::Events; -use reth_primitives::TransactionSigned; +use reth_ethereum_primitives::TransactionSigned; use reth_provider::{BlockNumReader, HeaderProvider}; use schnellru::{ByLength, LruMap}; use std::collections::VecDeque; @@ -34,7 +34,7 @@ pub type BscEngineApiTx = UnboundedSender< EngineApiRequest< crate::node::engine_api::payload::BscPayloadTypes, crate::BscPrimitives, - BlockchainProvider>>, + BlockchainProvider>, crate::node::evm::config::BscEvmConfig, >, >; diff --git a/src/system_contracts/mod.rs b/src/system_contracts/mod.rs index a5f5623c..bdc4d703 100644 --- a/src/system_contracts/mod.rs +++ b/src/system_contracts/mod.rs @@ -14,7 +14,7 @@ use alloy_primitives::{address, hex, Address, BlockNumber, Bytes, Signature, TxK use lazy_static::lazy_static; use reth_chainspec::{ChainSpec, EthChainSpec}; use reth_ethereum_forks::Hardforks; -use reth_primitives::{Transaction, TransactionSigned}; +use reth_ethereum_primitives::{Transaction, TransactionSigned}; use revm::state::Bytecode; use std::{collections::HashMap, sync::Arc}; use thiserror::Error; diff --git a/testing/bsc-ef-tests/Cargo.toml b/testing/bsc-ef-tests/Cargo.toml index 1e9c55c2..ee73b8e5 100644 --- a/testing/bsc-ef-tests/Cargo.toml +++ b/testing/bsc-ef-tests/Cargo.toml @@ -14,33 +14,32 @@ asm-keccak = ["alloy-primitives/asm-keccak"] reth_bsc = { path = "../.." } # reth dependencies aligned with root crate branch to avoid duplicate crate versions -reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-consensus = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = ["mdbx", "test-utils", "disable-lock"] } -reth-db-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-db-common = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-consensus = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-evm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-primitives-traits = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-provider = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = ["test-utils"] } -reth-revm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = ["std"] } -reth-tracing = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-trie = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } -reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" } +reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-consensus = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = ["mdbx", "test-utils", "disable-lock"] } +reth-db-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-db-common = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-consensus = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-evm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-primitives-traits = { git = "https://github.com/bnb-chain/reth-core.git", branch = "v0.3.1-v2", default-features = false } +reth-provider = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = ["test-utils"] } +reth-revm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = ["std"] } +reth-tracing = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-trie = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } +reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" } # revm -revm = { version = "34.0.0", features = ["secp256k1", "blst", "c-kzg", "memory_limit"] } +revm = { version = "38.0.0", features = ["secp256k1", "blst", "c-kzg", "memory_limit"] } # alloy -alloy-consensus = "1.1.3" -alloy-eips = "1.1.3" -alloy-genesis = "1.1.3" -alloy-primitives = "1.4.1" -alloy-rlp = "0.3.12" +alloy-consensus = "2.0.0" +alloy-eips = "2.0.0" +alloy-genesis = "2.0.0" +alloy-primitives = "1.5.6" +alloy-rlp = "0.3.13" # misc rayon = "1" diff --git a/testing/bsc-ef-tests/src/cases/blockchain_test.rs b/testing/bsc-ef-tests/src/cases/blockchain_test.rs index f907ba87..e932e733 100644 --- a/testing/bsc-ef-tests/src/cases/blockchain_test.rs +++ b/testing/bsc-ef-tests/src/cases/blockchain_test.rs @@ -29,7 +29,7 @@ use reth_provider::{ }; use reth_revm::{database::StateProviderDatabase, State}; use reth_trie::{HashedPostState, KeccakKeyHasher, StateRoot}; -use reth_trie_db::DatabaseStateRoot; +use reth_trie_db::{DatabaseHashedCursorFactory, DatabaseStateRoot, DatabaseTrieCursorFactory, LegacyKeyAdapter}; use std::{ collections::BTreeMap, fs, @@ -236,7 +236,10 @@ fn run_case( // Compute and check the post state root let hashed_state = HashedPostState::from_bundle_state::(output.state.state()); - let (computed_state_root, _) = StateRoot::overlay_root_with_updates( + let (computed_state_root, _) = , + DatabaseHashedCursorFactory<_>, + > as DatabaseStateRoot<_>>::overlay_root_with_updates( provider.tx_ref(), &hashed_state.clone_into_sorted(), ) diff --git a/testing/bsc-ef-tests/src/models.rs b/testing/bsc-ef-tests/src/models.rs index d1e94f68..9a48d989 100644 --- a/testing/bsc-ef-tests/src/models.rs +++ b/testing/bsc-ef-tests/src/models.rs @@ -117,6 +117,8 @@ impl From
for SealedHeader { excess_blob_gas: value.excess_blob_gas.map(|v| v.to::()), parent_beacon_block_root: value.parent_beacon_block_root, requests_hash: value.requests_hash, + block_access_list_hash: Default::default(), + slot_number: None, }; Self::new(header, value.hash) }