From 46fbf5b98b5a32c49e757da6d0c239c25a35eeb7 Mon Sep 17 00:00:00 2001 From: Divma Date: Fri, 28 Oct 2022 05:40:06 +0000 Subject: [PATCH] Update discv5 (#3171) ## Issue Addressed Updates discv5 Pending on - [x] #3547 - [x] Alex upgrades his deps ## Proposed Changes updates discv5 and the enr crate. The only relevant change would be some clear indications of ipv4 usage in lighthouse ## Additional Info Functionally, this should be equivalent to the prev version. As draft pending a discv5 release --- Cargo.lock | 618 ++++++------------ beacon_node/execution_layer/Cargo.toml | 8 +- beacon_node/lighthouse_network/Cargo.toml | 4 +- beacon_node/lighthouse_network/src/config.rs | 2 +- .../lighthouse_network/src/discovery/enr.rs | 10 +- .../src/discovery/enr_ext.rs | 29 +- .../lighthouse_network/src/discovery/mod.rs | 21 +- .../src/peer_manager/network_behaviour.rs | 2 +- boot_node/src/server.rs | 10 +- common/deposit_contract/Cargo.toml | 2 +- common/eth2_network_config/Cargo.toml | 2 +- crypto/eth2_hashing/Cargo.toml | 2 +- crypto/eth2_key_derivation/Cargo.toml | 2 +- crypto/eth2_keystore/Cargo.toml | 2 +- lighthouse/tests/boot_node.rs | 4 +- .../execution_engine_integration/Cargo.toml | 4 +- 16 files changed, 270 insertions(+), 452 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad6aac8f4..04cfd4235 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "auto_impl" -version = "0.5.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" dependencies = [ "proc-macro-error", "proc-macro2", @@ -366,7 +366,7 @@ checksum = "3bdca834647821e0b13d9539a8634eb62d3501b6b6c2cec1722786ee6671b851" [[package]] name = "beacon-api-client" version = "0.1.0" -source = "git+https://github.com/ralexstokes/beacon-api-client?rev=de34eeb#de34eeb92e4fdee5709d142910abf42cf857609b" +source = "git+https://github.com/ralexstokes/beacon-api-client?rev=7d5d8dad1648f771573f42585ad8080a45b05689#7d5d8dad1648f771573f42585ad8080a45b05689" dependencies = [ "ethereum-consensus", "http", @@ -913,15 +913,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.5.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279bc8fc53f788a75c7804af68237d1fce02cde1e275a886a4b320604dc2aeda" - -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" +checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" [[package]] name = "convert_case" @@ -1061,9 +1055,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.3.2" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" dependencies = [ "generic-array", "rand_core 0.6.3", @@ -1272,28 +1266,19 @@ dependencies = [ "hex", "reqwest", "serde_json", - "sha2 0.9.9", + "sha2 0.10.2", "tree_hash", "types", ] [[package]] name = "der" -version = "0.3.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb9d92785d1facb50567852ce75d0858630630e7eabea59cf7eb7474051087" +checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" dependencies = [ - "const-oid 0.5.2", - "typenum", -] - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid 0.7.1", + "const-oid", + "zeroize", ] [[package]] @@ -1403,14 +1388,14 @@ dependencies = [ [[package]] name = "discv5" -version = "0.1.0-beta.13" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed8f54486179d5a7f11e1f5526f49d925a411a96c1141a707bd5f071be2ab630" +checksum = "d767c0e59b3e8d65222d95df723cc2ea1da92bb0f27c563607e6f0bde064f255" dependencies = [ "aes", "aes-gcm", "arrayvec", - "digest 0.10.3", + "delay_map", "enr", "fnv", "futures", @@ -1418,13 +1403,14 @@ dependencies = [ "hex", "hkdf", "lazy_static", - "libp2p-core 0.30.2", + "libp2p-core", "lru", + "more-asserts", "parking_lot 0.11.2", "rand 0.8.5", "rlp", - "sha2 0.9.9", "smallvec", + "socket2", "tokio", "tokio-stream", "tokio-util 0.6.10", @@ -1442,24 +1428,12 @@ checksum = "5caaa75cbd2b960ff1e5392d2cfb1f44717fffe12fc1f32b7b5d1267f99732a6" [[package]] name = "ecdsa" -version = "0.11.1" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d33b390ab82f2e1481e331dbd0530895640179d2128ef9a79cc690b78d1eba" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der 0.3.5", - "elliptic-curve 0.9.12", - "hmac 0.11.0", - "signature", -] - -[[package]] -name = "ecdsa" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" -dependencies = [ - "der 0.5.1", - "elliptic-curve 0.11.12", + "der", + "elliptic-curve", "rfc6979", "signature", ] @@ -1526,32 +1500,18 @@ checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "elliptic-curve" -version = "0.9.12" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13e9b0c3c4170dcc2a12783746c4205d98e18957f57854251eea3f9750fe005" -dependencies = [ - "bitvec 0.20.4", - "ff 0.9.0", - "generic-array", - "group 0.9.0", - "pkcs8 0.6.1", - "rand_core 0.6.3", - "subtle", - "zeroize", -] - -[[package]] -name = "elliptic-curve" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ "base16ct", "crypto-bigint", - "der 0.5.1", - "ff 0.11.1", + "der", + "digest 0.10.3", + "ff", "generic-array", - "group 0.11.0", + "group", + "pkcs8", "rand_core 0.6.3", "sec1", "subtle", @@ -1569,21 +1529,21 @@ dependencies = [ [[package]] name = "enr" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809869a1328bfb586b48c9c0f87761c47c41793a85bcb06f66074a87cafc1bcd" +checksum = "26fa0a0be8915790626d5759eb51fe47435a8eac92c2f212bd2da9aa7f30ea56" dependencies = [ "base64", "bs58", "bytes", "ed25519-dalek", "hex", - "k256 0.8.1", + "k256", "log", "rand 0.8.5", "rlp", "serde", - "sha3 0.9.1", + "sha3 0.10.1", "zeroize", ] @@ -1593,7 +1553,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "syn", @@ -1768,7 +1728,7 @@ dependencies = [ "hex", "num-bigint-dig", "ring", - "sha2 0.9.9", + "sha2 0.10.2", "zeroize", ] @@ -1941,14 +1901,15 @@ dependencies = [ [[package]] name = "ethereum-consensus" version = "0.1.1" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=e1188b1#e1188b14f320f225f2e53aa10336614565f04129" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=a8110af76d97bf2bf27fb987a671808fcbdf1834#a8110af76d97bf2bf27fb987a671808fcbdf1834" dependencies = [ "async-stream", "blst", + "bs58", "enr", "hex", "integer-sqrt", - "multiaddr 0.14.0", + "multiaddr", "rand 0.8.5", "serde", "serde_json", @@ -1989,29 +1950,36 @@ dependencies = [ [[package]] name = "ethers-core" -version = "0.6.0" -source = "git+https://github.com/gakonst/ethers-rs?rev=02ad93a1cfb7b62eb051c77c61dc4c0218428e4a#02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ebdd63c828f58aa067f40f9adcbea5e114fb1f90144b3a1e2858e0c9b1ff4e8" dependencies = [ "arrayvec", "bytes", - "elliptic-curve 0.11.12", + "chrono", + "elliptic-curve", "ethabi 17.1.0", + "fastrlp", "generic-array", "hex", - "k256 0.10.4", + "k256", "rand 0.8.5", "rlp", "rlp-derive", + "rust_decimal", "serde", "serde_json", + "strum", "thiserror", "tiny-keccak", + "unicode-xid", ] [[package]] name = "ethers-providers" -version = "0.6.0" -source = "git+https://github.com/gakonst/ethers-rs?rev=02ad93a1cfb7b62eb051c77c61dc4c0218428e4a#02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46482e4d1e79b20c338fd9db9e166184eb387f0a4e7c05c5b5c0aa2e8c8900c" dependencies = [ "async-trait", "auto_impl", @@ -2021,11 +1989,13 @@ dependencies = [ "futures-core", "futures-timer", "futures-util", + "getrandom 0.2.7", + "hashers", "hex", "http", "once_cell", "parking_lot 0.11.2", - "pin-project 1.0.11", + "pin-project", "reqwest", "serde", "serde_json", @@ -2141,21 +2111,35 @@ dependencies = [ ] [[package]] -name = "ff" -version = "0.9.0" +name = "fastrlp" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a4d941a5b7c2a75222e2d44fcdf634a67133d9db31e177ae5ff6ecda852bfe" +checksum = "089263294bb1c38ac73649a6ad563dd9a5142c8dc0482be15b8b9acb22a1611e" dependencies = [ - "bitvec 0.20.4", - "rand_core 0.6.3", - "subtle", + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types 0.13.1", + "fastrlp-derive", +] + +[[package]] +name = "fastrlp-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fa41ebc231af281098b11ad4a4f6182ec9096902afffe948034a20d4e1385a" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "ff" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" dependencies = [ "rand_core 0.6.3", "subtle", @@ -2389,6 +2373,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.5" @@ -2440,8 +2433,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -2490,22 +2485,11 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "group" -version = "0.9.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3c1e8b4f1ca07e6605ea1be903a5f6956aec5c8a67fd44d56076631675ed8" +checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" dependencies = [ - "ff 0.9.0", - "rand_core 0.6.3", - "subtle", -] - -[[package]] -name = "group" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" -dependencies = [ - "ff 0.11.1", + "ff", "rand_core 0.6.3", "subtle", ] @@ -2553,6 +2537,15 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashers" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +dependencies = [ + "fxhash", +] + [[package]] name = "hashlink" version = "0.7.0" @@ -2587,15 +2580,6 @@ dependencies = [ "http", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.0" @@ -2625,12 +2609,11 @@ checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hkdf" -version = "0.11.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "digest 0.9.0", - "hmac 0.11.0", + "hmac 0.12.1", ] [[package]] @@ -2653,6 +2636,15 @@ dependencies = [ "digest 0.9.0", ] +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.3", +] + [[package]] name = "hmac-drbg" version = "0.3.0" @@ -3059,27 +3051,15 @@ dependencies = [ [[package]] name = "k256" -version = "0.8.1" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3e8e491ed22bc161583a1c77e42313672c483eba6bd9d7afec0f1131d0b9ce" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ "cfg-if", - "ecdsa 0.11.1", - "elliptic-curve 0.9.12", - "sha2 0.9.9", -] - -[[package]] -name = "k256" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" -dependencies = [ - "cfg-if", - "ecdsa 0.13.4", - "elliptic-curve 0.11.12", - "sec1", - "sha3 0.9.1", + "ecdsa", + "elliptic-curve", + "sha2 0.10.2", + "sha3 0.10.1", ] [[package]] @@ -3231,7 +3211,7 @@ dependencies = [ "getrandom 0.2.7", "instant", "lazy_static", - "libp2p-core 0.36.0", + "libp2p-core", "libp2p-dns", "libp2p-gossipsub", "libp2p-identify", @@ -3244,48 +3224,13 @@ dependencies = [ "libp2p-tcp", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.14.0", + "multiaddr", "parking_lot 0.12.1", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "smallvec", ] -[[package]] -name = "libp2p-core" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86aad7d54df283db817becded03e611137698a6509d4237a96881976a162340c" -dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "lazy_static", - "libsecp256k1", - "log", - "multiaddr 0.13.0", - "multihash 0.14.0", - "multistream-select 0.10.4", - "parking_lot 0.11.2", - "pin-project 1.0.11", - "prost 0.9.0", - "prost-build 0.9.0", - "rand 0.8.5", - "ring", - "rw-stream-sink 0.2.1", - "sha2 0.9.9", - "smallvec", - "thiserror", - "unsigned-varint 0.7.1", - "void", - "zeroize", -] - [[package]] name = "libp2p-core" version = "0.36.0" @@ -3303,15 +3248,16 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "multiaddr 0.14.0", - "multihash 0.16.2", - "multistream-select 0.11.0", + "multiaddr", + "multihash", + "multistream-select", + "p256", "parking_lot 0.12.1", - "pin-project 1.0.11", - "prost 0.11.0", - "prost-build 0.11.1", + "pin-project", + "prost", + "prost-build", "rand 0.8.5", - "rw-stream-sink 0.3.0", + "rw-stream-sink", "sha2 0.10.2", "smallvec", "thiserror", @@ -3327,7 +3273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cb3c16e3bb2f76c751ae12f0f26e788c89d353babdded40411e7923f01fc978" dependencies = [ "futures", - "libp2p-core 0.36.0", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", @@ -3348,12 +3294,12 @@ dependencies = [ "futures", "hex_fmt", "instant", - "libp2p-core 0.36.0", + "libp2p-core", "libp2p-swarm", "log", "prometheus-client", - "prost 0.11.0", - "prost-build 0.11.1", + "prost", + "prost-build", "rand 0.7.3", "regex", "sha2 0.10.2", @@ -3371,12 +3317,12 @@ dependencies = [ "asynchronous-codec", "futures", "futures-timer", - "libp2p-core 0.36.0", + "libp2p-core", "libp2p-swarm", "log", "lru", - "prost 0.11.0", - "prost-build 0.11.1", + "prost", + "prost-build", "prost-codec", "smallvec", "thiserror", @@ -3389,7 +3335,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a74ab339e8b5d989e8c1000a78adb5c064a6319245bb22d1e70b415ec18c39b8" dependencies = [ - "libp2p-core 0.36.0", + "libp2p-core", "libp2p-gossipsub", "libp2p-identify", "libp2p-swarm", @@ -3405,7 +3351,7 @@ dependencies = [ "asynchronous-codec", "bytes", "futures", - "libp2p-core 0.36.0", + "libp2p-core", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -3424,10 +3370,10 @@ dependencies = [ "curve25519-dalek 3.2.0", "futures", "lazy_static", - "libp2p-core 0.36.0", + "libp2p-core", "log", - "prost 0.11.0", - "prost-build 0.11.1", + "prost", + "prost-build", "rand 0.8.5", "sha2 0.10.2", "snow", @@ -3445,10 +3391,10 @@ dependencies = [ "asynchronous-codec", "bytes", "futures", - "libp2p-core 0.36.0", + "libp2p-core", "log", - "prost 0.11.0", - "prost-build 0.11.1", + "prost", + "prost-build", "unsigned-varint 0.7.1", "void", ] @@ -3464,9 +3410,9 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.36.0", + "libp2p-core", "log", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "smallvec", "thiserror", @@ -3479,7 +3425,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f02622b9dd150011b4eeec387f8bd013189a2f27da08ba363e7c6e606d77a48" dependencies = [ - "heck 0.4.0", + "heck", "quote", "syn", ] @@ -3495,7 +3441,7 @@ dependencies = [ "if-addrs 0.7.0", "ipnet", "libc", - "libp2p-core 0.36.0", + "libp2p-core", "log", "socket2", "tokio", @@ -3510,11 +3456,11 @@ dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.36.0", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", - "rw-stream-sink 0.3.0", + "rw-stream-sink", "soketto", "url", "webpki-roots", @@ -3527,7 +3473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b74ec8dc042b583f0b2b93d52917f3b374c1e4b1cfa79ee74c7672c41257694c" dependencies = [ "futures", - "libp2p-core 0.36.0", + "libp2p-core", "parking_lot 0.12.1", "thiserror", "yamux", @@ -3680,7 +3626,7 @@ dependencies = [ "regex", "serde", "serde_derive", - "sha2 0.9.9", + "sha2 0.10.2", "slog", "slog-async", "slog-term", @@ -3892,7 +3838,7 @@ dependencies = [ [[package]] name = "mev-build-rs" version = "0.2.1" -source = "git+https://github.com/ralexstokes/mev-rs?rev=a088806575805c00d63fa59c002abc5eb1dc7709#a088806575805c00d63fa59c002abc5eb1dc7709" +source = "git+https://github.com/ralexstokes/mev-rs?rev=6c99b0fbdc0427b1625469d2e575303ce08de5b8#6c99b0fbdc0427b1625469d2e575303ce08de5b8" dependencies = [ "async-trait", "axum", @@ -3981,22 +3927,10 @@ dependencies = [ ] [[package]] -name = "multiaddr" -version = "0.13.0" +name = "more-asserts" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ee4ea82141951ac6379f964f71b20876d43712bea8faf6dd1a375e08a46499" -dependencies = [ - "arrayref", - "bs58", - "byteorder", - "data-encoding", - "multihash 0.14.0", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.7.1", - "url", -] +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "multiaddr" @@ -4008,7 +3942,7 @@ dependencies = [ "bs58", "byteorder", "data-encoding", - "multihash 0.16.2", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -4016,19 +3950,6 @@ dependencies = [ "url", ] -[[package]] -name = "multihash" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" -dependencies = [ - "digest 0.9.0", - "generic-array", - "multihash-derive 0.7.2", - "sha2 0.9.9", - "unsigned-varint 0.7.1", -] - [[package]] name = "multihash" version = "0.16.2" @@ -4037,25 +3958,11 @@ checksum = "e3db354f401db558759dfc1e568d010a5d4146f4d3f637be1275ec4a3cf09689" dependencies = [ "core2", "digest 0.10.3", - "multihash-derive 0.8.0", + "multihash-derive", "sha2 0.10.2", "unsigned-varint 0.7.1", ] -[[package]] -name = "multihash-derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" -dependencies = [ - "proc-macro-crate", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "multihash-derive" version = "0.8.0" @@ -4094,20 +4001,6 @@ dependencies = [ "twoway", ] -[[package]] -name = "multistream-select" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" -dependencies = [ - "bytes", - "futures", - "log", - "pin-project 1.0.11", - "smallvec", - "unsigned-varint 0.7.1", -] - [[package]] name = "multistream-select" version = "0.11.0" @@ -4117,7 +4010,7 @@ dependencies = [ "bytes", "futures", "log", - "pin-project 1.0.11", + "pin-project", "smallvec", "unsigned-varint 0.7.1", ] @@ -4436,6 +4329,17 @@ dependencies = [ "types", ] +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2 0.10.2", +] + [[package]] name = "parity-scale-codec" version = "2.3.1" @@ -4611,33 +4515,13 @@ dependencies = [ "rustc_version 0.4.0", ] -[[package]] -name = "pin-project" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" -dependencies = [ - "pin-project-internal 0.4.30", -] - [[package]] name = "pin-project" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" dependencies = [ - "pin-project-internal 1.0.11", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "pin-project-internal", ] [[package]] @@ -4671,23 +4555,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c2f795bc591cb3384cb64082a578b89207ac92bb89c9d98c1ea2ace7cd8110" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der 0.3.5", - "spki 0.3.0", -] - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der 0.5.1", - "spki 0.5.4", - "zeroize", + "der", + "spki", ] [[package]] @@ -4884,16 +4757,6 @@ dependencies = [ "syn", ] -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive 0.9.0", -] - [[package]] name = "prost" version = "0.11.0" @@ -4901,27 +4764,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" dependencies = [ "bytes", - "prost-derive 0.11.0", -] - -[[package]] -name = "prost-build" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" -dependencies = [ - "bytes", - "heck 0.3.3", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost 0.9.0", - "prost-types 0.9.0", - "regex", - "tempfile", - "which", + "prost-derive", ] [[package]] @@ -4931,14 +4774,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" dependencies = [ "bytes", - "heck 0.4.0", + "heck", "itertools", "lazy_static", "log", "multimap", "petgraph", - "prost 0.11.0", - "prost-types 0.11.1", + "prost", + "prost-types", "regex", "tempfile", "which", @@ -4952,24 +4795,11 @@ checksum = "011ae9ff8359df7915f97302d591cdd9e0e27fbd5a4ddc5bd13b71079bb20987" dependencies = [ "asynchronous-codec", "bytes", - "prost 0.11.0", + "prost", "thiserror", "unsigned-varint 0.7.1", ] -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.11.0" @@ -4983,16 +4813,6 @@ dependencies = [ "syn", ] -[[package]] -name = "prost-types" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" -dependencies = [ - "bytes", - "prost 0.9.0", -] - [[package]] name = "prost-types" version = "0.11.1" @@ -5000,7 +4820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" dependencies = [ "bytes", - "prost 0.11.0", + "prost", ] [[package]] @@ -5336,12 +5156,12 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" dependencies = [ "crypto-bigint", - "hmac 0.11.0", + "hmac 0.12.1", "zeroize", ] @@ -5412,6 +5232,17 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rust_decimal" +version = "1.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee9164faf726e4f3ece4978b25ca877ddc6802fa77f38cdccb32c7f805ecd70c" +dependencies = [ + "arrayvec", + "num-traits", + "serde", +] + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -5497,17 +5328,6 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" -[[package]] -name = "rw-stream-sink" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" -dependencies = [ - "futures", - "pin-project 0.4.30", - "static_assertions", -] - [[package]] name = "rw-stream-sink" version = "0.3.0" @@ -5515,7 +5335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ "futures", - "pin-project 1.0.11", + "pin-project", "static_assertions", ] @@ -5618,13 +5438,14 @@ dependencies = [ [[package]] name = "sec1" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "der 0.5.1", + "base16ct", + "der", "generic-array", - "pkcs8 0.8.0", + "pkcs8", "subtle", "zeroize", ] @@ -5927,11 +5748,11 @@ dependencies = [ [[package]] name = "signature" -version = "1.3.2" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2807892cfa58e081aa1f1111391c7a0649d4fa127a4ffbe34bcbfb35a1171a4" +checksum = "deb766570a2825fa972bceff0d195727876a9cdf2460ab2e52d455dc2de47fd9" dependencies = [ - "digest 0.9.0", + "digest 0.10.3", "rand_core 0.6.3", ] @@ -6215,21 +6036,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spki" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dae7e047abc519c96350e9484a96c6bf1492348af912fd3446dd2dc323f6268" -dependencies = [ - "der 0.3.5", -] - -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der 0.5.1", + "der", ] [[package]] @@ -6354,7 +6166,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -6741,7 +6553,7 @@ checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", "log", - "pin-project 1.0.11", + "pin-project", "tokio", "tungstenite 0.14.0", ] @@ -6809,7 +6621,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "pin-project 1.0.11", + "pin-project", "pin-project-lite 0.2.9", "tokio", "tower-layer", @@ -6888,7 +6700,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.11", + "pin-project", "tracing", ] @@ -7174,12 +6986,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" - [[package]] name = "unicode-width" version = "0.1.9" @@ -7397,7 +7203,7 @@ dependencies = [ "mime_guess", "multipart", "percent-encoding", - "pin-project 1.0.11", + "pin-project", "scoped-tls", "serde", "serde_json", @@ -7583,7 +7389,7 @@ dependencies = [ "log", "once_cell", "parking_lot 0.12.1", - "pin-project 1.0.11", + "pin-project", "reqwest", "rlp", "secp256k1", diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index 770bc4cf8..bfc748d5b 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -37,11 +37,11 @@ rand = "0.8.5" zeroize = { version = "1.4.2", features = ["zeroize_derive"] } lighthouse_metrics = { path = "../../common/lighthouse_metrics" } lazy_static = "1.4.0" -ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" } +ethers-core = "0.17.0" builder_client = { path = "../builder_client" } fork_choice = { path = "../../consensus/fork_choice" } -mev-build-rs = {git = "https://github.com/ralexstokes/mev-rs", rev = "a088806575805c00d63fa59c002abc5eb1dc7709"} -ethereum-consensus = {git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e1188b1" } -ssz-rs = {git = "https://github.com/ralexstokes/ssz-rs", rev = "cb08f1" } +mev-build-rs = { git = "https://github.com/ralexstokes/mev-rs", rev = "6c99b0fbdc0427b1625469d2e575303ce08de5b8" } +ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "a8110af76d97bf2bf27fb987a671808fcbdf1834" } +ssz-rs = { git = "https://github.com/ralexstokes/ssz-rs", rev = "cb08f1" } tokio-stream = { version = "0.1.9", features = [ "sync" ] } strum = "0.24.0" diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index e5af0a749..977f0a108 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Sigma Prime "] edition = "2021" [dependencies] -discv5 = { version = "0.1.0-beta.13", features = ["libp2p"] } +discv5 = { version = "0.1.0", features = ["libp2p"] } unsigned-varint = { version = "0.6.0", features = ["codec"] } types = { path = "../../consensus/types" } eth2_ssz_types = "0.2.2" @@ -26,7 +26,7 @@ smallvec = "1.6.1" tokio-io-timeout = "1.1.1" lru = "0.7.1" parking_lot = "0.12.0" -sha2 = "0.9.1" +sha2 = "0.10" snap = "1.0.1" hex = "0.4.2" tokio-util = { version = "0.6.2", features = ["codec", "compat", "time"] } diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index 263ef0c7c..71566b877 100644 --- a/beacon_node/lighthouse_network/src/config.rs +++ b/beacon_node/lighthouse_network/src/config.rs @@ -176,7 +176,7 @@ impl Default for Config { .filter_rate_limiter(filter_rate_limiter) .filter_max_bans_per_ip(Some(5)) .filter_max_nodes_per_ip(Some(10)) - .table_filter(|enr| enr.ip().map_or(false, |ip| is_global(&ip))) // Filter non-global IPs + .table_filter(|enr| enr.ip4().map_or(false, |ip| is_global(&ip))) // Filter non-global IPs .ban_duration(Some(Duration::from_secs(3600))) .ping_interval(Duration::from_secs(300)) .build(); diff --git a/beacon_node/lighthouse_network/src/discovery/enr.rs b/beacon_node/lighthouse_network/src/discovery/enr.rs index b513ede59..6b4b87a5f 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr.rs @@ -149,12 +149,12 @@ pub fn create_enr_builder_from_config( builder.ip(enr_address); } if let Some(udp_port) = config.enr_udp_port { - builder.udp(udp_port); + builder.udp4(udp_port); } // we always give it our listening tcp port if enable_tcp { let tcp_port = config.enr_tcp_port.unwrap_or(config.libp2p_port); - builder.tcp(tcp_port); + builder.tcp4(tcp_port); } builder } @@ -189,13 +189,13 @@ pub fn build_enr( /// If this function returns true, we use the `disk_enr`. fn compare_enr(local_enr: &Enr, disk_enr: &Enr) -> bool { // take preference over disk_enr address if one is not specified - (local_enr.ip().is_none() || local_enr.ip() == disk_enr.ip()) + (local_enr.ip4().is_none() || local_enr.ip4() == disk_enr.ip4()) // tcp ports must match - && local_enr.tcp() == disk_enr.tcp() + && local_enr.tcp4() == disk_enr.tcp4() // must match on the same fork && local_enr.get(ETH2_ENR_KEY) == disk_enr.get(ETH2_ENR_KEY) // take preference over disk udp port if one is not specified - && (local_enr.udp().is_none() || local_enr.udp() == disk_enr.udp()) + && (local_enr.udp4().is_none() || local_enr.udp4() == disk_enr.udp4()) // we need the ATTESTATION_BITFIELD_ENR_KEY and SYNC_COMMITTEE_BITFIELD_ENR_KEY key to match, // otherwise we use a new ENR. This will likely only be true for non-validating nodes && local_enr.get(ATTESTATION_BITFIELD_ENR_KEY) == disk_enr.get(ATTESTATION_BITFIELD_ENR_KEY) diff --git a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs index 1001efe23..e9cca6667 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs @@ -48,14 +48,14 @@ impl EnrExt for Enr { /// The vector remains empty if these fields are not defined. fn multiaddr(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); - if let Some(ip) = self.ip() { - if let Some(udp) = self.udp() { + if let Some(ip) = self.ip4() { + if let Some(udp) = self.udp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Udp(udp)); multiaddrs.push(multiaddr); } - if let Some(tcp) = self.tcp() { + if let Some(tcp) = self.tcp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Tcp(tcp)); multiaddrs.push(multiaddr); @@ -84,15 +84,15 @@ impl EnrExt for Enr { fn multiaddr_p2p(&self) -> Vec { let peer_id = self.peer_id(); let mut multiaddrs: Vec = Vec::new(); - if let Some(ip) = self.ip() { - if let Some(udp) = self.udp() { + if let Some(ip) = self.ip4() { + if let Some(udp) = self.udp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Udp(udp)); multiaddr.push(Protocol::P2p(peer_id.into())); multiaddrs.push(multiaddr); } - if let Some(tcp) = self.tcp() { + if let Some(tcp) = self.tcp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Tcp(tcp)); multiaddr.push(Protocol::P2p(peer_id.into())); @@ -124,8 +124,8 @@ impl EnrExt for Enr { fn multiaddr_p2p_tcp(&self) -> Vec { let peer_id = self.peer_id(); let mut multiaddrs: Vec = Vec::new(); - if let Some(ip) = self.ip() { - if let Some(tcp) = self.tcp() { + if let Some(ip) = self.ip4() { + if let Some(tcp) = self.tcp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Tcp(tcp)); multiaddr.push(Protocol::P2p(peer_id.into())); @@ -150,8 +150,8 @@ impl EnrExt for Enr { fn multiaddr_p2p_udp(&self) -> Vec { let peer_id = self.peer_id(); let mut multiaddrs: Vec = Vec::new(); - if let Some(ip) = self.ip() { - if let Some(udp) = self.udp() { + if let Some(ip) = self.ip4() { + if let Some(udp) = self.udp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Udp(udp)); multiaddr.push(Protocol::P2p(peer_id.into())); @@ -173,8 +173,8 @@ impl EnrExt for Enr { /// The vector remains empty if these fields are not defined. fn multiaddr_tcp(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); - if let Some(ip) = self.ip() { - if let Some(tcp) = self.tcp() { + if let Some(ip) = self.ip4() { + if let Some(tcp) = self.tcp4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Tcp(tcp)); multiaddrs.push(multiaddr); @@ -232,6 +232,7 @@ impl CombinedKeyExt for CombinedKey { .expect("libp2p key must be valid"); Ok(CombinedKey::from(ed_keypair)) } + Keypair::Ecdsa(_) => Err("Ecdsa keypairs not supported"), } } } @@ -265,6 +266,10 @@ pub fn peer_id_to_node_id(peer_id: &PeerId) -> Result Err(format!( + "Unsupported public key (Ecdsa) from peer {}", + peer_id + )), } } diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index d766fd23a..3535c6bd9 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -197,7 +197,9 @@ impl Discovery { let local_enr = network_globals.local_enr.read().clone(); - info!(log, "ENR Initialised"; "enr" => local_enr.to_base64(), "seq" => local_enr.seq(), "id"=> %local_enr.node_id(), "ip" => ?local_enr.ip(), "udp"=> ?local_enr.udp(), "tcp" => ?local_enr.tcp()); + info!(log, "ENR Initialised"; "enr" => local_enr.to_base64(), "seq" => local_enr.seq(), "id"=> %local_enr.node_id(), + "ip4" => ?local_enr.ip4(), "udp4"=> ?local_enr.udp4(), "tcp4" => ?local_enr.tcp6() + ); let listen_socket = SocketAddr::new(config.listen_address, config.discovery_port); @@ -214,9 +216,9 @@ impl Discovery { "Adding node to routing table"; "node_id" => %bootnode_enr.node_id(), "peer_id" => %bootnode_enr.peer_id(), - "ip" => ?bootnode_enr.ip(), - "udp" => ?bootnode_enr.udp(), - "tcp" => ?bootnode_enr.tcp() + "ip" => ?bootnode_enr.ip4(), + "udp" => ?bootnode_enr.udp4(), + "tcp" => ?bootnode_enr.tcp4() ); let repr = bootnode_enr.to_string(); let _ = discv5.add_enr(bootnode_enr).map_err(|e| { @@ -268,9 +270,9 @@ impl Discovery { "Adding node to routing table"; "node_id" => %enr.node_id(), "peer_id" => %enr.peer_id(), - "ip" => ?enr.ip(), - "udp" => ?enr.udp(), - "tcp" => ?enr.tcp() + "ip" => ?enr.ip4(), + "udp" => ?enr.udp4(), + "tcp" => ?enr.tcp4() ); let _ = discv5.add_enr(enr).map_err(|e| { error!( @@ -763,7 +765,7 @@ impl Discovery { // we can connect to peers who aren't compatible with an upcoming fork. // `fork_digest` **must** be same. enr.eth2().map(|e| e.fork_digest) == Ok(enr_fork_id.fork_digest) - && (enr.tcp().is_some() || enr.tcp6().is_some()) + && (enr.tcp4().is_some() || enr.tcp6().is_some()) }; // General predicate @@ -1040,7 +1042,8 @@ impl NetworkBehaviour for Discovery { } Discv5Event::EnrAdded { .. } | Discv5Event::TalkRequest(_) - | Discv5Event::NodeInserted { .. } => {} // Ignore all other discv5 server events + | Discv5Event::NodeInserted { .. } + | Discv5Event::SessionEstablished { .. } => {} // Ignore all other discv5 server events } } } diff --git a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs index a19c6db65..c84e368f1 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs @@ -130,7 +130,7 @@ impl NetworkBehaviour for PeerManager { } // Check NAT if metrics are enabled - if self.network_globals.local_enr.read().udp().is_some() { + if self.network_globals.local_enr.read().udp4().is_some() { metrics::check_nat(); } diff --git a/boot_node/src/server.rs b/boot_node/src/server.rs index 6b7f0bf48..c4bf887e9 100644 --- a/boot_node/src/server.rs +++ b/boot_node/src/server.rs @@ -11,7 +11,10 @@ use types::EthSpec; pub async fn run(config: BootNodeConfig, log: slog::Logger) { // Print out useful information about the generated ENR - let enr_socket = config.local_enr.udp_socket().expect("Enr has a UDP socket"); + let enr_socket = config + .local_enr + .udp4_socket() + .expect("Enr has a UDP socket"); let eth2_field = config .local_enr .eth2() @@ -39,7 +42,7 @@ pub async fn run(config: BootNodeConfig, log: slog::Logger) { info!( log, "Adding bootnode"; - "address" => ?enr.udp_socket(), + "address" => ?enr.udp4_socket(), "peer_id" => enr.peer_id().to_string(), "node_id" => enr.node_id().to_string() ); @@ -89,11 +92,12 @@ pub async fn run(config: BootNodeConfig, log: slog::Logger) { // Ignore these events here } Discv5Event::EnrAdded { .. } => {} // Ignore - Discv5Event::TalkRequest(_) => {} // Ignore + Discv5Event::TalkRequest(_) => {} // Ignore Discv5Event::NodeInserted { .. } => {} // Ignore Discv5Event::SocketUpdated(socket_addr) => { info!(log, "External socket address updated"; "socket_addr" => format!("{:?}", socket_addr)); } + Discv5Event::SessionEstablished{ .. } => {} // Ignore } } } diff --git a/common/deposit_contract/Cargo.toml b/common/deposit_contract/Cargo.toml index 7c3d18394..7be0e8f3d 100644 --- a/common/deposit_contract/Cargo.toml +++ b/common/deposit_contract/Cargo.toml @@ -9,7 +9,7 @@ build = "build.rs" [build-dependencies] reqwest = { version = "0.11.0", features = ["blocking", "json", "native-tls-vendored"] } serde_json = "1.0.58" -sha2 = "0.9.1" +sha2 = "0.10" hex = "0.4.2" [dependencies] diff --git a/common/eth2_network_config/Cargo.toml b/common/eth2_network_config/Cargo.toml index 32cee89f7..619900555 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -18,4 +18,4 @@ serde_yaml = "0.8.13" types = { path = "../../consensus/types"} eth2_ssz = "0.4.1" eth2_config = { path = "../eth2_config"} -enr = { version = "0.5.1", features = ["ed25519", "k256"] } +enr = { version = "0.6.2", features = ["ed25519", "k256"] } diff --git a/crypto/eth2_hashing/Cargo.toml b/crypto/eth2_hashing/Cargo.toml index 28f106fcb..db296c70f 100644 --- a/crypto/eth2_hashing/Cargo.toml +++ b/crypto/eth2_hashing/Cargo.toml @@ -10,7 +10,7 @@ description = "Hashing primitives used in Ethereum 2.0" lazy_static = { version = "1.4.0", optional = true } cpufeatures = { version = "0.2.5", optional = true } ring = "0.16.19" -sha2 = "0.10.2" +sha2 = "0.10" [dev-dependencies] rustc-hex = "2.1.0" diff --git a/crypto/eth2_key_derivation/Cargo.toml b/crypto/eth2_key_derivation/Cargo.toml index 43a8fe88b..3f174a02d 100644 --- a/crypto/eth2_key_derivation/Cargo.toml +++ b/crypto/eth2_key_derivation/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -sha2 = "0.9.1" +sha2 = "0.10" zeroize = { version = "1.4.2", features = ["zeroize_derive"] } num-bigint-dig = { version = "0.6.0", features = ["zeroize"] } ring = "0.16.19" diff --git a/crypto/eth2_keystore/Cargo.toml b/crypto/eth2_keystore/Cargo.toml index 98521c8fb..d83a60da2 100644 --- a/crypto/eth2_keystore/Cargo.toml +++ b/crypto/eth2_keystore/Cargo.toml @@ -11,7 +11,7 @@ rand = "0.8.5" hmac = "0.11.0" pbkdf2 = { version = "0.8.0", default-features = false } scrypt = { version = "0.7.0", default-features = false } -sha2 = "0.9.1" +sha2 = "0.9.2" uuid = { version = "0.8.1", features = ["serde", "v4"] } zeroize = { version = "1.4.2", features = ["zeroize_derive"] } serde = "1.0.116" diff --git a/lighthouse/tests/boot_node.rs b/lighthouse/tests/boot_node.rs index 1c11ae046..8c000bbb3 100644 --- a/lighthouse/tests/boot_node.rs +++ b/lighthouse/tests/boot_node.rs @@ -56,7 +56,7 @@ impl CommandLineTestExec for CommandLineTest { fn enr_address_arg() { let mut test = CommandLineTest::new(); test.run_with_ip().with_config(|config| { - assert_eq!(config.local_enr.ip(), Some(IP_ADDRESS.parse().unwrap())); + assert_eq!(config.local_enr.ip4(), Some(IP_ADDRESS.parse().unwrap())); }); } @@ -127,7 +127,7 @@ fn enr_port_flag() { .flag("enr-port", Some(port.to_string().as_str())) .run_with_ip() .with_config(|config| { - assert_eq!(config.local_enr.udp(), Some(port)); + assert_eq!(config.local_enr.udp4(), Some(port)); }) } diff --git a/testing/execution_engine_integration/Cargo.toml b/testing/execution_engine_integration/Cargo.toml index 7a8d7e99b..a85138be9 100644 --- a/testing/execution_engine_integration/Cargo.toml +++ b/testing/execution_engine_integration/Cargo.toml @@ -15,8 +15,8 @@ execution_layer = { path = "../../beacon_node/execution_layer" } sensitive_url = { path = "../../common/sensitive_url" } types = { path = "../../consensus/types" } unused_port = { path = "../../common/unused_port" } -ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" } -ethers-providers = { git = "https://github.com/gakonst/ethers-rs", rev = "02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" } +ethers-core = "0.17.0" +ethers-providers = "0.17.0" deposit_contract = { path = "../../common/deposit_contract" } reqwest = { version = "0.11.0", features = ["json"] } hex = "0.4.2"