mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 11:41:51 +00:00
Update all crates versions
This commit is contained in:
733
Cargo.lock
generated
733
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ members = [
|
||||
"eth2/utils/eth2_testnet_config",
|
||||
"eth2/utils/logging",
|
||||
"eth2/utils/eth2_hashing",
|
||||
"eth2/utils/hashmap_delay",
|
||||
"eth2/utils/hashset_delay",
|
||||
"eth2/utils/lighthouse_metrics",
|
||||
"eth2/utils/merkle_proof",
|
||||
"eth2/utils/int_to_bytes",
|
||||
|
||||
@@ -5,26 +5,26 @@ authors = ["Paul Hauner <paul@paulhauner.com>", "Luke Anderson <luke@sigmaprime.
|
||||
edition = "2018"
|
||||
|
||||
[dev-dependencies]
|
||||
tempdir = "0.3"
|
||||
tempdir = "0.3.7"
|
||||
|
||||
[dependencies]
|
||||
bls = { path = "../eth2/utils/bls" }
|
||||
clap = "2.33.0"
|
||||
slog = "2.5.2"
|
||||
slog-term = "2.4.2"
|
||||
slog-async = "2.3.0"
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
types = { path = "../eth2/types" }
|
||||
dirs = "2.0.2"
|
||||
environment = { path = "../lighthouse/environment" }
|
||||
deposit_contract = { path = "../eth2/utils/deposit_contract" }
|
||||
libc = "0.2.65"
|
||||
eth2_ssz = { path = "../eth2/utils/ssz" }
|
||||
eth2_ssz_derive = { path = "../eth2/utils/ssz_derive" }
|
||||
hex = "0.3"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
hex = "0.4.2"
|
||||
validator_client = { path = "../validator_client" }
|
||||
rayon = "1.2.0"
|
||||
rayon = "1.3.0"
|
||||
eth2_testnet_config = { path = "../eth2/utils/eth2_testnet_config" }
|
||||
web3 = "0.10.0"
|
||||
futures = "0.1.25"
|
||||
futures = "0.3.4"
|
||||
clap_utils = { path = "../eth2/utils/clap_utils" }
|
||||
tokio = "0.1.22"
|
||||
tokio = "0.2.20"
|
||||
|
||||
@@ -22,23 +22,23 @@ store = { path = "./store" }
|
||||
client = { path = "client" }
|
||||
version = { path = "version" }
|
||||
clap = "2.33.0"
|
||||
rand = "0.7.2"
|
||||
rand = "0.7.3"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
|
||||
slog-term = "2.4.2"
|
||||
slog-async = "2.3.0"
|
||||
ctrlc = { version = "3.1.3", features = ["termination"] }
|
||||
tokio = "0.1.22"
|
||||
tokio-timer = "0.2.12"
|
||||
exit-future = "0.1.4"
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
ctrlc = { version = "3.1.4", features = ["termination"] }
|
||||
tokio = "0.2.20"
|
||||
tokio-timer = "0.2.13"
|
||||
exit-future = "0.2.0"
|
||||
env_logger = "0.7.1"
|
||||
dirs = "2.0.2"
|
||||
logging = { path = "../eth2/utils/logging" }
|
||||
futures = "0.1.29"
|
||||
futures = "0.3.4"
|
||||
environment = { path = "../lighthouse/environment" }
|
||||
genesis = { path = "genesis" }
|
||||
eth2_testnet_config = { path = "../eth2/utils/eth2_testnet_config" }
|
||||
eth2-libp2p = { path = "./eth2-libp2p" }
|
||||
eth2_ssz = { path = "../eth2/utils/ssz" }
|
||||
toml = "0.5.4"
|
||||
serde = "1.0.102"
|
||||
eth2_ssz = "0.1.2"
|
||||
toml = "0.5.6"
|
||||
serde = "1.0.106"
|
||||
clap_utils = { path = "../eth2/utils/clap_utils" }
|
||||
|
||||
@@ -11,18 +11,18 @@ write_ssz_files = [] # Writes debugging .ssz files to /tmp during block process
|
||||
eth2_config = { path = "../../eth2/utils/eth2_config" }
|
||||
merkle_proof = { path = "../../eth2/utils/merkle_proof" }
|
||||
store = { path = "../store" }
|
||||
parking_lot = "0.9.0"
|
||||
parking_lot = "0.10.2"
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics" }
|
||||
log = "0.4.8"
|
||||
operation_pool = { path = "../../eth2/operation_pool" }
|
||||
rayon = "1.2.0"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
rayon = "1.3.0"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_yaml = "0.8.11"
|
||||
serde_json = "1.0.41"
|
||||
serde_json = "1.0.52"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
sloggers = "0.3.4"
|
||||
sloggers = "1.0.0"
|
||||
slot_clock = { path = "../../eth2/utils/slot_clock" }
|
||||
eth2_hashing = "0.1.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
@@ -31,13 +31,13 @@ eth2_ssz_derive = "0.1.0"
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
tree_hash = "0.1.0"
|
||||
types = { path = "../../eth2/types" }
|
||||
tokio = "0.1.22"
|
||||
tokio = "0.2.20"
|
||||
eth1 = { path = "../eth1" }
|
||||
websocket_server = { path = "../websocket_server" }
|
||||
futures = "0.3"
|
||||
futures = "0.3.4"
|
||||
genesis = { path = "../genesis" }
|
||||
integer-sqrt = "0.1"
|
||||
rand = "0.7.2"
|
||||
integer-sqrt = "0.1.3"
|
||||
rand = "0.7.3"
|
||||
proto_array_fork_choice = { path = "../../eth2/proto_array_fork_choice" }
|
||||
lru = "0.4.3"
|
||||
tempfile = "3.1.0"
|
||||
|
||||
@@ -5,8 +5,8 @@ authors = ["Age Manning <Age@AgeManning.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dev-dependencies]
|
||||
sloggers = "0.3.4"
|
||||
toml = "^0.5"
|
||||
sloggers = "1.0.0"
|
||||
toml = "0.5.6"
|
||||
|
||||
[dependencies]
|
||||
beacon_chain = { path = "../beacon_chain" }
|
||||
@@ -15,27 +15,27 @@ network = { path = "../network" }
|
||||
timer = { path = "../timer" }
|
||||
eth2-libp2p = { path = "../eth2-libp2p" }
|
||||
rest_api = { path = "../rest_api" }
|
||||
parking_lot = "0.9.0"
|
||||
parking_lot = "0.10.2"
|
||||
websocket_server = { path = "../websocket_server" }
|
||||
prometheus = "0.7.0"
|
||||
prometheus = "0.8.0"
|
||||
types = { path = "../../eth2/types" }
|
||||
tree_hash = "0.1.0"
|
||||
eth2_config = { path = "../../eth2/utils/eth2_config" }
|
||||
slot_clock = { path = "../../eth2/utils/slot_clock" }
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
error-chain = "0.12.1"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
error-chain = "0.12.2"
|
||||
serde_yaml = "0.8.11"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
slog-async = "2.3.0"
|
||||
tokio = "0.1.22"
|
||||
slog-async = "2.5.0"
|
||||
tokio = "0.2.20"
|
||||
dirs = "2.0.2"
|
||||
futures = "0.1.29"
|
||||
reqwest = "0.9.22"
|
||||
url = "2.1.0"
|
||||
futures = "0.3.4"
|
||||
reqwest = "0.10.4"
|
||||
url = "2.1.1"
|
||||
eth1 = { path = "../eth1" }
|
||||
genesis = { path = "../genesis" }
|
||||
environment = { path = "../../lighthouse/environment" }
|
||||
eth2_ssz = { path = "../../eth2/utils/ssz" }
|
||||
eth2_ssz = "0.1.2"
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics" }
|
||||
|
||||
@@ -7,26 +7,26 @@ edition = "2018"
|
||||
[dev-dependencies]
|
||||
eth1_test_rig = { path = "../../tests/eth1_test_rig" }
|
||||
environment = { path = "../../lighthouse/environment" }
|
||||
toml = "^0.5"
|
||||
toml = "0.5.6"
|
||||
web3 = "0.10.0"
|
||||
sloggers = "0.3.4"
|
||||
sloggers = "1.0.0"
|
||||
|
||||
[dependencies]
|
||||
reqwest = "0.10"
|
||||
futures = {version = "0.3", features = ["compat"]}
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
hex = "0.3"
|
||||
reqwest = "0.10.4"
|
||||
futures = { version = "0.3.4", features = ["compat"] }
|
||||
serde_json = "1.0.52"
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
hex = "0.4.2"
|
||||
types = { path = "../../eth2/types"}
|
||||
merkle_proof = { path = "../../eth2/utils/merkle_proof"}
|
||||
eth2_ssz = { path = "../../eth2/utils/ssz"}
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
tree_hash = { path = "../../eth2/utils/tree_hash"}
|
||||
eth2_hashing = { path = "../../eth2/utils/eth2_hashing"}
|
||||
parking_lot = "0.7"
|
||||
slog = "^2.2.3"
|
||||
tokio = { version = "0.2", features = ["full"] }
|
||||
tree_hash = "0.1.0"
|
||||
eth2_hashing = "0.1.0"
|
||||
parking_lot = "0.10.2"
|
||||
slog = "2.5.2"
|
||||
tokio = { version = "0.2.20", features = ["full"] }
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
libflate = "0.1"
|
||||
libflate = "1.0.0"
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics"}
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
@@ -7,7 +7,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
hex = "0.4.2"
|
||||
types = { path = "../../eth2/types" }
|
||||
hashmap_delay = { path = "../../eth2/utils/hashmap_delay" }
|
||||
hashset_delay = { path = "../../eth2/utils/hashset_delay" }
|
||||
eth2_ssz_types = { path = "../../eth2/utils/ssz_types" }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
serde_derive = "1.0.106"
|
||||
@@ -20,7 +20,7 @@ futures = "0.3.4"
|
||||
error-chain = "0.12.2"
|
||||
dirs = "2.0.2"
|
||||
fnv = "1.0.6"
|
||||
unsigned-varint = "0.3.3"
|
||||
unsigned-varint = { git = "https://github.com/sigp/unsigned-varint", branch = "latest-codecs", features = ["codec"] }
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics" }
|
||||
smallvec = "1.4.0"
|
||||
|
||||
@@ -4,6 +4,7 @@ use crate::rpc::*;
|
||||
use crate::types::{GossipEncoding, GossipKind, GossipTopic};
|
||||
use crate::{error, Enr, NetworkConfig, NetworkGlobals, PubsubMessage, TopicHash};
|
||||
use discv5::Discv5Event;
|
||||
use futures::prelude::*;
|
||||
use libp2p::{
|
||||
core::{identity::Keypair, ConnectedPoint},
|
||||
gossipsub::{Gossipsub, GossipsubEvent, MessageId},
|
||||
|
||||
@@ -118,6 +118,7 @@ impl CombinedKeyExt for CombinedKey {
|
||||
fn peer_id_to_node_id(peer_id: &PeerId) -> Option<discv5::enr::NodeId> {
|
||||
let bytes = peer_id.as_bytes();
|
||||
// must be the identity hash
|
||||
/* To be updated
|
||||
if bytes.len() == 34 && bytes[0] == 0x00 {
|
||||
// left over is potentially secp256k1 key
|
||||
|
||||
@@ -130,9 +131,11 @@ fn peer_id_to_node_id(peer_id: &PeerId) -> Option<discv5::enr::NodeId> {
|
||||
return Some(discv5::enr::NodeId::parse(&output).expect("Must be correct length"));
|
||||
}
|
||||
}
|
||||
*/
|
||||
None
|
||||
}
|
||||
|
||||
/*
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::convert::TryInto;
|
||||
@@ -161,3 +164,4 @@ mod tests {
|
||||
assert_eq!(enr.node_id(), node_id);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -386,7 +386,7 @@ impl<TSpec: EthSpec> NetworkBehaviour for Discovery<TSpec> {
|
||||
// ENR's may have multiple Multiaddrs. The multi-addr associated with the UDP
|
||||
// port is removed, which is assumed to be associated with the discv5 protocol (and
|
||||
// therefore irrelevant for other libp2p components).
|
||||
let out_list = enr.multiaddr();
|
||||
let mut out_list = enr.multiaddr();
|
||||
out_list.retain(|addr| {
|
||||
addr.iter()
|
||||
.find(|v| match v {
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::rpc::{MetaData, Protocol, RPCError, RPCResponseErrorCode};
|
||||
use crate::{NetworkGlobals, PeerId};
|
||||
use futures::prelude::*;
|
||||
use futures::Stream;
|
||||
use hashmap_delay::HashSetDelay;
|
||||
use hashset_delay::HashSetDelay;
|
||||
use libp2p::identify::IdentifyInfo;
|
||||
use slog::{crit, debug, error, warn};
|
||||
use smallvec::SmallVec;
|
||||
@@ -453,7 +453,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
|
||||
impl<TSpec: EthSpec> Stream for PeerManager<TSpec> {
|
||||
type Item = PeerManagerEvent;
|
||||
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
// poll the timeouts for pings and status'
|
||||
loop {
|
||||
match self.ping_peers.poll_next_unpin(cx) {
|
||||
|
||||
@@ -203,7 +203,7 @@ impl<TSpec: EthSpec> Decoder for SSZOutboundCodec<TSpec> {
|
||||
match self.inner.decode(src).map_err(RPCError::from) {
|
||||
Ok(Some(mut packet)) => {
|
||||
// take the bytes from the buffer
|
||||
let raw_bytes = packet.take();
|
||||
let raw_bytes = packet.split();
|
||||
|
||||
match self.protocol.message_name {
|
||||
Protocol::Status => match self.protocol.version {
|
||||
|
||||
@@ -119,7 +119,7 @@ impl<TSpec: EthSpec> Decoder for SSZSnappyInboundCodec<TSpec> {
|
||||
// `n` is how many bytes the reader read in the compressed stream
|
||||
let n = reader.get_ref().position();
|
||||
self.len = None;
|
||||
src.split_to(n as usize);
|
||||
let _read_bytes = src.split_to(n as usize);
|
||||
match self.protocol.message_name {
|
||||
Protocol::Status => match self.protocol.version {
|
||||
Version::V1 => Ok(Some(RPCRequest::Status(StatusMessage::from_ssz_bytes(
|
||||
@@ -264,7 +264,7 @@ impl<TSpec: EthSpec> Decoder for SSZSnappyOutboundCodec<TSpec> {
|
||||
// `n` is how many bytes the reader read in the compressed stream
|
||||
let n = reader.get_ref().position();
|
||||
self.len = None;
|
||||
src.split_to(n as usize);
|
||||
let _read_byts = src.split_to(n as usize);
|
||||
match self.protocol.message_name {
|
||||
Protocol::Status => match self.protocol.version {
|
||||
Version::V1 => Ok(Some(RPCResponse::Status(
|
||||
@@ -336,7 +336,7 @@ impl<TSpec: EthSpec> OutboundCodec<RPCRequest<TSpec>> for SSZSnappyOutboundCodec
|
||||
// `n` is how many bytes the reader read in the compressed stream
|
||||
let n = reader.get_ref().position();
|
||||
self.len = None;
|
||||
src.split_to(n as usize);
|
||||
let _read_bytes = src.split_to(n as usize);
|
||||
Ok(Some(ErrorMessage::from_ssz_bytes(&decoded_buffer)?))
|
||||
}
|
||||
Err(e) => match e.kind() {
|
||||
|
||||
@@ -466,6 +466,13 @@ where
|
||||
};
|
||||
error!(self.log, "Attempted sending multiple responses to a single response request");
|
||||
}
|
||||
InboundSubstreamState::ResponsePendingFlush { substream, .. } => {
|
||||
*substream_state = InboundSubstreamState::ResponsePendingFlush {
|
||||
substream,
|
||||
closing: true,
|
||||
};
|
||||
error!(self.log, "Attempted sending multiple responses to a single response request");
|
||||
}
|
||||
InboundSubstreamState::Poisoned => {
|
||||
crit!(self.log, "Poisoned inbound substream");
|
||||
unreachable!("Coding error: Poisoned substream");
|
||||
@@ -510,7 +517,7 @@ where
|
||||
ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Select(
|
||||
NegotiationError::ProtocolError(e),
|
||||
)) => match e {
|
||||
ProtocolError::IoError(io_err) => RPCError::IoError(io_err),
|
||||
ProtocolError::IoError(io_err) => RPCError::IoError(io_err.to_string()),
|
||||
ProtocolError::InvalidProtocol => {
|
||||
RPCError::InternalError("Protocol was deemed invalid")
|
||||
}
|
||||
@@ -578,7 +585,7 @@ where
|
||||
"Could not poll inbound stream timer",
|
||||
)));
|
||||
}
|
||||
Poll::Pending => break,
|
||||
Poll::Pending | Poll::Ready(None) => break,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +612,7 @@ where
|
||||
"Could not poll outbound stream timer",
|
||||
)));
|
||||
}
|
||||
Poll::Pending => break,
|
||||
Poll::Pending | Poll::Ready(None) => break,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,7 +648,7 @@ where
|
||||
}
|
||||
Err(e) => {
|
||||
// error with sending in the codec
|
||||
error!(self.log, "Error sending RPC message"; "message" => message.to_string());
|
||||
error!(self.log, "Error sending RPC message"; "error" => e.to_string());
|
||||
// keep connection with the peer and return the
|
||||
// stream to awaiting response if this message
|
||||
// wasn't closing the stream
|
||||
@@ -701,7 +708,7 @@ where
|
||||
}
|
||||
Poll::Ready(Err(e)) => {
|
||||
// error during flush
|
||||
error!(self.log, "Error sending flushing RPC message");
|
||||
error!(self.log, "Error sending flushing RPC message"; "error" => e.to_string());
|
||||
// close the stream if required
|
||||
// TODO: Duplicate code
|
||||
if closing {
|
||||
|
||||
@@ -10,19 +10,18 @@ use crate::rpc::{
|
||||
},
|
||||
methods::ResponseTermination,
|
||||
};
|
||||
use futures::future::*;
|
||||
use futures::future::Ready;
|
||||
use futures::prelude::*;
|
||||
use futures::prelude::{AsyncRead, AsyncWrite};
|
||||
use libp2p::core::{upgrade, InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeInfo};
|
||||
use libp2p::core::{InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeInfo};
|
||||
use std::io;
|
||||
use std::marker::PhantomData;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use std::time::Duration;
|
||||
use tokio_io_timeout::TimeoutStream;
|
||||
use tokio_util::{
|
||||
codec::Framed,
|
||||
compat::{Compat, FuturesAsyncReadCompatExt, FuturesAsyncWriteCompatExt},
|
||||
compat::{Compat, FuturesAsyncReadCompatExt},
|
||||
};
|
||||
use types::EthSpec;
|
||||
|
||||
@@ -375,8 +374,10 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
let socket = Framed::new(socket, codec);
|
||||
Box::pin(future::join(socket.send(self), future::ok(socket)).map(|(_, socket)| socket))
|
||||
let mut socket = Framed::new(socket, codec);
|
||||
|
||||
let future = async { socket.send(self).await.map(|_| socket) };
|
||||
Box::pin(future)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +412,7 @@ impl From<ssz::DecodeError> for RPCError {
|
||||
}
|
||||
}
|
||||
impl From<tokio::time::Elapsed> for RPCError {
|
||||
fn from(err: tokio::time::Elapsed) -> Self {
|
||||
fn from(_: tokio::time::Elapsed) -> Self {
|
||||
RPCError::StreamTimeout
|
||||
}
|
||||
}
|
||||
@@ -444,7 +445,7 @@ impl std::error::Error for RPCError {
|
||||
match *self {
|
||||
// NOTE: this does have a source
|
||||
RPCError::SSZDecodeError(_) => None,
|
||||
RPCError::IoError(ref err) => Some(err),
|
||||
RPCError::IoError(_) => None,
|
||||
RPCError::StreamTimeout => None,
|
||||
RPCError::UnsupportedProtocol => None,
|
||||
RPCError::IncompleteStream => None,
|
||||
@@ -469,6 +470,7 @@ impl<TSpec: EthSpec> std::fmt::Display for RPCRequest<TSpec> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/// Converts a futures AsyncRead + AsyncWrite object to a tokio::AsyncRead + tokio::AsyncWrite
|
||||
/// object.
|
||||
struct TokioNegotiatedStream<T: AsyncRead + AsyncWrite + Unpin>(T);
|
||||
@@ -498,3 +500,4 @@ impl<T: AsyncRead + AsyncWrite + Unpin> tokio::io::AsyncWrite for TokioNegotiate
|
||||
Pin::new(&mut self.0).poll_close(cx)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -182,7 +182,7 @@ impl<TSpec: EthSpec> Service<TSpec> {
|
||||
impl<TSpec: EthSpec> Stream for Service<TSpec> {
|
||||
type Item = Result<BehaviourEvent<TSpec>, error::Error>;
|
||||
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
loop {
|
||||
match self.swarm.poll_next_unpin(cx) {
|
||||
Poll::Ready(Some(event)) => {
|
||||
@@ -190,7 +190,6 @@ impl<TSpec: EthSpec> Stream for Service<TSpec> {
|
||||
}
|
||||
Poll::Ready(None) => unreachable!("Swarm stream shouldn't end"),
|
||||
Poll::Pending => break,
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,20 +8,20 @@ edition = "2018"
|
||||
eth1_test_rig = { path = "../../tests/eth1_test_rig" }
|
||||
|
||||
[dependencies]
|
||||
futures = "0.3"
|
||||
futures = "0.3.4"
|
||||
types = { path = "../../eth2/types"}
|
||||
environment = { path = "../../lighthouse/environment"}
|
||||
eth1 = { path = "../eth1"}
|
||||
rayon = "1.0"
|
||||
rayon = "1.3.0"
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
merkle_proof = { path = "../../eth2/utils/merkle_proof" }
|
||||
eth2_ssz = "0.1"
|
||||
eth2_hashing = { path = "../../eth2/utils/eth2_hashing" }
|
||||
tree_hash = "0.1"
|
||||
tokio = {version = "0.2", features = ["full"]}
|
||||
parking_lot = "0.7"
|
||||
slog = "^2.2.3"
|
||||
exit-future = "0.2"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_hashing = "0.1.0"
|
||||
tree_hash = "0.1.0"
|
||||
tokio = { version = "0.2.20", features = ["full"] }
|
||||
parking_lot = "0.10.2"
|
||||
slog = "2.5.2"
|
||||
exit-future = "0.2.0"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
int_to_bytes = { path = "../../eth2/utils/int_to_bytes" }
|
||||
|
||||
@@ -5,28 +5,28 @@ authors = ["Age Manning <Age@AgeManning.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dev-dependencies]
|
||||
sloggers = "0.3.4"
|
||||
sloggers = "1.0.0"
|
||||
genesis = { path = "../genesis" }
|
||||
tempdir = "0.3"
|
||||
tempdir = "0.3.7"
|
||||
|
||||
[dependencies]
|
||||
beacon_chain = { path = "../beacon_chain" }
|
||||
store = { path = "../store" }
|
||||
eth2-libp2p = { path = "../eth2-libp2p" }
|
||||
hashmap_delay = { path = "../../eth2/utils/hashmap_delay" }
|
||||
hashset_delay = { path = "../../eth2/utils/hashset_delay" }
|
||||
rest_types = { path = "../../eth2/utils/rest_types" }
|
||||
types = { path = "../../eth2/types" }
|
||||
slot_clock = { path = "../../eth2/utils/slot_clock" }
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
eth2_ssz = "0.1.2"
|
||||
tree_hash = "0.1.0"
|
||||
futures = "0.1.29"
|
||||
error-chain = "0.12.1"
|
||||
tokio = "0.1.22"
|
||||
parking_lot = "0.9.0"
|
||||
smallvec = "1.0.0"
|
||||
futures = "0.3.4"
|
||||
error-chain = "0.12.2"
|
||||
tokio = "0.2.20"
|
||||
parking_lot = "0.10.2"
|
||||
smallvec = "1.4.0"
|
||||
# TODO: Remove rand crate for mainnet
|
||||
rand = "0.7.2"
|
||||
rand = "0.7.3"
|
||||
fnv = "1.0.6"
|
||||
rlp = "0.4.3"
|
||||
rlp = "0.4.5"
|
||||
|
||||
@@ -13,31 +13,31 @@ network = { path = "../network" }
|
||||
eth2-libp2p = { path = "../eth2-libp2p" }
|
||||
store = { path = "../store" }
|
||||
version = { path = "../version" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_yaml = "0.8"
|
||||
slog = "2.5"
|
||||
slog-term = "2.4"
|
||||
slog-async = "2.3"
|
||||
eth2_ssz = { path = "../../eth2/utils/ssz" }
|
||||
eth2_ssz_derive = { path = "../../eth2/utils/ssz_derive" }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
serde_json = "1.0.52"
|
||||
serde_yaml = "0.8.11"
|
||||
slog = "2.5.2"
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
types = { path = "../../eth2/types" }
|
||||
http = "0.1"
|
||||
hyper = "0.12"
|
||||
tokio = "0.1.22"
|
||||
url = "2.1"
|
||||
lazy_static = "1.3.0"
|
||||
http = "0.2.1"
|
||||
hyper = "0.13.5"
|
||||
tokio = "0.2.20"
|
||||
url = "2.1.1"
|
||||
lazy_static = "1.4.0"
|
||||
eth2_config = { path = "../../eth2/utils/eth2_config" }
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics" }
|
||||
slot_clock = { path = "../../eth2/utils/slot_clock" }
|
||||
hex = "0.3"
|
||||
parking_lot = "0.9"
|
||||
futures = "0.1.29"
|
||||
hex = "0.4.2"
|
||||
parking_lot = "0.10.2"
|
||||
futures = "0.3.4"
|
||||
operation_pool = { path = "../../eth2/operation_pool" }
|
||||
rayon = "1.3.0"
|
||||
|
||||
[dev-dependencies]
|
||||
remote_beacon_node = { path = "../../eth2/utils/remote_beacon_node" }
|
||||
node_test_rig = { path = "../../tests/node_test_rig" }
|
||||
tree_hash = { path = "../../eth2/utils/tree_hash" }
|
||||
tree_hash = "0.1.0"
|
||||
|
||||
@@ -10,23 +10,23 @@ harness = false
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.1.0"
|
||||
sloggers = "0.3.2"
|
||||
criterion = "0.3.0"
|
||||
rayon = "1.2.0"
|
||||
sloggers = "1.0.0"
|
||||
criterion = "0.3.2"
|
||||
rayon = "1.3.0"
|
||||
|
||||
[dependencies]
|
||||
db-key = "0.0.5"
|
||||
leveldb = "0.8.4"
|
||||
parking_lot = "0.9.0"
|
||||
itertools = "0.8"
|
||||
parking_lot = "0.10.2"
|
||||
itertools = "0.9.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
tree_hash = "0.1.0"
|
||||
types = { path = "../../eth2/types" }
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
slog = "2.2.3"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0.102"
|
||||
slog = "2.5.2"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../eth2/utils/lighthouse_metrics" }
|
||||
lru = "0.4.3"
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2018"
|
||||
beacon_chain = { path = "../beacon_chain" }
|
||||
types = { path = "../../eth2/types" }
|
||||
slot_clock = { path = "../../eth2/utils/slot_clock" }
|
||||
tokio = { version = "0.2", features = ["full"] }
|
||||
tokio = { version = "0.2.20", features = ["full"] }
|
||||
slog = "2.5.2"
|
||||
parking_lot = "0.10.0"
|
||||
futures = "0.3"
|
||||
parking_lot = "0.10.2"
|
||||
futures = "0.3.4"
|
||||
|
||||
@@ -7,11 +7,11 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
futures = "0.3"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde_json = "1.0.41"
|
||||
futures = "0.3.4"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_json = "1.0.52"
|
||||
slog = "2.5.2"
|
||||
tokio = { version = "0.2", features = ["full"] }
|
||||
tokio = { version = "0.2.20", features = ["full"] }
|
||||
types = { path = "../../eth2/types" }
|
||||
ws = "0.9.1"
|
||||
|
||||
@@ -6,14 +6,14 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
int_to_bytes = { path = "../utils/int_to_bytes" }
|
||||
parking_lot = "0.9.0"
|
||||
parking_lot = "0.10.2"
|
||||
types = { path = "../types" }
|
||||
state_processing = { path = "../state_processing" }
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
store = { path = "../../beacon_node/store" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.7.2"
|
||||
rand = "0.7.3"
|
||||
|
||||
@@ -9,11 +9,11 @@ name = "proto_array_fork_choice"
|
||||
path = "src/bin.rs"
|
||||
|
||||
[dependencies]
|
||||
parking_lot = "0.9.0"
|
||||
parking_lot = "0.10.2"
|
||||
types = { path = "../types" }
|
||||
itertools = "0.8.1"
|
||||
itertools = "0.9.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_yaml = "0.8.11"
|
||||
|
||||
@@ -9,10 +9,10 @@ name = "benches"
|
||||
harness = false
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.0"
|
||||
criterion = "0.3.2"
|
||||
env_logger = "0.7.1"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
lazy_static = "1.4.0"
|
||||
serde_yaml = "0.8.11"
|
||||
beacon_chain = { path = "../../beacon_node/beacon_chain" }
|
||||
@@ -21,20 +21,20 @@ store = { path = "../../beacon_node/store" }
|
||||
|
||||
[dependencies]
|
||||
bls = { path = "../utils/bls" }
|
||||
integer-sqrt = "0.1.2"
|
||||
itertools = "0.8.1"
|
||||
integer-sqrt = "0.1.3"
|
||||
itertools = "0.9.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_types = { path = "../utils/ssz_types" }
|
||||
merkle_proof = { path = "../utils/merkle_proof" }
|
||||
log = "0.4.8"
|
||||
safe_arith = { path = "../utils/safe_arith" }
|
||||
tree_hash = "0.1.0"
|
||||
tree_hash_derive = "0.2"
|
||||
tree_hash_derive = "0.2.0"
|
||||
types = { path = "../types" }
|
||||
rayon = "1.2.0"
|
||||
eth2_hashing = { path = "../utils/eth2_hashing" }
|
||||
rayon = "1.3.0"
|
||||
eth2_hashing = "0.1.0"
|
||||
int_to_bytes = { path = "../utils/int_to_bytes" }
|
||||
arbitrary = { version = "0.4.3", features = ["derive"], optional = true }
|
||||
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
|
||||
|
||||
[features]
|
||||
fake_crypto = ["bls/fake_crypto"]
|
||||
|
||||
@@ -13,19 +13,19 @@ bls = { path = "../utils/bls" }
|
||||
compare_fields = { path = "../utils/compare_fields" }
|
||||
compare_fields_derive = { path = "../utils/compare_fields_derive" }
|
||||
dirs = "2.0.2"
|
||||
derivative = "1.0.3"
|
||||
derivative = "2.1.1"
|
||||
eth2_interop_keypairs = { path = "../utils/eth2_interop_keypairs" }
|
||||
ethereum-types = "0.9.1"
|
||||
eth2_hashing = "0.1.0"
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
int_to_bytes = { path = "../utils/int_to_bytes" }
|
||||
log = "0.4.8"
|
||||
merkle_proof = { path = "../utils/merkle_proof" }
|
||||
rayon = "1.2.0"
|
||||
rand = "0.7.2"
|
||||
rayon = "1.3.0"
|
||||
rand = "0.7.3"
|
||||
safe_arith = { path = "../utils/safe_arith" }
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
slog = "2.5.2"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
@@ -33,17 +33,17 @@ eth2_ssz_types = { path = "../utils/ssz_types" }
|
||||
swap_or_not_shuffle = { path = "../utils/swap_or_not_shuffle" }
|
||||
test_random_derive = { path = "../utils/test_random_derive" }
|
||||
tree_hash = "0.1.0"
|
||||
tree_hash_derive = "0.2"
|
||||
tree_hash_derive = "0.2.0"
|
||||
rand_xorshift = "0.2.0"
|
||||
cached_tree_hash = { path = "../utils/cached_tree_hash" }
|
||||
serde_yaml = "0.8.11"
|
||||
tempfile = "3.1.0"
|
||||
arbitrary = { version = "0.4", features = ["derive"], optional = true }
|
||||
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.7.1"
|
||||
serde_json = "1.0.41"
|
||||
criterion = "0.3.0"
|
||||
serde_json = "1.0.52"
|
||||
criterion = "0.3.2"
|
||||
|
||||
[features]
|
||||
arbitrary-fuzz = [
|
||||
|
||||
@@ -7,15 +7,15 @@ edition = "2018"
|
||||
[dependencies]
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
|
||||
eth2_hashing = "0.1.0"
|
||||
hex = "0.3"
|
||||
rand = "0.7.2"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
hex = "0.4.2"
|
||||
rand = "0.7.3"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_hex = { path = "../serde_hex" }
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_types = { path = "../ssz_types" }
|
||||
tree_hash = "0.1.0"
|
||||
arbitrary = { version = "0.4", features = ["derive"], optional = true }
|
||||
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
|
||||
|
||||
[features]
|
||||
fake_crypto = []
|
||||
|
||||
@@ -5,17 +5,17 @@ authors = ["Michael Sproul <michael@sigmaprime.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.9"
|
||||
ethereum-types = "0.9.1"
|
||||
eth2_ssz_types = { path = "../ssz_types" }
|
||||
eth2_hashing = "0.1"
|
||||
eth2_hashing = "0.1.0"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
tree_hash = "0.1"
|
||||
smallvec = "1.2.0"
|
||||
tree_hash = "0.1.0"
|
||||
smallvec = "1.4.0"
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "0.9"
|
||||
quickcheck_macros = "0.8"
|
||||
quickcheck = "0.9.2"
|
||||
quickcheck_macros = "0.9.1"
|
||||
|
||||
[features]
|
||||
arbitrary = ["ethereum-types/arbitrary"]
|
||||
|
||||
@@ -8,8 +8,8 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.0"
|
||||
hex = "0.3"
|
||||
dirs = "2.0"
|
||||
hex = "0.4.2"
|
||||
dirs = "2.0.2"
|
||||
types = { path = "../../types" }
|
||||
eth2_testnet_config = { path = "../eth2_testnet_config" }
|
||||
eth2_ssz = { path = "../ssz" }
|
||||
eth2_ssz = "0.1.2"
|
||||
|
||||
@@ -8,5 +8,5 @@ edition = "2018"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
quote = "0.6"
|
||||
syn = "1.0.18"
|
||||
quote = "1.0.4"
|
||||
|
||||
@@ -8,7 +8,7 @@ use syn::{parse_macro_input, DeriveInput};
|
||||
fn is_slice(field: &syn::Field) -> bool {
|
||||
field.attrs.iter().any(|attr| {
|
||||
attr.path.is_ident("compare_fields")
|
||||
&& attr.tts.to_string().replace(" ", "") == "(as_slice)"
|
||||
&& attr.tokens.to_string().replace(" ", "") == "(as_slice)"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ edition = "2018"
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
reqwest = "0.9.20"
|
||||
serde_json = "1.0"
|
||||
reqwest = { version = "0.10.4", features = ["blocking", "json"] }
|
||||
serde_json = "1.0.52"
|
||||
|
||||
[dependencies]
|
||||
types = { path = "../../types"}
|
||||
eth2_ssz = { path = "../ssz"}
|
||||
tree_hash = { path = "../tree_hash"}
|
||||
ethabi = "12.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
tree_hash = "0.1.0"
|
||||
ethabi = "12.0.0"
|
||||
|
||||
@@ -56,8 +56,8 @@ pub fn download_deposit_contract(
|
||||
if abi_file.exists() {
|
||||
// Nothing to do.
|
||||
} else {
|
||||
match reqwest::get(url) {
|
||||
Ok(mut response) => {
|
||||
match reqwest::blocking::get(url) {
|
||||
Ok(response) => {
|
||||
let mut abi_file = File::create(abi_file)
|
||||
.map_err(|e| format!("Failed to create local abi file: {:?}", e))?;
|
||||
let mut bytecode_file = File::create(bytecode_file)
|
||||
|
||||
@@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
toml = "0.5.4"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
toml = "0.5.6"
|
||||
types = { path = "../../types" }
|
||||
|
||||
@@ -13,13 +13,13 @@ lazy_static = { version = "1.4.0", optional = true }
|
||||
ring = "0.16.9"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
sha2 = "0.8.0"
|
||||
sha2 = "0.8.1"
|
||||
|
||||
[dev-dependencies]
|
||||
rustc-hex = "2.0.1"
|
||||
rustc-hex = "2.1.0"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
wasm-bindgen-test = "0.3.2"
|
||||
wasm-bindgen-test = "0.3.12"
|
||||
|
||||
[features]
|
||||
default = ["zero_hash_cache"]
|
||||
|
||||
@@ -8,13 +8,13 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
lazy_static = "1.4.0"
|
||||
num-bigint = "0.2.3"
|
||||
num-bigint = "0.2.6"
|
||||
eth2_hashing = "0.1.0"
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
|
||||
serde_yaml = "0.8.11"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
|
||||
[dev-dependencies]
|
||||
base64 = "0.11.0"
|
||||
base64 = "0.12.0"
|
||||
|
||||
@@ -7,15 +7,14 @@ edition = "2018"
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
reqwest = "0.9.20"
|
||||
reqwest = { version = "0.10.4", features = ["blocking"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tempdir = "0.3"
|
||||
reqwest = "0.9.20"
|
||||
tempdir = "0.3.7"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0"
|
||||
serde_yaml = "0.8"
|
||||
serde = "1.0.106"
|
||||
serde_yaml = "0.8.11"
|
||||
types = { path = "../../types"}
|
||||
eth2-libp2p = { path = "../../../beacon_node/eth2-libp2p"}
|
||||
eth2_ssz = { path = "../ssz"}
|
||||
eth2_ssz = "0.1.2"
|
||||
|
||||
@@ -45,11 +45,9 @@ pub fn get_file(filename: &str) -> Result<(), String> {
|
||||
let mut file =
|
||||
File::create(path).map_err(|e| format!("Failed to create {}: {:?}", filename, e))?;
|
||||
|
||||
let mut response =
|
||||
reqwest::get(&url).map_err(|e| format!("Failed to download {}: {}", filename, e))?;
|
||||
let mut contents: Vec<u8> = vec![];
|
||||
response
|
||||
.copy_to(&mut contents)
|
||||
let contents = reqwest::blocking::get(&url)
|
||||
.map_err(|e| format!("Failed to download {}: {}", filename, e))?
|
||||
.bytes()
|
||||
.map_err(|e| format!("Failed to read {} response bytes: {}", filename, e))?;
|
||||
|
||||
file.write(&contents)
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
//! A simple hashmap object coupled with a `delay_queue` which has entries that expire after a
|
||||
//! fixed time.
|
||||
//!
|
||||
//! A `HashMapDelay` implements `Stream` which removes expired items from the map.
|
||||
|
||||
/// The default delay for entries, in seconds. This is only used when `insert()` is used to add
|
||||
/// entries.
|
||||
const DEFAULT_DELAY: u64 = 30;
|
||||
|
||||
use futures::prelude::*;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
};
|
||||
use tokio::time::delay_queue::{self, DelayQueue};
|
||||
|
||||
pub struct HashMapDelay<K, V>
|
||||
where
|
||||
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
|
||||
{
|
||||
/// The given entries.
|
||||
entries: HashMap<K, MapEntry<V>>,
|
||||
/// A queue holding the timeouts of each entry.
|
||||
expirations: DelayQueue<K>,
|
||||
/// The default expiration timeout of an entry.
|
||||
default_entry_timeout: Duration,
|
||||
}
|
||||
|
||||
/// A wrapping around entries that adds the link to the entry's expiration, via a `delay_queue` key.
|
||||
struct MapEntry<V> {
|
||||
/// The expiration key for the entry.
|
||||
key: delay_queue::Key,
|
||||
/// The actual entry.
|
||||
value: V,
|
||||
}
|
||||
|
||||
impl<K, V> Default for HashMapDelay<K, V>
|
||||
where
|
||||
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
|
||||
{
|
||||
fn default() -> Self {
|
||||
HashMapDelay::new(Duration::from_secs(DEFAULT_DELAY))
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V> HashMapDelay<K, V>
|
||||
where
|
||||
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
|
||||
{
|
||||
/// Creates a new instance of `HashMapDelay`.
|
||||
pub fn new(default_entry_timeout: Duration) -> Self {
|
||||
HashMapDelay {
|
||||
entries: HashMap::new(),
|
||||
expirations: DelayQueue::new(),
|
||||
default_entry_timeout,
|
||||
}
|
||||
}
|
||||
|
||||
/// Insert an entry into the mapping. Entries will expire after the `default_entry_timeout`.
|
||||
pub fn insert(&mut self, key: K, value: V) {
|
||||
self.insert_at(key, value, self.default_entry_timeout);
|
||||
}
|
||||
|
||||
/// Inserts an entry that will expire at a given instant.
|
||||
pub fn insert_at(&mut self, key: K, value: V, entry_duration: Duration) {
|
||||
let delay_key = self.expirations.insert(key.clone(), entry_duration);
|
||||
let entry = MapEntry {
|
||||
key: delay_key,
|
||||
value,
|
||||
};
|
||||
self.entries.insert(key, entry);
|
||||
}
|
||||
|
||||
/// Gets a reference to an entry if it exists.
|
||||
///
|
||||
/// Returns None if the entry does not exist.
|
||||
pub fn get(&self, key: &K) -> Option<&V> {
|
||||
self.entries.get(key).map(|entry| &entry.value)
|
||||
}
|
||||
|
||||
/// Gets a mutable reference to an entry if it exists.
|
||||
///
|
||||
/// Returns None if the entry does not exist.
|
||||
pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {
|
||||
self.entries.get_mut(key).map(|entry| &mut entry.value)
|
||||
}
|
||||
|
||||
/// Returns true if the key exists, false otherwise.
|
||||
pub fn contains_key(&self, key: &K) -> bool {
|
||||
self.entries.contains_key(key)
|
||||
}
|
||||
|
||||
/// Returns the length of the mapping.
|
||||
pub fn len(&self) -> usize {
|
||||
self.entries.len()
|
||||
}
|
||||
|
||||
/// Updates the timeout for a given key. Returns true if the key existed, false otherwise.
|
||||
///
|
||||
/// Panics if the duration is too far in the future.
|
||||
pub fn update_timeout(&mut self, key: &K, timeout: Duration) -> bool {
|
||||
if let Some(entry) = self.entries.get(key) {
|
||||
self.expirations.reset(&entry.key, timeout);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// Removes a key from the map returning the value associated with the key that was in the map.
|
||||
///
|
||||
/// Return None if the key was not in the map.
|
||||
pub fn remove(&mut self, key: &K) -> Option<V> {
|
||||
if let Some(entry) = self.entries.remove(key) {
|
||||
self.expirations.remove(&entry.key);
|
||||
return Some(entry.value);
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
/// Retains only the elements specified by the predicate.
|
||||
///
|
||||
/// In other words, remove all pairs `(k, v)` such that `f(&k,&mut v)` returns false.
|
||||
pub fn retain<F: FnMut(&K, &mut V) -> bool>(&mut self, mut f: F) {
|
||||
let expiration = &mut self.expirations;
|
||||
self.entries.retain(|key, entry| {
|
||||
let result = f(key, &mut entry.value);
|
||||
if !result {
|
||||
expiration.remove(&entry.key);
|
||||
}
|
||||
result
|
||||
})
|
||||
}
|
||||
|
||||
/// Removes all entries from the map.
|
||||
pub fn clear(&mut self) {
|
||||
self.entries.clear();
|
||||
self.expirations.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V> Stream for HashMapDelay<K, V>
|
||||
where
|
||||
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
|
||||
V: Unpin,
|
||||
{
|
||||
type Item = Result<(K, V), String>;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
match self.expirations.poll_expired(cx) {
|
||||
Poll::Ready(Some(Ok(key))) => match self.entries.remove(key.get_ref()) {
|
||||
Some(entry) => Poll::Ready(Some(Ok((key.into_inner(), entry.value)))),
|
||||
None => Poll::Ready(Some(Err("Value no longer exists in expirations".into()))),
|
||||
},
|
||||
Poll::Ready(Some(Err(e))) => {
|
||||
Poll::Ready(Some(Err(format!("delay queue error: {:?}", e))))
|
||||
}
|
||||
Poll::Ready(None) => Poll::Ready(None),
|
||||
Poll::Pending => Poll::Pending,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
//! This crate provides two objects:
|
||||
//! - `HashMapDelay`
|
||||
//! - `HashSetDelay`
|
||||
//!
|
||||
//! # HashMapDelay
|
||||
//!
|
||||
//! This provides a `HashMap` coupled with a `DelayQueue`. Objects that are inserted into
|
||||
//! the map are inserted with an expiry. `Stream` is implemented on the `HashMapDelay`
|
||||
//! which return objects that have expired. These objects are removed from the mapping.
|
||||
//!
|
||||
//! # HashSetDelay
|
||||
//!
|
||||
//! This is similar to a `HashMapDelay` except the mapping maps to the expiry time. This
|
||||
//! allows users to add objects and check their expiry deadlines before the `Stream`
|
||||
//! consumes them.
|
||||
|
||||
mod hashmap_delay;
|
||||
mod hashset_delay;
|
||||
|
||||
pub use crate::hashmap_delay::HashMapDelay;
|
||||
pub use crate::hashset_delay::HashSetDelay;
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "hashmap_delay"
|
||||
name = "hashset_delay"
|
||||
version = "0.2.0"
|
||||
authors = ["Age Manning <Age@AgeManning.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures = "0.3.4"
|
||||
tokio = { version = "0.2.19", features = ["time"] }
|
||||
tokio = { version = "0.2.20", features = ["time"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "0.2.19", features = ["time", "rt-threaded", "macros"] }
|
||||
tokio = { version = "0.2.20", features = ["time", "rt-threaded", "macros"] }
|
||||
12
eth2/utils/hashset_delay/src/lib.rs
Normal file
12
eth2/utils/hashset_delay/src/lib.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
//! This crate provides a single type (its counter-part HashMapDelay has been removed as it
|
||||
//! currently is not in use in lighthouse):
|
||||
//! - `HashSetDelay`
|
||||
//!
|
||||
//! # HashSetDelay
|
||||
//!
|
||||
//! This is similar to a `HashMapDelay` except the mapping maps to the expiry time. This
|
||||
//! allows users to add objects and check their expiry deadlines before the `Stream`
|
||||
//! consumes them.
|
||||
|
||||
mod hashset_delay;
|
||||
pub use crate::hashset_delay::HashSetDelay;
|
||||
@@ -5,8 +5,8 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bytes = "0.4.12"
|
||||
bytes = "0.5.4"
|
||||
|
||||
[dev-dependencies]
|
||||
yaml-rust = "0.4.3"
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
|
||||
@@ -8,4 +8,4 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
lazy_static = "1.4.0"
|
||||
prometheus = "0.7.0"
|
||||
prometheus = "0.8.0"
|
||||
|
||||
@@ -6,6 +6,6 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
slog = "2.5.2"
|
||||
slog-term = "2.4.2"
|
||||
slog-term = "2.5.0"
|
||||
lighthouse_metrics = { path = "../lighthouse_metrics" }
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
@@ -5,14 +5,14 @@ authors = ["Michael Sproul <michael@sigmaprime.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.9"
|
||||
ethereum-types = "0.9.1"
|
||||
eth2_hashing = "0.1.0"
|
||||
lazy_static = "1.4.0"
|
||||
safe_arith = { path = "../safe_arith" }
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "0.9.0"
|
||||
quickcheck_macros = "0.8.0"
|
||||
quickcheck = "0.9.2"
|
||||
quickcheck_macros = "0.9.1"
|
||||
|
||||
[features]
|
||||
arbitrary = ["ethereum-types/arbitrary"]
|
||||
|
||||
@@ -7,15 +7,15 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
reqwest = { version = "0.10", features = ["json"] }
|
||||
url = "1.2"
|
||||
serde = "1.0"
|
||||
reqwest = { version = "0.10.4", features = ["json"] }
|
||||
url = "2.1.1"
|
||||
serde = "1.0.106"
|
||||
futures = "0.3.4"
|
||||
types = { path = "../../../eth2/types" }
|
||||
rest_types = { path = "../rest_types" }
|
||||
hex = "0.3"
|
||||
eth2_ssz = { path = "../../../eth2/utils/ssz" }
|
||||
serde_json = "^1.0"
|
||||
hex = "0.4.2"
|
||||
eth2_ssz = "0.1.2"
|
||||
serde_json = "1.0.52"
|
||||
eth2_config = { path = "../../../eth2/utils/eth2_config" }
|
||||
proto_array_fork_choice = { path = "../../../eth2/proto_array_fork_choice" }
|
||||
operation_pool = { path = "../../../eth2/operation_pool" }
|
||||
|
||||
@@ -6,11 +6,11 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
types = { path = "../../types" }
|
||||
eth2_ssz_derive = { path = "../ssz_derive" }
|
||||
eth2_ssz = { path = "../ssz" }
|
||||
eth2_hashing = { path = "../eth2_hashing" }
|
||||
tree_hash = { path = "../tree_hash" }
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_hashing = "0.1.0"
|
||||
tree_hash = "0.1.0"
|
||||
state_processing = { path = "../../state_processing" }
|
||||
bls = { path = "../bls" }
|
||||
serde = { version = "1.0.102", features = ["derive"] }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
rayon = "1.3.0"
|
||||
|
||||
@@ -5,5 +5,5 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.102"
|
||||
hex = "0.3"
|
||||
serde = "1.0.106"
|
||||
hex = "0.4.2"
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
use hex::ToHex;
|
||||
use serde::de::{self, Visitor};
|
||||
use std::fmt;
|
||||
|
||||
pub fn encode<T: AsRef<[u8]>>(data: T) -> String {
|
||||
let mut hex = String::with_capacity(data.as_ref().len() * 2);
|
||||
|
||||
// Writing to a string never errors, so we can unwrap here.
|
||||
data.write_hex(&mut hex).unwrap();
|
||||
|
||||
let hex = hex::encode(data);
|
||||
let mut s = "0x".to_string();
|
||||
|
||||
s.push_str(hex.as_str());
|
||||
|
||||
s
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@ edition = "2018"
|
||||
types = { path = "../../types" }
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../lighthouse_metrics" }
|
||||
parking_lot = "0.9.0"
|
||||
parking_lot = "0.10.2"
|
||||
|
||||
@@ -14,7 +14,7 @@ eth2_ssz_derive = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.9.1"
|
||||
smallvec = "1.2.0"
|
||||
smallvec = "1.4.0"
|
||||
|
||||
[features]
|
||||
arbitrary = ["ethereum-types/arbitrary"]
|
||||
|
||||
@@ -11,5 +11,5 @@ name = "ssz_derive"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
quote = "0.6"
|
||||
syn = "1.0.18"
|
||||
quote = "1.0.4"
|
||||
|
||||
@@ -54,7 +54,8 @@ fn get_serializable_field_types<'a>(struct_data: &'a syn::DataStruct) -> Vec<&'a
|
||||
/// The field attribute is: `#[ssz(skip_serializing)]`
|
||||
fn should_skip_serializing(field: &syn::Field) -> bool {
|
||||
field.attrs.iter().any(|attr| {
|
||||
attr.path.is_ident("ssz") && attr.tts.to_string().replace(" ", "") == "(skip_serializing)"
|
||||
attr.path.is_ident("ssz")
|
||||
&& attr.tokens.to_string().replace(" ", "") == "(skip_serializing)"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -148,7 +149,8 @@ pub fn ssz_encode_derive(input: TokenStream) -> TokenStream {
|
||||
/// The field attribute is: `#[ssz(skip_deserializing)]`
|
||||
fn should_skip_deserializing(field: &syn::Field) -> bool {
|
||||
field.attrs.iter().any(|attr| {
|
||||
attr.path.is_ident("ssz") && attr.tts.to_string().replace(" ", "") == "(skip_deserializing)"
|
||||
attr.path.is_ident("ssz")
|
||||
&& attr.tokens.to_string().replace(" ", "") == "(skip_deserializing)"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ name = "ssz_types"
|
||||
|
||||
[dependencies]
|
||||
tree_hash = "0.1.0"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_hex = { path = "../serde_hex" }
|
||||
eth2_ssz = "0.1.2"
|
||||
typenum = "1.11.2"
|
||||
arbitrary = { version = "0.4", features = ["derive"], optional = true }
|
||||
typenum = "1.12.0"
|
||||
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_yaml = "0.8.11"
|
||||
tree_hash_derive = "0.2"
|
||||
tree_hash_derive = "0.2.0"
|
||||
|
||||
@@ -9,9 +9,9 @@ name = "benches"
|
||||
harness = false
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.0"
|
||||
criterion = "0.3.2"
|
||||
yaml-rust = "0.4.3"
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
|
||||
[dependencies]
|
||||
eth2_hashing = "0.1.0"
|
||||
|
||||
@@ -9,5 +9,5 @@ description = "Procedural derive macros for implementation of TestRandom trait"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
quote = "0.6"
|
||||
syn = "1.0.18"
|
||||
quote = "1.0.4"
|
||||
|
||||
@@ -10,7 +10,7 @@ use syn::{parse_macro_input, DeriveInput};
|
||||
/// The field attribute is: `#[test_random(default)]`
|
||||
fn should_use_default(field: &syn::Field) -> bool {
|
||||
field.attrs.iter().any(|attr| {
|
||||
attr.path.is_ident("test_random") && attr.tts.to_string().replace(" ", "") == "(default)"
|
||||
attr.path.is_ident("test_random") && attr.tokens.to_string().replace(" ", "") == "(default)"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -11,16 +11,16 @@ name = "benches"
|
||||
harness = false
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.0"
|
||||
rand = "0.7.2"
|
||||
tree_hash_derive = "0.2"
|
||||
criterion = "0.3.2"
|
||||
rand = "0.7.3"
|
||||
tree_hash_derive = "0.2.0"
|
||||
types = { path = "../../types" }
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.9"
|
||||
ethereum-types = "0.9.1"
|
||||
eth2_hashing = "0.1.0"
|
||||
smallvec = "1.2.0"
|
||||
smallvec = "1.4.0"
|
||||
|
||||
[features]
|
||||
arbitrary = ["ethereum-types/arbitrary"]
|
||||
|
||||
@@ -10,5 +10,5 @@ license = "Apache-2.0"
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
quote = "0.6"
|
||||
syn = "1.0.18"
|
||||
quote = "1.0.4"
|
||||
|
||||
@@ -51,7 +51,7 @@ fn get_cache_field_for(field: &syn::Field) -> Option<syn::Ident> {
|
||||
let parsed_attrs = cached_tree_hash_attr_metas(&field.attrs);
|
||||
if let [Meta::List(MetaList { nested, .. })] = &parsed_attrs[..] {
|
||||
nested.iter().find_map(|x| match x {
|
||||
NestedMeta::Meta(Meta::Word(cache_field_ident)) => Some(cache_field_ident.clone()),
|
||||
NestedMeta::Meta(Meta::Path(path)) => path.get_ident().cloned(),
|
||||
_ => None,
|
||||
})
|
||||
} else {
|
||||
@@ -73,7 +73,8 @@ fn cached_tree_hash_attr_metas(attrs: &[Attribute]) -> Vec<Meta> {
|
||||
/// The field attribute is: `#[tree_hash(skip_hashing)]`
|
||||
fn should_skip_hashing(field: &syn::Field) -> bool {
|
||||
field.attrs.iter().any(|attr| {
|
||||
attr.path.is_ident("tree_hash") && attr.tts.to_string().replace(" ", "") == "(skip_hashing)"
|
||||
attr.path.is_ident("tree_hash")
|
||||
&& attr.tokens.to_string().replace(" ", "") == "(skip_hashing)"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -9,24 +9,24 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.0"
|
||||
hex = "0.3"
|
||||
hex = "0.4.2"
|
||||
log = "0.4.8"
|
||||
serde = "1.0.102"
|
||||
serde = "1.0.106"
|
||||
serde_yaml = "0.8.11"
|
||||
simple_logger = "1.3.0"
|
||||
simple_logger = "1.6.0"
|
||||
types = { path = "../eth2/types" }
|
||||
state_processing = { path = "../eth2/state_processing" }
|
||||
eth2_ssz = "0.1.2"
|
||||
regex = "1.3.1"
|
||||
regex = "1.3.7"
|
||||
eth1_test_rig = { path = "../tests/eth1_test_rig" }
|
||||
futures = {version = "0.3", features = ["compat"]}
|
||||
futures = { version = "0.3.4", features = ["compat"] }
|
||||
environment = { path = "../lighthouse/environment" }
|
||||
web3 = "0.10.0"
|
||||
eth2_testnet_config = { path = "../eth2/utils/eth2_testnet_config" }
|
||||
dirs = "2.0"
|
||||
dirs = "2.0.2"
|
||||
genesis = { path = "../beacon_node/genesis" }
|
||||
deposit_contract = { path = "../eth2/utils/deposit_contract" }
|
||||
tree_hash = { path = "../eth2/utils/tree_hash" }
|
||||
tokio = { version = "0.2", features = ["full"] }
|
||||
tree_hash = "0.1.0"
|
||||
tokio = { version = "0.2.20", features = ["full"] }
|
||||
clap_utils = { path = "../eth2/utils/clap_utils" }
|
||||
eth2-libp2p = { path = "../beacon_node/eth2-libp2p" }
|
||||
|
||||
@@ -9,17 +9,17 @@ write_ssz_files = ["beacon_node/write_ssz_files"] # Writes debugging .ssz files
|
||||
|
||||
[dependencies]
|
||||
beacon_node = { "path" = "../beacon_node" }
|
||||
tokio = "0.1.22"
|
||||
slog = { version = "^2.2.3" , features = ["max_level_trace"] }
|
||||
sloggers = "0.3.4"
|
||||
tokio = "0.2.20"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
sloggers = "1.0.0"
|
||||
types = { "path" = "../eth2/types" }
|
||||
clap = "2.32.0"
|
||||
env_logger = "0.6.1"
|
||||
clap = "2.33.0"
|
||||
env_logger = "0.7.1"
|
||||
logging = { path = "../eth2/utils/logging" }
|
||||
slog-term = "^2.4.0"
|
||||
slog-async = "^2.3.0"
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
environment = { path = "./environment" }
|
||||
futures = "0.1.25"
|
||||
futures = "0.3.4"
|
||||
validator_client = { "path" = "../validator_client" }
|
||||
account_manager = { "path" = "../account_manager" }
|
||||
clap_utils = { path = "../eth2/utils/clap_utils" }
|
||||
|
||||
@@ -6,19 +6,19 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.0"
|
||||
tokio = "0.1.22"
|
||||
slog = { version = "^2.2.3" , features = ["max_level_trace"] }
|
||||
sloggers = "0.3.4"
|
||||
tokio = "0.2.20"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
sloggers = "1.0.0"
|
||||
types = { "path" = "../../eth2/types" }
|
||||
eth2_config = { "path" = "../../eth2/utils/eth2_config" }
|
||||
eth2_testnet_config = { path = "../../eth2/utils/eth2_testnet_config" }
|
||||
env_logger = "0.6.1"
|
||||
env_logger = "0.7.1"
|
||||
logging = { path = "../../eth2/utils/logging" }
|
||||
slog-term = "^2.4.0"
|
||||
slog-async = "^2.3.0"
|
||||
ctrlc = { version = "3.1.1", features = ["termination"] }
|
||||
futures = "0.1.25"
|
||||
parking_lot = "0.7"
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
ctrlc = { version = "3.1.4", features = ["termination"] }
|
||||
futures = "0.3.4"
|
||||
parking_lot = "0.10.2"
|
||||
slog-json = "2.3.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
use eth2_config::Eth2Config;
|
||||
use eth2_testnet_config::Eth2TestnetConfig;
|
||||
use futures::{sync::oneshot, Future};
|
||||
use futures::channel::oneshot;
|
||||
use slog::{info, o, Drain, Level, Logger};
|
||||
use sloggers::{null::NullLoggerBuilder, Build};
|
||||
use std::cell::RefCell;
|
||||
@@ -17,7 +17,7 @@ use std::ffi::OsStr;
|
||||
use std::fs::{rename as FsRename, OpenOptions};
|
||||
use std::path::PathBuf;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use tokio::runtime::{Builder as RuntimeBuilder, Runtime, TaskExecutor};
|
||||
use tokio::runtime::{Builder as RuntimeBuilder, Handle, Runtime};
|
||||
use types::{EthSpec, InteropEthSpec, MainnetEthSpec, MinimalEthSpec};
|
||||
|
||||
pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
|
||||
@@ -183,10 +183,10 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
|
||||
/// An execution context that can be used by a service.
|
||||
///
|
||||
/// Distinct from an `Environment` because a `Context` is not able to give a mutable reference to a
|
||||
/// `Runtime`, instead it only has access to a `TaskExecutor`.
|
||||
/// `Runtime`, instead it only has access to a `Runtime`.
|
||||
#[derive(Clone)]
|
||||
pub struct RuntimeContext<E: EthSpec> {
|
||||
pub executor: TaskExecutor,
|
||||
pub runtime_handle: Handle,
|
||||
pub log: Logger,
|
||||
pub eth_spec_instance: E,
|
||||
pub eth2_config: Eth2Config,
|
||||
@@ -198,7 +198,7 @@ impl<E: EthSpec> RuntimeContext<E> {
|
||||
/// The generated service will have the `service_name` in all it's logs.
|
||||
pub fn service_context(&self, service_name: String) -> Self {
|
||||
Self {
|
||||
executor: self.executor.clone(),
|
||||
runtime_handle: self.runtime_handle.clone(),
|
||||
log: self.log.new(o!("service" => service_name)),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
@@ -233,7 +233,7 @@ impl<E: EthSpec> Environment<E> {
|
||||
/// Returns a `Context` where no "service" has been added to the logger output.
|
||||
pub fn core_context(&mut self) -> RuntimeContext<E> {
|
||||
RuntimeContext {
|
||||
executor: self.runtime.executor(),
|
||||
runtime_handle: self.runtime.handle().clone(),
|
||||
log: self.log.clone(),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
@@ -243,7 +243,7 @@ impl<E: EthSpec> Environment<E> {
|
||||
/// Returns a `Context` where the `service_name` is added to the logger output.
|
||||
pub fn service_context(&mut self, service_name: String) -> RuntimeContext<E> {
|
||||
RuntimeContext {
|
||||
executor: self.runtime.executor(),
|
||||
runtime_handle: self.runtime.handle().clone(),
|
||||
log: self.log.new(o!("service" => service_name)),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
@@ -268,11 +268,9 @@ impl<E: EthSpec> Environment<E> {
|
||||
}
|
||||
|
||||
/// Shutdown the `tokio` runtime when all tasks are idle.
|
||||
pub fn shutdown_on_idle(self) -> Result<(), String> {
|
||||
pub fn shutdown_on_idle(self) {
|
||||
self.runtime
|
||||
.shutdown_on_idle()
|
||||
.wait()
|
||||
.map_err(|e| format!("Tokio runtime shutdown returned an error: {:?}", e))
|
||||
.shutdown_timeout(std::time::Duration::from_secs(5))
|
||||
}
|
||||
|
||||
/// Sets the logger (and all child loggers) to log to a file.
|
||||
|
||||
@@ -12,19 +12,19 @@ fake_crypto = ["bls/fake_crypto"]
|
||||
[dependencies]
|
||||
bls = { path = "../../eth2/utils/bls" }
|
||||
compare_fields = { path = "../../eth2/utils/compare_fields" }
|
||||
ethereum-types = "0.9"
|
||||
hex = "0.3"
|
||||
rayon = "1.2.0"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
ethereum-types = "0.9.1"
|
||||
hex = "0.4.2"
|
||||
rayon = "1.3.0"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_repr = "0.1.5"
|
||||
serde_yaml = "0.8.11"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
tree_hash = "0.1.0"
|
||||
tree_hash_derive = "0.2"
|
||||
tree_hash_derive = "0.2.0"
|
||||
cached_tree_hash = { path = "../../eth2/utils/cached_tree_hash" }
|
||||
state_processing = { path = "../../eth2/state_processing" }
|
||||
swap_or_not_shuffle = { path = "../../eth2/utils/swap_or_not_shuffle" }
|
||||
types = { path = "../../eth2/types" }
|
||||
walkdir = "2.2.9"
|
||||
walkdir = "2.3.1"
|
||||
|
||||
@@ -21,7 +21,7 @@ impl BlsCase for BlsSign {}
|
||||
impl Case for BlsSign {
|
||||
fn result(&self, _case_index: usize) -> Result<(), Error> {
|
||||
// Convert private_key and message to required types
|
||||
let mut sk = hex::decode(&self.input.privkey[2..])
|
||||
let sk = hex::decode(&self.input.privkey[2..])
|
||||
.map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))?;
|
||||
let sk = SecretKey::from_bytes(&sk).unwrap();
|
||||
let msg = hex::decode(&self.input.message[2..])
|
||||
|
||||
@@ -6,8 +6,8 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
web3 = "0.10.0"
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
futures = { version = "0.3", features = ["compat"] }
|
||||
tokio = { version = "0.2.20", features = ["time"] }
|
||||
futures = { version = "0.3.4", features = ["compat"] }
|
||||
types = { path = "../../eth2/types"}
|
||||
serde_json = "1.0"
|
||||
serde_json = "1.0.52"
|
||||
deposit_contract = { path = "../../eth2/utils/deposit_contract"}
|
||||
|
||||
@@ -9,11 +9,11 @@ environment = { path = "../../lighthouse/environment" }
|
||||
beacon_node = { path = "../../beacon_node" }
|
||||
types = { path = "../../eth2/types" }
|
||||
eth2_config = { path = "../../eth2/utils/eth2_config" }
|
||||
tempdir = "0.3"
|
||||
reqwest = "0.9"
|
||||
url = "1.2"
|
||||
serde = "1.0"
|
||||
futures = "0.1.25"
|
||||
tempdir = "0.3.7"
|
||||
reqwest = "0.10.4"
|
||||
url = "2.1.1"
|
||||
serde = "1.0.106"
|
||||
futures = "0.3.4"
|
||||
genesis = { path = "../../beacon_node/genesis" }
|
||||
remote_beacon_node = { path = "../../eth2/utils/remote_beacon_node" }
|
||||
validator_client = { path = "../../validator_client" }
|
||||
|
||||
@@ -10,9 +10,9 @@ edition = "2018"
|
||||
node_test_rig = { path = "../node_test_rig" }
|
||||
types = { path = "../../eth2/types" }
|
||||
validator_client = { path = "../../validator_client" }
|
||||
parking_lot = "0.9.0"
|
||||
futures = "0.1.29"
|
||||
tokio = "0.1.22"
|
||||
parking_lot = "0.10.2"
|
||||
futures = "0.3.4"
|
||||
tokio = "0.2.20"
|
||||
eth1_test_rig = { path = "../eth1_test_rig" }
|
||||
env_logger = "0.7.1"
|
||||
clap = "2.33.0"
|
||||
|
||||
@@ -17,28 +17,28 @@ eth2_interop_keypairs = { path = "../eth2/utils/eth2_interop_keypairs" }
|
||||
slot_clock = { path = "../eth2/utils/slot_clock" }
|
||||
rest_types = { path = "../eth2/utils/rest_types" }
|
||||
types = { path = "../eth2/types" }
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
serde_json = "1.0.41"
|
||||
serde = "1.0.106"
|
||||
serde_derive = "1.0.106"
|
||||
serde_json = "1.0.52"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
|
||||
slog-async = "2.3.0"
|
||||
slog-term = "2.4.2"
|
||||
tokio = "0.1.22"
|
||||
tokio-timer = "0.2.12"
|
||||
error-chain = "0.12.1"
|
||||
bincode = "1.2.0"
|
||||
futures = "0.1.29"
|
||||
slog-async = "2.5.0"
|
||||
slog-term = "2.5.0"
|
||||
tokio = "0.2.20"
|
||||
tokio-timer = "0.2.13"
|
||||
error-chain = "0.12.2"
|
||||
bincode = "1.2.1"
|
||||
futures = "0.3.4"
|
||||
dirs = "2.0.2"
|
||||
logging = { path = "../eth2/utils/logging" }
|
||||
environment = { path = "../lighthouse/environment" }
|
||||
parking_lot = "0.7"
|
||||
exit-future = "0.1.4"
|
||||
libc = "0.2.65"
|
||||
eth2_ssz_derive = { path = "../eth2/utils/ssz_derive" }
|
||||
hex = "0.3"
|
||||
parking_lot = "0.10.2"
|
||||
exit-future = "0.2.0"
|
||||
libc = "0.2.69"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
hex = "0.4.2"
|
||||
deposit_contract = { path = "../eth2/utils/deposit_contract" }
|
||||
bls = { path = "../eth2/utils/bls" }
|
||||
remote_beacon_node = { path = "../eth2/utils/remote_beacon_node" }
|
||||
tempdir = "0.3"
|
||||
rayon = "1.2.0"
|
||||
tempdir = "0.3.7"
|
||||
rayon = "1.3.0"
|
||||
web3 = "0.10.0"
|
||||
|
||||
Reference in New Issue
Block a user