diff --git a/.circleci/config.yml b/.circleci/config.yml index 76c73e731..27cda7751 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,9 +34,6 @@ commands: - run: name: Prepare for apt upgrades command: sudo apt update - - run: - name: Install libssl-dev for openssl-sys - command: sudo apt install -y libssl-dev - run: name: Install libclang command: sudo apt install clang @@ -46,10 +43,7 @@ commands: name: Prepare for apt upgrades command: apt update - run: - name: Install libssl-dev for openssl-sys - command: apt install -y libssl-dev - - run: - name: Install libclang for rocksdb + name: Install libclang command: apt install -y clang orbs: rust: circleci/rust@1.6.0 @@ -236,9 +230,6 @@ jobs: - run: name: Update package sources command: sudo apt update - - run: - name: Install libssl-dev for openssl-sys - command: sudo NEEDRESTART_MODE=a apt install -y libssl-dev - run: name: Install libclang command: sudo NEEDRESTART_MODE=a apt install clang diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76648c1ca..5e7aeb3ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,7 +81,7 @@ jobs: - name: Build trin for ${{ matrix.arch }} run: | - cargo install cross + cargo install cross --git https://github.com/cross-rs/cross env PROFILE=${{ matrix.profile }} make build-${{ matrix.arch }} - name: Move cross-compiled binary diff --git a/Cargo.lock b/Cargo.lock index 94f907eee..390bfd1b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,7 +187,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bytes 1.5.0", ] @@ -402,6 +402,12 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.4" @@ -423,16 +429,6 @@ dependencies = [ "term", ] -[[package]] -name = "assert-json-diff" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -473,6 +469,16 @@ dependencies = [ "zstd-safe 7.0.0", ] +[[package]] +name = "async-dup" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2886ab563af5038f79ec016dd7b87947ed138b794e8dd64992962c9cca0411" +dependencies = [ + "async-lock 3.3.0", + "futures-io", +] + [[package]] name = "async-executor" version = "1.8.0" @@ -502,6 +508,23 @@ dependencies = [ "once_cell", ] +[[package]] +name = "async-h1" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d1d1dae8cb2c4258a79d6ed088b7fb9b4763bf4e9b22d040779761e046a2971" +dependencies = [ + "async-channel 1.9.0", + "async-dup", + "async-global-executor", + "async-io 1.13.0", + "futures-lite 1.13.0", + "http-types", + "httparse", + "log", + "pin-project", +] + [[package]] name = "async-io" version = "1.13.0" @@ -561,50 +584,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-object-pool" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb901c30ebc2fc4ab46395bbfbdba9542c16559d853645d75190c3056caf3bc" -dependencies = [ - "async-std", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if 1.0.0", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.30", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.3.0", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if 1.0.0", - "futures-core", - "futures-io", - "rustix 0.38.30", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - [[package]] name = "async-std" version = "1.12.0" @@ -615,7 +594,6 @@ dependencies = [ "async-global-executor", "async-io 1.13.0", "async-lock 2.8.0", - "async-process", "crossbeam-utils 0.8.19", "futures-channel", "futures-core", @@ -660,6 +638,19 @@ version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +[[package]] +name = "async-tls" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d85a97c4a0ecce878efd3f945f119c78a646d8975340bca0398f9bb05c30cc52" +dependencies = [ + "futures-core", + "futures-io", + "rustls 0.18.1", + "webpki", + "webpki-roots 0.20.0", +] + [[package]] name = "async-trait" version = "0.1.77" @@ -773,6 +764,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "base64" version = "0.13.1" @@ -791,17 +788,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "basic-cookies" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67bd8fd42c16bdb08688243dc5f0cc117a3ca9efeeaba3a345a18a6159ad96f7" -dependencies = [ - "lalrpop", - "lalrpop-util", - "regex", -] - [[package]] name = "bech32" version = "0.9.1" @@ -1017,12 +1003,6 @@ dependencies = [ "iovec", ] -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.5.0" @@ -1112,12 +1092,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "castaway" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" - [[package]] name = "cc" version = "1.0.83" @@ -1134,7 +1108,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -1338,6 +1312,17 @@ dependencies = [ "crossbeam-utils 0.8.19", ] +[[package]] +name = "config" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" +dependencies = [ + "lazy_static", + "nom 5.1.3", + "serde", +] + [[package]] name = "const-hex" version = "1.10.0" @@ -1493,6 +1478,15 @@ dependencies = [ "crossbeam-utils 0.8.19", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils 0.8.19", +] + [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -1584,37 +1578,6 @@ dependencies = [ "cipher 0.4.4", ] -[[package]] -name = "curl" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" -dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2 0.4.10", - "winapi 0.3.9", -] - -[[package]] -name = "curl-sys" -version = "0.4.70+curl-8.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" -dependencies = [ - "cc", - "libc", - "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "windows-sys 0.48.0", -] - [[package]] name = "curve25519-dalek" version = "4.1.1" @@ -1713,12 +1676,39 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.14.3", + "lock_api 0.4.11", + "once_cell", + "parking_lot_core 0.9.9", +] + [[package]] name = "data-encoding" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "deadpool" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d126179d86aee4556e54f5f3c6bf6d9884e7cc52cef82f77ee6f90a7747616d" +dependencies = [ + "async-trait", + "config", + "crossbeam-queue", + "num_cpus", + "serde", + "tokio", +] + [[package]] name = "delay_map" version = "0.1.2" @@ -1886,7 +1876,7 @@ checksum = "63b0b31b65aa1fcbd4e0171f1afed5363ccf25efb988ecd42450036f4c6d8539" dependencies = [ "aes 0.7.5", "aes-gcm 0.9.2", - "arrayvec", + "arrayvec 0.7.4", "delay_map 0.3.0", "enr 0.10.0", "fnv", @@ -2330,7 +2320,7 @@ version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bytes 1.5.0", "cargo_metadata", "chrono", @@ -2553,7 +2543,6 @@ dependencies = [ "ethportal-api", "futures 0.3.30", "hex", - "httpmock", "hyper", "jsonrpsee", "portal-bridge", @@ -2582,17 +2571,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "4.0.3" @@ -2657,7 +2635,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "auto_impl", "bytes 1.5.0", ] @@ -2720,17 +2698,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "flume" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bebadab126f8120d410b677ed95eee4ba6eb7c6dd8e34a5ec88a08050e26132" -dependencies = [ - "futures-core", - "futures-sink", - "spinning_top", -] - [[package]] name = "fnv" version = "1.0.7" @@ -3263,12 +3230,17 @@ version = "6.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1947510dc91e2bf586ea5ffb412caad7673264e14bb39fb9078da114a94ce1a5" dependencies = [ + "async-h1", "async-std", + "async-tls", "async-trait", "cfg-if 1.0.0", + "dashmap", + "deadpool", + "futures 0.3.30", "http-types", - "isahc 0.9.14", "log", + "rustls 0.18.1", ] [[package]] @@ -3311,34 +3283,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "httpmock" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b02e044d3b4c2f94936fb05f9649efa658ca788f44eb6b87554e2033fc8ce93" -dependencies = [ - "assert-json-diff", - "async-object-pool", - "async-trait", - "base64 0.21.7", - "basic-cookies", - "crossbeam-utils 0.8.19", - "form_urlencoded", - "futures-util", - "hyper", - "isahc 1.7.2", - "lazy_static", - "levenshtein", - "log", - "regex", - "serde", - "serde_json", - "serde_regex", - "similar", - "tokio", - "url", -] - [[package]] name = "humantime" version = "2.1.0" @@ -3379,7 +3323,7 @@ dependencies = [ "http", "hyper", "log", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "tokio", "tokio-rustls", @@ -3597,56 +3541,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "isahc" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a" -dependencies = [ - "bytes 0.5.6", - "crossbeam-utils 0.8.19", - "curl", - "curl-sys", - "flume", - "futures-lite 1.13.0", - "http", - "log", - "once_cell", - "slab", - "sluice", - "tracing", - "tracing-futures", - "url", - "waker-fn", -] - -[[package]] -name = "isahc" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "334e04b4d781f436dc315cb1e7515bd96826426345d498149e4bde36b67f8ee9" -dependencies = [ - "async-channel 1.9.0", - "castaway", - "crossbeam-utils 0.8.19", - "curl", - "curl-sys", - "encoding_rs", - "event-listener 2.5.3", - "futures-lite 1.13.0", - "http", - "log", - "mime", - "once_cell", - "polling 2.8.0", - "slab", - "sluice", - "tracing", - "tracing-futures", - "url", - "waker-fn", -] - [[package]] name = "itertools" version = "0.10.5" @@ -3727,7 +3621,7 @@ dependencies = [ "tokio-util 0.7.10", "tracing", "url", - "webpki-roots", + "webpki-roots 0.25.3", ] [[package]] @@ -3930,7 +3824,6 @@ dependencies = [ "itertools 0.10.5", "lalrpop-util", "petgraph", - "pico-args", "regex", "regex-syntax 0.7.5", "string_cache", @@ -3944,9 +3837,6 @@ name = "lalrpop-util" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" -dependencies = [ - "regex", -] [[package]] name = "lazy_static" @@ -3967,10 +3857,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "levenshtein" -version = "1.0.5" +name = "lexical-core" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] [[package]] name = "libc" @@ -3994,16 +3891,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libnghttp2-sys" -version = "0.1.9+1.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "libredox" version = "0.0.1" @@ -4026,18 +3913,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-sys" -version = "1.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "light-client" version = "0.1.0" @@ -4354,6 +4229,17 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "nom" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + [[package]] name = "nom" version = "7.1.3" @@ -4463,7 +4349,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "auto_impl", "bytes 1.5.0", "ethereum-types", @@ -4488,18 +4374,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -4518,7 +4392,7 @@ version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bitvec", "byte-slice-cast", "bytes 1.5.0", @@ -4804,12 +4678,6 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pico-args" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" - [[package]] name = "pin-project" version = "1.1.3" @@ -5567,7 +5435,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", @@ -5580,7 +5448,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.3", "winreg", ] @@ -5661,7 +5529,7 @@ name = "reth-rlp" version = "0.1.0-alpha.10" source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.1.0-alpha.10#1b16d804ef01f4ec3c25e7986381c22739c105b9" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "auto_impl", "bytes 1.5.0", "c-kzg 0.1.0 (git+https://github.com/ethereum/c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d)", @@ -6025,6 +5893,19 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +dependencies = [ + "base64 0.12.3", + "log", + "ring 0.16.20", + "sct 0.6.1", + "webpki", +] + [[package]] name = "rustls" version = "0.21.10" @@ -6034,7 +5915,7 @@ dependencies = [ "log", "ring 0.17.7", "rustls-webpki", - "sct", + "sct 0.7.1", ] [[package]] @@ -6159,6 +6040,16 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + [[package]] name = "sct" version = "0.7.1" @@ -6331,16 +6222,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "serde_regex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" -dependencies = [ - "regex", - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.5" @@ -6551,12 +6432,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "similar" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" - [[package]] name = "simple_asn1" version = "0.6.2" @@ -6584,17 +6459,6 @@ dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "sluice" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" -dependencies = [ - "async-channel 1.9.0", - "futures-core", - "futures-io", -] - [[package]] name = "smallvec" version = "0.6.14" @@ -6678,15 +6542,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning_top" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" -dependencies = [ - "lock_api 0.4.11", -] - [[package]] name = "spki" version = "0.7.3" @@ -6941,6 +6796,7 @@ dependencies = [ "mime_guess", "once_cell", "pin-project-lite", + "rustls 0.18.1", "serde", "serde_json", "web-sys", @@ -7300,7 +7156,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", "tokio", ] @@ -7359,11 +7215,11 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.10", "tokio", "tokio-rustls", "tungstenite", - "webpki-roots", + "webpki-roots 0.25.3", ] [[package]] @@ -7736,7 +7592,6 @@ dependencies = [ "ethereum-types", "ethereum_ssz", "ethportal-api", - "httpmock", "parking_lot 0.11.2", "portalnet", "quickcheck", @@ -7862,7 +7717,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.21.10", "sha1 0.10.6", "thiserror", "url", @@ -7999,12 +7854,12 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls", + "rustls 0.21.10", "rustls-webpki", "serde", "serde_json", "url", - "webpki-roots", + "webpki-roots 0.25.3", ] [[package]] @@ -8257,6 +8112,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki-roots" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" +dependencies = [ + "webpki", +] + [[package]] name = "webpki-roots" version = "0.25.3" diff --git a/Cargo.toml b/Cargo.toml index a903e3211..88fd6f026 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ rlp = "0.5.0" rpc = { path = "rpc"} serde_json = {version = "1.0.89", features = ["preserve_order"]} sha3 = "0.9.1" -surf = "2.3.2" +surf = { version = "2.3.2", default-features = false, features = ["h1-client-rustls", "middleware-logger", "encoding"] } # we use rustils because OpenSSL cause issues compiling on aarch64 tempfile = "3.3.0" tokio = { version = "1.14.0", features = ["full"] } tracing = "0.1.36" diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 000000000..ce2be15a2 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,4 @@ +[build] +pre-build = [ + "apt-get update && apt-get install --assume-yes llvm-dev clang-6.0", +] diff --git a/Makefile b/Makefile index 97bb14f99..2f3a604bf 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,106 @@ -help: - @echo "lint - run clippy and rustfmt" - @echo "lint-unstable - run clippy, rustfmt and rustc lints with unstable features. expect errors, which cannot be resolved, so the user must step through and evaluate each one manually." - @echo "notes - generate release notes" - @echo "release - publish a new release" - @echo "create-docker-image - create docker image" - @echo "push-docker-image - push docker image" - -lint: - cargo +nightly fmt --all - cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings - -lint-unstable: - cargo +nightly fmt --all - cargo clippy --all --all-targets --all-features --no-deps -- -Wclippy::cargo - RUSTFLAGS="-W unused_crate_dependencies" cargo build - -create-docker-image: - docker build -t ethpm/trin:latest -t ethpm/trin:$(version) -f ./Dockerfile . - -push-docker-image: - docker push ethpm/trin:latest ethpm/trin:$(version) +# Heavily inspired by Lighthouse: https://github.com/sigp/lighthouse/blob/693886b94176faa4cb450f024696cb69cda2fe58/Makefile +.DEFAULT_GOAL := help + +GIT_TAG ?= $(shell git describe --tags --abbrev=0) +BIN_DIR = "dist/bin" + +BUILD_PATH = "target" + +# List of features to use when building. Can be override via the environment. +FEATURES ?= + +# Cargo profile for builds. Default is for local builds, CI uses an override. +PROFILE ?= release + +# Extra flags for Cargo +CARGO_INSTALL_EXTRA_FLAGS ?= + +.PHONY: lint +lint: # Run clippy and rustfmt + cargo +nightly fmt --all + cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings + +.PHONY: lint-unstable +lint-unstable: #run clippy, rustfmt and rustc lints with unstable features. expect errors, which cannot be resolved, so the user must step through and evaluate each one manually. + cargo +nightly fmt --all + cargo clippy --all --all-targets --all-features --no-deps -- -Wclippy::cargo + RUSTFLAGS="-W unused_crate_dependencies" cargo build + +#@ Help + +.PHONY: help +help: ## Display this help. + @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + +#@ Build + +.PHONY: install +install: ## Build and install the trin binary under `~/.cargo/bin`. + cargo install --path bin/trin --bin trin --force --locked \ + --features "$(FEATURES)" \ + --profile "$(PROFILE)" \ + $(CARGO_INSTALL_EXTRA_FLAGS) + +# Builds the trin binary natively. +build-native-%: + cargo build --bin trin --target $* --features "$(FEATURES)" --profile "$(PROFILE)" + +# The following commands use `cross` to build a cross-compile. +# +# These commands require that: +# +# - `cross` is installed (`cargo install cross`). +# - Docker is running. +# - The current user is in the `docker` group. +# +# The resulting binaries will be created in the `target/` directory. + +# No jemalloc on Windows +build-x86_64-pc-windows-gnu: FEATURES := $(filter-out jemalloc jemalloc-prof,$(FEATURES)) + +# Note: The additional rustc compiler flags are for intrinsics needed by MDBX. +# See: https://github.com/cross-rs/cross/wiki/FAQ#undefined-reference-with-build-std +build-%: + RUSTFLAGS="" \ + cross build --bin trin --target $* --features "$(FEATURES)" --profile "$(PROFILE)" + +# Unfortunately we can't easily use cross to build for Darwin because of licensing issues. +# If we wanted to, we would need to build a custom Docker image with the SDK available. +# +# Note: You must set `SDKROOT` and `MACOSX_DEPLOYMENT_TARGET`. These can be found using `xcrun`. +# +# `SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)` +build-x86_64-apple-darwin: + $(MAKE) build-native-x86_64-apple-darwin +build-aarch64-apple-darwin: + $(MAKE) build-native-aarch64-apple-darwin + +# Create a `.tar.gz` containing a binary for a specific target. +define tarball_release_binary + cp $(BUILD_PATH)/$(1)/$(PROFILE)/$(2) $(BIN_DIR)/$(2) + cd $(BIN_DIR) && \ + tar -czf trin-$(GIT_TAG)-$(1)$(3).tar.gz $(2) && \ + rm $(2) +endef + +# The current git tag will be used as the version in the output file names. You +# will likely need to use `git tag` and create a semver tag (e.g., `v0.2.3`). +# +# Note: This excludes macOS tarballs because of SDK licensing issues. +.PHONY: build-release-tarballs +build-release-tarballs: ## Create a series of `.tar.gz` files in the BIN_DIR directory, each containing a `trin` binary for a different target. + [ -d $(BIN_DIR) ] || mkdir -p $(BIN_DIR) + $(MAKE) build-x86_64-unknown-linux-gnu + $(call tarball_release_binary,"x86_64-unknown-linux-gnu","trin","") + $(MAKE) build-aarch64-unknown-linux-gnu + $(call tarball_release_binary,"aarch64-unknown-linux-gnu","trin","") + $(MAKE) build-x86_64-pc-windows-gnu + $(call tarball_release_binary,"x86_64-pc-windows-gnu","trin.exe","") + +##@ Other + +.PHONY: clean +clean: ## Perform a `cargo` clean and remove the binary and test vectors directories. + cargo clean + rm -rf $(BIN_DIR) + rm -rf $(EF_TESTS_DIR) diff --git a/book/src/developers/contributing/build_instructions/linux.md b/book/src/developers/contributing/build_instructions/linux.md index bf45070dc..9ab6a0ee3 100644 --- a/book/src/developers/contributing/build_instructions/linux.md +++ b/book/src/developers/contributing/build_instructions/linux.md @@ -14,7 +14,7 @@ These steps are for setting up a Trin node as a service on Ubuntu. ### Installation ```sh -$ sudo apt install libssl-dev libclang-dev pkg-config build-essential +$ sudo apt install libclang-dev pkg-config build-essential ``` Install Trin: > Tip: If you intend to submit code changes to trin, first fork the repo and diff --git a/book/src/developers/quick_setup.md b/book/src/developers/quick_setup.md index 42c174249..cf01a40e8 100644 --- a/book/src/developers/quick_setup.md +++ b/book/src/developers/quick_setup.md @@ -16,7 +16,7 @@ Note: If you use a VPN, you should disable it before running Trin. Install dependencies (Ubuntu/Debian): ```sh -apt install libssl-dev libclang-dev pkg-config build-essential +apt install libclang-dev pkg-config build-essential ``` Environment variables: diff --git a/ethportal-peertest/Cargo.toml b/ethportal-peertest/Cargo.toml index 0c713ee1b..c583553c0 100644 --- a/ethportal-peertest/Cargo.toml +++ b/ethportal-peertest/Cargo.toml @@ -17,7 +17,6 @@ ethereum-types = "0.14.1" ethereum_ssz = "0.5.3" ethportal-api = { path="../ethportal-api"} futures = "0.3.21" -httpmock = "0.6.6" hex = "0.4.3" hyper = { version = "0.14", features = ["full"] } jsonrpsee = {version="0.20.0", features = ["async-client", "client", "macros", "server"]} diff --git a/portal-bridge/Cargo.toml b/portal-bridge/Cargo.toml index ac3297109..ac9231222 100644 --- a/portal-bridge/Cargo.toml +++ b/portal-bridge/Cargo.toml @@ -34,7 +34,7 @@ serde = { version = "1.0.150", features = ["derive", "rc"] } serde_json = "1.0.89" serde_yaml = "0.9" ssz_types = "0.5.4" -surf = "2.3.2" +surf = { version = "2.3.2", default-features = false, features = ["h1-client-rustls", "middleware-logger", "encoding"] } # we use rustils because OpenSSL cause issues compiling on aarch64 tokio = { version = "1.14.0", features = ["full"] } tracing = "0.1.36" tracing-subscriber = "0.3.15" diff --git a/trin-history/Cargo.toml b/trin-history/Cargo.toml index f9deda051..3ac264f52 100644 --- a/trin-history/Cargo.toml +++ b/trin-history/Cargo.toml @@ -34,7 +34,6 @@ utp-rs = { git = "https://github.com/ethereum/utp", tag = "v0.1.0-alpha.9" } [dev-dependencies] env_logger = "0.9.0" quickcheck = "1.0.3" -httpmock = "0.6.6" rand = "0.8.4" rstest = "0.18.2" serial_test = "0.5.1"