Fixed Compiler Warnings & Failing Tests (#3771)
This commit is contained in:
parent
6c9de4a53a
commit
1a39976715
@ -4,7 +4,7 @@ use slot_clock::SlotClock;
|
|||||||
use crate::beacon_chain::{BeaconChain, BeaconChainTypes, MAXIMUM_GOSSIP_CLOCK_DISPARITY};
|
use crate::beacon_chain::{BeaconChain, BeaconChainTypes, MAXIMUM_GOSSIP_CLOCK_DISPARITY};
|
||||||
use crate::BeaconChainError;
|
use crate::BeaconChainError;
|
||||||
use bls::PublicKey;
|
use bls::PublicKey;
|
||||||
use types::{consts::eip4844::BLS_MODULUS, BeaconStateError, BlobsSidecar, Hash256, Slot};
|
use types::{consts::eip4844::BLS_MODULUS, BeaconStateError, BlobsSidecar, Slot};
|
||||||
|
|
||||||
pub enum BlobError {
|
pub enum BlobError {
|
||||||
/// The blob sidecar is from a slot that is later than the current slot (with respect to the
|
/// The blob sidecar is from a slot that is later than the current slot (with respect to the
|
||||||
|
@ -916,8 +916,7 @@ mod test {
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use types::{
|
use types::{
|
||||||
ExecutionPayloadMerge, ForkName, FullPayload, MainnetEthSpec, Transactions, Unsigned,
|
ExecutionPayloadMerge, ForkName, MainnetEthSpec, Transactions, Unsigned, VariableList,
|
||||||
VariableList,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Tester {
|
struct Tester {
|
||||||
|
@ -11,7 +11,7 @@ use std::sync::Arc;
|
|||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
use tokio::sync::{watch, Mutex, RwLock};
|
use tokio::sync::{watch, Mutex, RwLock};
|
||||||
use tokio_stream::wrappers::WatchStream;
|
use tokio_stream::wrappers::WatchStream;
|
||||||
use types::{Address, ExecutionBlockHash, Hash256};
|
use types::ExecutionBlockHash;
|
||||||
|
|
||||||
/// The number of payload IDs that will be stored for each `Engine`.
|
/// The number of payload IDs that will be stored for each `Engine`.
|
||||||
///
|
///
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
//! This crate only provides useful functionality for "The Merge", it does not provide any of the
|
//! This crate only provides useful functionality for "The Merge", it does not provide any of the
|
||||||
//! deposit-contract functionality that the `beacon_node/eth1` crate already provides.
|
//! deposit-contract functionality that the `beacon_node/eth1` crate already provides.
|
||||||
|
|
||||||
use crate::json_structures::JsonBlobBundles;
|
|
||||||
use crate::payload_cache::PayloadCache;
|
use crate::payload_cache::PayloadCache;
|
||||||
use auth::{strip_prefix, Auth, JwtKey};
|
use auth::{strip_prefix, Auth, JwtKey};
|
||||||
use builder_client::BuilderHttpClient;
|
use builder_client::BuilderHttpClient;
|
||||||
@ -36,8 +35,6 @@ use tokio::{
|
|||||||
time::sleep,
|
time::sleep,
|
||||||
};
|
};
|
||||||
use tokio_stream::wrappers::WatchStream;
|
use tokio_stream::wrappers::WatchStream;
|
||||||
#[cfg(feature = "withdrawals")]
|
|
||||||
use types::Withdrawal;
|
|
||||||
use types::{AbstractExecPayload, Blob, ExecPayload, KzgCommitment};
|
use types::{AbstractExecPayload, Blob, ExecPayload, KzgCommitment};
|
||||||
use types::{
|
use types::{
|
||||||
BlindedPayload, BlockType, ChainSpec, Epoch, ExecutionBlockHash, ForkName,
|
BlindedPayload, BlockType, ChainSpec, Epoch, ExecutionBlockHash, ForkName,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
test_utils::{
|
test_utils::{
|
||||||
Block, MockServer, DEFAULT_BUILDER_THRESHOLD_WEI, DEFAULT_JWT_SECRET,
|
MockServer, DEFAULT_BUILDER_THRESHOLD_WEI, DEFAULT_JWT_SECRET, DEFAULT_TERMINAL_BLOCK,
|
||||||
DEFAULT_TERMINAL_BLOCK, DEFAULT_TERMINAL_DIFFICULTY,
|
DEFAULT_TERMINAL_DIFFICULTY,
|
||||||
},
|
},
|
||||||
Config, *,
|
Config, *,
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@ use tokio::sync::mpsc::UnboundedSender;
|
|||||||
use tree_hash::TreeHash;
|
use tree_hash::TreeHash;
|
||||||
use types::{
|
use types::{
|
||||||
AbstractExecPayload, BlindedPayload, BlobsSidecar, EthSpec, ExecPayload, ExecutionBlockHash,
|
AbstractExecPayload, BlindedPayload, BlobsSidecar, EthSpec, ExecPayload, ExecutionBlockHash,
|
||||||
FullPayload, Hash256, SignedBeaconBlock, SignedBeaconBlockEip4844,
|
FullPayload, Hash256, SignedBeaconBlock,
|
||||||
};
|
};
|
||||||
use warp::Rejection;
|
use warp::Rejection;
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ use libp2p::multiaddr::{Multiaddr, Protocol as MProtocol};
|
|||||||
use libp2p::swarm::{ConnectionLimits, Swarm, SwarmBuilder, SwarmEvent};
|
use libp2p::swarm::{ConnectionLimits, Swarm, SwarmBuilder, SwarmEvent};
|
||||||
use libp2p::PeerId;
|
use libp2p::PeerId;
|
||||||
use slog::{crit, debug, info, o, trace, warn};
|
use slog::{crit, debug, info, o, trace, warn};
|
||||||
use std::io::Write;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -9,8 +9,8 @@ use std::time::Duration;
|
|||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use types::{
|
use types::{
|
||||||
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockMerge, Epoch, EthSpec, ForkContext,
|
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockMerge, EmptyBlock, Epoch, EthSpec,
|
||||||
ForkName, Hash256, MinimalEthSpec, Signature, SignedBeaconBlock, Slot,
|
ForkContext, ForkName, Hash256, MinimalEthSpec, Signature, SignedBeaconBlock, Slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
@ -3,7 +3,6 @@ use crate::{metrics, service::NetworkMessage, sync::SyncMessage};
|
|||||||
use beacon_chain::store::Error;
|
use beacon_chain::store::Error;
|
||||||
use beacon_chain::{
|
use beacon_chain::{
|
||||||
attestation_verification::{self, Error as AttnError, VerifiedAttestation},
|
attestation_verification::{self, Error as AttnError, VerifiedAttestation},
|
||||||
blob_verification::BlobError,
|
|
||||||
observed_operations::ObservationOutcome,
|
observed_operations::ObservationOutcome,
|
||||||
sync_committee_verification::{self, Error as SyncCommitteeError},
|
sync_committee_verification::{self, Error as SyncCommitteeError},
|
||||||
validator_monitor::get_block_delay_ms,
|
validator_monitor::get_block_delay_ms,
|
||||||
@ -22,8 +21,8 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
|||||||
use store::hot_cold_store::HotColdDBError;
|
use store::hot_cold_store::HotColdDBError;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use types::{
|
use types::{
|
||||||
Attestation, AttesterSlashing, BlobsSidecar, EthSpec, Hash256, IndexedAttestation,
|
Attestation, AttesterSlashing, EthSpec, Hash256, IndexedAttestation, ProposerSlashing,
|
||||||
ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedBlsToExecutionChange,
|
SignedAggregateAndProof, SignedBeaconBlock, SignedBlsToExecutionChange,
|
||||||
SignedContributionAndProof, SignedVoluntaryExit, Slot, SubnetId, SyncCommitteeMessage,
|
SignedContributionAndProof, SignedVoluntaryExit, Slot, SubnetId, SyncCommitteeMessage,
|
||||||
SyncSubnetId,
|
SyncSubnetId,
|
||||||
};
|
};
|
||||||
@ -701,11 +700,11 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub async fn process_gossip_block_and_blobs_sidecar(
|
pub async fn process_gossip_block_and_blobs_sidecar(
|
||||||
self,
|
self,
|
||||||
message_id: MessageId,
|
_message_id: MessageId,
|
||||||
peer_id: PeerId,
|
_peer_id: PeerId,
|
||||||
peer_client: Client,
|
_peer_client: Client,
|
||||||
block_and_blob: Arc<SignedBeaconBlockAndBlobsSidecar<T::EthSpec>>,
|
_block_and_blob: Arc<SignedBeaconBlockAndBlobsSidecar<T::EthSpec>>,
|
||||||
seen_timestamp: Duration,
|
_seen_timestamp: Duration,
|
||||||
) {
|
) {
|
||||||
//FIXME
|
//FIXME
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
|
@ -36,6 +36,12 @@ ALTAIR_FORK_EPOCH: 512
|
|||||||
# Merge
|
# Merge
|
||||||
BELLATRIX_FORK_VERSION: 0x02000064
|
BELLATRIX_FORK_VERSION: 0x02000064
|
||||||
BELLATRIX_FORK_EPOCH: 385536
|
BELLATRIX_FORK_EPOCH: 385536
|
||||||
|
# Capella
|
||||||
|
CAPELLA_FORK_VERSION: 0x03000064
|
||||||
|
CAPELLA_FORK_EPOCH: 18446744073709551615
|
||||||
|
# Eip4844
|
||||||
|
EIP4844_FORK_VERSION: 0x04000064
|
||||||
|
EIP4844_FORK_EPOCH: 18446744073709551615
|
||||||
# Sharding
|
# Sharding
|
||||||
SHARDING_FORK_VERSION: 0x03000064
|
SHARDING_FORK_VERSION: 0x03000064
|
||||||
SHARDING_FORK_EPOCH: 18446744073709551615
|
SHARDING_FORK_EPOCH: 18446744073709551615
|
||||||
|
@ -36,6 +36,12 @@ ALTAIR_FORK_EPOCH: 74240
|
|||||||
# Merge
|
# Merge
|
||||||
BELLATRIX_FORK_VERSION: 0x02000000
|
BELLATRIX_FORK_VERSION: 0x02000000
|
||||||
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
|
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
|
||||||
|
# Capella
|
||||||
|
CAPELLA_FORK_VERSION: 0x03000000
|
||||||
|
CAPELLA_FORK_EPOCH: 18446744073709551615
|
||||||
|
# Eip4844
|
||||||
|
EIP4844_FORK_VERSION: 0x04000000
|
||||||
|
EIP4844_FORK_EPOCH: 18446744073709551615
|
||||||
# Sharding
|
# Sharding
|
||||||
SHARDING_FORK_VERSION: 0x03000000
|
SHARDING_FORK_VERSION: 0x03000000
|
||||||
SHARDING_FORK_EPOCH: 18446744073709551615
|
SHARDING_FORK_EPOCH: 18446744073709551615
|
||||||
|
@ -8,7 +8,7 @@ use rayon::prelude::*;
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use types::{
|
use types::{
|
||||||
AbstractExecPayload, BeaconState, BeaconStateError, ChainSpec, EthSpec, Hash256,
|
AbstractExecPayload, BeaconState, BeaconStateError, ChainSpec, EthSpec, Hash256,
|
||||||
IndexedAttestation, SignedBeaconBlock,
|
SignedBeaconBlock,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
|
@ -633,7 +633,7 @@ impl ChainSpec {
|
|||||||
* Capella hard fork params
|
* Capella hard fork params
|
||||||
*/
|
*/
|
||||||
capella_fork_version: [0x03, 00, 00, 00],
|
capella_fork_version: [0x03, 00, 00, 00],
|
||||||
capella_fork_epoch: Some(Epoch::new(18446744073709551615)),
|
capella_fork_epoch: None,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Eip4844 hard fork params
|
* Eip4844 hard fork params
|
||||||
@ -970,6 +970,7 @@ pub struct Config {
|
|||||||
#[serde(default = "default_eip4844_fork_version")]
|
#[serde(default = "default_eip4844_fork_version")]
|
||||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||||
eip4844_fork_version: [u8; 4],
|
eip4844_fork_version: [u8; 4],
|
||||||
|
#[serde(default)]
|
||||||
#[serde(serialize_with = "serialize_fork_epoch")]
|
#[serde(serialize_with = "serialize_fork_epoch")]
|
||||||
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||||
pub eip4844_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
pub eip4844_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||||
|
@ -199,7 +199,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn previous_and_next_fork_consistent() {
|
fn previous_and_next_fork_consistent() {
|
||||||
assert_eq!(ForkName::Merge.next_fork(), None);
|
assert_eq!(ForkName::Eip4844.next_fork(), None);
|
||||||
assert_eq!(ForkName::Base.previous_fork(), None);
|
assert_eq!(ForkName::Base.previous_fork(), None);
|
||||||
|
|
||||||
for (prev_fork, fork) in ForkName::list_all().into_iter().tuple_windows() {
|
for (prev_fork, fork) in ForkName::list_all().into_iter().tuple_windows() {
|
||||||
|
@ -21,11 +21,15 @@ use state_processing::{
|
|||||||
ConsensusContext,
|
ConsensusContext,
|
||||||
};
|
};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
#[cfg(not(all(feature = "withdrawals", feature = "withdrawals-processing")))]
|
||||||
|
use std::marker::PhantomData;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
#[cfg(all(feature = "withdrawals", feature = "withdrawals-processing"))]
|
||||||
|
use types::SignedBlsToExecutionChange;
|
||||||
use types::{
|
use types::{
|
||||||
Attestation, AttesterSlashing, BeaconBlock, BeaconState, BlindedPayload, ChainSpec, Deposit,
|
Attestation, AttesterSlashing, BeaconBlock, BeaconState, BlindedPayload, ChainSpec, Deposit,
|
||||||
EthSpec, ExecutionPayload, ForkName, FullPayload, ProposerSlashing, SignedBlsToExecutionChange,
|
EthSpec, ExecutionPayload, ForkName, FullPayload, ProposerSlashing, SignedVoluntaryExit,
|
||||||
SignedVoluntaryExit, SyncAggregate,
|
SyncAggregate,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Deserialize)]
|
#[derive(Debug, Clone, Default, Deserialize)]
|
||||||
@ -42,7 +46,10 @@ struct ExecutionMetadata {
|
|||||||
/// Newtype for testing withdrawals.
|
/// Newtype for testing withdrawals.
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
pub struct WithdrawalsPayload<T: EthSpec> {
|
pub struct WithdrawalsPayload<T: EthSpec> {
|
||||||
|
#[cfg(all(feature = "withdrawals", feature = "withdrawals-processing"))]
|
||||||
payload: FullPayload<T>,
|
payload: FullPayload<T>,
|
||||||
|
#[cfg(not(all(feature = "withdrawals", feature = "withdrawals-processing")))]
|
||||||
|
_phantom_data: PhantomData<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -6,15 +6,14 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use crate::{http_metrics::metrics, validator_store::ValidatorStore};
|
use crate::{http_metrics::metrics, validator_store::ValidatorStore};
|
||||||
use environment::RuntimeContext;
|
use environment::RuntimeContext;
|
||||||
use eth2::types::{Graffiti, VariableList};
|
|
||||||
use slog::{crit, debug, error, info, trace, warn};
|
use slog::{crit, debug, error, info, trace, warn};
|
||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use types::{
|
use types::{
|
||||||
AbstractExecPayload, BlindedPayload, BlobsSidecar, BlockType, EthSpec, ExecPayload, ForkName,
|
AbstractExecPayload, BlindedPayload, BlockType, EthSpec, FullPayload, Graffiti, PublicKeyBytes,
|
||||||
FullPayload, PublicKeyBytes, Slot,
|
Slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -19,12 +19,11 @@ use std::sync::Arc;
|
|||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
use types::{
|
use types::{
|
||||||
attestation::Error as AttestationError, graffiti::GraffitiString, AbstractExecPayload, Address,
|
attestation::Error as AttestationError, graffiti::GraffitiString, AbstractExecPayload, Address,
|
||||||
AggregateAndProof, Attestation, BeaconBlock, BlindedPayload, BlobsSidecar, ChainSpec,
|
AggregateAndProof, Attestation, BeaconBlock, BlindedPayload, ChainSpec, ContributionAndProof,
|
||||||
ContributionAndProof, Domain, Epoch, EthSpec, ExecPayload, Fork, FullPayload, Graffiti,
|
Domain, Epoch, EthSpec, Fork, Graffiti, Hash256, Keypair, PublicKeyBytes, SelectionProof,
|
||||||
Hash256, Keypair, PublicKeyBytes, SelectionProof, Signature, SignedAggregateAndProof,
|
Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedRoot,
|
||||||
SignedBeaconBlock, SignedContributionAndProof, SignedRoot, SignedValidatorRegistrationData,
|
SignedValidatorRegistrationData, Slot, SyncAggregatorSelectionData, SyncCommitteeContribution,
|
||||||
Slot, SyncAggregatorSelectionData, SyncCommitteeContribution, SyncCommitteeMessage,
|
SyncCommitteeMessage, SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData,
|
||||||
SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData,
|
|
||||||
};
|
};
|
||||||
use validator_dir::ValidatorDir;
|
use validator_dir::ValidatorDir;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user