Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ use store::{
use task_executor::{ShutdownReason, TaskExecutor};
use tokio_stream::Stream;
use tree_hash::TreeHash;
use types::blob_sidecar::{BlobSidecarList, FixedBlobSidecarList};
use types::blob_sidecar::FixedBlobSidecarList;
use types::payload::BlockProductionVersion;
use types::*;

Expand Down
30 changes: 13 additions & 17 deletions beacon_node/beacon_chain/tests/op_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async fn voluntary_exit_duplicate_in_state() {
.validators()
.get(exited_validator as usize)
.unwrap()
.exit_epoch,
.exit_epoch(),
spec.far_future_epoch
);

Expand Down Expand Up @@ -274,14 +274,12 @@ async fn proposer_slashing_duplicate_in_state() {
.await;

// Verify validator is actually slashed.
assert!(
harness
.get_current_state()
.validators()
.get(slashed_validator as usize)
.unwrap()
.slashed
);
assert!(harness
.get_current_state()
.validators()
.get(slashed_validator as usize)
.unwrap()
.slashed());

// Clear the in-memory gossip cache & try to verify the same slashing on gossip.
// It should still fail because gossip verification should check the validator's `slashed` field
Expand Down Expand Up @@ -402,14 +400,12 @@ async fn attester_slashing_duplicate_in_state() {
.await;

// Verify validator is actually slashed.
assert!(
harness
.get_current_state()
.validators()
.get(slashed_validator as usize)
.unwrap()
.slashed
);
assert!(harness
.get_current_state()
.validators()
.get(slashed_validator as usize)
.unwrap()
.slashed());

// Clear the in-memory gossip cache & try to verify the same slashing on gossip.
// It should still fail because gossip verification should check the validator's `slashed` field
Expand Down
1 change: 0 additions & 1 deletion beacon_node/execution_layer/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use pretty_reqwest_error::PrettyReqwestError;
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use ssz_types::FixedVector;
use std::convert::TryFrom;
use strum::IntoStaticStr;
use superstruct::superstruct;
pub use types::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use strum::EnumString;
use superstruct::superstruct;
use types::beacon_block_body::KzgCommitments;
use types::blob_sidecar::BlobsList;
use types::{
EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadDeneb,
ExecutionPayloadMerge, Transactions, Unsigned, VariableList, Withdrawal,
};
use types::Unsigned;

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down
4 changes: 1 addition & 3 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,7 @@ pub fn serve<T: BeaconChainTypes>(
relative_epoch,
) =>
{
state
.committee_cache(relative_epoch)
.map(Arc::clone)
state.committee_cache(relative_epoch).cloned()
}
_ => CommitteeCache::initialized(
state,
Expand Down
2 changes: 0 additions & 2 deletions beacon_node/store/src/impls/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use crate::*;
use ssz::Encode;
use ssz_derive::Encode;
use std::io::{Read, Write};
use std::sync::Arc;
use types::{CompactBeaconState, PublicKeyBytes};
use zstd::{Decoder, Encoder};

pub fn store_full_state<E: EthSpec>(
Expand Down
15 changes: 13 additions & 2 deletions beacon_node/store/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ fn slot_of_prev_restore_point<E: EthSpec>(current_slot: Slot) -> Slot {
(current_slot - 1) / slots_per_historical_root * slots_per_historical_root
}

/* FIXME(sproul): these tests are broken because they do not store states in a way that is
* compatible with using state diffs in the hot DB. If we keep state diffs, we should rewrite these
* tests to be less quirky.
#[cfg(test)]
mod test {
use super::*;
Expand Down Expand Up @@ -422,6 +425,7 @@ mod test {

let state_a_root = hashes.next().unwrap();
*state_b.state_roots_mut().get_mut(0).unwrap() = state_a_root;
state_a.apply_pending_mutations().unwrap();
store.put_state(&state_a_root, &state_a).unwrap();

let iter = BlockRootsIterator::new(&store, &state_b);
Expand All @@ -447,8 +451,11 @@ mod test {
#[test]
fn state_root_iter() {
let log = NullLoggerBuilder.build().unwrap();
let store =
HotColdDB::open_ephemeral(Config::default(), ChainSpec::minimal(), log).unwrap();
let config = Config {
epochs_per_state_diff: 256,
..Config::default()
};
let store = HotColdDB::open_ephemeral(config, ChainSpec::minimal(), log).unwrap();
let slots_per_historical_root = MainnetEthSpec::slots_per_historical_root();

let mut state_a: BeaconState<MainnetEthSpec> = get_state();
Expand All @@ -473,6 +480,9 @@ mod test {
let state_a_root = Hash256::from_low_u64_be(slots_per_historical_root as u64);
let state_b_root = Hash256::from_low_u64_be(slots_per_historical_root as u64 * 2);

state_a.apply_pending_mutations().unwrap();
state_b.apply_pending_mutations().unwrap();

store.put_state(&state_a_root, &state_a).unwrap();
store.put_state(&state_b_root, &state_b).unwrap();

Expand Down Expand Up @@ -505,3 +515,4 @@ mod test {
}
}
}
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::signature_sets::Error as SignatureSetError;
use crate::{ContextError, EpochCacheError};
use crate::ContextError;
use merkle_proof::MerkleTreeError;
use safe_arith::ArithError;
use ssz::DecodeError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::common::{
};
use crate::per_block_processing::errors::{BlockProcessingError, IntoWithIndex};
use crate::VerifySignatures;
use safe_arith::SafeArith;
use std::sync::Arc;
use types::consts::altair::{PARTICIPATION_FLAG_WEIGHTS, PROPOSER_WEIGHT, WEIGHT_DENOMINATOR};

Expand Down
2 changes: 1 addition & 1 deletion consensus/types/src/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::test_utils::TestRandom;
use crate::*;
use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
use ssz_types::{typenum::U33, FixedVector};
use ssz_types::typenum::U33;
use test_random_derive::TestRandom;
use tree_hash_derive::TreeHash;

Expand Down