Skip to content

Commit

Permalink
Address half of Sean's review
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Apr 22, 2024
1 parent 900b880 commit a359c74
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 21 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ c-kzg = "1"
clap = "2"
compare_fields_derive = { path = "common/compare_fields_derive" }
criterion = "0.3"
crossbeam-channel = "0.5.8"
delay_map = "0.3"
derivative = "2"
dirs = "3"
Expand Down Expand Up @@ -146,6 +145,7 @@ rayon = "1.7"
regex = "1"
reqwest = { version = "0.11", default-features = false, features = ["blocking", "json", "stream", "rustls-tls", "native-tls-vendored"] }
ring = "0.16"
rpds = "0.11"
rusqlite = { version = "0.28", features = ["bundled"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
1 change: 0 additions & 1 deletion beacon_node/beacon_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ serde_json = { workspace = true }
[dependencies]
bitvec = { workspace = true }
bls = { workspace = true }
crossbeam-channel = { workspace = true }
derivative = { workspace = true }
eth1 = { workspace = true }
eth2 = { workspace = true }
Expand Down
6 changes: 0 additions & 6 deletions beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,6 @@ where
let (_, updated_builder) = self.set_genesis_state(genesis_state)?;
self = updated_builder;

// Build the committee caches before storing. The database assumes that states have
// committee caches built before storing.
weak_subj_state
.build_all_committee_caches(&self.spec)
.map_err(|e| format!("Error building caches on checkpoint state: {:?}", e))?;

// Fill in the linear block roots between the checkpoint block's slot and the aligned
// state's slot. All slots less than the block's slot will be handled by block backfill,
// while states greater or equal to the checkpoint state will be handled by `migrate_db`.
Expand Down
1 change: 0 additions & 1 deletion consensus/state_processing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ arbitrary = { workspace = true }
lighthouse_metrics = { workspace = true }
lazy_static = { workspace = true }
derivative = { workspace = true }
vec_map = "0.8.2"

[features]
default = ["legacy-arith"]
Expand Down
4 changes: 2 additions & 2 deletions consensus/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ smallvec = { workspace = true }
maplit = { workspace = true }
strum = { workspace = true }
milhouse = { workspace = true }
rpds = "0.11.0"
rpds = { workspace = true }

[dev-dependencies]
criterion = { workspace = true }
Expand All @@ -70,4 +70,4 @@ sqlite = []
# The `arbitrary-fuzz` feature is a no-op provided for backwards compatibility.
# For simplicity `Arbitrary` is now derived regardless of the feature's presence.
arbitrary-fuzz = []
portable = ["bls/supranational-portable"]
portable = ["bls/supranational-portable"]
7 changes: 0 additions & 7 deletions consensus/types/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,6 @@ impl ChainSpec {
}
}

/// Return the name of the fork activated at `slot`, if any.
pub fn fork_activated_at_slot<E: EthSpec>(&self, slot: Slot) -> Option<ForkName> {
let prev_slot_fork = self.fork_name_at_slot::<E>(slot.saturating_sub(Slot::new(1)));
let slot_fork = self.fork_name_at_slot::<E>(slot);
(slot_fork != prev_slot_fork).then_some(slot_fork)
}

/// Returns the fork version for a named fork.
pub fn fork_version_for_name(&self, fork_name: ForkName) -> [u8; 4] {
match fork_name {
Expand Down
10 changes: 9 additions & 1 deletion testing/ef_tests/src/cases/ssz_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serde::{de::Error as SerdeError, Deserialize, Deserializer};
use ssz_derive::{Decode, Encode};
use tree_hash_derive::TreeHash;
use types::typenum::*;
use types::{BitList, BitVector, ForkName, VariableList, Vector};
use types::{BitList, BitVector, FixedVector, ForkName, VariableList, Vector};

#[derive(Debug, Clone, Deserialize)]
struct Metadata {
Expand Down Expand Up @@ -139,6 +139,14 @@ impl Case for SszGeneric {
[elem_ty => primitive_type]
[length => typenum]
)?;
type_dispatch!(
ssz_generic_test,
(&self.path),
FixedVector,
<>,
[elem_ty => primitive_type]
[length => typenum]
)?;
}
"bitlist" => {
let mut limit = parts[1];
Expand Down

0 comments on commit a359c74

Please sign in to comment.