diff --git a/Cargo.lock b/Cargo.lock index 6faa529..fd62073 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,9 +16,17 @@ dependencies = [ "jsonrpsee", "op-alloy-network", "reth-rpc-eth-types", + "rundler-pool", + "rundler-provider", + "rundler-sim", + "rundler-task", + "rundler-types", + "rundler-utils", "serde", "serde_json", "tokio", + "tracing", + "tracing-subscriber 0.3.20", "wiremock", ] @@ -66,7 +74,7 @@ dependencies = [ "alloy-rlp", "num_enum", "serde", - "strum", + "strum 0.27.2", ] [[package]] @@ -84,7 +92,7 @@ dependencies = [ "auto_impl", "borsh", "c-kzg", - "derive_more", + "derive_more 2.0.1", "either", "k256", "once_cell", @@ -93,7 +101,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -110,6 +118,44 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-contract" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5903097e4c131ad2dd80d87065f23c715ccb9cdb905fa169dffab8e1e798bae" +dependencies = [ + "alloy-consensus", + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-provider", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport", + "futures", + "futures-util", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "alloy-dyn-abi" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdff496dd4e98a81f4861e66f7eaf5f2488971848bb42d9c892f871730245c8" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "itoa", + "serde", + "serde_json", + "winnow", +] + [[package]] name = "alloy-eip2124" version = "0.2.0" @@ -120,7 +166,7 @@ dependencies = [ "alloy-rlp", "crc", "serde", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -146,7 +192,7 @@ dependencies = [ "borsh", "k256", "serde", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -164,14 +210,14 @@ dependencies = [ "auto_impl", "borsh", "c-kzg", - "derive_more", + "derive_more 2.0.1", "either", "ethereum_ssz", "ethereum_ssz_derive", "serde", "serde_with", "sha2", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -189,12 +235,12 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-sol-types", "auto_impl", - "derive_more", + "derive_more 2.0.1", "op-alloy-consensus", "op-alloy-rpc-types-engine", "op-revm", "revm", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -247,7 +293,7 @@ dependencies = [ "http 1.3.1", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", "tracing", ] @@ -270,11 +316,11 @@ dependencies = [ "alloy-sol-types", "async-trait", "auto_impl", - "derive_more", + "derive_more 2.0.1", "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -305,7 +351,7 @@ dependencies = [ "op-alloy-consensus", "op-revm", "revm", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -330,7 +376,7 @@ dependencies = [ "bytes", "cfg-if", "const-hex", - "derive_more", + "derive_more 2.0.1", "foldhash 0.2.0", "getrandom 0.3.4", "hashbrown 0.16.0", @@ -342,7 +388,7 @@ dependencies = [ "proptest", "rand 0.9.2", "ruint", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "sha3", "tiny-keccak", @@ -362,7 +408,9 @@ dependencies = [ "alloy-network-primitives", "alloy-primitives", "alloy-rpc-client", + "alloy-rpc-types-debug", "alloy-rpc-types-eth", + "alloy-rpc-types-trace", "alloy-signer", "alloy-sol-types", "alloy-transport", @@ -380,7 +428,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", "tokio", "tracing", "url", @@ -426,7 +474,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.5.2", "tracing", "url", "wasmtimer", @@ -468,6 +516,18 @@ dependencies = [ "alloy-serde", ] +[[package]] +name = "alloy-rpc-types-debug" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4936f579d9d10eae01772b2ab3497f9d568684f05f26f8175e12f9a1a2babc33" +dependencies = [ + "alloy-primitives", + "derive_more 2.0.1", + "serde", + "serde_with", +] + [[package]] name = "alloy-rpc-types-engine" version = "1.1.2" @@ -479,13 +539,13 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more", + "derive_more 2.0.1", "ethereum_ssz", "ethereum_ssz_derive", "jsonwebtoken", "rand 0.8.5", "serde", - "strum", + "strum 0.27.2", ] [[package]] @@ -506,7 +566,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -520,7 +580,7 @@ dependencies = [ "alloy-serde", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -546,7 +606,7 @@ dependencies = [ "either", "elliptic-curve 0.13.8", "k256", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -562,7 +622,7 @@ dependencies = [ "async-trait", "k256", "rand 0.8.5", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -585,6 +645,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d792e205ed3b72f795a8044c52877d2e6b6e9b1d13f431478121d8d4eaa9028" dependencies = [ + "alloy-json-abi", "alloy-sol-macro-input", "const-hex", "heck", @@ -603,12 +664,14 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bd1247a8f90b465ef3f1207627547ec16940c35597875cdc09c49d58b19693c" dependencies = [ + "alloy-json-abi", "const-hex", "dunce", "heck", "macro-string", "proc-macro2", "quote", + "serde_json", "syn 2.0.110", "syn-solidity", ] @@ -644,15 +707,15 @@ dependencies = [ "alloy-json-rpc", "auto_impl", "base64 0.22.1", - "derive_more", + "derive_more 2.0.1", "futures", "futures-utils-wasm", "parking_lot", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", "tokio", - "tower", + "tower 0.5.2", "tracing", "url", "wasmtimer", @@ -668,7 +731,7 @@ dependencies = [ "alloy-transport", "reqwest", "serde_json", - "tower", + "tower 0.5.2", "tracing", "url", ] @@ -682,7 +745,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arrayvec", - "derive_more", + "derive_more 2.0.1", "nybbles", "serde", "smallvec", @@ -1095,6 +1158,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "async-lock" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -1219,7 +1293,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1826f2e4cfc2cd19ee53c42fbf68e2f81ec21108e0b7ecf6a71cf062137360fc" dependencies = [ - "bindgen", + "bindgen 0.72.1", "cc", "cmake", "dunce", @@ -1470,7 +1544,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", - "tower", + "tower 0.5.2", "tracing", ] @@ -1592,13 +1666,40 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "axum" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" dependencies = [ - "axum-core", + "axum-core 0.5.5", "bytes", "form_urlencoded", "futures-util", @@ -1608,7 +1709,7 @@ dependencies = [ "hyper 1.8.0", "hyper-util", "itoa", - "matchit", + "matchit 0.8.4", "memchr", "mime", "percent-encoding", @@ -1619,12 +1720,32 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.5.5" @@ -1701,6 +1822,26 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.10.0", + "cexpr", + "clang-sys", + "itertools 0.10.5", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.110", +] + [[package]] name = "bindgen" version = "0.72.1" @@ -1716,7 +1857,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 2.1.1", "shlex", "syn 2.0.110", ] @@ -1832,7 +1973,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-util", "tower-service", @@ -1966,8 +2107,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-link", ] @@ -2037,6 +2180,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "const-hex" version = "1.17.0" @@ -2075,6 +2227,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "convert_case" version = "0.7.1" @@ -2162,6 +2320,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -2382,6 +2549,19 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.110", +] + [[package]] name = "derive_more" version = "2.0.1" @@ -2397,7 +2577,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ - "convert_case", + "convert_case 0.7.1", "proc-macro2", "quote", "syn 2.0.110", @@ -2657,6 +2837,27 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -2735,6 +2936,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "fnv" version = "1.0.7" @@ -3255,6 +3462,20 @@ dependencies = [ "tokio", "tokio-rustls 0.26.4", "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.8.0", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] @@ -3611,12 +3832,12 @@ dependencies = [ "parking_lot", "pin-project", "rand 0.9.2", - "rustc-hash", + "rustc-hash 2.1.1", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", "tokio", - "tower", + "tower 0.5.2", "tracing", ] @@ -3652,11 +3873,11 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-stream", "tokio-util", - "tower", + "tower 0.5.2", "tracing", ] @@ -3669,7 +3890,7 @@ dependencies = [ "http 1.3.1", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -3842,6 +4063,12 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "matchit" version = "0.8.4" @@ -3902,7 +4129,7 @@ dependencies = [ "metrics", "metrics-util", "quanta", - "thiserror", + "thiserror 2.0.17", "tokio", "tracing", ] @@ -3976,6 +4203,33 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "moka" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077" +dependencies = [ + "async-lock", + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "equivalent", + "event-listener", + "futures-util", + "parking_lot", + "portable-atomic", + "rustc_version 0.4.1", + "smallvec", + "tagptr", + "uuid", +] + +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + [[package]] name = "native-tls" version = "0.2.14" @@ -4167,9 +4421,9 @@ dependencies = [ "alloy-rlp", "alloy-rpc-types-eth", "alloy-serde", - "derive_more", + "derive_more 2.0.1", "serde", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -4206,11 +4460,11 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", - "derive_more", + "derive_more 2.0.1", "op-alloy-consensus", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -4224,12 +4478,12 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-rpc-types-engine", - "derive_more", + "derive_more 2.0.1", "ethereum_ssz", "ethereum_ssz_derive", "op-alloy-consensus", "snap", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -4354,6 +4608,12 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.5" @@ -4383,7 +4643,18 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" dependencies = [ - "parse-display-derive", + "parse-display-derive 0.9.1", + "regex", + "regex-syntax", +] + +[[package]] +name = "parse-display" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287d8d3ebdce117b8539f59411e4ed9ec226e0a4153c7f55495c6070d68e6f72" +dependencies = [ + "parse-display-derive 0.10.0", "regex", "regex-syntax", ] @@ -4402,6 +4673,20 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "parse-display-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc048687be30d79502dea2f623d052f3a074012c6eac41726b7ab17213616b1" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "regex-syntax", + "structmeta", + "syn 2.0.110", +] + [[package]] name = "paste" version = "1.0.15" @@ -4434,6 +4719,16 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset", + "indexmap 2.12.0", +] + [[package]] name = "phf" version = "0.13.1" @@ -4654,6 +4949,58 @@ dependencies = [ "unarray", ] +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +dependencies = [ + "heck", + "itertools 0.10.5", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.110", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 2.0.110", +] + +[[package]] +name = "prost-types" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost", +] + [[package]] name = "quanta" version = "0.12.6" @@ -4686,10 +5033,10 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.1.1", "rustls 0.23.35", "socket2 0.6.1", - "thiserror", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -4706,11 +5053,11 @@ dependencies = [ "lru-slab", "rand 0.9.2", "ring", - "rustc-hash", + "rustc-hash 2.1.1", "rustls 0.23.35", "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -4997,13 +5344,14 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.26.4", - "tower", + "tower 0.5.2", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", ] [[package]] @@ -5014,7 +5362,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-primitives", - "derive_more", + "derive_more 2.0.1", "metrics", "parking_lot", "pin-project", @@ -5022,7 +5370,7 @@ dependencies = [ "reth-errors", "reth-ethereum-primitives", "reth-execution-types", - "reth-metrics", + "reth-metrics 1.9.3", "reth-primitives-traits", "reth-storage-api", "reth-trie", @@ -5045,7 +5393,7 @@ dependencies = [ "alloy-primitives", "alloy-trie", "auto_impl", - "derive_more", + "derive_more 2.0.1", "reth-ethereum-forks", "reth-network-peers", "reth-primitives-traits", @@ -5090,7 +5438,7 @@ dependencies = [ "auto_impl", "reth-execution-types", "reth-primitives-traits", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5125,7 +5473,7 @@ dependencies = [ "reth-consensus", "reth-execution-errors", "reth-storage-errors", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5140,13 +5488,13 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "bytes", - "derive_more", + "derive_more 2.0.1", "reth-chainspec", "reth-codecs-derive", "reth-ethereum-primitives", "reth-primitives-traits", "serde", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5159,7 +5507,7 @@ dependencies = [ "alloy-primitives", "auto_impl", "once_cell", - "rustc-hash", + "rustc-hash 2.1.1", ] [[package]] @@ -5189,7 +5537,7 @@ dependencies = [ "alloy-evm", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 2.0.1", "futures-util", "reth-execution-errors", "reth-execution-types", @@ -5210,7 +5558,7 @@ dependencies = [ "alloy-rlp", "nybbles", "reth-storage-errors", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5222,7 +5570,7 @@ dependencies = [ "alloy-eips", "alloy-evm", "alloy-primitives", - "derive_more", + "derive_more 2.0.1", "reth-ethereum-primitives", "reth-primitives-traits", "reth-trie-common", @@ -5238,7 +5586,16 @@ source = "git+https://github.com/paradigmxyz/reth?tag=v1.9.3#27a8c0f5a6dfb27dea8 dependencies = [ "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", +] + +[[package]] +name = "reth-metrics" +version = "1.4.7" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v1.4.7#dc7cb6e6670b0da294a0e5010e02855f5aaf6b49" +dependencies = [ + "metrics", + "metrics-derive", ] [[package]] @@ -5268,7 +5625,7 @@ dependencies = [ "alloy-rpc-types-admin", "alloy-rpc-types-eth", "auto_impl", - "derive_more", + "derive_more 2.0.1", "enr", "futures", "reth-eth-wire-types", @@ -5277,7 +5634,7 @@ dependencies = [ "reth-network-peers", "reth-network-types", "reth-tokio-util", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-stream", ] @@ -5291,7 +5648,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 2.0.1", "futures", "reth-consensus", "reth-eth-wire-types", @@ -5313,7 +5670,7 @@ dependencies = [ "alloy-rlp", "secp256k1 0.30.0", "serde_with", - "thiserror", + "thiserror 2.0.17", "url", ] @@ -5340,7 +5697,7 @@ dependencies = [ "alloy-genesis", "alloy-hardforks", "alloy-primitives", - "derive_more", + "derive_more 2.0.1", "miniz_oxide", "op-alloy-consensus", "op-alloy-rpc-types", @@ -5352,7 +5709,7 @@ dependencies = [ "reth-primitives-traits", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5376,7 +5733,7 @@ dependencies = [ "reth-storage-errors", "reth-trie-common", "revm", - "thiserror", + "thiserror 2.0.17", "tracing", ] @@ -5404,7 +5761,7 @@ dependencies = [ "reth-primitives-traits", "reth-storage-errors", "revm", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5450,7 +5807,7 @@ dependencies = [ "alloy-trie", "auto_impl", "bytes", - "derive_more", + "derive_more 2.0.1", "once_cell", "op-alloy-consensus", "reth-codecs", @@ -5460,7 +5817,7 @@ dependencies = [ "secp256k1 0.30.0", "serde", "serde_with", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5469,10 +5826,10 @@ version = "1.9.3" source = "git+https://github.com/paradigmxyz/reth?tag=v1.9.3#27a8c0f5a6dfb27dea84c5751776ecabdd069646" dependencies = [ "alloy-primitives", - "derive_more", + "derive_more 2.0.1", "serde", - "strum", - "thiserror", + "strum 0.27.2", + "thiserror 2.0.17", ] [[package]] @@ -5505,7 +5862,7 @@ dependencies = [ "reth-evm", "reth-primitives-traits", "revm-context", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -5522,7 +5879,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-sol-types", "alloy-transport", - "derive_more", + "derive_more 2.0.1", "futures", "itertools 0.14.0", "jsonrpsee-core", @@ -5536,20 +5893,20 @@ dependencies = [ "reth-ethereum-primitives", "reth-evm", "reth-execution-types", - "reth-metrics", + "reth-metrics 1.9.3", "reth-primitives-traits", "reth-revm", "reth-rpc-convert", "reth-rpc-server-types", "reth-storage-api", - "reth-tasks", + "reth-tasks 1.9.3", "reth-transaction-pool", "reth-trie", "revm", "revm-inspectors", "schnellru", "serde", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-stream", "tracing", @@ -5568,7 +5925,7 @@ dependencies = [ "reth-errors", "reth-network-api", "serde", - "strum", + "strum 0.27.2", ] [[package]] @@ -5588,9 +5945,9 @@ version = "1.9.3" source = "git+https://github.com/paradigmxyz/reth?tag=v1.9.3#27a8c0f5a6dfb27dea84c5751776ecabdd069646" dependencies = [ "alloy-primitives", - "derive_more", + "derive_more 2.0.1", "serde", - "strum", + "strum 0.27.2", ] [[package]] @@ -5623,12 +5980,30 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 2.0.1", "reth-primitives-traits", "reth-prune-types", "reth-static-file-types", "revm-database-interface", - "thiserror", + "thiserror 2.0.17", +] + +[[package]] +name = "reth-tasks" +version = "1.4.7" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v1.4.7#dc7cb6e6670b0da294a0e5010e02855f5aaf6b49" +dependencies = [ + "auto_impl", + "dyn-clone", + "futures-util", + "metrics", + "pin-project", + "rayon", + "reth-metrics 1.4.7", + "thiserror 2.0.17", + "tokio", + "tracing", + "tracing-futures", ] [[package]] @@ -5640,8 +6015,8 @@ dependencies = [ "dyn-clone", "futures-util", "metrics", - "reth-metrics", - "thiserror", + "reth-metrics 1.9.3", + "thiserror 2.0.17", "tokio", "tracing", "tracing-futures", @@ -5679,18 +6054,18 @@ dependencies = [ "reth-ethereum-primitives", "reth-execution-types", "reth-fs-util", - "reth-metrics", + "reth-metrics 1.9.3", "reth-primitives-traits", "reth-storage-api", - "reth-tasks", + "reth-tasks 1.9.3", "revm-interpreter", "revm-primitives", - "rustc-hash", + "rustc-hash 2.1.1", "schnellru", "serde", "serde_json", "smallvec", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-stream", "tracing", @@ -5731,7 +6106,7 @@ dependencies = [ "alloy-trie", "arrayvec", "bytes", - "derive_more", + "derive_more 2.0.1", "itertools 0.14.0", "nybbles", "rayon", @@ -5908,7 +6283,7 @@ dependencies = [ "revm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.17", ] [[package]] @@ -6078,6 +6453,195 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rundler-bindings-fastlz" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "bindgen 0.70.1", + "cc", +] + +[[package]] +name = "rundler-contracts" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-contract", + "alloy-primitives", + "alloy-sol-macro", + "alloy-sol-types", + "const-hex", + "serde_json", +] + +[[package]] +name = "rundler-pool" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-network-primitives", + "alloy-primitives", + "alloy-sol-types", + "anyhow", + "async-stream", + "async-trait", + "futures", + "futures-util", + "itertools 0.13.0", + "metrics", + "metrics-derive", + "parking_lot", + "prost", + "rundler-contracts", + "rundler-provider", + "rundler-sim", + "rundler-task", + "rundler-types", + "rundler-utils", + "tokio", + "tokio-stream", + "tonic", + "tonic-build", + "tonic-health", + "tonic-reflection", + "tracing", +] + +[[package]] +name = "rundler-provider" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-consensus", + "alloy-contract", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-primitives", + "alloy-provider", + "alloy-rlp", + "alloy-rpc-client", + "alloy-rpc-types-any", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-serde", + "alloy-sol-types", + "alloy-transport", + "anyhow", + "async-trait", + "auto_impl", + "futures-util", + "metrics", + "metrics-derive", + "moka", + "pin-project", + "rand 0.8.5", + "regex", + "reth-tasks 1.4.7", + "rundler-bindings-fastlz", + "rundler-contracts", + "rundler-types", + "rundler-utils", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tower 0.4.13", + "tracing", + "url", +] + +[[package]] +name = "rundler-sim" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "anyhow", + "arrayvec", + "async-trait", + "futures-util", + "metrics", + "metrics-derive", + "rundler-contracts", + "rundler-provider", + "rundler-types", + "rundler-utils", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "rundler-task" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-primitives", + "anyhow", + "async-trait", + "pin-project", + "reth-tasks 1.4.7", + "rundler-provider", + "rundler-types", + "rundler-utils", + "thiserror 1.0.69", + "tokio", + "tonic", + "tower 0.4.13", + "tracing", +] + +[[package]] +name = "rundler-types" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-sol-types", + "anyhow", + "async-trait", + "auto_impl", + "chrono", + "futures-util", + "metrics", + "metrics-derive", + "num_enum", + "parse-display 0.10.0", + "rundler-contracts", + "rundler-utils", + "serde", + "strum 0.26.3", + "thiserror 1.0.69", +] + +[[package]] +name = "rundler-utils" +version = "0.10.0" +source = "git+https://github.com/rayyan224/rundler#ca4ad813c11d321c625fec1bb588ae9fb28807cf" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "anyhow", + "derive_more 0.99.20", + "itertools 0.13.0", + "metrics", + "rand 0.8.5", + "schnellru", + "tokio", + "tracing", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.1.1" @@ -6652,7 +7216,7 @@ checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 2.0.17", "time", ] @@ -6786,13 +7350,35 @@ dependencies = [ "syn 2.0.110", ] +[[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", + "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.110", ] [[package]] @@ -6867,6 +7453,12 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -6902,12 +7494,12 @@ dependencies = [ "futures", "log", "memchr", - "parse-display", + "parse-display 0.9.1", "pin-project-lite", "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 2.0.17", "tokio", "tokio-stream", "tokio-tar", @@ -6924,13 +7516,33 @@ dependencies = [ "testcontainers", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.110", ] [[package]] @@ -7086,7 +7698,7 @@ dependencies = [ "alloy-signer-local", "anyhow", "async-trait", - "axum", + "axum 0.8.7", "backon", "clap", "dotenvy", @@ -7240,6 +7852,96 @@ dependencies = [ "winnow", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.9", + "base64 0.22.1", + "bytes", + "h2 0.4.12", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.8.0", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "socket2 0.5.10", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn 2.0.110", +] + +[[package]] +name = "tonic-health" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eaf34ddb812120f5c601162d5429933c9b527d901ab0e7f930d3147e33a09b2" +dependencies = [ + "async-stream", + "prost", + "tokio", + "tokio-stream", + "tonic", +] + +[[package]] +name = "tonic-reflection" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878d81f52e7fcfd80026b7fdb6a9b578b3c3653ba987f87f0dce4b64043cba27" +dependencies = [ + "prost", + "prost-types", + "tokio", + "tokio-stream", + "tonic", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.5.2" @@ -7269,7 +7971,7 @@ dependencies = [ "http-body 1.0.1", "iri-string", "pin-project-lite", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", ] @@ -7631,6 +8333,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.3.9" @@ -8144,7 +8855,7 @@ version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ - "bindgen", + "bindgen 0.72.1", "cc", "pkg-config", ] diff --git a/crates/account-abstraction-core/Cargo.toml b/crates/account-abstraction-core/Cargo.toml index 55277ca..e729ebd 100644 --- a/crates/account-abstraction-core/Cargo.toml +++ b/crates/account-abstraction-core/Cargo.toml @@ -22,6 +22,15 @@ jsonrpsee.workspace = true async-trait = { workspace = true } alloy-sol-types.workspace= true anyhow.workspace = true +rundler-types = { git = "https://github.com/rayyan224/rundler", package = "rundler-types" } +rundler-pool = { git = "https://github.com/rayyan224/rundler", package = "rundler-pool" } +rundler-sim = { git = "https://github.com/rayyan224/rundler", package = "rundler-sim" } +rundler-provider = { git = "https://github.com/rayyan224/rundler", package = "rundler-provider" } +rundler-task = { git = "https://github.com/rayyan224/rundler", package = "rundler-task" } +rundler-utils = { git = "https://github.com/rayyan224/rundler", package = "rundler-utils" } +tracing.workspace = true +tracing-subscriber.workspace = true + [dev-dependencies] alloy-primitives.workspace = true diff --git a/crates/account-abstraction-core/core/src/lib.rs b/crates/account-abstraction-core/core/src/lib.rs index fe08aa7..7444b43 100644 --- a/crates/account-abstraction-core/core/src/lib.rs +++ b/crates/account-abstraction-core/core/src/lib.rs @@ -1,5 +1,7 @@ pub mod account_abstraction_service; pub mod entrypoints; +pub mod mempool; pub mod types; pub use account_abstraction_service::{AccountAbstractionService, AccountAbstractionServiceImpl}; +pub use mempool::SimpleMempool; pub use types::{SendUserOperationResponse, VersionedUserOperation}; diff --git a/crates/account-abstraction-core/core/src/mempool.rs b/crates/account-abstraction-core/core/src/mempool.rs new file mode 100644 index 0000000..218727b --- /dev/null +++ b/crates/account-abstraction-core/core/src/mempool.rs @@ -0,0 +1,177 @@ +use alloy_primitives::{Address, B256, U256}; +use anyhow::Result; +use rundler_pool::{LocalPoolBuilder, LocalPoolHandle, PoolConfig, PoolTask, PoolTaskArgs}; +use rundler_sim::PrecheckSettings; +use rundler_sim::simulation::Settings as SimulationSettings; +use rundler_types::pool::Pool; +use rundler_types::{ + EntryPointVersion, PriorityFeeMode, UserOperationId, UserOperationVariant, chain::ChainSpec, +}; +use std::collections::HashMap; +use tokio::sync::broadcast; +use tracing::info; + +pub struct MempoolConfig { + pub rpc_url: String, + pub chain_id: u64, + pub entry_point_address: Address, + pub entry_point_version: EntryPointVersion, +} + +impl Default for MempoolConfig { + fn default() -> Self { + Self { + rpc_url: "http://localhost:8545".to_string(), + chain_id: 1, + entry_point_address: Address::ZERO, + entry_point_version: EntryPointVersion::V0_7, + } + } +} + +pub struct SimpleMempool { + config: MempoolConfig, + pool_handle: Option, +} + +impl SimpleMempool { + pub fn new(config: MempoolConfig) -> Self { + Self { + config, + pool_handle: None, + } + } + + pub async fn initialize(&mut self) -> Result<()> { + info!( + "Initializing mempool with chain_id: {}", + self.config.chain_id + ); + + let chain_spec = ChainSpec { + id: self.config.chain_id, + ..Default::default() + }; + + let pool_config = PoolConfig { + chain_spec: chain_spec.clone(), + entry_point: self.config.entry_point_address, + entry_point_version: self.config.entry_point_version, + same_sender_mempool_count: 4, + min_replacement_fee_increase_percentage: 10, + max_size_of_pool_bytes: 500_000_000, + blocklist: None, + allowlist: None, + precheck_settings: PrecheckSettings { + max_verification_gas: 5_000_000, + max_bundle_execution_gas: 1_000_000_000, + bundle_priority_fee_overhead_percent: 0, + base_fee_accept_percent: 50, + max_uo_cost: U256::from(10u128.pow(18)), + priority_fee_mode: PriorityFeeMode::BaseFeePercent(0), + pre_verification_gas_accept_percent: 100, + verification_gas_limit_efficiency_reject_threshold: 10.0, + }, + sim_settings: SimulationSettings { + min_stake_value: U256::from(10u128.pow(18)), + min_unstake_delay: 84600, + tracer_timeout: "5s".to_string(), + enable_unsafe_fallback: false, + }, + mempool_channel_configs: HashMap::from([(B256::ZERO, Default::default())]), + reputation_tracking_enabled: true, + paymaster_tracking_enabled: true, + da_gas_tracking_enabled: false, + drop_min_num_blocks: 10, + throttled_entity_mempool_count: 4, + throttled_entity_live_blocks: 10, + paymaster_cache_length: 10000, + max_expected_storage_slots: 100, + execution_gas_limit_efficiency_reject_threshold: 10.0, + verification_gas_limit_efficiency_reject_threshold: 10.0, + max_time_in_pool: Some(std::time::Duration::from_secs(3600)), + }; + + let (event_tx, _event_rx) = broadcast::channel(1000); + let pool_builder = LocalPoolBuilder::new(100); + + let pool_task_args = PoolTaskArgs { + chain_spec: chain_spec.clone(), + http_url: self.config.rpc_url.clone(), + chain_max_sync_retries: 3, + chain_poll_interval: std::time::Duration::from_secs(1), + pool_configs: vec![pool_config], + remote_address: None, + chain_update_channel_capacity: 1000, + unsafe_mode: false, + }; + + let _pool_task = PoolTask::new(pool_task_args, event_tx.clone(), pool_builder, event_tx); + + let pool_builder = LocalPoolBuilder::new(100); + let handle = pool_builder.get_handle(); + + self.pool_handle = Some(handle); + + info!("Mempool initialized successfully"); + + Ok(()) + } + + pub async fn add_operation(&self, op: UserOperationVariant) -> Result { + let handle = self + .pool_handle + .as_ref() + .ok_or_else(|| anyhow::anyhow!("Pool not initialized"))?; + + // Default permissions: no special limits or sponsorship. + let perms = rundler_types::UserOperationPermissions::default(); + + let hash = handle + .add_op(op, perms) + .await + .map_err(anyhow::Error::from)?; + + Ok(hash) + } + + pub async fn get_operations(&self, _max_ops: u64) -> Result> { + let _pool_builder = self + .pool_handle + .as_ref() + .ok_or_else(|| anyhow::anyhow!("Pool not initialized"))?; + + anyhow::bail!( + "get_operations not yet fully implemented - need to determine correct LocalPoolHandle API" + ) + } + + pub async fn remove_operation(&self, _op_id: UserOperationId) -> Result<()> { + let _pool_builder = self + .pool_handle + .as_ref() + .ok_or_else(|| anyhow::anyhow!("Pool not initialized"))?; + + anyhow::bail!( + "remove_operation not yet fully implemented - need to determine correct LocalPoolHandle API" + ) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn test_mempool_creation() { + let config = MempoolConfig::default(); + let mut mempool = SimpleMempool::new(config); + + // Should start without a pool handle until initialized. + assert!(mempool.pool_handle.is_none()); + + // After initialize, a handle should be available. + mempool.initialize().await.unwrap(); + assert!(mempool.pool_handle.is_some()); + } +} diff --git a/crates/ingress-rpc/src/queue.rs b/crates/ingress-rpc/src/queue.rs index ee6063c..79d18c2 100644 --- a/crates/ingress-rpc/src/queue.rs +++ b/crates/ingress-rpc/src/queue.rs @@ -8,7 +8,6 @@ use std::sync::Arc; use tips_core::AcceptedBundle; use tokio::time::Duration; use tracing::{error, info}; - #[async_trait] pub trait MessageQueue: Send + Sync { async fn publish(&self, topic: &str, key: &str, payload: &[u8]) -> Result<()>;