diff --git a/.dockerignore b/.dockerignore index b14041a2..c51436d7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,5 +3,5 @@ docs Dockerfile bundler-spec-tests target -crates/contrarcts/thirdparty/account-abstraction/* +crates/contracts/thirdparty/account-abstraction/* tests/thirdparty/bundler/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8fc126a..d71ec2e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,9 +53,9 @@ jobs: sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc - wget -c https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.6-ea9e62ca.tar.gz - tar -xf geth-linux-amd64-1.11.6-ea9e62ca.tar.gz - mv geth-linux-amd64-1.11.6-ea9e62ca/geth /usr/local/bin/ + wget -c https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.12.0-e501b3b0.tar.gz + tar -xf geth-linux-amd64-1.12.0-e501b3b0.tar.gz + mv geth-linux-amd64-1.12.0-e501b3b0/geth /usr/local/bin/ chmod a+x /usr/local/bin/geth - name: Build @@ -111,4 +111,4 @@ jobs: - run: npm install -g yarn - name: Run tests - run: pdm run test --launcher-script silius/bundler-spec-tests/launcher.sh --url http://localhost:3000 + run: pdm run test --launcher-script silius/bundler-spec-tests/launcher.sh --url http://127.0.0.1:3000 diff --git a/Cargo.lock b/Cargo.lock index 04e62144..b59d0612 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -92,7 +92,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e416903084d3392ebd32d94735c395d6709415b76c7728e594d3f996f2b03e65" dependencies = [ - "alloy-rlp 0.3.2", + "alloy-rlp 0.3.3", "bytes", "cfg-if", "const-hex", @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f938f00332d63a5b0ac687bd6f46d03884638948921d9f8b50c59563d421ae25" +checksum = "cc0fac0fc16baf1f63f78b47c3d24718f3619b0714076f6a02957d808d52cbef" dependencies = [ "arrayvec", "bytes", @@ -134,7 +134,7 @@ checksum = "5bd2b0c6299738585f1bfa9720bb8df0e57750be8cf83269093d425bc919039b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "syn-solidity 0.2.0", "tiny-keccak", ] @@ -149,7 +149,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "syn-solidity 0.3.2", "tiny-keccak", ] @@ -209,9 +209,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" @@ -371,15 +371,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "array-init" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" -dependencies = [ - "nodrop", -] - [[package]] name = "arrayref" version = "0.3.7" @@ -410,6 +401,17 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -429,7 +431,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -440,7 +442,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -564,9 +566,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -688,9 +690,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", "serde", @@ -704,9 +706,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -722,9 +724,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -776,7 +778,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -809,18 +811,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -846,20 +847,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.0" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.4.0" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", @@ -869,14 +869,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -901,7 +901,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -942,7 +942,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bech32", "bs58", "digest 0.10.7", @@ -964,9 +964,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-hex" -version = "1.6.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca268df6cd88e646b564e6aff1a016834e5f42077c736ef6b6789c31ef9ec5dc" +checksum = "aa72a10d0e914cad6bcad4e7409e68d230c1c2db67896e19a37f758b1fcbdab5" dependencies = [ "cfg-if", "cpufeatures", @@ -1056,16 +1056,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -1107,9 +1097,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -1157,7 +1147,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1168,14 +1158,14 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "dashmap" -version = "5.5.1" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", "hashbrown 0.14.0", @@ -1350,9 +1340,9 @@ dependencies = [ [[package]] name = "educe" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079044df30bb07de7d846d41a184c4b00e66ebdac93ee459253474f3a47e50ae" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" dependencies = [ "enum-ordinalize", "proc-macro2", @@ -1405,11 +1395,11 @@ dependencies = [ [[package]] name = "enr" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" +checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "hex", "k256", @@ -1417,7 +1407,6 @@ dependencies = [ "rand 0.8.5", "rlp", "serde", - "serde-hex", "sha3", "zeroize", ] @@ -1432,18 +1421,18 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "enumn" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1464,7 +1453,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1475,9 +1464,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -1567,7 +1556,7 @@ dependencies = [ [[package]] name = "ethers" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "ethers-addressbook 2.0.8", "ethers-contract 2.0.8", @@ -1585,20 +1574,20 @@ version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba3fd516c15a9a587135229466dbbfc85796de55c5660afbbb1b1c78517d85c" dependencies = [ - "ethers-addressbook 2.0.9", - "ethers-contract 2.0.9", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "ethers-etherscan 2.0.9", - "ethers-middleware 2.0.9", - "ethers-providers 2.0.9", - "ethers-signers 2.0.9", + "ethers-addressbook 2.0.10", + "ethers-contract 2.0.10", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-etherscan 2.0.10", + "ethers-middleware 2.0.10", + "ethers-providers 2.0.10", + "ethers-signers 2.0.10", "ethers-solc 2.0.9", ] [[package]] name = "ethers-addressbook" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "ethers-core 2.0.8", "once_cell", @@ -1608,11 +1597,11 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0245617f11b8178fa50b52e433e2c34ac69f39116b62c8be2437decf2edf1986" +checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" dependencies = [ - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "serde", "serde_json", @@ -1621,7 +1610,7 @@ dependencies = [ [[package]] name = "ethers-contract" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "const-hex", "ethers-contract-abigen 2.0.8", @@ -1639,15 +1628,15 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02bb80fd2c22631a5eb8a02cbf373cc5fd86937fc966bb670b9a884580c8e71c" +checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" dependencies = [ "const-hex", - "ethers-contract-abigen 2.0.9", - "ethers-contract-derive 2.0.9", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "ethers-providers 2.0.9", + "ethers-contract-abigen 2.0.10", + "ethers-contract-derive 2.0.10", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-providers 2.0.10", "futures-util", "once_cell", "pin-project", @@ -1659,7 +1648,7 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "Inflector", "const-hex", @@ -1667,38 +1656,38 @@ dependencies = [ "ethers-core 2.0.8", "ethers-etherscan 2.0.8", "eyre", - "prettyplease 0.2.12", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "reqwest", "serde", "serde_json", - "syn 2.0.29", + "syn 2.0.37", "toml", "walkdir", ] [[package]] name = "ethers-contract-abigen" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22c54db0d393393e732a5b20273e4f8ab89f0cce501c84e75fab9c126799a6e6" +checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" dependencies = [ "Inflector", "const-hex", "dunce", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "ethers-etherscan 2.0.9", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-etherscan 2.0.10", "eyre", - "prettyplease 0.2.12", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "reqwest", "serde", "serde_json", - "syn 2.0.29", + "syn 2.0.37", "toml", "walkdir", ] @@ -1706,7 +1695,7 @@ dependencies = [ [[package]] name = "ethers-contract-derive" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "Inflector", "const-hex", @@ -1715,29 +1704,29 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "ethers-contract-derive" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ee4f216184a1304b707ed258f4f70aa40bf7e1522ab8963d127a8d516eaa1a" +checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" dependencies = [ "Inflector", "const-hex", - "ethers-contract-abigen 2.0.9", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-contract-abigen 2.0.10", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2", "quote", "serde_json", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "ethers-core" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "arrayvec", "bytes", @@ -1756,7 +1745,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.29", + "syn 2.0.37", "tempfile", "thiserror", "tiny-keccak", @@ -1765,9 +1754,9 @@ dependencies = [ [[package]] name = "ethers-core" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c29523f73c12753165781c6e5dc11c84d3e44c080a15f7c6cfbd70b514cb6f1" +checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" dependencies = [ "arrayvec", "bytes", @@ -1786,7 +1775,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.29", + "syn 2.0.37", "tempfile", "thiserror", "tiny-keccak", @@ -1795,8 +1784,8 @@ dependencies = [ [[package]] name = "ethers-core" -version = "2.0.9" -source = "git+https://github.com/gakonst/ethers-rs#f2d412c8cf732167288f68aee826eb6615b4b2e4" +version = "2.0.10" +source = "git+https://github.com/gakonst/ethers-rs#08bcb67c36d9a2869950e51ecf76124c9febe035" dependencies = [ "arrayvec", "bytes", @@ -1822,11 +1811,11 @@ dependencies = [ [[package]] name = "ethers-etherscan" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "ethers-core 2.0.8", "reqwest", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -1835,13 +1824,13 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aab5af432b3fe5b7756b60df5c9ddeb85a13414575ad8a9acd707c24f0a77a5" +checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" dependencies = [ - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -1851,7 +1840,7 @@ dependencies = [ [[package]] name = "ethers-flashbots" version = "0.14.0" -source = "git+https://github.com/qi-protocol/ethers-flashbots.git?branch=master#1c6504cd2d1f4d67e4af2dd9a5ee676a284452f9" +source = "git+https://github.com/qi-protocol/ethers-flashbots.git?rev=1c6504cd2d1f4d67e4af2dd9a5ee676a284452f9#1c6504cd2d1f4d67e4af2dd9a5ee676a284452f9" dependencies = [ "async-trait", "chrono", @@ -1869,7 +1858,7 @@ dependencies = [ [[package]] name = "ethers-flashbots-test" version = "0.13.1" -source = "git+https://github.com/da-bao-jian/ethers-flashbots.git?branch=master#1eda9b7bb84e82f43f35b98c34d9066f9596b41d" +source = "git+https://github.com/da-bao-jian/ethers-flashbots.git?rev=1eda9b7bb84e82f43f35b98c34d9066f9596b41d#1eda9b7bb84e82f43f35b98c34d9066f9596b41d" dependencies = [ "async-trait", "chrono", @@ -1887,7 +1876,7 @@ dependencies = [ [[package]] name = "ethers-middleware" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "async-trait", "auto_impl", @@ -1912,17 +1901,17 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356151d5ded56d4918146366abc9dfc9df367cf0096492a7a5477b21b7693615" +checksum = "473f1ccd0c793871bbc248729fa8df7e6d2981d6226e4343e3bbaa9281074d5d" dependencies = [ "async-trait", "auto_impl", - "ethers-contract 2.0.9", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "ethers-etherscan 2.0.9", - "ethers-providers 2.0.9", - "ethers-signers 2.0.9", + "ethers-contract 2.0.10", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-etherscan 2.0.10", + "ethers-providers 2.0.10", + "ethers-signers 2.0.10", "futures-channel", "futures-locks", "futures-util", @@ -1940,15 +1929,17 @@ dependencies = [ [[package]] name = "ethers-providers" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ + "async-recursion", "async-trait", "auto_impl", - "base64 0.21.2", + "base64 0.21.4", "bytes", "const-hex", "enr", "ethers-core 2.0.8", + "futures-channel", "futures-core", "futures-timer", "futures-util", @@ -1975,17 +1966,17 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c84664b294e47fc2860d6db0db0246f79c4c724e552549631bb9505b834bee" +checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.2", + "base64 0.21.4", "bytes", "const-hex", "enr", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core", "futures-timer", "futures-util", @@ -2000,7 +1991,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite 0.20.0", + "tokio-tungstenite 0.20.1", "tracing", "tracing-futures", "url", @@ -2013,7 +2004,7 @@ dependencies = [ [[package]] name = "ethers-signers" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "async-trait", "coins-bip32", @@ -2030,9 +2021,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170b299698702ef1f53d2275af7d6d97409cfa4f9398ee9ff518f6bc9102d0ad" +checksum = "5ea44bec930f12292866166f9ddbea6aa76304850e4d8dcd66dc492b43d00ff1" dependencies = [ "async-trait", "coins-bip32", @@ -2040,7 +2031,7 @@ dependencies = [ "const-hex", "elliptic-curve", "eth-keystore", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.8.5", "sha2 0.10.7", "thiserror", @@ -2050,7 +2041,7 @@ dependencies = [ [[package]] name = "ethers-solc" version = "2.0.8" -source = "git+https://github.com/gakonst/ethers-rs?rev=fa3017715a298728d9fb341933818a5d0d84c2dc#fa3017715a298728d9fb341933818a5d0d84c2dc" +source = "git+https://github.com/Vid201/ethers-rs?branch=chore/ws#d9c2bafd0c462a5b009fb1712c6cc5c866e0ef73" dependencies = [ "cfg-if", "const-hex", @@ -2066,7 +2057,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "sha2 0.10.7", @@ -2091,7 +2082,7 @@ dependencies = [ "const-hex", "dirs 5.0.1", "dunce", - "ethers-core 2.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "glob", "home", "md-5", @@ -2100,7 +2091,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "solang-parser", @@ -2313,7 +2304,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -2384,7 +2375,7 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -2443,7 +2434,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.1.7", "js-sys", "pin-project", "serde", @@ -2456,14 +2447,14 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.2.0", "http", "js-sys", "pin-project", @@ -2500,6 +2491,19 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "group" version = "0.13.0" @@ -2598,9 +2602,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2938,18 +2942,19 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8002beb64691edce321fc16cdba91916b10d798f9d480a05467b0ee98463c03b" +checksum = "9ad9b31183a8bcbe843e32ca8554ad2936633548d95a7bb6a8e14c767dea6b05" dependencies = [ - "jsonrpsee-client-transport 0.20.0", - "jsonrpsee-core 0.20.0", - "jsonrpsee-http-client 0.20.0", - "jsonrpsee-proc-macros 0.20.0", - "jsonrpsee-server 0.20.0", - "jsonrpsee-types 0.20.0", - "jsonrpsee-wasm-client 0.20.0", - "jsonrpsee-ws-client 0.20.0", + "jsonrpsee-client-transport 0.20.1", + "jsonrpsee-core 0.20.1", + "jsonrpsee-http-client 0.20.1", + "jsonrpsee-proc-macros 0.20.1", + "jsonrpsee-server 0.20.1", + "jsonrpsee-types 0.20.1", + "jsonrpsee-wasm-client 0.20.1", + "jsonrpsee-ws-client 0.20.1", + "tokio", "tracing", ] @@ -2977,15 +2982,15 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310f9566a32ec8db214805127c4f17e7e8e91015e4a1407fc1d0e84df0086a73" +checksum = "97f2743cad51cc86b0dbfe316309eeb87a9d96a3d7f4dd7a99767c4b5f065335" dependencies = [ "futures-channel", "futures-util", - "gloo-net 0.3.1", + "gloo-net 0.4.0", "http", - "jsonrpsee-core 0.20.0", + "jsonrpsee-core 0.20.1", "pin-project", "rustls-native-certs", "soketto", @@ -3028,9 +3033,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4278372ecb78ebb522c36a242209a29162f4af0997a41158c8b60450b081baf1" +checksum = "35dc957af59ce98373bcdde0c1698060ca6c2d2e9ae357b459c7158b6df33330" dependencies = [ "anyhow", "async-lock", @@ -3039,7 +3044,7 @@ dependencies = [ "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.20.0", + "jsonrpsee-types 0.20.1", "parking_lot", "rand 0.8.5", "rustc-hash", @@ -3073,15 +3078,15 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2393386c97ce214851a9677568c5a38223ae4eada833617cb16d8464d1128f1b" +checksum = "0dd865d0072764cb937b0110a92b5f53e995f7101cb346beca03d93a2dea79de" dependencies = [ "async-trait", "hyper", "hyper-rustls", - "jsonrpsee-core 0.20.0", - "jsonrpsee-types 0.20.0", + "jsonrpsee-core 0.20.1", + "jsonrpsee-types 0.20.1", "serde", "serde_json", "thiserror", @@ -3106,9 +3111,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985d4a3753a08aaf120429924567795b2764c5c691489316a7fd076178e708b4" +checksum = "cef91b1017a4edb63f65239381c18de39f88d0e0760ab626d806e196f7f51477" dependencies = [ "heck", "proc-macro-crate", @@ -3139,15 +3144,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc6357836b1d7b1367fe6d9a9b8d6e5488d1f1db985dfca4cb4ceaa9f37679e" +checksum = "24f4e2f3d223d810e363fb8b5616ec4c6254243ee7f452d05ac281cdc9cf76b2" dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core 0.20.0", - "jsonrpsee-types 0.20.0", + "jsonrpsee-core 0.20.1", + "jsonrpsee-types 0.20.1", "route-recognizer", "serde", "serde_json", @@ -3190,9 +3195,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbea61f2d95b9592491228db0c4d2b1e43ea1154ed9713bb666169cf3919ea7d" +checksum = "fa9e25aec855b2a7d3ed90fded6c41e8c3fb72b63f071e1be3f0004eba19b625" dependencies = [ "anyhow", "beef", @@ -3215,13 +3220,13 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051742038473f3aaada8fc1eb19c76a5354e37e886999d60061f1f303cfc45e8" +checksum = "010306151579898dc1000bab239ef7a73a73f04cb8ef267ee28b9a000267e813" dependencies = [ - "jsonrpsee-client-transport 0.20.0", - "jsonrpsee-core 0.20.0", - "jsonrpsee-types 0.20.0", + "jsonrpsee-client-transport 0.20.1", + "jsonrpsee-core 0.20.1", + "jsonrpsee-types 0.20.1", ] [[package]] @@ -3238,14 +3243,14 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9590173f77867bc96b5127e4a862e2edcb7f603c83616e9302d68aab983bc023" +checksum = "d88e35e9dfa89248ae3e92f689c1f0a190ce12d377eba7d2d08e5a7f6cc5694a" dependencies = [ "http", - "jsonrpsee-client-transport 0.20.0", - "jsonrpsee-core 0.20.0", - "jsonrpsee-types 0.20.0", + "jsonrpsee-client-transport 0.20.1", + "jsonrpsee-core 0.20.1", + "jsonrpsee-types 0.20.1", "url", ] @@ -3255,7 +3260,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "pem", "ring", "serde", @@ -3301,7 +3306,7 @@ dependencies = [ "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", "string_cache", "term", "tiny-keccak", @@ -3328,9 +3333,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -3350,9 +3355,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lock_api" @@ -3390,30 +3395,25 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -3474,7 +3474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys", ] @@ -3529,12 +3529,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - [[package]] name = "nom" version = "7.1.3" @@ -3614,14 +3608,14 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "object" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -3665,11 +3659,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -3686,7 +3680,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -3697,9 +3691,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -3741,9 +3735,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec", "bitvec", @@ -3756,9 +3750,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3785,7 +3779,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.3.5", - "smallvec 1.11.0", + "smallvec", "windows-targets", ] @@ -3857,10 +3851,11 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] @@ -3915,7 +3910,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -3953,14 +3948,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -3999,20 +3994,20 @@ version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" dependencies = [ - "portable-atomic 1.4.2", + "portable-atomic 1.4.3", ] [[package]] name = "portable-atomic" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" [[package]] name = "postcard" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ee729232311d3cd113749948b689627618133b1c5012b77342c1950b25eaeb" +checksum = "d534c6e61df1c7166e636ca612d9820d486fe96ddad37f7abc671517b297488e" dependencies = [ "cobs", "heapless", @@ -4043,12 +4038,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4107,9 +4102,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -4287,9 +4282,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -4297,14 +4292,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -4347,14 +4340,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -4368,13 +4361,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -4385,9 +4378,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "remove_dir_all" @@ -4404,7 +4397,7 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -4511,7 +4504,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=aa6f2cb0610fb4fa0926b4 dependencies = [ "async-trait", "bytes", - "ethers-core 2.0.9 (git+https://github.com/gakonst/ethers-rs)", + "ethers-core 2.0.10 (git+https://github.com/gakonst/ethers-rs)", "futures", "metrics", "pin-project", @@ -4608,7 +4601,7 @@ dependencies = [ "crc", "crunchy", "derive_more", - "ethers-core 2.0.9 (git+https://github.com/gakonst/ethers-rs)", + "ethers-core 2.0.10 (git+https://github.com/gakonst/ethers-rs)", "fixed-hash", "hash-db", "hex", @@ -4654,7 +4647,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=aa6f2cb0610fb4fa0926b4 dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4762,7 +4755,7 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95294d6e3a6192f3aabf91c38f56505a625aa495533442744185a36d75a790c4" dependencies = [ - "alloy-rlp 0.3.2", + "alloy-rlp 0.3.3", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", @@ -4836,14 +4829,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.19", ] [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno", @@ -4854,13 +4847,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", - "rustls-webpki 0.101.4", + "rustls-webpki 0.101.6", "sct", ] @@ -4882,14 +4875,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.100.2" +version = "0.100.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" dependencies = [ "ring", "untrusted", @@ -4897,9 +4890,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -5075,9 +5068,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -5105,40 +5098,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hex" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca37e3e4d1b39afd7ff11ee4e947efae85adfddf4841787bfa47c470e96dc26d" -dependencies = [ - "array-init", - "serde", - "smallvec 0.6.14", -] - [[package]] name = "serde_derive" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -5179,7 +5161,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.27", + "time", ] [[package]] @@ -5191,7 +5173,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5209,9 +5191,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -5272,9 +5254,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -5299,11 +5281,11 @@ dependencies = [ name = "silius" version = "0.2.0-alpha" dependencies = [ - "anyhow", "clap", "dirs 4.0.0", "ethers 2.0.8", "expanded-pathbuf", + "eyre", "log", "pin-utils", "silius-bundler", @@ -5321,14 +5303,14 @@ version = "0.2.0-alpha" dependencies = [ "alloy-primitives 0.2.0", "alloy-sol-types 0.2.0", - "anyhow", "async-trait", "bytes", "dotenv", "ethers 2.0.8", "ethers-flashbots", "ethers-flashbots-test", - "jsonrpsee 0.20.0", + "eyre", + "jsonrpsee 0.20.1", "serde", "serde_json", "silius-contracts", @@ -5343,9 +5325,9 @@ dependencies = [ name = "silius-contracts" version = "0.2.0-alpha" dependencies = [ - "anyhow", "ethers 2.0.8", "ethers-solc 2.0.9", + "eyre", "lazy_static", "serde", "serde_json", @@ -5360,8 +5342,8 @@ version = "0.2.0-alpha" dependencies = [ "alloy-primitives 0.3.3", "alloy-sol-types 0.3.2", - "anyhow", "ethers 2.0.8", + "eyre", "reqwest", "serde", "serde_json", @@ -5375,12 +5357,12 @@ dependencies = [ name = "silius-grpc" version = "0.2.0-alpha" dependencies = [ - "anyhow", "arrayref", "async-trait", "dashmap", "ethers 2.0.8", "expanded-pathbuf", + "eyre", "parking_lot", "prost", "prost-build", @@ -5400,10 +5382,10 @@ dependencies = [ name = "silius-primitives" version = "0.2.0-alpha" dependencies = [ - "anyhow", "educe", "ethers 2.0.8", "expanded-pathbuf", + "eyre", "lazy_static", "rustc-hex", "serde", @@ -5420,9 +5402,9 @@ dependencies = [ name = "silius-rpc" version = "0.2.0-alpha" dependencies = [ - "anyhow", "async-trait", "ethers 2.0.8", + "eyre", "git-version", "hyper", "jsonrpsee 0.18.2", @@ -5440,8 +5422,8 @@ dependencies = [ name = "silius-tests" version = "0.2.0-alpha" dependencies = [ - "anyhow", "ethers 2.0.8", + "eyre", "silius-contracts", "silius-primitives", "silius-uopool", @@ -5453,11 +5435,11 @@ dependencies = [ name = "silius-uopool" version = "0.2.0-alpha" dependencies = [ - "anyhow", "async-trait", "educe", "enumset", "ethers 2.0.8", + "eyre", "page_size 0.5.0", "parking_lot", "prost", @@ -5481,7 +5463,7 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.27", + "time", ] [[package]] @@ -5501,18 +5483,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smol_str" @@ -5550,9 +5523,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys", @@ -5711,7 +5684,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5740,7 +5713,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "sha2 0.10.7", @@ -5757,7 +5730,7 @@ checksum = "2271abd7d01895a3e5bfa4b578e32f09155002ce1ec239532e297f82aafad06b" dependencies = [ "build_const", "hex", - "semver 1.0.18", + "semver 1.0.19", "serde_json", "svm-rs", ] @@ -5775,9 +5748,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -5792,7 +5765,7 @@ checksum = "c93e348d6f105577df7bb5e8ad835d8f0f8ecbd709da24e711bb107a048d8000" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5804,7 +5777,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5855,22 +5828,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5885,20 +5858,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -5909,15 +5871,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -5960,7 +5922,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -5983,7 +5945,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6036,23 +5998,23 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2dbec703c26b00d74844519606ef15d09a7d6857860f84ad223dec002ddea2" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", "native-tls", "tokio", "tokio-native-tls", - "tungstenite 0.20.0", + "tungstenite 0.20.1", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -6065,9 +6027,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -6086,9 +6048,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "serde", @@ -6164,9 +6126,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "bitflags 2.4.0", "bytes", @@ -6213,7 +6175,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6258,7 +6220,7 @@ dependencies = [ "once_cell", "regex", "sharded-slab", - "smallvec 1.11.0", + "smallvec", "thread_local", "tracing", "tracing-core", @@ -6305,9 +6267,9 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e862a1c4128df0112ab625f55cd5c934bcb4312ba80b39ae4b4835a3fd58e649" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ "byteorder", "bytes", @@ -6325,9 +6287,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -6361,9 +6323,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -6394,9 +6356,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -6454,9 +6416,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -6471,12 +6433,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -6504,7 +6460,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -6538,7 +6494,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6561,9 +6517,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" dependencies = [ "ring", "untrusted", @@ -6575,7 +6531,7 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "rustls-webpki 0.100.2", + "rustls-webpki 0.100.3", ] [[package]] @@ -6586,13 +6542,14 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] @@ -6613,9 +6570,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -6771,7 +6728,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6790,7 +6747,7 @@ dependencies = [ "hmac", "pbkdf2 0.11.0", "sha1", - "time 0.3.27", + "time", "zstd", ] diff --git a/Cargo.toml b/Cargo.toml index 436f9761..7ebd1193 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,10 +21,12 @@ repository = "https://github.com/Vid201/silius" rust-version = "1.71.1" [workspace.dependencies] -anyhow = "1" async-trait = "0.1" -ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "fa3017715a298728d9fb341933818a5d0d84c2dc" } +ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "fa3017715a298728d9fb341933818a5d0d84c2dc", features = [ + "ws", +] } expanded-pathbuf = "0.1" +eyre = "0.6.8" parking_lot = "0.12" serde_json = "1" tokio = { version = "1.18", features = ["full"] } @@ -37,3 +39,5 @@ debug = true [patch] [patch.crates-io] revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "3d8ca6641d2e72448c23f4596f769c8fd1c784d1" } +[patch."https://github.com/gakonst/ethers-rs"] +ethers = { git = "https://github.com/Vid201/ethers-rs", branch = "chore/ws" } diff --git a/Dockerfile b/Dockerfile index 23750a8b..75259de0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN apk add openssl1.1-compat COPY --from=builder /silius/target/release/silius /usr/local/bin/silius -EXPOSE 3000 +EXPOSE 3000 3001 ENTRYPOINT ["usr/local/bin/silius"] diff --git a/Makefile b/Makefile index eb9ae27c..f3fb7e31 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ build: cargo build --release run-silius: - cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws + cargo run --release -- bundler --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws run-silius-bundling: - cargo run --release -- bundling --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 + cargo run --release -- bundling --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 run-silius-uopool: - cargo run --release -- uopool --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 + cargo run --release -- uopool --eth-client-address ws://127.0.0.1:8546 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 run-silius-rpc: cargo run --release -- rpc --http --ws @@ -17,10 +17,10 @@ run-silius-create-wallet: cargo run --release -- create-wallet --output-path ${HOME}/.silius run-silius-debug: - cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.api eth,debug,web3 + cargo run --release -- bundler --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.api eth,debug,web3 run-silius-debug-mode: - cargo run --profile debug-fast -- bundler --verbosity 4 --eth-client-address http://127.0.0.1:8545 --mnemonic-file /home/vid/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.api eth,debug,web3 + cargo run --profile debug-fast -- bundler --verbosity 4 --eth-client-address ws://127.0.0.1:8546 --mnemonic-file /home/vid/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.api eth,debug,web3 fetch-thirdparty: git submodule update --init diff --git a/README.md b/README.md index e8f1a010..c6cf5b61 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For more information: https://hackmd.io/@Vid201/aa-bundler-rust Rust version: 1.71.1 1. `libclang-dev`, `pkg-config` and `libssl-dev` on Debian/Ubuntu. -2. Ethereum execution client JSON-RPC API with enabled [`debug_traceCall`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debug_tracecall). For production, you can use [Geth](https://github.com/ethereum/go-ethereum) or [Erigon](https://github.com/ledgerwatch/erigon). For testing, we are using Geth dev mode (tested with [v1.11.6](https://github.com/ethereum/go-ethereum/releases/tag/v1.11.6)); so you need to install [Geth](https://geth.ethereum.org/docs/getting-started/installing-geth) for running tests. +2. Ethereum execution client JSON-RPC API with enabled [`debug_traceCall`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debug_tracecall). For production, you can use [Geth](https://github.com/ethereum/go-ethereum) or [Erigon](https://github.com/ledgerwatch/erigon). For testing, we are using Geth dev mode (tested with [v1.12.0](https://github.com/ethereum/go-ethereum/releases/tag/v1.12.0)); so you need to install [Geth](https://geth.ethereum.org/docs/getting-started/installing-geth) for running tests. 3. [`solc`](https://docs.soliditylang.org/en/v0.8.17/installing-solidity.html) >=0.8.12. 4. [`cargo-sort`](https://crates.io/crates/cargo-sort) and [`cargo-udeps`](https://crates.io/crates/cargo-udeps). @@ -45,19 +45,19 @@ cargo run --release -- create-wallet --output-path ${HOME}/.silius --chain-id 5 Run bundler (with user operation pool and JSON-RPC API): ```bash -cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws +cargo run --release -- bundler --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws ``` Run only bundling component: ```bash -cargo run --release -- bundling --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 +cargo run --release -- bundling --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 ``` Run only user operation pool: ```bash -cargo run --release -- uopool --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 +cargo run --release -- uopool --eth-client-address ws://127.0.0.1:8546 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 ``` Run only JSON-RPC API: @@ -69,7 +69,7 @@ cargo run --release -- rpc --http --ws ### Docker ```bash -docker run --net=host -v ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:/data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -v ./db:/data/silius/db ghcr.io/vid201/silius:latest bundler --eth-client-address http://127.0.0.1:8545 --datadir data/silius --mnemonic-file data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 --http --http.addr 0.0.0.0 --http.port 3000 --http.api eth,debug,web3 --ws --ws.addr 0.0.0.0 --ws.port 3001 --ws.api eth,debug,web3 +docker run --net=host -v ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:/data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -v ./db:/data/silius/db ghcr.io/vid201/silius:latest bundler --eth-client-address ws://127.0.0.1:8546 --datadir data/silius --mnemonic-file data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 --http --http.addr 0.0.0.0 --http.port 3000 --http.api eth,debug,web3 --ws --ws.addr 0.0.0.0 --ws.port 3001 --ws.api eth,debug,web3 --eth-client-proxy-address http://127.0.0.1:8545 ``` ## Supported networks diff --git a/bin/silius/Cargo.toml b/bin/silius/Cargo.toml index 23406765..fac357c0 100644 --- a/bin/silius/Cargo.toml +++ b/bin/silius/Cargo.toml @@ -11,11 +11,11 @@ AA (ERC-4337) bundler - Silius """ [dependencies] -anyhow = { workspace = true } clap = { version = "4", features = ["derive"] } dirs = "4.0" ethers = { workspace = true } expanded-pathbuf = { workspace = true } +eyre = { workspace = true } log = "0.4.19" pin-utils = "0.1" silius-bundler = { path = "../../crates/bundler" } diff --git a/bin/silius/src/bundler.rs b/bin/silius/src/bundler.rs index 47e4b770..3105bbd6 100644 --- a/bin/silius/src/bundler.rs +++ b/bin/silius/src/bundler.rs @@ -3,7 +3,7 @@ use crate::{ utils::unwrap_path_or_home, }; use ethers::{ - providers::{Http, Middleware, Provider}, + providers::{Middleware, Provider, Ws}, types::Address, }; use silius_grpc::{ @@ -27,10 +27,11 @@ pub async fn launch_bundler( uopool_args: UoPoolArgs, common_args: BundlerAndUoPoolArgs, rpc_args: RpcArgs, -) -> anyhow::Result<()> { + eth_client: Arc>, +) -> eyre::Result<()> { launch_uopool( uopool_args.clone(), - common_args.eth_client_address.clone(), + eth_client.clone(), common_args.chain.clone(), common_args.entry_points.clone(), ) @@ -38,7 +39,7 @@ pub async fn launch_bundler( launch_bundling( bundler_args.clone(), - common_args.eth_client_address.clone(), + eth_client.clone(), common_args.chain, common_args.entry_points, format!( @@ -50,7 +51,6 @@ pub async fn launch_bundler( launch_rpc( rpc_args, - common_args.eth_client_address, format!( "http://{:?}:{:?}", uopool_args.uopool_addr, uopool_args.uopool_port @@ -67,18 +67,17 @@ pub async fn launch_bundler( pub async fn launch_bundling( args: BundlerArgs, - eth_client_address: String, + eth_client: Arc>, chain: Option, entry_points: Vec
, uopool_grpc_listen_address: String, -) -> anyhow::Result<()> { +) -> eyre::Result<()> { info!("Starting bundling gRPC service..."); - let eth_client = Arc::new(Provider::::try_from(eth_client_address.clone())?); let eth_client_version = check_connected_chain(eth_client.clone(), chain).await?; info!( - "Bundling component connected to Ethereum execution client at {}: {}", - eth_client_address, eth_client_version + "Bundling component connected to Ethereum execution client with version {}", + eth_client_version, ); let chain_id = eth_client.get_chainid().await?; @@ -87,12 +86,12 @@ pub async fn launch_bundling( let wallet: Wallet; if args.send_bundle_mode == SendBundleMode::Flashbots { wallet = Wallet::from_file(args.mnemonic_file.into(), &chain_id, true) - .map_err(|error| anyhow::format_err!("Could not load mnemonic file: {}", error))?; + .map_err(|error| eyre::format_err!("Could not load mnemonic file: {}", error))?; info!("Wallet Signer {:?}", wallet.signer); - info!("Flashbots Signer {:?}", wallet.fb_signer); + info!("Flashbots Signer {:?}", wallet.flashbots_signer); } else { wallet = Wallet::from_file(args.mnemonic_file.into(), &chain_id, false) - .map_err(|error| anyhow::format_err!("Could not load mnemonic file: {}", error))?; + .map_err(|error| eyre::format_err!("Could not load mnemonic file: {}", error))?; info!("{:?}", wallet.signer); } @@ -104,7 +103,7 @@ pub async fn launch_bundling( SocketAddr::new(args.bundler_addr, args.bundler_port), wallet, entry_points, - eth_client_address, + eth_client, chain_conn, args.beneficiary, args.min_balance, @@ -128,17 +127,16 @@ pub async fn launch_bundling( pub async fn launch_uopool( args: UoPoolArgs, - eth_client_address: String, + eth_client: Arc>, chain: Option, entry_points: Vec
, -) -> anyhow::Result<()> { +) -> eyre::Result<()> { info!("Starting uopool gRPC service..."); - let eth_client = Arc::new(Provider::::try_from(eth_client_address.clone())?); let eth_client_version = check_connected_chain(eth_client.clone(), chain).await?; info!( - "UoPool connected to Ethereum execution client at {}: {}", - eth_client_address, eth_client_version + "UoPool component connected to Ethereum execution client with version {}", + eth_client_version ); let chain_id = Chain::from(eth_client.get_chainid().await?); @@ -149,7 +147,7 @@ pub async fn launch_uopool( SocketAddr::new(args.uopool_addr, args.uopool_port), datadir, entry_points, - eth_client.clone(), + eth_client, chain_id, args.max_verification_gas, args.min_stake, @@ -170,12 +168,11 @@ pub async fn launch_uopool( pub async fn launch_rpc( args: RpcArgs, - eth_client_address: String, uopool_grpc_listen_address: String, bundler_grpc_listen_address: String, -) -> anyhow::Result<()> { +) -> eyre::Result<()> { if !args.is_enabled() { - return Err(anyhow::anyhow!("No RPC protocol is enabled")); + return Err(eyre::eyre!("No RPC protocol is enabled")); } info!("Starting bundler JSON-RPC server..."); @@ -189,8 +186,11 @@ pub async fn launch_rpc( args.ws_port, ) .with_cors(&args.http_corsdomain, JsonRpcServerType::Http) - .with_cors(&args.ws_origins, JsonRpcServerType::Ws) - .with_proxy(eth_client_address); + .with_cors(&args.ws_origins, JsonRpcServerType::Ws); + + if let Some(eth_client_proxy_address) = args.eth_client_proxy_address.clone() { + server = server.with_proxy(eth_client_proxy_address); + } let http_api: HashSet = HashSet::from_iter(args.http_api.iter().cloned()); let ws_api: HashSet = HashSet::from_iter(args.ws_api.iter().cloned()); @@ -262,13 +262,13 @@ pub async fn launch_rpc( "Started bundler JSON-RPC server with http: {:?}:{:?}, ws: {:?}:{:?}", args.http_addr, args.http_port, args.ws_addr, args.ws_port, ); - pending::>().await + pending::>().await }); Ok(()) } -pub fn create_wallet(args: CreateWalletArgs) -> anyhow::Result<()> { +pub fn create_wallet(args: CreateWalletArgs) -> eyre::Result<()> { info!( "Creating bundler wallet... Storing to: {:?}", args.output_path @@ -279,7 +279,7 @@ pub fn create_wallet(args: CreateWalletArgs) -> anyhow::Result<()> { if args.flashbots_key { let wallet = Wallet::build_random(path, &args.chain_id, true)?; info!("Wallet signer {:?}", wallet.signer); - info!("Flashbots signer {:?}", wallet.fb_signer); + info!("Flashbots signer {:?}", wallet.flashbots_signer); } else { let wallet = Wallet::build_random(path, &args.chain_id, false)?; info!("Wallet signer {:?}", wallet.signer); @@ -289,15 +289,15 @@ pub fn create_wallet(args: CreateWalletArgs) -> anyhow::Result<()> { } async fn check_connected_chain( - eth_client: Arc>, + eth_client: Arc>, chain: Option, -) -> anyhow::Result { +) -> eyre::Result { let chain_id = eth_client.get_chainid().await?; let chain_conn = Chain::from(chain_id); if let Some(chain_opt) = chain { if chain_conn.name() != chain_opt { - return Err(anyhow::format_err!( + return Err(eyre::format_err!( "Tried to connect to the execution client of different chain: {} != {}", chain_opt, chain_conn.name() diff --git a/bin/silius/src/cli/args.rs b/bin/silius/src/cli/args.rs index e176306c..f411492a 100644 --- a/bin/silius/src/cli/args.rs +++ b/bin/silius/src/cli/args.rs @@ -70,7 +70,7 @@ pub struct UoPoolArgs { pub datadir: Option, /// Max allowed verification gas. - #[clap(long, default_value="3000000", value_parser=parse_u256)] + #[clap(long, default_value="5000000", value_parser=parse_u256)] pub max_verification_gas: U256, /// Minimum stake required for entities. @@ -98,7 +98,7 @@ pub struct UoPoolArgs { #[derive(Debug, Clone, Parser)] pub struct BundlerAndUoPoolArgs { /// Ethereum execution client RPC endpoint. - #[clap(long, default_value = "http://127.0.0.1:8545")] + #[clap(long, default_value = "ws://127.0.0.1:8546")] pub eth_client_address: String, /// Chain information. @@ -172,6 +172,10 @@ pub struct RpcArgs { /// By default, this option is set to `*`. #[clap(long = "ws.origins", value_delimiter = ',', default_value = "*")] pub ws_origins: Vec, + + /// Ethereum execution client proxy HTTP RPC endpoint + #[clap(long)] + pub eth_client_proxy_address: Option, } impl RpcArgs { @@ -296,6 +300,7 @@ mod tests { String::from("web3") ], ws_origins: vec![String::from("127.0.0.1:4321")], + eth_client_proxy_address: None, }, RpcArgs::try_parse_from(args).unwrap() ); @@ -331,6 +336,7 @@ mod tests { ws_port: 3001, ws_api: vec![String::from("eth"),], ws_origins: vec![String::from("*")], + eth_client_proxy_address: None, }, RpcArgs::try_parse_from(args).unwrap() ); @@ -366,6 +372,7 @@ mod tests { String::from("web3") ], ws_origins: vec![String::from("127.0.0.1:4321")], + eth_client_proxy_address: None, }, RpcArgs::try_parse_from(args).unwrap() ); @@ -400,6 +407,7 @@ mod tests { ws_port: 3001, ws_api: vec![String::from("eth"),], ws_origins: vec![String::from("*")], + eth_client_proxy_address: None, }, RpcArgs::try_parse_from(args).unwrap() ); @@ -423,6 +431,7 @@ mod tests { ws_port: 3001, ws_api: vec![String::from("eth"),], ws_origins: vec![String::from("*")], + eth_client_proxy_address: None, } .is_enabled(), true @@ -447,6 +456,7 @@ mod tests { String::from("web3") ], ws_origins: vec![String::from("127.0.0.1:4321")], + eth_client_proxy_address: None, } .is_enabled(), true @@ -475,6 +485,7 @@ mod tests { String::from("web3") ], ws_origins: vec![String::from("127.0.0.1:4321")], + eth_client_proxy_address: None, } .is_enabled(), true @@ -499,6 +510,7 @@ mod tests { ws_port: 3001, ws_api: vec![String::from("eth"),], ws_origins: vec![String::from("*")], + eth_client_proxy_address: None, } .is_enabled(), false diff --git a/bin/silius/src/cli/commands.rs b/bin/silius/src/cli/commands.rs index 8257b95b..9d142344 100644 --- a/bin/silius/src/cli/commands.rs +++ b/bin/silius/src/cli/commands.rs @@ -1,7 +1,10 @@ use super::args::{BundlerAndUoPoolArgs, BundlerArgs, CreateWalletArgs, RpcArgs, UoPoolArgs}; -use crate::bundler::{create_wallet, launch_bundler, launch_bundling, launch_rpc, launch_uopool}; +use crate::{ + bundler::{create_wallet, launch_bundler, launch_bundling, launch_rpc, launch_uopool}, + utils::create_ws_provider, +}; use clap::Parser; -use std::future::pending; +use std::{future::pending, sync::Arc}; /// Start the bundler with all components (bundling component, user operation mempool, RPC server) #[derive(Debug, Parser)] @@ -25,8 +28,9 @@ pub struct BundlerCommand { impl BundlerCommand { /// Execute the command - pub async fn execute(self) -> anyhow::Result<()> { - launch_bundler(self.bundler, self.uopool, self.common, self.rpc).await?; + pub async fn execute(self) -> eyre::Result<()> { + let eth_client = Arc::new(create_ws_provider(&self.common.eth_client_address).await?); + launch_bundler(self.bundler, self.uopool, self.common, self.rpc, eth_client).await?; pending().await } } @@ -49,10 +53,11 @@ pub struct BundlingCommand { impl BundlingCommand { /// Execute the command - pub async fn execute(self) -> anyhow::Result<()> { + pub async fn execute(self) -> eyre::Result<()> { + let eth_client = Arc::new(create_ws_provider(&self.common.eth_client_address).await?); launch_bundling( self.bundler, - self.common.eth_client_address, + eth_client, self.common.chain, self.common.entry_points, self.uopool_grpc_listen_address, @@ -76,10 +81,11 @@ pub struct UoPoolCommand { impl UoPoolCommand { /// Execute the command - pub async fn execute(self) -> anyhow::Result<()> { + pub async fn execute(self) -> eyre::Result<()> { + let eth_client = Arc::new(create_ws_provider(&self.common.eth_client_address).await?); launch_uopool( self.uopool, - self.common.eth_client_address, + eth_client, self.common.chain, self.common.entry_points, ) @@ -95,10 +101,6 @@ pub struct RpcCommand { #[clap(flatten)] rpc: RpcArgs, - /// Ethereum execution client RPC endpoint - #[clap(long, default_value = "http://127.0.0.1:8545")] - pub eth_client_address: String, - /// UoPool gRPC listen address #[clap(long, default_value = "http://127.0.0.1:3002")] pub uopool_grpc_listen_address: String, @@ -110,10 +112,9 @@ pub struct RpcCommand { impl RpcCommand { /// Execute the command - pub async fn execute(self) -> anyhow::Result<()> { + pub async fn execute(self) -> eyre::Result<()> { launch_rpc( self.rpc, - self.eth_client_address, self.uopool_grpc_listen_address, self.bundler_grpc_listen_address, ) @@ -132,7 +133,7 @@ pub struct CreateWalletCommand { impl CreateWalletCommand { /// Execute the command - pub fn execute(self) -> anyhow::Result<()> { + pub fn execute(self) -> eyre::Result<()> { create_wallet(self.create_wallet) } } diff --git a/bin/silius/src/cli/mod.rs b/bin/silius/src/cli/mod.rs index 9b269d46..66f2e7ac 100644 --- a/bin/silius/src/cli/mod.rs +++ b/bin/silius/src/cli/mod.rs @@ -56,10 +56,14 @@ pub enum Commands { CreateWallet(commands::CreateWalletCommand), } -pub fn run() -> anyhow::Result<()> { +pub fn run() -> eyre::Result<()> { let cli = Cli::parse(); - std::env::set_var("RUST_LOG", format!("silius={}", cli.get_log_level())); + let rust_log = match std::env::var("RUST_LOG") { + Ok(val) => format!("{},silius={}", val, cli.get_log_level()), + Err(_) => format!("silius={}", cli.get_log_level()), + }; + std::env::set_var("RUST_LOG", rust_log); tracing_subscriber::fmt::init(); std::thread::Builder::new() diff --git a/bin/silius/src/utils.rs b/bin/silius/src/utils.rs index 94f8abb6..a6d13904 100644 --- a/bin/silius/src/utils.rs +++ b/bin/silius/src/utils.rs @@ -1,5 +1,8 @@ use dirs::home_dir; -use ethers::types::{Address, U256}; +use ethers::{ + providers::{Provider, Ws}, + types::{Address, U256}, +}; use expanded_pathbuf::ExpandedPathBuf; use pin_utils::pin_mut; use silius_primitives::{bundler::SendBundleMode, UoPoolMode}; @@ -7,13 +10,13 @@ use std::{future::Future, str::FromStr}; use tracing::info; /// Unwrap path or returns home directory -pub fn unwrap_path_or_home(path: Option) -> anyhow::Result { +pub fn unwrap_path_or_home(path: Option) -> eyre::Result { if let Some(path) = path { Ok(path) } else { home_dir() .map(|h| h.join(".silius")) - .ok_or_else(|| anyhow::anyhow!("Get Home directory error")) + .ok_or_else(|| eyre::eyre!("Get Home directory error")) .map(ExpandedPathBuf) } } @@ -64,3 +67,9 @@ where Ok(()) } + +/// Creates ethers provider with WebSockets connection +pub async fn create_ws_provider(addr: &str) -> eyre::Result> { + let provider = Provider::::connect_with_reconnects(addr, usize::MAX).await?; + Ok(provider) +} diff --git a/bundler-spec-tests/docker-compose.yml b/bundler-spec-tests/docker-compose.yml index 93121277..fa25243c 100644 --- a/bundler-spec-tests/docker-compose.yml +++ b/bundler-spec-tests/docker-compose.yml @@ -1,12 +1,36 @@ -version: '2' +version: "3" services: geth-dev: - build: geth-dev + image: ethereum/client-go:release-1.12 + healthcheck: + test: [ "CMD-SHELL", "geth attach --exec eth.blockNumber" ] + interval: 10s + timeout: 5s + retries: 5 ports: - 8545:8545 + - 8546:8546 + command: + - --miner.gaslimit=12000000 + - --http + - --http.api=personal,eth,net,web3,debug + - --allow-insecure-unlock + - --rpc.allow-unprotected-txs + - --http.vhosts=* + - --http.corsdomain=* + - --http.addr=0.0.0.0 + - --ws + - --ws.api=personal,eth,net,web3,debug + - --ws.origins=* + - --ws.addr=0.0.0.0 + - --dev + - --nodiscover + - --maxpeers=0 + - --mine + - --verbosity=2 fund-signer: - image: ethereum/client-go:release-1.10 + image: ethereum/client-go:release-1.12 entrypoint: 'geth --exec "eth.sendTransaction({from: eth.accounts[0], to: \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\", value: web3.toWei(10000, \"ether\")})" attach http://geth-dev:8545' depends_on: geth-dev: diff --git a/bundler-spec-tests/geth-dev/Dockerfile b/bundler-spec-tests/geth-dev/Dockerfile deleted file mode 100644 index 8b87ce79..00000000 --- a/bundler-spec-tests/geth-dev/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ethereum/client-go:release-1.10 - -ENTRYPOINT geth \ - --verbosity 1 \ - --http.vhosts '*,localhost,host.docker.internal' \ - --http \ - --http.api personal,eth,net,web3,debug \ - --http.corsdomain '*' \ - --http.addr "0.0.0.0" \ - --nodiscover --maxpeers 0 --mine \ - --networkid 1337 \ - --dev \ - --allow-insecure-unlock \ - --rpc.allow-unprotected-txs \ - --dev.gaslimit 20000000 \ No newline at end of file diff --git a/bundler-spec-tests/launcher.sh b/bundler-spec-tests/launcher.sh old mode 100644 new mode 100755 index 8031386f..d51e26e5 --- a/bundler-spec-tests/launcher.sh +++ b/bundler-spec-tests/launcher.sh @@ -10,9 +10,10 @@ case $1 in start) docker-compose up -d + sleep 2 silius bundler \ --verbosity 4 \ - --eth-client-address http://localhost:8545 \ + --eth-client-address ws://127.0.0.1:8546 \ --mnemonic-file keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 \ diff --git a/crates/bundler/Cargo.toml b/crates/bundler/Cargo.toml index e7f0efd2..ce68c725 100644 --- a/crates/bundler/Cargo.toml +++ b/crates/bundler/Cargo.toml @@ -11,12 +11,11 @@ AA (ERC-4337) bundler bundling implementation """ [dependencies] - -anyhow = { workspace = true } async-trait = "0.1" bytes = "1.4.0" ethers = { workspace = true } -ethers-flashbots = { git = "https://github.com/qi-protocol/ethers-flashbots.git", branch = "master" } +ethers-flashbots = { git = "https://github.com/qi-protocol/ethers-flashbots.git", rev = "1c6504cd2d1f4d67e4af2dd9a5ee676a284452f9" } +eyre = { workspace = true } serde = { version = "1.0", features = ["derive"] } serde_json = "1" silius-contracts = { path = "../contracts" } @@ -29,8 +28,6 @@ url = "2.4.0" alloy-primitives = "0.2.0" alloy-sol-types = "0.2.0" dotenv = "0.15.0" -ethers-flashbots-test = { git = "https://github.com/da-bao-jian/ethers-flashbots.git", branch = "master" } +ethers-flashbots-test = { git = "https://github.com/da-bao-jian/ethers-flashbots.git", rev = "1eda9b7bb84e82f43f35b98c34d9066f9596b41d" } jsonrpsee = { version = "0.20.0", features = ["server", "macros", "client"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } - - diff --git a/crates/bundler/src/bundler.rs b/crates/bundler/src/bundler.rs index 4ea1b43e..bc7c8173 100644 --- a/crates/bundler/src/bundler.rs +++ b/crates/bundler/src/bundler.rs @@ -1,6 +1,6 @@ use ethers::{ prelude::{LocalWallet, SignerMiddleware}, - providers::{Http, Middleware, Provider}, + providers::{Middleware, PubsubClient}, signers::Signer, types::{ transaction::eip2718::TypedTransaction, Address, Eip1559TransactionRequest, H256, U256, U64, @@ -21,18 +21,20 @@ use url::Url; /// A type alias for the Flashbots Signer client type FlashbotsClientType = - Arc, LocalWallet>>; + Arc, LocalWallet>, LocalWallet>>; /// A type alias for the Ethereum Signer client -type EthClientType = Arc>; +type EthClientType = Arc, LocalWallet>>; /// The `Bundler` struct is used to represent a bundler with necessary properties #[derive(Clone, Debug)] -pub struct Bundler { +pub struct Bundler +where + M: Middleware + 'static, + ::Provider: PubsubClient, +{ /// Wallet instance representing the bundler's wallet. pub wallet: Wallet, - /// URL of an Ethereum client. - pub eth_client_address: String, /// Beneficiary address where the gas is refunded after execution pub beneficiary: Address, /// Entry point contract address @@ -44,14 +46,18 @@ pub struct Bundler { /// Block Builder relay endpoints pub relay_endpoints: Option>, /// Ethereum signer middleware - pub eth_client: Option>>, + pub eth_client_signer: Option>, /// Flashbots signer middleware - pub fb_client: Option>>, + pub flashbots_client_signer: Option>, /// Minimum balance required pub min_balance: U256, } -impl Bundler { +impl Bundler +where + M: Middleware + 'static, + ::Provider: PubsubClient, +{ /// Create a new `Bundler` instance /// if `send_bundle_mode` is `SendBundleMode::Flashbots` and `relay_endpoints` is `None`, the default Flashbots relay endpoint will be used /// @@ -60,14 +66,14 @@ impl Bundler { #[allow(clippy::too_many_arguments)] pub fn new( wallet: Wallet, - eth_client_address: String, + eth_client: Arc, beneficiary: Address, entry_point: Address, chain: Chain, send_bundle_mode: SendBundleMode, relay_endpoints: Option>, min_balance: U256, - ) -> anyhow::Result { + ) -> eyre::Result { if !(chain.id() == supported_networks::MAINNET || chain.id() == supported_networks::GOERLI || chain.id() == supported_networks::SEPOLIA) @@ -78,7 +84,6 @@ impl Bundler { match send_bundle_mode { SendBundleMode::EthClient => { - let eth_client = Provider::::try_from(eth_client_address.clone())?; let client = Arc::new(SignerMiddleware::new( eth_client.clone(), wallet.signer.clone(), @@ -86,56 +91,53 @@ impl Bundler { Ok(Self { wallet, - eth_client_address, beneficiary, entry_point, chain, send_bundle_mode, relay_endpoints: None, - eth_client: Some(client), - fb_client: None, + eth_client_signer: Some(client), + flashbots_client_signer: None, min_balance, }) } SendBundleMode::Flashbots => match relay_endpoints { None => { let relay_endpoints = vec![flashbots_relay_endpoints::FLASHBOTS.to_string()]; - let fb_client = generate_fb_middleware( - eth_client_address.clone(), + let flashbots_client = generate_flashbots_middleware( + eth_client.clone(), Some(relay_endpoints.clone()), wallet.clone(), )?; Ok(Self { wallet, - eth_client_address, beneficiary, entry_point, chain, send_bundle_mode, relay_endpoints: Some(relay_endpoints), - eth_client: None, - fb_client: Some(fb_client), + eth_client_signer: None, + flashbots_client_signer: Some(flashbots_client), min_balance, }) } Some(relay_endpoints) => { - let fb_client = generate_fb_middleware( - eth_client_address.clone(), + let flashbots_client = generate_flashbots_middleware( + eth_client.clone(), Some(relay_endpoints.clone()), wallet.clone(), )?; Ok(Self { wallet, - eth_client_address, beneficiary, entry_point, chain, send_bundle_mode, relay_endpoints: Some(relay_endpoints), - eth_client: None, - fb_client: Some(fb_client), + eth_client_signer: None, + flashbots_client_signer: Some(flashbots_client), min_balance, }) } @@ -150,7 +152,7 @@ impl Bundler { /// /// # Returns /// * `H256` - The transaction hash of the bundle or transaction - pub async fn send_next_bundle(&self, uos: &Vec) -> anyhow::Result { + pub async fn send_next_bundle(&self, uos: &Vec) -> eyre::Result { if uos.is_empty() { info!("Skipping creating a new bundle, no user operations"); return Ok(H256::default()); @@ -173,13 +175,13 @@ impl Bundler { /// # Returns /// * `TypedTransaction` - A [TypedTransaction](TypedTransaction) #[allow(clippy::ptr_arg)] - async fn generate_tx( + async fn generate_tx( &self, - client: Arc, + client: Arc, uos: &Vec, - ) -> anyhow::Result + ) -> eyre::Result where - M: Middleware + 'static, + N: Middleware + 'static, { let ep = EntryPointAPI::new(self.entry_point, client.clone()); @@ -247,10 +249,10 @@ impl Bundler { /// /// # Returns /// * `H256` - The transaction hash - async fn send_next_bundle_eth(&self, uos: &Vec) -> anyhow::Result { - let client = match self.eth_client.clone() { + async fn send_next_bundle_eth(&self, uos: &Vec) -> eyre::Result { + let client = match self.eth_client_signer.clone() { Some(client) => client, - None => return Err(anyhow::anyhow!("No Ethereum client provided")), + None => return Err(eyre::eyre!("No Ethereum client provided")), }; let tx = self.generate_tx(client.clone(), uos).await?; @@ -285,22 +287,22 @@ impl Bundler { /// /// # Returns /// * `H256` - The transaction hash of the bundle - async fn send_next_bundle_flashbots(&self, uos: &Vec) -> anyhow::Result { - let client = match self.fb_client.clone() { + async fn send_next_bundle_flashbots(&self, uos: &Vec) -> eyre::Result { + let client = match self.flashbots_client_signer.clone() { Some(client) => client, - None => return Err(anyhow::anyhow!("No Flashbots client provided")), + None => return Err(eyre::eyre!("No Flashbots client provided")), }; let tx = self.generate_tx(client.clone(), uos).await?; let bundle_req = generate_bundle_req(client.clone(), vec![tx], false).await?; - match simulate_fb_bundle(client.clone(), &bundle_req).await { + match simulate_flashbots_bundle(client.clone(), &bundle_req).await { Ok(_) => {} - Err(e) => return Err(anyhow::anyhow!("Bundle simulation failed: {:?}", e)), + Err(e) => return Err(eyre::eyre!("Bundle simulation failed: {:?}", e)), }; - let bundle_hash = send_fb_bundle(client.clone(), bundle_req.clone()).await?; + let bundle_hash = send_flashbots_bundle(client.clone(), bundle_req.clone()).await?; Ok(bundle_hash) } @@ -315,24 +317,24 @@ impl Bundler { /// # Returns /// * `H256` - The transaction hash of the bundle #[allow(clippy::needless_return)] -async fn send_fb_bundle( +async fn send_flashbots_bundle( client: FlashbotsClientType, bundle: BundleRequest, -) -> anyhow::Result { +) -> eyre::Result { // Send the Flashbots bundle and check for status let pending_bundle = match client.inner().send_bundle(&bundle).await { Ok(bundle) => bundle, - Err(e) => return Err(anyhow::anyhow!("Failed to send bundle: {:?}", e)), + Err(e) => return Err(eyre::eyre!("Failed to send bundle: {:?}", e)), }; info!("Bundle Received at block: {:?}", pending_bundle.block); match pending_bundle.await { Ok(bundle_hash) => return Ok(bundle_hash), Err(BundleNotIncluded) => { - return Err(anyhow::anyhow!("Bundle not included in the target block")); + return Err(eyre::eyre!("Bundle not included in the target block")); } Err(e) => { - return Err(anyhow::anyhow!("Bundle rejected: {:?}", e)); + return Err(eyre::eyre!("Bundle rejected: {:?}", e)); } }; } @@ -342,23 +344,23 @@ async fn send_fb_bundle( /// # Arguments /// * `client` - An [Flashbots SignerMiddleware](FlashbotsSignerMiddleware) /// * `bundle` - A [BundleRequest](BundleRequest) sent to Flashbots relay -async fn simulate_fb_bundle( +async fn simulate_flashbots_bundle( client: FlashbotsClientType, bundle: &BundleRequest, -) -> anyhow::Result { +) -> eyre::Result { let simulated_bundle = client.inner().simulate_bundle(bundle).await?; // Currently there's only 1 tx per bundle for tx in &simulated_bundle.transactions { trace!("Simulate bundle: {:?}", tx); if let Some(err) = &tx.error { - return Err(anyhow::anyhow!( + return Err(eyre::eyre!( "Transaction failed simulation with error: {:?}", err )); } if let Some(revert) = &tx.revert { - return Err(anyhow::anyhow!( + return Err(eyre::eyre!( "Transaction failed simulation with revert: {:?}", revert )); @@ -381,13 +383,13 @@ async fn generate_bundle_req( client: FlashbotsClientType, txs: Vec, revertible: bool, -) -> anyhow::Result { +) -> eyre::Result { let mut bundle_req = BundleRequest::new(); for tx in txs { let typed_tx = TypedTransaction::Eip1559(tx.into()); let raw_signed_tx = match client.signer().sign_transaction(&typed_tx).await { Ok(tx) => typed_tx.rlp_signed(&tx), - Err(e) => return Err(anyhow::anyhow!("Failed to sign transaction: {:?}", e)), + Err(e) => return Err(eyre::eyre!("Failed to sign transaction: {:?}", e)), }; if revertible { @@ -410,17 +412,17 @@ async fn generate_bundle_req( /// Create a Flashbots middleware /// /// # Arguments -/// * `eth_client_address` - The URL of an Ethereum execution client +/// * `eth_client` - Connection to the Ethereum execution client /// * `relay_endpoints` - An array of Flashbots relay endpoints /// * `wallet` - A [Wallet](Wallet) instance /// /// # Returns /// * `FlashbotsClientType` - A [Flashbots Signer Middleware](FlashbotsClientType) -pub(crate) fn generate_fb_middleware( - eth_client_address: String, +pub(crate) fn generate_flashbots_middleware( + eth_client: Arc, relay_endpoints: Option>, wallet: Wallet, -) -> anyhow::Result>> { +) -> eyre::Result> { // Only support one relay endpoint for now let relay_endpoint: &str = relay_endpoints .as_ref() @@ -428,24 +430,25 @@ pub(crate) fn generate_fb_middleware( .first() .expect("No Flashbots relay endpoint provided"); - let provider = Provider::::try_from(eth_client_address.clone())?; - - let bundle_signer = match wallet.fb_signer { + let bundle_signer = match wallet.flashbots_signer { Some(ref signer) => signer, - None => return Err(anyhow::anyhow!("No Flashbots signer provided")), + None => return Err(eyre::eyre!("No Flashbots signer provided")), }; - let mut fb_middleware = FlashbotsMiddleware::new( - provider.clone(), + let mut flashbots_middleware = FlashbotsMiddleware::new( + eth_client, Url::parse(relay_endpoint.clone())?, bundle_signer.clone(), ); - fb_middleware.set_simulation_relay( + flashbots_middleware.set_simulation_relay( Url::parse(relay_endpoint.clone()).expect("Failed to parse simulation relay URL"), bundle_signer.clone(), ); - let client = Arc::new(SignerMiddleware::new(fb_middleware, wallet.signer.clone())); + let client = Arc::new(SignerMiddleware::new( + flashbots_middleware, + wallet.signer.clone(), + )); Ok(client) } @@ -454,7 +457,8 @@ pub(crate) fn generate_fb_middleware( mod test { use crate::{ bundler::{ - generate_bundle_req, generate_fb_middleware, send_fb_bundle, simulate_fb_bundle, + generate_bundle_req, generate_flashbots_middleware, send_flashbots_bundle, + simulate_flashbots_bundle, }, mock_relay::{MockFlashbotsBlockBuilderRelay, MockFlashbotsRelayServer, INIT_BLOCK}, Bundler, @@ -463,7 +467,7 @@ mod test { use alloy_sol_types::{sol, SolCall}; use ethers::{ contract::abigen, - providers::Middleware, + providers::{Http, Middleware, Provider, PubsubClient, Ws}, signers::Signer, types::{ transaction::eip2718::TypedTransaction, Address, Eip1559TransactionRequest, @@ -475,7 +479,7 @@ mod test { use silius_primitives::{ bundler::SendBundleMode, consts::flashbots_relay_endpoints, Chain, Wallet, }; - use std::env; + use std::sync::Arc; sol! { #[derive(Debug)] @@ -512,20 +516,21 @@ mod test { // UO signing key const SIGNING_KEY: &str = "0xdf1f39dd322a0cb54da8724bf1baf639f0d34916d529adbe2942a28b47dbed4a"; - struct TestContext { - pub bundler: Bundler, + struct TestContext + where + M: Middleware + 'static, + ::Provider: PubsubClient, + { + pub bundler: Bundler, pub entry_point: Address, pub anvil: AnvilInstance, } - async fn setup() -> anyhow::Result { - std::env::set_var("RUST_LOG", "info"); - tracing_subscriber::fmt::init(); - + async fn setup() -> eyre::Result>> { dotenv::dotenv().ok(); - let eth_client_address = env::var("HTTP_RPC").expect("HTTP_RPC env var not set"); - let ep_address = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789".parse::
()?; - let wallet = Wallet::from_phrase(KEY_PHRASE, &U256::from(1), true)?; + // RPC URL to mainnet + let eth_client_address = + std::env::var("HTTP_RPC_URL").expect("HTTP_RPC_URL env var not set"); // Start Anvil and expose the port at 8545 let port = 8545u16; @@ -536,10 +541,14 @@ mod test { .block_time(1u64) .spawn(); + let eth_client = Arc::new(Provider::::connect(anvil.ws_endpoint()).await?); + let ep_address = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789".parse::
()?; + let wallet = Wallet::from_phrase(KEY_PHRASE, &anvil.chain_id().into(), true)?; + // Create a bundler and connect to the Anvil let bundler = Bundler::new( wallet.clone(), - "http://localhost:8545".to_string(), + eth_client, wallet.signer.address(), ep_address, Chain::from(1), @@ -556,24 +565,33 @@ mod test { }) } + async fn start_mock_server() -> eyre::Result<(ServerHandle, MockFlashbotsBlockBuilderRelay)> { + // Start a mock server connecting to the Anvil, exposing the port at 3001 + let mock_relay = MockFlashbotsBlockBuilderRelay::new(8545u64).await.unwrap(); + let server = ServerBuilder::new() + .build("127.0.0.1:3001".to_string()) + .await?; + let handle = server.start(mock_relay.clone().into_rpc()); + + Ok((handle, mock_relay)) + } + #[tokio::test] #[ignore] - async fn test_simulate_fb_bundle_goerli() -> anyhow::Result<()> { - std::env::set_var("RUST_LOG", "info"); - tracing_subscriber::fmt::init(); - + async fn test_simulate_bundle_flashbots_goerli() -> eyre::Result<()> { dotenv::dotenv().ok(); - let eth_client_address = env::var("HTTP_RPC").expect("HTTP_RPC env var not set"); + let eth_client_address = std::env::var("WS_RPC_URL").expect("WS_RPC_URL env var not set"); + let eth_client = Arc::new(Provider::::connect(eth_client_address).await?); let ep_address = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789".parse::
()?; let dir = format!( - "{}/.silius/0x03b758624016FE79Aa871e172aF027f46d1Ec1D3", - env::var("HOME").unwrap() + "{}/.silius/0x129D197b2a989C6798601A49D89a4AEC822A17a3", + std::env::var("HOME").unwrap() ); let wallet = Wallet::from_file(dir.into(), &U256::from(5), true)?; let bundler = Bundler::new( wallet.clone(), - eth_client_address.to_string(), + eth_client.clone(), wallet.signer.address(), ep_address, Chain::from(5), @@ -583,8 +601,8 @@ mod test { ) .expect("Failed to create bundler"); - let fb_client = generate_fb_middleware( - eth_client_address.clone().to_string(), + let flashbots_client = generate_flashbots_middleware( + eth_client.clone(), Some(vec![flashbots_relay_endpoints::FLASHBOTS_GOERLI.to_string()]), bundler.wallet.clone(), )?; @@ -601,10 +619,12 @@ mod test { let approve_call_data = approve.encode(); let address = bundler.wallet.signer.address(); - let nonce = fb_client + let nonce = flashbots_client .get_transaction_count(address.clone(), None) .await?; + let (max_fee_per_gas, max_priority_fee) = eth_client.estimate_eip1559_fees(None).await?; + let approve_tx_req = TypedTransaction::Eip1559(Eip1559TransactionRequest { to: Some(NameOrAddress::Address( "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".parse::()?, @@ -612,8 +632,8 @@ mod test { from: Some(address), data: Some(approve_call_data.into()), chain_id: Some(U64::from(5)), - max_fee_per_gas: Some(U256::from(1000000000000u64)), - max_priority_fee_per_gas: Some(U256::from(1000000000000u64)), + max_fee_per_gas: Some(max_fee_per_gas), + max_priority_fee_per_gas: Some(max_priority_fee), gas: Some(U256::from(1000000u64)), nonce: Some(nonce.clone()), value: None, @@ -621,32 +641,24 @@ mod test { }); let sim_bundle_req = - generate_bundle_req(fb_client.clone(), vec![approve_tx_req.clone()], true).await?; - let pre_simultation_block = sim_bundle_req.block().unwrap(); + generate_bundle_req(flashbots_client.clone(), vec![approve_tx_req.clone()], true) + .await?; + let pre_simulation_block = sim_bundle_req.simulation_block().unwrap(); + + let simulation_res = + simulate_flashbots_bundle(flashbots_client.clone(), &sim_bundle_req).await?; + let post_simulation_block = simulation_res.simulation_block; + let coinbase_diff = simulation_res.coinbase_diff; - let simultation_res = simulate_fb_bundle(fb_client.clone(), &sim_bundle_req).await?; - let post_simulation_block = simultation_res.simulation_block; - let coinbase_diff = simultation_res.coinbase_diff; - assert_eq!(pre_simultation_block, post_simulation_block); + assert_eq!(pre_simulation_block, post_simulation_block); assert_ne!(coinbase_diff, U256::zero()); Ok(()) } - async fn start_mock_server() -> anyhow::Result<(ServerHandle, MockFlashbotsBlockBuilderRelay)> { - // Start a mock server connecting to the Anvil, exposing the port at 3001 - let mock_relay = MockFlashbotsBlockBuilderRelay::new(8545u64).await.unwrap(); - let server = ServerBuilder::new() - .build("127.0.0.1:3001".to_string()) - .await?; - let handle = server.start(mock_relay.clone().into_rpc()); - - Ok((handle, mock_relay)) - } - #[tokio::test(flavor = "multi_thread")] #[ignore] - async fn test_send_bundle_flashbots() -> anyhow::Result<()> { + async fn test_send_bundle_flashbots() -> eyre::Result<()> { let ctx = setup().await?; let (_handle, mock_relay) = start_mock_server().await?; @@ -654,9 +666,13 @@ mod test { let depositor = mock_relay.mock_eth_client.clone(); let address = bundler.wallet.signer.address(); + let eth_client = Arc::new(Provider::::try_from( + "http://127.0.0.1:8545".to_string(), + )?); + // Create a Flashbots signer middleware - let fb_client = generate_fb_middleware( - "http://localhost:8545".to_string(), + let flashbots_client = generate_flashbots_middleware( + eth_client, Some(vec!["http://127.0.0.1:3001".to_string()]), bundler.wallet.clone(), )?; @@ -681,7 +697,7 @@ mod test { .await? .await?; - let balance_before = fb_client.clone().get_balance(address, None).await?; + let balance_before = flashbots_client.clone().get_balance(address, None).await?; // Create approve calldata let approve = approveCall { @@ -699,7 +715,7 @@ mod test { // WETH address alloy_Address::parse_checksummed("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", None) .unwrap(), - // USDt address + // USDT address alloy_Address::parse_checksummed("0xdAC17F958D2ee523a2206206994597C13D831ec7", None) .unwrap(), ]; @@ -714,7 +730,7 @@ mod test { }; let swap_call_data = swap_eth.encode(); - let nonce = fb_client + let nonce = flashbots_client .clone() .get_transaction_count(address, None) .await?; @@ -752,32 +768,32 @@ mod test { // Simulate the bundle let sim_bundle_req = generate_bundle_req( - fb_client.clone(), + flashbots_client.clone(), vec![approve_tx_req.clone(), swap_tx_req.clone()], true, ) - .await?; - sim_bundle_req - .clone() - .set_simulation_block(U64::from(INIT_BLOCK.clone())); + .await? + .set_simulation_block(U64::from(INIT_BLOCK.clone())); + // Swap on Anvil as mock to simulation. In reality, no real state change should happen - let simultation_res = simulate_fb_bundle(fb_client.clone(), &sim_bundle_req).await?; + let simulation_res = + simulate_flashbots_bundle(flashbots_client.clone(), &sim_bundle_req).await?; - assert_eq!(simultation_res.transactions.len(), 2); - assert_eq!(simultation_res.transactions[0].from, address); + assert_eq!(simulation_res.transactions.len(), 2); + assert_eq!(simulation_res.transactions[0].from, address); - let balance_after = fb_client.clone().get_balance(address, None).await?; + let balance_after = flashbots_client.clone().get_balance(address, None).await?; assert_ne!(balance_before, balance_after); // Send the bundle let bundle_req = generate_bundle_req( - fb_client.clone(), + flashbots_client.clone(), vec![approve_tx_req.clone(), swap_tx_req.clone()], true, ) .await?; - let result = send_fb_bundle(fb_client.clone(), bundle_req.clone()).await; + let result = send_flashbots_bundle(flashbots_client.clone(), bundle_req.clone()).await; assert!(matches!( result, Err(ref e) if e.to_string() == "Bundle not included in the target block" diff --git a/crates/bundler/src/mock_relay.rs b/crates/bundler/src/mock_relay.rs index 8eeab79b..2a4f0b66 100644 --- a/crates/bundler/src/mock_relay.rs +++ b/crates/bundler/src/mock_relay.rs @@ -1,16 +1,13 @@ -use anyhow; use async_trait::async_trait; use ethers::{ middleware::SignerMiddleware, prelude::LocalWallet, providers::{Http, Middleware, Provider}, - types::U256, -}; -use ethers_flashbots_test::{ - relay::SendBundleResponse, BundleRequest, BundleTransaction, SimulatedBundle, - SimulatedTransaction, + types::{Bytes, H256, U256, U64}, }; +use ethers_flashbots_test::{relay::SendBundleResponse, SimulatedBundle, SimulatedTransaction}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use serde::{Deserialize, Serialize}; use std::sync::Arc; use std::time::Duration; @@ -32,8 +29,8 @@ pub struct MockFlashbotsBlockBuilderRelay { #[cfg(test)] impl MockFlashbotsBlockBuilderRelay { - pub async fn new(port: u64) -> anyhow::Result { - let url = format!("http://localhost:{}", port).to_string(); + pub async fn new(port: u64) -> eyre::Result { + let url = format!("http://127.0.0.1:{}", port).to_string(); let mock_eth_client = Provider::::try_from(&url)?; // Create a wallet and SignerMiddleware @@ -62,15 +59,7 @@ impl MockFlashbotsRelayServer for MockFlashbotsBlockBuilderRelay { } async fn call_bundle(&self, bundle_req: BundleRequest) -> RpcResult { - let txs: Vec<_> = bundle_req - .transactions() - .iter() - .map(|tx| match tx { - BundleTransaction::Raw(inner) => (*inner).clone(), - _ => panic!("Not a raw transaction"), - }) - .map(|tx| tx.to_vec()) - .collect(); + let txs: Vec<_> = bundle_req.transactions; let mut simulated_bundle = SimulatedBundle::default(); simulated_bundle.simulation_block = INIT_BLOCK.into(); @@ -104,3 +93,37 @@ impl MockFlashbotsRelayServer for MockFlashbotsBlockBuilderRelay { Ok(simulated_bundle) } } + +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BundleRequest { + #[serde(rename = "txs")] + // #[serde(serialize_with = "serialize_txs")] + // transactions: Vec, + pub transactions: Vec, + #[serde(rename = "revertingTxHashes")] + #[serde(skip_serializing_if = "Vec::is_empty")] + revertible_transaction_hashes: Vec, + + #[serde(rename = "blockNumber")] + #[serde(skip_serializing_if = "Option::is_none")] + target_block: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + min_timestamp: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + max_timestamp: Option, + + #[serde(rename = "stateBlockNumber")] + #[serde(skip_serializing_if = "Option::is_none")] + simulation_block: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "timestamp")] + simulation_timestamp: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "baseFee")] + simulation_basefee: Option, +} diff --git a/crates/contracts/Cargo.toml b/crates/contracts/Cargo.toml index 17452161..c110a594 100644 --- a/crates/contracts/Cargo.toml +++ b/crates/contracts/Cargo.toml @@ -11,9 +11,8 @@ AA (ERC-4337) bundler smart contract interfaces """ [dependencies] - -anyhow = { workspace = true } ethers = { workspace = true } +eyre = { workspace = true } lazy_static = "1.4.0" serde = "1" serde_json = "1" @@ -24,6 +23,6 @@ thiserror = "1" tokio = { workspace = true } [build-dependencies] -anyhow = { workspace = true } ethers = { workspace = true, features = ["solc-full"] } ethers-solc = "2.0.8" +eyre = { workspace = true } diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 3d1a8494..edd9da86 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -6,7 +6,7 @@ fn compile( source: &PathBuf, build_info: &PathBuf, target: &PathBuf, -) -> anyhow::Result<()> { +) -> eyre::Result<()> { let build_path_config = ProjectPathsConfig::builder() .sources(source) .artifacts(target) @@ -27,7 +27,7 @@ fn compile( Ok(()) } -fn compile_aa_smart_contracts() -> anyhow::Result<()> { +fn compile_aa_smart_contracts() -> eyre::Result<()> { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("thirdparty/account-abstraction"); let target = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR not set")); let build_info = root.join("contracts").join("build-info"); diff --git a/crates/contracts/src/entry_point.rs b/crates/contracts/src/entry_point.rs index 2fd8af72..43837af9 100644 --- a/crates/contracts/src/entry_point.rs +++ b/crates/contracts/src/entry_point.rs @@ -388,7 +388,7 @@ mod tests { } #[test] - fn deserialize_error_msg() -> anyhow::Result<()> { + fn deserialize_error_msg() -> eyre::Result<()> { let err_msg = Bytes::from_str("0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001841413934206761732076616c756573206f766572666c6f770000000000000000")?; let res = EntryPointAPIErrors::decode(err_msg)?; println!("res: {:?}", res); diff --git a/crates/contracts/src/tracer.rs b/crates/contracts/src/tracer.rs index 32dedf3b..fd441686 100644 --- a/crates/contracts/src/tracer.rs +++ b/crates/contracts/src/tracer.rs @@ -1,5 +1,5 @@ -use anyhow::format_err; use ethers::types::{Address, Bytes, GethTrace, U256}; +use eyre::format_err; use serde::Deserialize; use std::collections::HashMap; @@ -15,7 +15,7 @@ pub struct JsTracerFrame { } impl TryFrom for JsTracerFrame { - type Error = anyhow::Error; + type Error = eyre::Error; fn try_from(val: GethTrace) -> Result { match val { GethTrace::Known(val) => Err(format_err!("Invalid geth trace: {val:?}")), @@ -165,7 +165,10 @@ pub const JS_TRACER: &str = r#" this.lastThreeOpcodes.shift(); } // this.debug.push(this.lastOp + '-' + opcode + '-' + log.getDepth() + '-' + log.getGas() + '-' + log.getCost()) - if (log.getGas() < log.getCost()) { + if (log.getGas() < log.getCost() || ( + // special rule for SSTORE with gas metering + opcode === 'SSTORE' && log.getGas() < 2300) + ) { this.currentLevel.oog = true; } if (opcode === 'REVERT' || opcode === 'RETURN') { diff --git a/crates/grpc/Cargo.toml b/crates/grpc/Cargo.toml index 8ebded98..73ae2cd0 100644 --- a/crates/grpc/Cargo.toml +++ b/crates/grpc/Cargo.toml @@ -11,12 +11,12 @@ AA (ERC-4337) bundler gRPC interfaces """ [dependencies] -anyhow = { workspace = true } arrayref = "0.3" async-trait = { workspace = true } dashmap = "5.4.0" ethers = { workspace = true } expanded-pathbuf = { workspace = true } +eyre = { workspace = true } parking_lot = { workspace = true } prost = "0.11" serde_json = { workspace = true } diff --git a/crates/grpc/src/builder.rs b/crates/grpc/src/builder.rs index ae5e7e46..109818b8 100644 --- a/crates/grpc/src/builder.rs +++ b/crates/grpc/src/builder.rs @@ -1,6 +1,6 @@ use crate::uopool::{GAS_INCREASE_PERC, MAX_UOS_PER_UNSTAKED_SENDER}; use ethers::{ - providers::Middleware, + providers::{Middleware, PubsubClient}, types::{Address, U256}, }; use silius_contracts::EntryPoint; @@ -18,6 +18,7 @@ use std::sync::Arc; pub struct UoPoolBuilder where M: Middleware + Clone + 'static, + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, { @@ -37,6 +38,7 @@ where impl UoPoolBuilder where M: Middleware + Clone + 'static, + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, E: Debug + Display, diff --git a/crates/grpc/src/bundler.rs b/crates/grpc/src/bundler.rs index ef24c683..084ae74c 100644 --- a/crates/grpc/src/bundler.rs +++ b/crates/grpc/src/bundler.rs @@ -2,6 +2,7 @@ use crate::proto::bundler::*; use crate::proto::uopool::{GetSortedRequest, HandlePastEventRequest}; use crate::uo_pool_client::UoPoolClient; use async_trait::async_trait; +use ethers::providers::{Middleware, PubsubClient}; use ethers::types::{Address, H256, U256}; use parking_lot::Mutex; use silius_bundler::Bundler; @@ -10,8 +11,12 @@ use std::{net::SocketAddr, sync::Arc, time::Duration}; use tonic::{Request, Response, Status}; use tracing::{error, info, warn}; -pub struct BundlerService { - pub bundlers: Vec, +pub struct BundlerService +where + M: Middleware + Clone + 'static, + ::Provider: PubsubClient, +{ + pub bundlers: Vec>, pub running: Arc>, pub uopool_grpc_client: UoPoolClient, } @@ -21,9 +26,13 @@ fn is_running(running: Arc>) -> bool { *r } -impl BundlerService { +impl BundlerService +where + M: Middleware + Clone + 'static, + ::Provider: PubsubClient, +{ pub fn new( - bundlers: Vec, + bundlers: Vec>, uopool_grpc_client: UoPoolClient, ) -> Self { Self { @@ -36,7 +45,7 @@ impl BundlerService { async fn get_user_operations( uopool_grpc_client: &UoPoolClient, ep: &Address, - ) -> anyhow::Result> { + ) -> eyre::Result> { let req = Request::new(GetSortedRequest { ep: Some((*ep).into()), }); @@ -49,7 +58,7 @@ impl BundlerService { Ok(uos) } - pub async fn send_bundles(&self) -> anyhow::Result { + pub async fn send_bundles(&self) -> eyre::Result { let mut tx_hashes: Vec = vec![]; for bundler in self.bundlers.iter() { @@ -83,7 +92,7 @@ impl BundlerService { async fn handle_past_events( uopool_grpc_client: &UoPoolClient, ep: &Address, - ) -> anyhow::Result<()> { + ) -> eyre::Result<()> { let req = Request::new(HandlePastEventRequest { ep: Some((*ep).into()), }); @@ -151,7 +160,11 @@ impl BundlerService { } #[async_trait] -impl bundler_server::Bundler for BundlerService { +impl bundler_server::Bundler for BundlerService +where + M: Middleware + Clone + 'static, + ::Provider: PubsubClient, +{ async fn set_bundler_mode( &self, req: Request, @@ -190,11 +203,11 @@ impl bundler_server::Bundler for BundlerService { } #[allow(clippy::too_many_arguments)] -pub fn bundler_service_run( +pub fn bundler_service_run( addr: SocketAddr, wallet: Wallet, eps: Vec
, - eth_client_address: String, + eth_client: Arc, chain: Chain, beneficiary: Address, min_balance: U256, @@ -202,13 +215,16 @@ pub fn bundler_service_run( uopool_grpc_client: UoPoolClient, send_bundle_mode: SendBundleMode, relay_endpoints: Option>, -) { - let bundlers: Vec = eps +) where + M: Middleware + Clone + 'static, + ::Provider: PubsubClient, +{ + let bundlers: Vec> = eps .iter() .map(|ep| { Bundler::new( wallet.clone(), - eth_client_address.clone(), + eth_client.clone(), beneficiary, *ep, chain, diff --git a/crates/grpc/src/uopool.rs b/crates/grpc/src/uopool.rs index 43e34b1c..4bbcc3a2 100644 --- a/crates/grpc/src/uopool.rs +++ b/crates/grpc/src/uopool.rs @@ -4,14 +4,15 @@ use crate::{ proto::types::{GetChainIdResponse, GetSupportedEntryPointsResponse}, utils::{parse_addr, parse_hash, parse_uo}, }; -use anyhow::Result; use async_trait::async_trait; use dashmap::DashMap; +use ethers::providers::PubsubClient; use ethers::{ - providers::{Http, Middleware, Provider}, + providers::Middleware, types::{Address, U256}, }; use expanded_pathbuf::ExpandedPathBuf; +use eyre::Result; use silius_contracts::entry_point::EntryPointErr; use silius_primitives::reputation::ReputationEntry; use silius_primitives::{uopool::AddError, Chain, UoPoolMode}; @@ -36,6 +37,7 @@ type StandardUserPool = pub struct UoPoolService where M: Middleware + Clone + 'static, + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, { @@ -46,6 +48,7 @@ where impl UoPoolService where M: Middleware + Clone + 'static, + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, E: Debug + Display, @@ -71,6 +74,7 @@ impl uo_pool_server::UoPool for UoPoolService where EntryPointErr: From<::Error>, M: Middleware + Clone + 'static, + ::Provider: PubsubClient, P: Mempool + Send + Sync + 'static, R: Reputation, Error = E> + Send + Sync + 'static, E: Debug + Display + 'static, @@ -344,11 +348,11 @@ where } #[allow(clippy::too_many_arguments)] -pub async fn uopool_service_run( +pub async fn uopool_service_run( addr: SocketAddr, datadir: ExpandedPathBuf, eps: Vec
, - eth_client: Arc>, + eth_client: Arc, chain: Chain, max_verification_gas: U256, min_stake: U256, @@ -356,18 +360,18 @@ pub async fn uopool_service_run( min_priority_fee_per_gas: U256, whitelist: Vec
, upool_mode: UoPoolMode, -) -> Result<()> { +) -> Result<()> +where + EntryPointErr: From<::Error>, + M: Middleware + Clone + 'static, + ::Provider: PubsubClient, +{ tokio::spawn(async move { let mut builder = tonic::transport::Server::builder(); let m_map = Arc::new(DashMap::< MempoolId, - UoPoolBuilder< - Provider, - DatabaseMempool, - DatabaseReputation, - DBError, - >, + UoPoolBuilder, DatabaseReputation, DBError>, >::new()); let env = Arc::new(init_env::(datadir.join("db")).expect("Init mdbx failed")); @@ -393,7 +397,7 @@ pub async fn uopool_service_run( } let svc = uo_pool_server::UoPoolServer::new(UoPoolService::< - Provider, + M, DatabaseMempool, DatabaseReputation, DBError, diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 34f21649..507f4393 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -11,10 +11,10 @@ AA (ERC-4337) bundler commonly used types """ [dependencies] -anyhow = { workspace = true } educe = { version = "0.4", features = ["Debug", "Default"] } ethers = { workspace = true } expanded-pathbuf = { workspace = true } +eyre = { workspace = true } lazy_static = "1.4.0" rustc-hex = "^2.0.1" serde = "1" diff --git a/crates/primitives/src/wallet.rs b/crates/primitives/src/wallet.rs index e46a7bd4..0985fa57 100644 --- a/crates/primitives/src/wallet.rs +++ b/crates/primitives/src/wallet.rs @@ -14,7 +14,7 @@ pub struct Wallet { /// Signing key of the wallet pub signer: ethers::signers::Wallet, /// Flashbots signing key of the wallet - pub fb_signer: Option>, + pub flashbots_signer: Option>, } impl Wallet { @@ -32,7 +32,7 @@ impl Wallet { path: ExpandedPathBuf, chain_id: &U256, flashbots_key: bool, - ) -> anyhow::Result { + ) -> eyre::Result { let mut rng = rand::thread_rng(); fs::create_dir_all(&path)?; @@ -48,7 +48,7 @@ impl Wallet { let mut entries = fs::read_dir(&path)?; let entry = entries.next().expect("No file found")?; - let fb_wallet = MnemonicBuilder::::default() + let flashbots_wallet = MnemonicBuilder::::default() .phrase(entry.path()) .derivation_path("m/44'/60'/0'/0/1") .expect("Failed to derive wallet") @@ -56,12 +56,12 @@ impl Wallet { Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: Some(fb_wallet.with_chain_id(chain_id.as_u64())), + flashbots_signer: Some(flashbots_wallet.with_chain_id(chain_id.as_u64())), }) } else { Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: None, + flashbots_signer: None, }) } } @@ -80,7 +80,7 @@ impl Wallet { path: ExpandedPathBuf, chain_id: &U256, flashbots_key: bool, - ) -> anyhow::Result { + ) -> eyre::Result { let wallet_builder = MnemonicBuilder::::default().phrase(path.to_path_buf()); let wallet = wallet_builder @@ -90,19 +90,19 @@ impl Wallet { .build()?; if flashbots_key { - let fb_wallet = wallet_builder + let flashbots_wallet = wallet_builder .derivation_path("m/44'/60'/0'/0/1") .expect("Failed to derive wallet") .build()?; Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: Some(fb_wallet.with_chain_id(chain_id.as_u64())), + flashbots_signer: Some(flashbots_wallet.with_chain_id(chain_id.as_u64())), }) } else { Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: None, + flashbots_signer: None, }) } } @@ -117,7 +117,7 @@ impl Wallet { /// /// # Returns /// * `Self` - A new `Wallet` instance - pub fn from_phrase(phrase: &str, chain_id: &U256, flashbots_key: bool) -> anyhow::Result { + pub fn from_phrase(phrase: &str, chain_id: &U256, flashbots_key: bool) -> eyre::Result { let wallet_builder = MnemonicBuilder::::default().phrase(phrase); let wallet = wallet_builder @@ -127,18 +127,18 @@ impl Wallet { .build()?; if flashbots_key { - let fb_wallet = wallet_builder + let flashbots_wallet = wallet_builder .derivation_path("m/44'/60'/0'/0/1") .expect("Failed to derive wallet") .build()?; Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: Some(fb_wallet.with_chain_id(chain_id.as_u64())), + flashbots_signer: Some(flashbots_wallet.with_chain_id(chain_id.as_u64())), }) } else { Ok(Self { signer: wallet.with_chain_id(chain_id.as_u64()), - fb_signer: None, + flashbots_signer: None, }) } } @@ -157,7 +157,7 @@ impl Wallet { uo: &UserOperation, ep: &Address, chain_id: &U256, - ) -> anyhow::Result { + ) -> eyre::Result { let h = uo.hash(ep, chain_id); let sig = self.signer.sign_message(h.0.as_bytes()).await?; Ok(UserOperation { diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml index c90839d3..d7c8484c 100644 --- a/crates/rpc/Cargo.toml +++ b/crates/rpc/Cargo.toml @@ -11,10 +11,9 @@ AA (ERC-4337) bundler RPC implementation """ [dependencies] - -anyhow = { workspace = true } async-trait = { workspace = true } ethers = { workspace = true } +eyre = { workspace = true } git-version = "0.3.5" hyper = { version = "0.14" } jsonrpsee = { version = "0.18.2", features = ["server", "macros", "client"] } diff --git a/crates/rpc/src/rpc.rs b/crates/rpc/src/rpc.rs index 7fd3ce64..90f90a53 100644 --- a/crates/rpc/src/rpc.rs +++ b/crates/rpc/src/rpc.rs @@ -1,5 +1,5 @@ use super::middleware::ProxyJsonRpcLayer; -use anyhow::Error; +use eyre::Error; use hyper::{http::HeaderValue, Method}; use jsonrpsee::{ server::{ServerBuilder, ServerHandle}, @@ -162,7 +162,7 @@ impl JsonRpcServer { /// /// # Returns /// * `Result<(Option, Option), Error>` - The [handle]((Option, Option)) of the HTTP and WS servers. - pub async fn start(&self) -> anyhow::Result<(Option, Option)> { + pub async fn start(&self) -> eyre::Result<(Option, Option)> { let http_handle = if self.http { let service = ServiceBuilder::new() .option_layer(self.http_cors_layer.clone()) diff --git a/crates/uopool/Cargo.toml b/crates/uopool/Cargo.toml index fff9aaf4..0d4b55a5 100644 --- a/crates/uopool/Cargo.toml +++ b/crates/uopool/Cargo.toml @@ -11,11 +11,11 @@ AA (ERC-4337) bundler uopool implementation """ [dependencies] -anyhow = { workspace = true } async-trait = { workspace = true } educe = { version = "0.4", features = ["Debug", "Default"] } enumset = "1.1.2" ethers = { workspace = true } +eyre = { workspace = true } page_size = "0.5.0" parking_lot = { workspace = true } prost = "0.11" diff --git a/crates/uopool/src/database/env.rs b/crates/uopool/src/database/env.rs index 748644a1..d3e530bd 100644 --- a/crates/uopool/src/database/env.rs +++ b/crates/uopool/src/database/env.rs @@ -73,7 +73,7 @@ fn default_page_size() -> usize { impl Env { /// Sets up the database environment - pub fn open(path: PathBuf) -> anyhow::Result { + pub fn open(path: PathBuf) -> eyre::Result { fs::create_dir_all(&path)?; let env = Environment::new() diff --git a/crates/uopool/src/database/mempool.rs b/crates/uopool/src/database/mempool.rs index c5262fd9..8eb3453b 100644 --- a/crates/uopool/src/database/mempool.rs +++ b/crates/uopool/src/database/mempool.rs @@ -171,7 +171,7 @@ impl Mempool for DatabaseMempool { /// /// # Returns /// * `Ok(())` - If the [CodeHash](CodeHash) was set - /// * `Err(anyhow::Error)` - If the [CodeHash](CodeHash) could not be set + /// * `Err(eyre::Error)` - If the [CodeHash](CodeHash) could not be set fn set_code_hashes( &mut self, uo_hash: &UserOperationHash, @@ -198,7 +198,7 @@ impl Mempool for DatabaseMempool { /// /// # Returns /// * `Ok(())` - If the [UserOperation](UserOperation) was removed - /// * `Err(anyhow::Error)` - If the [UserOperation](UserOperation) could not be removed + /// * `Err(eyre::Error)` - If the [UserOperation](UserOperation) could not be removed fn remove(&mut self, uo_hash: &UserOperationHash) -> Result<(), DBError> { let uo_hash_wrap: WrapUserOperationHash = (*uo_hash).into(); diff --git a/crates/uopool/src/database/mod.rs b/crates/uopool/src/database/mod.rs index f9ff798a..13629515 100644 --- a/crates/uopool/src/database/mod.rs +++ b/crates/uopool/src/database/mod.rs @@ -11,7 +11,7 @@ pub mod reputation; mod tables; mod utils; -pub fn init_env(path: PathBuf) -> anyhow::Result> { +pub fn init_env(path: PathBuf) -> eyre::Result> { let env = Env::open(path)?; env.create_tables()?; Ok(env) diff --git a/crates/uopool/src/memory/mempool.rs b/crates/uopool/src/memory/mempool.rs index 7cb79817..130ceaf3 100644 --- a/crates/uopool/src/memory/mempool.rs +++ b/crates/uopool/src/memory/mempool.rs @@ -23,7 +23,7 @@ impl Mempool for MemoryMempool { type UserOperations = Vec; /// An array of [code_hashes](CodeHash) type CodeHashes = Vec; - type Error = anyhow::Error; + type Error = eyre::Error; /// Adds a [UserOperation](UserOperation) to the mempool /// @@ -34,13 +34,13 @@ impl Mempool for MemoryMempool { /// /// # Returns /// * `Ok(UserOperationHash)` - The hash of the [UserOperation](UserOperation) that was added - /// * `Err(anyhow::Error)` - If the [UserOperation](UserOperation) could not be added + /// * `Err(eyre::Error)` - If the [UserOperation](UserOperation) could not be added fn add( &mut self, uo: UserOperation, ep: &Address, chain_id: &U256, - ) -> anyhow::Result { + ) -> eyre::Result { let uo_hash = uo.hash(ep, chain_id); self.user_operations_by_sender @@ -60,8 +60,8 @@ impl Mempool for MemoryMempool { /// # Returns /// * `Ok(Some(UserOperation))` - The [UserOperation](UserOperation) if it exists /// * `Ok(None)` - If the [UserOperation](UserOperation) does not exist - /// * `Err(anyhow::Error)` - If the [UserOperation](UserOperation) could not be retrieved - fn get(&self, uo_hash: &UserOperationHash) -> anyhow::Result> { + /// * `Err(eyre::Error)` - If the [UserOperation](UserOperation) could not be retrieved + fn get(&self, uo_hash: &UserOperationHash) -> eyre::Result> { Ok(self.user_operations.get(uo_hash).cloned()) } @@ -106,7 +106,7 @@ impl Mempool for MemoryMempool { /// /// # Returns /// * `Ok(bool)` - True if the [CodeHash](CodeHash) exists. Otherwise, false. - fn has_code_hashes(&self, uo_hash: &UserOperationHash) -> anyhow::Result { + fn has_code_hashes(&self, uo_hash: &UserOperationHash) -> eyre::Result { Ok(self.code_hashes_by_user_operation.contains_key(uo_hash)) } @@ -118,12 +118,12 @@ impl Mempool for MemoryMempool { /// /// # Returns /// * `Ok(())` - If the [CodeHash](CodeHash) was set - /// * `Err(anyhow::Error)` - If the [CodeHash](CodeHash) could not be set + /// * `Err(eyre::Error)` - If the [CodeHash](CodeHash) could not be set fn set_code_hashes( &mut self, uo_hash: &UserOperationHash, hashes: &Self::CodeHashes, - ) -> anyhow::Result<(), Self::Error> { + ) -> eyre::Result<(), Self::Error> { self.code_hashes_by_user_operation .insert(*uo_hash, hashes.clone()); Ok(()) @@ -151,14 +151,14 @@ impl Mempool for MemoryMempool { /// /// # Returns /// * `Ok(())` - If the [UserOperation](UserOperation) was removed - /// * `Err(anyhow::Error)` - If the [UserOperation](UserOperation) could not be removed - fn remove(&mut self, uo_hash: &UserOperationHash) -> anyhow::Result<()> { + /// * `Err(eyre::Error)` - If the [UserOperation](UserOperation) could not be removed + fn remove(&mut self, uo_hash: &UserOperationHash) -> eyre::Result<()> { let uo: UserOperation; if let Some(user_op) = self.user_operations.get(uo_hash) { uo = user_op.clone(); } else { - return Err(anyhow::anyhow!("User operation not found")); + return Err(eyre::eyre!("User operation not found")); } self.user_operations.remove(uo_hash); @@ -180,7 +180,7 @@ impl Mempool for MemoryMempool { /// /// # Returns /// * `Ok(Vec)` - The sorted [UserOperations](UserOperation) - fn get_sorted(&self) -> anyhow::Result { + fn get_sorted(&self) -> eyre::Result { let mut uos: Vec = self.user_operations.values().cloned().collect(); uos.sort_by(|a, b| { if a.max_priority_fee_per_gas != b.max_priority_fee_per_gas { diff --git a/crates/uopool/src/memory/reputation.rs b/crates/uopool/src/memory/reputation.rs index a6170980..52a71318 100644 --- a/crates/uopool/src/memory/reputation.rs +++ b/crates/uopool/src/memory/reputation.rs @@ -30,7 +30,7 @@ pub struct MemoryReputation { impl Reputation for MemoryReputation { /// An array of [`ReputationEntry`](silius_primitives::reputation::ReputationEntry) type ReputationEntries = Vec; - type Error = anyhow::Error; + type Error = eyre::Error; /// Initialize an instance of the [MemoryReputation](MemoryReputation) fn init( diff --git a/crates/uopool/src/uopool.rs b/crates/uopool/src/uopool.rs index fd07bf60..1aaf8630 100644 --- a/crates/uopool/src/uopool.rs +++ b/crates/uopool/src/uopool.rs @@ -8,12 +8,12 @@ use crate::{ }, MempoolId, Overhead, Reputation, }; -use anyhow::format_err; use ethers::{ prelude::LogMeta, - providers::Middleware, + providers::{Middleware, PubsubClient}, types::{Address, BlockNumber, U256, U64}, }; +use eyre::format_err; use silius_contracts::{ entry_point::{EntryPointAPIEvents, EntryPointErr, UserOperationEventFilter}, utils::parse_from_input_data, @@ -40,6 +40,7 @@ const LATEST_SCAN_DEPTH: u64 = 1000; /// Architecturally, the [UoPool](UoPool) is the backend service managed by the [UoPoolService](UoPoolService) and serves requests from the [RPC API](EthApiServer). pub struct UoPool, P, R, E> where + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, E: Debug, @@ -62,6 +63,7 @@ where impl, P, R, E> UoPool where + ::Provider: PubsubClient, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, E: Debug + Display, @@ -230,7 +232,7 @@ where /// Sorts the [UserOperations](UserOperation) in the mempool by calling the [Mempool::get_sorted](Mempool::get_sorted) function /// /// # Returns - /// `Result, anyhow::Error>` - The sorted [UserOperations](UserOperation) + /// `Result, eyre::Error>` - The sorted [UserOperations](UserOperation) pub fn get_sorted_user_operations(&self) -> Result, E> { self.mempool.get_sorted() } @@ -243,11 +245,11 @@ where /// `uos` - An array of [UserOperations](UserOperation) to bundle /// /// # Returns - /// `Result, anyhow::Error>` - The bundled [UserOperations](UserOperation). + /// `Result, eyre::Error>` - The bundled [UserOperations](UserOperation). pub async fn bundle_user_operations( &mut self, uos: Vec, - ) -> anyhow::Result> { + ) -> eyre::Result> { let mut uos_valid = vec![]; let mut senders = HashSet::new(); let mut gas_total = U256::zero(); @@ -392,8 +394,8 @@ where /// Gets the block base fee per gas /// /// # Returns - /// `Result` - The block base fee per gas. - pub async fn base_fee_per_gas(&self) -> anyhow::Result { + /// `Result` - The block base fee per gas. + pub async fn base_fee_per_gas(&self) -> eyre::Result { let block = self .entry_point .eth_client() @@ -487,11 +489,11 @@ where /// * `uo_hash` - The [UserOperationHash](UserOperationHash) to filter the events for. /// /// # Returns - /// `Result, anyhow::Error>` - The filtered event, if any. + /// `Result, eyre::Error>` - The filtered event, if any. pub async fn get_user_operation_event_meta( &self, uo_hash: &UserOperationHash, - ) -> anyhow::Result> { + ) -> eyre::Result> { let mut event: Option<(UserOperationEventFilter, LogMeta)> = None; let filter = self .entry_point @@ -514,11 +516,11 @@ where /// * `uo_hash` - The [UserOperationHash](UserOperationHash) to get the user operation for. /// /// # Returns - /// `Result` - The user operation, if any. + /// `Result` - The user operation, if any. pub async fn get_user_operation_by_hash( &self, uo_hash: &UserOperationHash, - ) -> anyhow::Result { + ) -> eyre::Result { let event = self.get_user_operation_event_meta(uo_hash).await?; if let Some((event, log_meta)) = event { @@ -555,11 +557,11 @@ where /// * `uo_hash` - The [UserOperationHash](UserOperationHash) to get the user operation receipt for. /// /// # Returns - /// `Result` - The user operation receipt, if any. + /// `Result` - The user operation receipt, if any. pub async fn get_user_operation_receipt( &self, uo_hash: &UserOperationHash, - ) -> anyhow::Result { + ) -> eyre::Result { let event = self.get_user_operation_event_meta(uo_hash).await?; if let Some((event, log_meta)) = event { @@ -592,8 +594,8 @@ where /// If [UserOperation](UserOperation) is found, it is removed from the [UserOperationQueue](UserOperationQueue), while simultaneously incrementing the reputation of the sender and paymaster. /// /// # Returns - /// `Result<(), anyhow::Error>` - None if the query was successful. - pub async fn handle_past_events(&mut self) -> anyhow::Result<()> { + /// `Result<(), eyre::Error>` - None if the query was successful. + pub async fn handle_past_events(&mut self) -> eyre::Result<()> { let block_num = self.entry_point.eth_client().get_block_number().await?; let block_st = std::cmp::max( 1u64, @@ -612,16 +614,16 @@ where self.remove_user_operation(&uo_event.user_op_hash.into()); self.reputation .increment_included(&uo_event.sender) - .map_err(|err| anyhow::anyhow!(err.to_string()))?; + .map_err(|err| eyre::eyre!(err.to_string()))?; self.reputation .increment_included(&uo_event.paymaster) - .map_err(|err| anyhow::anyhow!(err.to_string()))?; + .map_err(|err| eyre::eyre!(err.to_string()))?; // TODO: include event aggregator } EntryPointAPIEvents::AccountDeployedFilter(event) => { self.reputation .increment_included(&event.factory) - .map_err(|err| anyhow::anyhow!(err.to_string()))?; + .map_err(|err| eyre::eyre!(err.to_string()))?; } _ => (), } diff --git a/docker-compose.yml b/docker-compose.yml index a83b96b2..6549285a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: "3" + services: silius: image: ghcr.io/vid201/silius:latest @@ -9,7 +10,7 @@ services: command: - bundler - --eth-client-address - - http://127.0.0.1:8545 + - ws://127.0.0.1:8546 - --datadir - data/silius - --mnemonic-file @@ -32,3 +33,5 @@ services: - "3001" - --ws.api - eth,debug,web3 + -- eth-client-proxy-address + -- http://127.0.0.1:8545 diff --git a/examples/Cargo.toml b/examples/Cargo.toml index e48e2ab6..df6a8836 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -14,8 +14,8 @@ AA (ERC-4337) bundler examples [dependencies] alloy-primitives = "0.3" alloy-sol-types = "0.3" -anyhow = { workspace = true } ethers = { workspace = true } +eyre = { workspace = true } reqwest = { version = "0.11.4", features = ["json"] } serde = "1" serde_json = "1" @@ -25,7 +25,7 @@ silius-tests = { path = "../tests" } tokio = { workspace = true } [package.metadata.cargo-udeps.ignore] -normal = ["anyhow", "silius-contracts", "silius-primitives", "silius-tests"] +normal = ["eyre", "silius-contracts", "silius-primitives", "silius-tests"] [[example]] name = "user-operation" diff --git a/examples/simple_account/create.rs b/examples/simple_account/create.rs index 1a1c4f6d..ae58f58d 100644 --- a/examples/simple_account/create.rs +++ b/examples/simple_account/create.rs @@ -17,7 +17,7 @@ const SIMPLE_ACCOUNT_FACTORY: &str = "0x9406Cc6185a346906296840746125a0E44976454 const CREATE_INDEX: u64 = 2; #[tokio::main] -async fn main() -> anyhow::Result<()> { +async fn main() -> eyre::Result<()> { let seed_phrase = env::var("SEED_PHRASE").unwrap(); let bundler_url = env::var("BUNDLER_URL").unwrap(); let wallet = MnemonicBuilder::::default() diff --git a/examples/simple_account/deposit.rs b/examples/simple_account/deposit.rs index c22276ec..188ab700 100644 --- a/examples/simple_account/deposit.rs +++ b/examples/simple_account/deposit.rs @@ -16,7 +16,7 @@ const CREATE_INDEX: u64 = 1; const SEND_VALUE: &str = "0.01"; // ether unit #[tokio::main] -async fn main() -> anyhow::Result<()> { +async fn main() -> eyre::Result<()> { let seed_phrase = env::var("SEED_PHRASE").unwrap(); let provider_url = env::var("PROVIDER_URL").unwrap(); let wallet = MnemonicBuilder::::default() diff --git a/examples/simple_account/transfer.rs b/examples/simple_account/transfer.rs index 841f0982..9643f09e 100644 --- a/examples/simple_account/transfer.rs +++ b/examples/simple_account/transfer.rs @@ -19,7 +19,7 @@ const SIMPLE_ACCOUNT_FACTORY: &str = "0x9406Cc6185a346906296840746125a0E44976454 const CREATE_INDEX: u64 = 1; #[tokio::main] -async fn main() -> anyhow::Result<()> { +async fn main() -> eyre::Result<()> { let seed_phrase = env::var("SEED_PHRASE").unwrap(); let bundler_url = env::var("BUNDLER_URL").unwrap(); let wallet = MnemonicBuilder::::default() diff --git a/examples/user_operation.rs b/examples/user_operation.rs index 9813ac4f..37f5f02f 100644 --- a/examples/user_operation.rs +++ b/examples/user_operation.rs @@ -7,7 +7,7 @@ pub const CHAIN_ID: u64 = 1337; pub const ENTRY_POINT: &str = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"; #[tokio::main] -async fn main() -> anyhow::Result<()> { +async fn main() -> eyre::Result<()> { // create wallet let wallet = Wallet::from_phrase(MNEMONIC_PHRASE, &CHAIN_ID.into(), false)?; println!("Wallet address: {:?}", wallet.signer); diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 079a56e6..d4eeb43d 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -11,8 +11,8 @@ AA (ERC-4337) bundler integration tests """ [dependencies] -anyhow = { workspace = true } ethers = { workspace = true } +eyre = { workspace = true } silius-contracts = { path = "../crates/contracts" } silius-primitives = { path = "../crates/primitives" } silius-uopool = { path = "../crates/uopool" } diff --git a/tests/src/common/mod.rs b/tests/src/common/mod.rs index b821f016..428a8b24 100644 --- a/tests/src/common/mod.rs +++ b/tests/src/common/mod.rs @@ -5,7 +5,7 @@ use self::gen::{ }; use ethers::{ prelude::{MiddlewareBuilder, NonceManagerMiddleware, SignerMiddleware}, - providers::{Http, Middleware, Provider}, + providers::{Middleware, Provider, Ws}, signers::{coins_bip39::English, LocalWallet, MnemonicBuilder, Signer}, types::{Address, TransactionRequest, U256}, utils::{Geth, GethInstance}, @@ -16,7 +16,7 @@ use tempdir::TempDir; pub mod gen; pub const SEED_PHRASE: &str = "test test test test test test test test test test test junk"; -pub type ClientType = NonceManagerMiddleware, LocalWallet>>; +pub type ClientType = NonceManagerMiddleware, LocalWallet>>; pub struct DeployedContract { contract: C, @@ -37,7 +37,7 @@ impl DeployedContract { pub async fn deploy_entry_point( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (ep, receipt) = EntryPointContract::deploy(client, ())? .send_with_receipt() .await?; @@ -47,7 +47,7 @@ pub async fn deploy_entry_point( pub async fn deploy_test_opcode_account( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (acc, receipt) = TestOpcodesAccount::deploy(client, ())? .send_with_receipt() .await?; @@ -57,7 +57,7 @@ pub async fn deploy_test_opcode_account( pub async fn deploy_test_opcode_account_factory( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (factory, receipt) = TestOpcodesAccountFactory::deploy(client, ())? .send_with_receipt() .await?; @@ -68,7 +68,7 @@ pub async fn deploy_test_opcode_account_factory( pub async fn deploy_test_storage_account_factory( client: Arc, test_coin_addr: Address, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (factory, receipt) = TestStorageAccountFactory::deploy(client, test_coin_addr)? .send_with_receipt() .await?; @@ -78,7 +78,7 @@ pub async fn deploy_test_storage_account_factory( pub async fn deploy_test_storage_account( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (acc, receipt) = TestStorageAccount::deploy(client, ())? .send_with_receipt() .await?; @@ -89,7 +89,7 @@ pub async fn deploy_test_storage_account( pub async fn deploy_test_recursion_account( client: Arc, ep: Address, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (acc, receipt) = TestRecursionAccount::deploy(client, ep)? .send_with_receipt() .await?; @@ -99,7 +99,7 @@ pub async fn deploy_test_recursion_account( pub async fn deploy_test_rules_account_factory( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (factory, receipt) = TestRulesAccountFactory::deploy(client, ())? .send_with_receipt() .await?; @@ -109,7 +109,7 @@ pub async fn deploy_test_rules_account_factory( pub async fn deploy_tracer_test( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (factory, receipt) = TracerTest::deploy(client, ())?.send_with_receipt().await?; let addr = receipt.contract_address.unwrap_or(Address::zero()); Ok(DeployedContract::new(factory, addr)) @@ -117,13 +117,13 @@ pub async fn deploy_tracer_test( pub async fn deploy_test_coin( client: Arc, -) -> anyhow::Result>> { +) -> eyre::Result>> { let (factory, receipt) = TestCoin::deploy(client, ())?.send_with_receipt().await?; let addr = receipt.contract_address.unwrap_or(Address::zero()); Ok(DeployedContract::new(factory, addr)) } -pub async fn setup_geth() -> anyhow::Result<(GethInstance, ClientType, Provider)> { +pub async fn setup_geth() -> eyre::Result<(GethInstance, ClientType, Provider)> { let chain_id: u64 = 1337; let tmp_dir = TempDir::new("test_geth")?; let wallet = MnemonicBuilder::::default() @@ -131,8 +131,9 @@ pub async fn setup_geth() -> anyhow::Result<(GethInstance, ClientType, Provider< .build()?; let geth = Geth::new().data_dir(tmp_dir.path().to_path_buf()).spawn(); - let provider = - Provider::::try_from(geth.endpoint())?.interval(Duration::from_millis(10u64)); + let provider = Provider::::connect(geth.ws_endpoint()) + .await? + .interval(Duration::from_millis(5u64)); let client = SignerMiddleware::new(provider.clone(), wallet.clone().with_chain_id(chain_id)) .nonce_manager(wallet.address()); diff --git a/tests/src/simulation_tests.rs b/tests/src/simulation_tests.rs index 23927cfd..a68cc75f 100644 --- a/tests/src/simulation_tests.rs +++ b/tests/src/simulation_tests.rs @@ -11,7 +11,7 @@ use crate::common::{ }; use ethers::abi::Token; use ethers::prelude::BaseContract; -use ethers::providers::{Http, Provider}; +use ethers::providers::{Provider, PubsubClient, Ws}; use ethers::types::transaction::eip2718::TypedTransaction; use ethers::types::Address; use ethers::utils::{parse_units, GethInstance}; @@ -54,8 +54,10 @@ use std::sync::Arc; const MAX_UOS_PER_UNSTAKED_SENDER: usize = 4; const GAS_INCREASE_PERC: u64 = 10; -struct TestContext +struct TestContext where + M: Middleware + 'static, + ::Provider: PubsubClient, V: UserOperationValidator + 'static, P: Mempool + Send + Sync, R: Reputation, Error = E> + Send + Sync, @@ -74,13 +76,13 @@ where type Context = TestContext< ClientType, - StandardUserOperationValidator, MemoryMempool, MemoryReputation, anyhow::Error>, + StandardUserOperationValidator, MemoryMempool, MemoryReputation, eyre::Error>, MemoryMempool, MemoryReputation, - anyhow::Error, + eyre::Error, >; -async fn setup() -> anyhow::Result { +async fn setup() -> eyre::Result { let chain_id = 1337u64; let (_geth, _client, provider) = setup_geth().await?; let client = Arc::new(_client); @@ -150,15 +152,10 @@ async fn setup() -> anyhow::Result { let pool = UoPool::< ClientType, - StandardUserOperationValidator< - Provider, - MemoryMempool, - MemoryReputation, - anyhow::Error, - >, + StandardUserOperationValidator, MemoryMempool, MemoryReputation, eyre::Error>, MemoryMempool, MemoryReputation, - anyhow::Error, + eyre::Error, >::new( entry_point, validator, @@ -187,7 +184,7 @@ async fn setup() -> anyhow::Result { async fn create_storage_factory_init_code( salt: u64, init_func: String, -) -> anyhow::Result<(Bytes, Bytes)> { +) -> eyre::Result<(Bytes, Bytes)> { let c = setup().await?; let contract: &BaseContract = c.storage_factory.contract().deref().deref(); let func = contract.abi().function("create")?; @@ -201,7 +198,7 @@ async fn create_storage_factory_init_code( Ok((init_code.into(), init_func.into())) } -async fn create_opcode_factory_init_code(init_func: String) -> anyhow::Result<(Bytes, Bytes)> { +async fn create_opcode_factory_init_code(init_func: String) -> eyre::Result<(Bytes, Bytes)> { let c = setup().await?; let contract: &BaseContract = c.opcodes_factory.contract().deref().deref(); let token = vec![Token::String(init_func)]; @@ -222,7 +219,7 @@ async fn create_test_user_operation( init_code: Bytes, init_func: Bytes, factory_address: Address, -) -> anyhow::Result { +) -> eyre::Result { let paymaster_and_data = if let Some(rule) = pm_rule { let mut data = vec![]; data.extend_from_slice(context.paymaster.address.as_bytes()); @@ -241,7 +238,7 @@ async fn create_test_user_operation( let call_init_code_for_addr = context.client.call(&tx, None).await?; let (head, address) = call_init_code_for_addr.split_at(12); - anyhow::ensure!( + eyre::ensure!( !head.iter().any(|i| *i != 0), format!( "call init code returns non address data : {:?}", @@ -338,7 +335,7 @@ async fn test_existing_user_operation( } #[tokio::test] -async fn accept_plain_request() -> anyhow::Result<()> { +async fn accept_plain_request() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("".to_string()) .await @@ -359,7 +356,7 @@ async fn accept_plain_request() -> anyhow::Result<()> { } #[tokio::test] -async fn reject_unkown_rule() -> anyhow::Result<()> { +async fn reject_unkown_rule() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("".to_string()) .await @@ -383,7 +380,7 @@ async fn reject_unkown_rule() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_with_bad_opcode_in_ctr() -> anyhow::Result<()> { +async fn fail_with_bad_opcode_in_ctr() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("coinbase".to_string()) .await @@ -407,7 +404,7 @@ async fn fail_with_bad_opcode_in_ctr() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_with_bad_opcode_in_paymaster() -> anyhow::Result<()> { +async fn fail_with_bad_opcode_in_paymaster() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("".to_string()) .await @@ -431,7 +428,7 @@ async fn fail_with_bad_opcode_in_paymaster() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_with_bad_opcode_in_validation() -> anyhow::Result<()> { +async fn fail_with_bad_opcode_in_validation() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("".to_string()) .await @@ -455,7 +452,7 @@ async fn fail_with_bad_opcode_in_validation() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_if_create_too_many() -> anyhow::Result<()> { +async fn fail_if_create_too_many() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_opcode_factory_init_code("".to_string()) .await @@ -479,7 +476,7 @@ async fn fail_if_create_too_many() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_referencing_self_token() -> anyhow::Result<()> { +async fn fail_referencing_self_token() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_storage_factory_init_code(0, "".to_string()) .await @@ -545,7 +542,7 @@ async fn fail_to_access_other_address_struct_data() { } #[tokio::test] -async fn fail_if_referencing_other_token_balance() -> anyhow::Result<()> { +async fn fail_if_referencing_other_token_balance() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_storage_factory_init_code(0, "".to_string()) .await @@ -577,7 +574,7 @@ async fn fail_if_referencing_self_token_balance_after_wallet_creation() { } #[tokio::test] -async fn fail_with_unstaked_paymaster_returning_context() -> anyhow::Result<()> { +async fn fail_with_unstaked_paymaster_returning_context() -> eyre::Result<()> { let c = setup().await?; let pm = deploy_test_storage_account(c.client.clone()) .await @@ -616,7 +613,7 @@ async fn fail_with_unstaked_paymaster_returning_context() -> anyhow::Result<()> } #[tokio::test] -async fn fail_with_validation_recursively_calls_handle_ops() -> anyhow::Result<()> { +async fn fail_with_validation_recursively_calls_handle_ops() -> eyre::Result<()> { let c = setup().await?; let acct = deploy_test_recursion_account(c.client.clone(), c.entry_point.address) .await @@ -647,7 +644,7 @@ async fn fail_with_validation_recursively_calls_handle_ops() -> anyhow::Result<( } #[tokio::test] -async fn succeed_with_inner_revert() -> anyhow::Result<()> { +async fn succeed_with_inner_revert() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_storage_factory_init_code(0, "".to_string()) .await @@ -667,7 +664,7 @@ async fn succeed_with_inner_revert() -> anyhow::Result<()> { } #[tokio::test] -async fn fail_with_inner_oog_revert() -> anyhow::Result<()> { +async fn fail_with_inner_oog_revert() -> eyre::Result<()> { let c = setup().await?; let (init_code, init_func) = create_storage_factory_init_code(0, "".to_string()) .await diff --git a/tests/src/tracer_tests.rs b/tests/src/tracer_tests.rs index 3b0dd52d..340d660d 100644 --- a/tests/src/tracer_tests.rs +++ b/tests/src/tracer_tests.rs @@ -23,7 +23,7 @@ struct Context { tracer_test: DeployedContract>, } -async fn setup() -> anyhow::Result> { +async fn setup() -> eyre::Result> { let (_geth, _client, _) = setup_geth().await?; let client = Arc::new(_client); @@ -38,7 +38,7 @@ async fn setup() -> anyhow::Result> { async fn trace_call( c: &Context, func_data: Bytes, -) -> anyhow::Result { +) -> eyre::Result { let req = TransactionRequest::new() .to(c.tracer_test.address) .data(func_data); @@ -71,7 +71,7 @@ async fn trace_exec_self( func_data: Vec, use_number: bool, extra_wrapper: bool, -) -> anyhow::Result { +) -> eyre::Result { let contract: &BaseContract = c.tracer_test.contract().deref().deref(); let func = contract.abi().function("execSelf")?; let exec_test_call_gas = @@ -86,7 +86,7 @@ async fn trace_exec_self( } #[tokio::test] -async fn count_opcode_depth_bigger_than_1() -> anyhow::Result<()> { +async fn count_opcode_depth_bigger_than_1() -> eyre::Result<()> { let c = setup().await?; let contract: &BaseContract = c.tracer_test.contract().deref().deref(); let func_data = contract @@ -115,7 +115,7 @@ async fn count_opcode_depth_bigger_than_1() -> anyhow::Result<()> { } #[tokio::test] -async fn trace_exec_self_should_revert() -> anyhow::Result<()> { +async fn trace_exec_self_should_revert() -> eyre::Result<()> { let c = setup().await?; let ret = trace_exec_self(&c, Bytes::from_str("0xdead")?.to_vec(), true, true).await?; assert!( @@ -142,7 +142,7 @@ async fn trace_exec_self_should_revert() -> anyhow::Result<()> { } #[tokio::test] -async fn trace_exec_self_call_itself() -> anyhow::Result<()> { +async fn trace_exec_self_call_itself() -> eyre::Result<()> { let c = setup().await?; let contract: &BaseContract = c.tracer_test.contract().deref().deref(); let inner_call = contract.abi().function("doNothing")?.encode_input(&[])?; @@ -168,7 +168,7 @@ async fn trace_exec_self_call_itself() -> anyhow::Result<()> { } #[tokio::test] -async fn should_report_direct_use_of_gas_opcode() -> anyhow::Result<()> { +async fn should_report_direct_use_of_gas_opcode() -> eyre::Result<()> { let c = setup().await?; let contract: &BaseContract = c.tracer_test.contract().deref().deref(); let func_data = contract.abi().function("testCallGas")?.encode_input(&[])?; @@ -181,7 +181,7 @@ async fn should_report_direct_use_of_gas_opcode() -> anyhow::Result<()> { } #[tokio::test] -async fn should_ignore_gas_used_as_part_of_call() -> anyhow::Result<()> { +async fn should_ignore_gas_used_as_part_of_call() -> eyre::Result<()> { let c = setup().await?; let contract: &BaseContract = c.tracer_test.contract().deref().deref(); let do_nothing = contract.abi().function("doNothing")?.encode_input(&[])?;