diff --git a/Cargo.lock b/Cargo.lock index 6e7ededbd6b..39f02313da5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "beacon_node" -version = "1.4.0" +version = "1.5.0-rc.0" dependencies = [ "beacon_chain", "clap", @@ -719,7 +719,7 @@ dependencies = [ [[package]] name = "boot_node" -version = "1.4.0" +version = "1.5.0-rc.0" dependencies = [ "beacon_node", "clap", @@ -1548,7 +1548,7 @@ dependencies = [ "hex", "hkdf", "lazy_static", - "libp2p-core 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-core 0.29.0", "lru", "lru_time_cache", "parking_lot", @@ -1830,7 +1830,7 @@ dependencies = [ "futures", "futures-util", "hex", - "libsecp256k1", + "libsecp256k1 0.6.0", "procinfo", "proto_array", "psutil", @@ -1848,6 +1848,7 @@ dependencies = [ name = "eth2_config" version = "0.2.0" dependencies = [ + "paste", "serde", "serde_derive", "types", @@ -3218,7 +3219,7 @@ dependencies = [ [[package]] name = "lcli" -version = "1.4.0" +version = "1.5.0-rc.0" dependencies = [ "account_utils", "bls", @@ -3325,14 +3326,14 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.39.1" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.40.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "atomic", "bytes 1.0.1", "futures", "lazy_static", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -3375,7 +3376,7 @@ dependencies = [ "futures", "futures-timer", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.5.0", "log", "multiaddr", "multihash", @@ -3397,8 +3398,8 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "asn1_der", "bs58", @@ -3408,11 +3409,11 @@ dependencies = [ "futures", "futures-timer", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.6.0", "log", "multiaddr", "multihash", - "multistream-select 0.10.3", + "multistream-select 0.10.4", "parking_lot", "pin-project 1.0.7", "prost", @@ -3430,22 +3431,22 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "flate2", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", ] [[package]] name = "libp2p-dns" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "async-std-resolver", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "smallvec", "trust-dns-resolver", @@ -3453,13 +3454,13 @@ dependencies = [ [[package]] name = "libp2p-floodsub" -version = "0.30.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.31.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "cuckoofilter", "fnv", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "prost", @@ -3470,8 +3471,8 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.33.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "asynchronous-codec", "base64 0.13.0", @@ -3480,7 +3481,7 @@ dependencies = [ "fnv", "futures", "hex_fmt", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "prost", @@ -3495,11 +3496,11 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.30.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.31.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "prost", @@ -3510,8 +3511,8 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.31.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.32.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "arrayvec 0.5.2", "asynchronous-codec", @@ -3519,7 +3520,7 @@ dependencies = [ "either", "fnv", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "prost", @@ -3535,8 +3536,8 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.31.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.32.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "async-io", "data-encoding", @@ -3544,7 +3545,7 @@ dependencies = [ "futures", "if-watch", "lazy_static", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "rand 0.8.4", @@ -3555,13 +3556,13 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "asynchronous-codec", "bytes 1.0.1", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "nohash-hasher", "parking_lot", @@ -3572,14 +3573,14 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.32.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.33.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "bytes 1.0.1", "curve25519-dalek", "futures", "lazy_static", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "prost", "prost-build", @@ -3593,11 +3594,11 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.30.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.31.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "rand 0.7.3", @@ -3607,13 +3608,13 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "asynchronous-codec", "bytes 1.0.1", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "prost", "prost-build", @@ -3624,7 +3625,7 @@ dependencies = [ [[package]] name = "libp2p-pnet" version = "0.21.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "futures", "log", @@ -3636,14 +3637,14 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.3.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.4.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "asynchronous-codec", "bytes 1.0.1", "futures", "futures-timer", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "pin-project 1.0.7", @@ -3658,13 +3659,13 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.12.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.13.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "async-trait", "bytes 1.0.1", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "libp2p-swarm", "log", "lru", @@ -3677,12 +3678,12 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.30.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.31.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "either", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "rand 0.7.3", "smallvec", @@ -3693,7 +3694,7 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.24.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "quote", "syn", @@ -3701,8 +3702,8 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "async-io", "futures", @@ -3711,7 +3712,7 @@ dependencies = [ "if-watch", "ipnet", "libc", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "socket2 0.4.0", "tokio 1.8.1", @@ -3719,23 +3720,23 @@ dependencies = [ [[package]] name = "libp2p-uds" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "async-std", "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.30.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "futures", "js-sys", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -3743,13 +3744,13 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.30.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.31.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "log", "quicksink", "rw-stream-sink", @@ -3760,11 +3761,11 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.33.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.34.0" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "futures", - "libp2p-core 0.29.0 (git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a)", + "libp2p-core 0.30.0", "parking_lot", "thiserror", "yamux", @@ -3789,11 +3790,30 @@ dependencies = [ "typenum", ] +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2", + "typenum", +] + [[package]] name = "libsecp256k1-core" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee11012b293ea30093c129173cac4335513064094619f4639a25b310fd33c11" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" dependencies = [ "crunchy", "digest", @@ -3802,18 +3822,18 @@ dependencies = [ [[package]] name = "libsecp256k1-gen-ecmult" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32239626ffbb6a095b83b37a02ceb3672b2443a87a000a884fc3c4d16925c9c0" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" dependencies = [ "libsecp256k1-core", ] [[package]] name = "libsecp256k1-gen-genmult" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76acb433e21d10f5f9892b1962c2856c58c7f39a9e4bd68ac82b9436a0ffd5b9" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" dependencies = [ "libsecp256k1-core", ] @@ -3843,7 +3863,7 @@ dependencies = [ [[package]] name = "lighthouse" -version = "1.4.0" +version = "1.5.0-rc.0" dependencies = [ "account_manager", "account_utils", @@ -4096,18 +4116,18 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51aa5bb0ca22415daca596a227b507f880ad1b2318a87fa9325312a5d285ca0d" +checksum = "4f1f5b98cb843034ca9ca7fd9cbfdd579c674d58fdc4a6015948be5559b52446" dependencies = [ "minicbor-derive", ] [[package]] name = "minicbor-derive" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2b9e8883d58e34b18facd16c4564a77ea50fce028ad3d0ee6753440e37acc8" +checksum = "54999f917cd092b13904737e26631aa2b2b88d625db68e4bab461dcd8006c788" dependencies = [ "proc-macro2", "quote", @@ -4252,8 +4272,8 @@ dependencies = [ [[package]] name = "multistream-select" -version = "0.10.3" -source = "git+https://github.com/sigp/rust-libp2p?rev=75fd53ec5407a58ae1ff600fd1c68ea49079364a#75fd53ec5407a58ae1ff600fd1c68ea49079364a" +version = "0.10.4" +source = "git+https://github.com/sigp/rust-libp2p?rev=35eaa10eeacabea3239bfd7216a2f0c836efb719#35eaa10eeacabea3239bfd7216a2f0c836efb719" dependencies = [ "bytes 1.0.1", "futures", @@ -4640,6 +4660,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + [[package]] name = "pbkdf2" version = "0.4.0" @@ -7315,7 +7341,7 @@ dependencies = [ "itertools 0.10.1", "lazy_static", "libc", - "libsecp256k1", + "libsecp256k1 0.5.0", "lighthouse_metrics", "lighthouse_version", "lockfile", diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index 2b6feec5aad..a559bb853bc 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "beacon_node" -version = "1.4.0" +version = "1.5.0-rc.0" authors = ["Paul Hauner ", "Age Manning { let pk_bytes = pk.to_bytes(); @@ -211,7 +211,7 @@ impl CombinedKeyPublicExt for CombinedPublicKey { libp2p::core::identity::ed25519::PublicKey::decode(&pk_bytes) .expect("valid public key"), ); - PeerId::from_public_key(libp2p_pk) + PeerId::from_public_key(&libp2p_pk) } } } @@ -283,7 +283,7 @@ mod tests { let libp2p_sk = libp2p::identity::secp256k1::SecretKey::from_bytes(sk_bytes).unwrap(); let secp256k1_kp: libp2p::identity::secp256k1::Keypair = libp2p_sk.into(); let libp2p_kp = Keypair::Secp256k1(secp256k1_kp); - let peer_id = libp2p_kp.public().into_peer_id(); + let peer_id = libp2p_kp.public().to_peer_id(); let enr = discv5::enr::EnrBuilder::new("v4") .build(&secret_key) @@ -304,7 +304,7 @@ mod tests { let libp2p_sk = libp2p::identity::ed25519::SecretKey::from_bytes(sk_bytes).unwrap(); let ed25519_kp: libp2p::identity::ed25519::Keypair = libp2p_sk.into(); let libp2p_kp = Keypair::Ed25519(ed25519_kp); - let peer_id = libp2p_kp.public().into_peer_id(); + let peer_id = libp2p_kp.public().to_peer_id(); let enr = discv5::enr::EnrBuilder::new("v4").build(&keypair).unwrap(); let node_id = peer_id_to_node_id(&peer_id).unwrap(); diff --git a/beacon_node/eth2_libp2p/src/service.rs b/beacon_node/eth2_libp2p/src/service.rs index c5291bbdf50..3c5ee5938b9 100644 --- a/beacon_node/eth2_libp2p/src/service.rs +++ b/beacon_node/eth2_libp2p/src/service.rs @@ -143,7 +143,7 @@ impl Service { .with_max_established_outgoing(Some( (config.target_peers as f32 * (1.0 + PEER_EXCESS_FACTOR)) as u32, )) - .with_max_established_total(Some( + .with_max_established(Some( (config.target_peers as f32 * (1.0 + PEER_EXCESS_FACTOR)) as u32, )) .with_max_established_per_peer(Some(MAX_CONNECTIONS_PER_PEER)); diff --git a/boot_node/Cargo.toml b/boot_node/Cargo.toml index bb4dff5f8c6..133e39c4c6c 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "boot_node" -version = "1.4.0" +version = "1.5.0-rc.0" authors = ["Sigma Prime "] edition = "2018" diff --git a/common/eth2/Cargo.toml b/common/eth2/Cargo.toml index 2e684a6d7ae..7e6e12761bd 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -17,7 +17,7 @@ proto_array = { path = "../../consensus/proto_array", optional = true } serde_utils = { path = "../../consensus/serde_utils" } zeroize = { version = "1.1.1", features = ["zeroize_derive"] } eth2_keystore = { path = "../../crypto/eth2_keystore" } -libsecp256k1 = "0.5.0" +libsecp256k1 = "0.6.0" ring = "0.16.19" bytes = "1.0.1" account_utils = { path = "../../common/account_utils" } diff --git a/common/eth2_config/Cargo.toml b/common/eth2_config/Cargo.toml index 0cb3f1dfbc1..fe8708cd223 100644 --- a/common/eth2_config/Cargo.toml +++ b/common/eth2_config/Cargo.toml @@ -8,3 +8,4 @@ edition = "2018" serde = "1.0.116" serde_derive = "1.0.116" types = { path = "../../consensus/types" } +paste = "1.0.5" diff --git a/common/eth2_config/src/lib.rs b/common/eth2_config/src/lib.rs index c30dab5df7a..4ab3fba5cef 100644 --- a/common/eth2_config/src/lib.rs +++ b/common/eth2_config/src/lib.rs @@ -1,7 +1,16 @@ +//! This crate primarily exists to serve the `common/eth2_network_configs` crate, by providing the +//! canonical list of built-in-networks and some tooling to help include those configurations in the +//! `lighthouse` binary. +//! +//! It also provides some additional structs which are useful to other components of `lighthouse` +//! (e.g., `Eth2Config`). + use std::env; use std::path::PathBuf; use types::{ChainSpec, EthSpecId}; +pub use paste::paste; + // A macro is used to define this constant so it can be used with `include_bytes!`. #[macro_export] macro_rules! predefined_networks_dir { @@ -73,40 +82,157 @@ impl<'a> Eth2NetArchiveAndDirectory<'a> { } } -macro_rules! define_net { - ($title: ident, $macro_title: tt, $name: tt, $genesis_is_known: tt) => { - #[macro_use] - pub mod $title { - use super::*; - - pub const ETH2_NET_DIR: Eth2NetArchiveAndDirectory = Eth2NetArchiveAndDirectory { - name: $name, - unique_id: $name, - genesis_is_known: $genesis_is_known, - }; - - // A wrapper around `std::include_bytes` which includes a file from a specific network - // directory. Used by upstream crates to import files at compile time. - #[macro_export] - macro_rules! $macro_title { - ($base_dir: tt, $filename: tt) => { - include_bytes!(concat!( - $base_dir, - "/", - predefined_networks_dir!(), - "/", - $name, - "/", - $filename - )) +/// Indicates that the `genesis.ssz.zip` file is present on the filesystem. This means that the +/// deposit ceremony has concluded and the final genesis `BeaconState` is known. +const GENESIS_STATE_IS_KNOWN: bool = true; + +#[derive(Copy, Clone, Debug, PartialEq)] +pub struct HardcodedNet { + pub name: &'static str, + pub genesis_is_known: bool, + pub config: &'static [u8], + pub deploy_block: &'static [u8], + pub boot_enr: &'static [u8], + pub genesis_state_bytes: &'static [u8], +} + +/// Defines an `Eth2NetArchiveAndDirectory` for some network. +/// +/// It also defines a `include__bytes!` macro which provides a wrapper around +/// `std::include_bytes`, allowing the inclusion of bytes from the specific testnet directory. +macro_rules! define_archive { + ($name_ident: ident, $name_str: tt, $genesis_is_known: ident) => { + paste! { + #[macro_use] + pub mod $name_ident { + use super::*; + + pub const ETH2_NET_DIR: Eth2NetArchiveAndDirectory = Eth2NetArchiveAndDirectory { + name: $name_str, + unique_id: $name_str, + genesis_is_known: $genesis_is_known, }; + + /// A wrapper around `std::include_bytes` which includes a file from a specific network + /// directory. Used by upstream crates to import files at compile time. + #[macro_export] + macro_rules! [<include_ $name_ident _file>] { + ($this_crate: ident, $base_dir: tt, $filename: tt) => { + include_bytes!(concat!( + $base_dir, + "/", + $this_crate::predefined_networks_dir!(), + "/", + $name_str, + "/", + $filename + )) + }; + } } } }; } -define_net!(pyrmont, include_pyrmont_file, "pyrmont", true); +/// Creates a `HardcodedNet` definition for some network. +#[macro_export] +macro_rules! define_net { + ($this_crate: tt, $mod: ident, $include_file: tt) => {{ + use $this_crate::$mod::ETH2_NET_DIR; + + $this_crate::HardcodedNet { + name: ETH2_NET_DIR.name, + genesis_is_known: ETH2_NET_DIR.genesis_is_known, + config: $this_crate::$include_file!($this_crate, "../", "config.yaml"), + deploy_block: $this_crate::$include_file!($this_crate, "../", "deploy_block.txt"), + boot_enr: $this_crate::$include_file!($this_crate, "../", "boot_enr.yaml"), + genesis_state_bytes: $this_crate::$include_file!($this_crate, "../", "genesis.ssz"), + } + }}; +} + +/// Calls `define_net` on a list of networks, and then defines two more lists: +/// +/// - `HARDCODED_NETS`: a list of all the networks defined by this macro. +/// - `HARDCODED_NET_NAMES`: a list of the *names* of the networks defined by this macro. +#[macro_export] +macro_rules! define_nets { + ($this_crate: ident, $($name_ident: ident, $name_str: tt,)+) => { + $this_crate::paste! { + $( + const [<$name_ident:upper>]: $this_crate::HardcodedNet = $this_crate::define_net!($this_crate, $name_ident, [<include_ $name_ident _file>]); + )+ + const HARDCODED_NETS: &[$this_crate::HardcodedNet] = &[$([<$name_ident:upper>],)+]; + pub const HARDCODED_NET_NAMES: &[&'static str] = &[$($name_str,)+]; + } + }; +} + +/// The canonical macro for defining built-in network configurations. +/// +/// This macro will provide: +/// +/// - An `Eth2NetArchiveAndDirectory` for each network. +/// - `ETH2_NET_DIRS`: a list of all the above `Eth2NetArchiveAndDirectory`. +/// - The `instantiate_hardcoded_nets` macro (see its documentation). +/// +/// ## Design Justification +/// +/// Ultimately, this macro serves as a single list of all the networks. The reason it is structured +/// in such a complex web-of-macros way is because two requirements of built-in (hard-coded) networks: +/// +/// 1. We must use `std::include_bytes!` to "bake" arbitrary bytes (genesis states, etc) into the binary. +/// 2. We must use a `build.rs` script to decompress the genesis state from a zip file, before we +/// can include those bytes. +/// +/// Because of these two constraints, we must first define all of the networks and the paths to +/// their files in this crate. Then, we must use another crate (`eth2_network_configs`) to run a +/// `build.rs` which will unzip the genesis states. Then, that `eth2_network_configs` crate can +/// perform the final step of using `std::include_bytes` to bake the files (bytes) into the binary. +macro_rules! define_hardcoded_nets { + ($(($name_ident: ident, $name_str: tt, $genesis_is_known: ident)),+) => { + paste! { + $( + define_archive!($name_ident, $name_str, $genesis_is_known); + )+ + + pub const ETH2_NET_DIRS: &[Eth2NetArchiveAndDirectory<'static>] = &[$($name_ident::ETH2_NET_DIR,)+]; -define_net!(mainnet, include_mainnet_file, "mainnet", true); + /// This macro is designed to be called by an external crate. When called, it will + /// define in that external crate: + /// + /// - A `HardcodedNet` for each network. + /// - `HARDCODED_NETS`: a list of all the above `HardcodedNet`. + /// - `HARDCODED_NET_NAMES`: a list of all the names of the above `HardcodedNet` (as `&str`). + #[macro_export] + macro_rules! instantiate_hardcoded_nets { + ($this_crate: ident) => { + $this_crate::define_nets!($this_crate, $($name_ident, $name_str,)+); + } + } + } + }; +} -define_net!(prater, include_prater_file, "prater", true); +// Add a new "built-in" network by adding it to the list below. +// +// The last entry must not end with a comma, otherwise compilation will fail. +// +// This is the canonical place for defining the built-in network configurations that are present in +// the `common/eth2_network_config/built_in_network_configs` directory. +// +// Each net is defined as a three-tuple: +// +// 0. The name of the testnet as an "ident" (i.e. something that can be a Rust variable name). +// 1. The human-friendly name of the testnet (i.e. usually with "-" instead of "_"). +// 2. A bool indicating if the genesis state is known and present as a `genesis.ssz.zip`. +// +// The directory containing the testnet files should match the human-friendly name (element 1). +define_hardcoded_nets!( + (mainnet, "mainnet", GENESIS_STATE_IS_KNOWN), + (pyrmont, "pyrmont", GENESIS_STATE_IS_KNOWN), + (prater, "prater", GENESIS_STATE_IS_KNOWN), + (altair_devnet_0, "altair-devnet-0", GENESIS_STATE_IS_KNOWN), + (altair_devnet_1, "altair-devnet-1", GENESIS_STATE_IS_KNOWN), + (altair_devnet_2, "altair-devnet-2", GENESIS_STATE_IS_KNOWN) +); diff --git a/common/eth2_network_config/build.rs b/common/eth2_network_config/build.rs index d84dbde4d88..fa45fafa4e7 100644 --- a/common/eth2_network_config/build.rs +++ b/common/eth2_network_config/build.rs @@ -1,15 +1,9 @@ //! Extracts zipped genesis states on first run. -use eth2_config::{mainnet, prater, pyrmont, Eth2NetArchiveAndDirectory, GENESIS_FILE_NAME}; +use eth2_config::{Eth2NetArchiveAndDirectory, ETH2_NET_DIRS, GENESIS_FILE_NAME}; use std::fs::File; use std::io; use zip::ZipArchive; -const ETH2_NET_DIRS: &[Eth2NetArchiveAndDirectory<'static>] = &[ - mainnet::ETH2_NET_DIR, - pyrmont::ETH2_NET_DIR, - prater::ETH2_NET_DIR, -]; - fn main() { for network in ETH2_NET_DIRS { match uncompress_state(network) { diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-0/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/boot_enr.yaml new file mode 100644 index 00000000000..1d2d16d9d8a --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/boot_enr.yaml @@ -0,0 +1,3 @@ +# EF bootnode +# /ip4/3.125.155.250/udp/9000/p2p/16Uiu2HAm8JSAXCaRruMvWjmY4bdJQhGc6a73VdRxCEpKwp9q56N1 +- enr:-Ku4QOcLld1mPvi9bXxN468zT5ZAX6zHFABOgm6-G76AFaC8C7yOAocpOBgRUKvuxLp-EBt3IqpOLUBZcTiou6VYmtoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpBY9DG-GVBGmf__________gmlkgnY0gmlwhAN9m_qJc2VjcDI1NmsxoQK_TT5hHmoWJpZ4aSv1bdoD5noop1fWU54qz4Tj53t_1oN1ZHCCIyg diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-0/config.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/config.yaml new file mode 100644 index 00000000000..7b406ab3e60 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/config.yaml @@ -0,0 +1,73 @@ +# Altair interop devnet config + +# Extends the mainnet preset +PRESET_BASE: 'mainnet' + +CONFIG_NAME: "altair-devnet-0" + +# Genesis +# --------------------------------------------------------------- +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 10000 +# July 7, 2021, 12pm UTC +MIN_GENESIS_TIME: 1625659200 +# Location for the altair star is 19h 50m 46.99855 +GENESIS_FORK_VERSION: 0x19504699 +# 86400 seconds (1 day) +GENESIS_DELAY: 86400 + + +# Forking +# --------------------------------------------------------------- +# Some forks are disabled for now: +# - These may be re-assigned to another fork-version later +# - Temporarily set to max uint64 value: 2**64 - 1 + +# Altair +ALTAIR_FORK_VERSION: 0x01000000 +ALTAIR_FORK_EPOCH: 10 +# Merge +MERGE_FORK_VERSION: 0x02000000 +MERGE_FORK_EPOCH: 18446744073709551615 +# Sharding +SHARDING_FORK_VERSION: 0x03000000 +SHARDING_FORK_EPOCH: 18446744073709551615 + +# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D. +MIN_ANCHOR_POW_BLOCK_DIFFICULTY: 4294967296 + + +# Time parameters +# --------------------------------------------------------------- +# 12 seconds +SECONDS_PER_SLOT: 12 +# 14 (estimate from Eth1 mainnet) +SECONDS_PER_ETH1_BLOCK: 14 +# 2**8 (= 256) epochs ~27 hours +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 +# 2**8 (= 256) epochs ~27 hours +SHARD_COMMITTEE_PERIOD: 256 +# 2**11 (= 2,048) Eth1 blocks ~8 hours +ETH1_FOLLOW_DISTANCE: 2048 + + +# Validator cycle +# --------------------------------------------------------------- +# 2**2 (= 4) +INACTIVITY_SCORE_BIAS: 4 +# 2**4 (= 16) +INACTIVITY_SCORE_RECOVERY_RATE: 16 +# 2**4 * 10**9 (= 16,000,000,000) Gwei +EJECTION_BALANCE: 16000000000 +# 2**2 (= 4) +MIN_PER_EPOCH_CHURN_LIMIT: 4 +# 2**16 (= 65,536) +CHURN_LIMIT_QUOTIENT: 65536 + + +# Deposit contract +# --------------------------------------------------------------- +# Ethereum Goerli testnet +DEPOSIT_CHAIN_ID: 5 +DEPOSIT_NETWORK_ID: 5 +DEPOSIT_CONTRACT_ADDRESS: 0x3fe221a147E62eC697723fBfB4dd9505F4F966c7 + diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-0/deploy_block.txt b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/deploy_block.txt new file mode 100644 index 00000000000..cebdc42f6a9 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/deploy_block.txt @@ -0,0 +1 @@ +5088851 diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-0/genesis.ssz.zip b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/genesis.ssz.zip new file mode 100644 index 00000000000..cd1c42b70cf Binary files /dev/null and b/common/eth2_network_config/built_in_network_configs/altair-devnet-0/genesis.ssz.zip differ diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-1/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/boot_enr.yaml new file mode 100644 index 00000000000..2322d7cdbb1 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/boot_enr.yaml @@ -0,0 +1,3 @@ +# EF bootnode +# /ip4/18.192.182.103/udp/9000/p2p/16Uiu2HAmVHXRwinNmyfyN9jVTR7wbKuGd8dEkSLX3iTQThpMNAXi +- enr:-Ku4QJTSfjugOE_5xyEDYceUlHTd8QiP1QF5q4o6APwk9V7QXV6POQKfhXixhLNMI-_-tGRRorbzR_vMAFe_vQT5XWYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCFITryGVBHAP__________gmlkgnY0gmlwhBLAtmeJc2VjcDI1NmsxoQP3FwrhFYB60djwRjAoOjttq6du94DtkQuaN99wvgqaIYN1ZHCCIyg diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-1/config.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/config.yaml new file mode 100644 index 00000000000..329e321fa24 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/config.yaml @@ -0,0 +1,73 @@ +# Altair interop devnet config + +# Extends the mainnet preset +PRESET_BASE: 'mainnet' + +CONFIG_NAME: "altair-devnet-1" + +# Genesis +# --------------------------------------------------------------- +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 10000 +# July 14, 2021, 12pm UTC +MIN_GENESIS_TIME: 1626264000 +# Location for the altair star is 19h 50m 46.99855 + 1, since its the second devnet +GENESIS_FORK_VERSION: 0x19504700 +# 86400 seconds (1 day) +GENESIS_DELAY: 86400 + + +# Forking +# --------------------------------------------------------------- +# Some forks are disabled for now: +# - These may be re-assigned to another fork-version later +# - Temporarily set to max uint64 value: 2**64 - 1 + +# Altair +# increasing altair fork version by 1 to differentiate from altair-devnet-0 +ALTAIR_FORK_VERSION: 0x01000001 +ALTAIR_FORK_EPOCH: 10 +# Merge +MERGE_FORK_VERSION: 0x02000000 +MERGE_FORK_EPOCH: 18446744073709551615 +# Sharding +SHARDING_FORK_VERSION: 0x03000000 +SHARDING_FORK_EPOCH: 18446744073709551615 + +# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D. +MIN_ANCHOR_POW_BLOCK_DIFFICULTY: 4294967296 + + +# Time parameters +# --------------------------------------------------------------- +# 12 seconds +SECONDS_PER_SLOT: 12 +# 14 (estimate from Eth1 mainnet) +SECONDS_PER_ETH1_BLOCK: 14 +# 2**8 (= 256) epochs ~27 hours +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 +# 2**8 (= 256) epochs ~27 hours +SHARD_COMMITTEE_PERIOD: 256 +# 2**11 (= 2,048) Eth1 blocks ~8 hours +ETH1_FOLLOW_DISTANCE: 2048 + + +# Validator cycle +# --------------------------------------------------------------- +# 2**2 (= 4) +INACTIVITY_SCORE_BIAS: 4 +# 2**4 (= 16) +INACTIVITY_SCORE_RECOVERY_RATE: 16 +# 2**4 * 10**9 (= 16,000,000,000) Gwei +EJECTION_BALANCE: 16000000000 +# 2**2 (= 4) +MIN_PER_EPOCH_CHURN_LIMIT: 4 +# 2**16 (= 65,536) +CHURN_LIMIT_QUOTIENT: 65536 + + +# Deposit contract +# --------------------------------------------------------------- +# Ethereum Goerli testnet +DEPOSIT_CHAIN_ID: 5 +DEPOSIT_NETWORK_ID: 5 +DEPOSIT_CONTRACT_ADDRESS: 0x5004957f885F5A5408e6Ff50B338435aD3fE4E17 diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-1/deploy_block.txt b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/deploy_block.txt new file mode 100644 index 00000000000..baa7718f058 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/deploy_block.txt @@ -0,0 +1 @@ +5110538 diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-1/genesis.ssz.zip b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/genesis.ssz.zip new file mode 100644 index 00000000000..d8536ccbb81 Binary files /dev/null and b/common/eth2_network_config/built_in_network_configs/altair-devnet-1/genesis.ssz.zip differ diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-2/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/boot_enr.yaml new file mode 100644 index 00000000000..e0e67ac4101 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/boot_enr.yaml @@ -0,0 +1,3 @@ +# EF bootnode +# # /ip4/18.184.200.173/udp/9000/p2p/16Uiu2HAm8KdBVKsRWCGa2T5wpMjCVnYqvYDiN2CFJeEmmo3t3MbU +- enr:-Ku4QLEvQ0IJnMGeZn1RsiPXvIho0LH8_XmHzq9FiF1uuwAdcFxt94-qfoT7VrBxU3-Nt7t-R3luvFhJlcCQI6VDV0oBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCKO0zOGVBHAf__________gmlkgnY0gmlwhBK4yK2Jc2VjcDI1NmsxoQK_m0f1DzDc9Cjrspm36zuRa7072HSiMGYWLsKiVSbP34N1ZHCCIyg diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-2/config.yaml b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/config.yaml new file mode 100644 index 00000000000..458d0e356f8 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/config.yaml @@ -0,0 +1,73 @@ +# Altair interop devnet config + +# Extends the mainnet preset +PRESET_BASE: 'mainnet' + +CONFIG_NAME: "altair-devnet-2" + +# Genesis +# --------------------------------------------------------------- +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 13000 +# July 28, 2021, 12pm UTC +MIN_GENESIS_TIME: 1627473600 +# Location for the altair star is 19h 50m 46.99855 + 2, since its the third devnet +GENESIS_FORK_VERSION: 0x19504701 +# 86400 seconds (1 day) +GENESIS_DELAY: 86400 + + +# Forking +# --------------------------------------------------------------- +# Some forks are disabled for now: +# - These may be re-assigned to another fork-version later +# - Temporarily set to max uint64 value: 2**64 - 1 + +# Altair +# increasing altair fork version by 1 to differentiate from altair-devnet-1 +ALTAIR_FORK_VERSION: 0x01000002 +ALTAIR_FORK_EPOCH: 10 +# Merge +MERGE_FORK_VERSION: 0x02000000 +MERGE_FORK_EPOCH: 18446744073709551615 +# Sharding +SHARDING_FORK_VERSION: 0x03000000 +SHARDING_FORK_EPOCH: 18446744073709551615 + +# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D. +MIN_ANCHOR_POW_BLOCK_DIFFICULTY: 4294967296 + + +# Time parameters +# --------------------------------------------------------------- +# 12 seconds +SECONDS_PER_SLOT: 12 +# 14 (estimate from Eth1 mainnet) +SECONDS_PER_ETH1_BLOCK: 14 +# 2**8 (= 256) epochs ~27 hours +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 +# 2**8 (= 256) epochs ~27 hours +SHARD_COMMITTEE_PERIOD: 256 +# 2**11 (= 2,048) Eth1 blocks ~8 hours +ETH1_FOLLOW_DISTANCE: 2048 + + +# Validator cycle +# --------------------------------------------------------------- +# 2**2 (= 4) +INACTIVITY_SCORE_BIAS: 4 +# 2**4 (= 16) +INACTIVITY_SCORE_RECOVERY_RATE: 16 +# 2**4 * 10**9 (= 16,000,000,000) Gwei +EJECTION_BALANCE: 16000000000 +# 2**2 (= 4) +MIN_PER_EPOCH_CHURN_LIMIT: 4 +# 2**16 (= 65,536) +CHURN_LIMIT_QUOTIENT: 65536 + + +# Deposit contract +# --------------------------------------------------------------- +# Ethereum Goerli testnet +DEPOSIT_CHAIN_ID: 5 +DEPOSIT_NETWORK_ID: 5 +DEPOSIT_CONTRACT_ADDRESS: 0xF40eb070317e56F243ea1968882d2938D4125a69 diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-2/deploy_block.txt b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/deploy_block.txt new file mode 100644 index 00000000000..43f58df4d85 --- /dev/null +++ b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/deploy_block.txt @@ -0,0 +1 @@ +5208017 diff --git a/common/eth2_network_config/built_in_network_configs/altair-devnet-2/genesis.ssz.zip b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/genesis.ssz.zip new file mode 100644 index 00000000000..4e2c2221952 Binary files /dev/null and b/common/eth2_network_config/built_in_network_configs/altair-devnet-2/genesis.ssz.zip differ diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index 4f38905931c..1fa7a52321a 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -1,6 +1,18 @@ -use eth2_config::{predefined_networks_dir, *}; +//! Provides the `Eth2NetworkConfig` struct which defines the configuration of an eth2 network or +//! test-network (aka "testnet"). +//! +//! Whilst the `Eth2NetworkConfig` struct can be used to read a specification from a directory at +//! runtime, this crate also includes some pre-defined network configurations "built-in" to the +//! binary itself (the most notable of these being the "mainnet" configuration). When a network is +//! "built-in", the genesis state and configuration files is included in the final binary via the +//! `std::include_bytes` macro. This provides convenience to the user, the binary is self-sufficient +//! and does not require the configuration to be read from the filesystem at runtime. +//! +//! To add a new built-in testnet, add it to the `define_hardcoded_nets` invocation in the `eth2_config` +//! crate. use enr::{CombinedKey, Enr}; +use eth2_config::{instantiate_hardcoded_nets, HardcodedNet}; use std::fs::{create_dir_all, File}; use std::io::{Read, Write}; use std::path::PathBuf; @@ -11,36 +23,13 @@ pub const BOOT_ENR_FILE: &str = "boot_enr.yaml"; pub const GENESIS_STATE_FILE: &str = "genesis.ssz"; pub const BASE_CONFIG_FILE: &str = "config.yaml"; -#[derive(Copy, Clone, Debug, PartialEq)] -pub struct HardcodedNet { - pub name: &'static str, - pub genesis_is_known: bool, - pub config: &'static [u8], - pub deploy_block: &'static [u8], - pub boot_enr: &'static [u8], - pub genesis_state_bytes: &'static [u8], -} - -macro_rules! define_net { - ($mod: ident, $include_file: tt) => {{ - use eth2_config::$mod::ETH2_NET_DIR; - - HardcodedNet { - name: ETH2_NET_DIR.name, - genesis_is_known: ETH2_NET_DIR.genesis_is_known, - config: $include_file!("../", "config.yaml"), - deploy_block: $include_file!("../", "deploy_block.txt"), - boot_enr: $include_file!("../", "boot_enr.yaml"), - genesis_state_bytes: $include_file!("../", "genesis.ssz"), - } - }}; -} - -const PYRMONT: HardcodedNet = define_net!(pyrmont, include_pyrmont_file); -const MAINNET: HardcodedNet = define_net!(mainnet, include_mainnet_file); -const PRATER: HardcodedNet = define_net!(prater, include_prater_file); +// Creates definitions for: +// +// - Each of the `HardcodedNet` values (e.g., `MAINNET`, `PYRMONT`, etc). +// - `HARDCODED_NETS: &[HardcodedNet]` +// - `HARDCODED_NET_NAMES: &[&'static str]` +instantiate_hardcoded_nets!(eth2_config); -const HARDCODED_NETS: &[HardcodedNet] = &[PYRMONT, MAINNET, PRATER]; pub const DEFAULT_HARDCODED_NETWORK: &str = "mainnet"; /// Specifies an Eth2 network. @@ -241,6 +230,19 @@ mod tests { type E = MainnetEthSpec; + #[test] + fn default_network_exists() { + assert!(HARDCODED_NET_NAMES.contains(&DEFAULT_HARDCODED_NETWORK)); + } + + #[test] + fn hardcoded_testnet_names() { + assert_eq!(HARDCODED_NET_NAMES.len(), HARDCODED_NETS.len()); + for (name, net) in HARDCODED_NET_NAMES.iter().zip(HARDCODED_NETS.iter()) { + assert_eq!(name, &net.name); + } + } + #[test] fn mainnet_config_eq_chain_spec() { let config = Eth2NetworkConfig::from_hardcoded_net(&MAINNET).unwrap(); diff --git a/common/lighthouse_version/src/lib.rs b/common/lighthouse_version/src/lib.rs index 06dec1c0dee..559e5962cf3 100644 --- a/common/lighthouse_version/src/lib.rs +++ b/common/lighthouse_version/src/lib.rs @@ -16,7 +16,7 @@ pub const VERSION: &str = git_version!( // NOTE: using --match instead of --exclude for compatibility with old Git "--match=thiswillnevermatchlol" ], - prefix = "Lighthouse/v1.4.0-", + prefix = "Lighthouse/v1.5.0-rc.0-", fallback = "unknown" ); diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 1d311ec8cd9..6a021345429 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lcli" description = "Lighthouse CLI (modeled after zcli)" -version = "1.4.0" +version = "1.5.0-rc.0" authors = ["Paul Hauner <paul@paulhauner.com>"] edition = "2018" diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 0598998a470..8b5a1129d52 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lighthouse" -version = "1.4.0" +version = "1.5.0-rc.0" authors = ["Sigma Prime <contact@sigmaprime.io>"] edition = "2018" autotests = false diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 547e8b8c863..ccfe121efe9 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -8,7 +8,7 @@ use clap_utils::flags::DISABLE_MALLOC_TUNING_FLAG; use env_logger::{Builder, Env}; use environment::EnvironmentBuilder; use eth2_hashing::have_sha_extensions; -use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK}; +use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK, HARDCODED_NET_NAMES}; use lighthouse_version::VERSION; use malloc_utils::configure_memory_allocator; use slog::{crit, info, warn}; @@ -127,7 +127,7 @@ fn main() { .long("network") .value_name("network") .help("Name of the Eth2 chain Lighthouse will sync and follow.") - .possible_values(&["pyrmont", "mainnet", "prater"]) + .possible_values(HARDCODED_NET_NAMES) .conflicts_with("testnet-dir") .takes_value(true) .global(true)