Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/unstable' into electra-alpha10
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Jan 13, 2025
2 parents f4fe1b8 + c9747fb commit 1205d83
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 102 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ members = [
"beacon_node/client",
"beacon_node/eth1",
"beacon_node/execution_layer",
"beacon_node/genesis",
"beacon_node/http_api",
"beacon_node/http_metrics",
"beacon_node/lighthouse_network",
"beacon_node/lighthouse_network/gossipsub",
"beacon_node/network",
"beacon_node/operation_pool",
"beacon_node/store",
"beacon_node/timer",

Expand All @@ -30,6 +32,7 @@ members = [
"common/eth2_interop_keypairs",
"common/eth2_network_config",
"common/eth2_wallet_manager",
"common/filesystem",
"common/lighthouse_version",
"common/lockfile",
"common/logging",
Expand All @@ -48,14 +51,16 @@ members = [
"common/unused_port",
"common/validator_dir",
"common/warp_utils",

"consensus/fixed_bytes",
"consensus/fork_choice",

"consensus/int_to_bytes",
"consensus/merkle_proof",
"consensus/proto_array",
"consensus/safe_arith",
"consensus/state_processing",
"consensus/swap_or_not_shuffle",
"consensus/types",

"crypto/bls",
"crypto/eth2_key_derivation",
Expand Down
16 changes: 8 additions & 8 deletions beacon_node/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ eth1_test_rig = { workspace = true }
sensitive_url = { workspace = true }

[dependencies]
futures = { workspace = true }
types = { workspace = true }
environment = { workspace = true }
eth1 = { workspace = true }
ethereum_hashing = { workspace = true }
ethereum_ssz = { workspace = true }
futures = { workspace = true }
int_to_bytes = { workspace = true }
merkle_proof = { workspace = true }
rayon = { workspace = true }
slog = { workspace = true }
state_processing = { workspace = true }
merkle_proof = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_hashing = { workspace = true }
tree_hash = { workspace = true }
tokio = { workspace = true }
slog = { workspace = true }
int_to_bytes = { workspace = true }
tree_hash = { workspace = true }
types = { workspace = true }
14 changes: 7 additions & 7 deletions beacon_node/operation_pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = { workspace = true }

[dependencies]
bitvec = { workspace = true }
derivative = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
itertools = { workspace = true }
metrics = { workspace = true }
parking_lot = { workspace = true }
types = { workspace = true }
state_processing = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
state_processing = { workspace = true }
store = { workspace = true }
bitvec = { workspace = true }
rand = { workspace = true }
types = { workspace = true }

[dev-dependencies]
beacon_chain = { workspace = true }
tokio = { workspace = true }
maplit = { workspace = true }
tokio = { workspace = true }

[features]
portable = ["beacon_chain/portable"]
1 change: 0 additions & 1 deletion common/filesystem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name = "filesystem"
version = "0.1.0"
authors = ["Mark Mackey <mark@sigmaprime.io>"]
edition = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion consensus/merkle_proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = { workspace = true }
[dependencies]
alloy-primitives = { workspace = true }
ethereum_hashing = { workspace = true }
safe_arith = { workspace = true }
fixed_bytes = { workspace = true }
safe_arith = { workspace = true }

[dev-dependencies]
quickcheck = { workspace = true }
Expand Down
56 changes: 28 additions & 28 deletions consensus/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,56 @@ harness = false

[dependencies]
alloy-primitives = { workspace = true }
merkle_proof = { workspace = true }
alloy-rlp = { version = "0.3.4", features = ["derive"] }
# The arbitrary dependency is enabled by default since Capella to avoid complexity introduced by
# `AbstractExecPayload`
arbitrary = { workspace = true, features = ["derive"] }
bls = { workspace = true, features = ["arbitrary"] }
kzg = { workspace = true }
compare_fields = { workspace = true }
compare_fields_derive = { workspace = true }
derivative = { workspace = true }
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
ethereum_hashing = { workspace = true }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true, features = ["arbitrary"] }
ethereum_ssz_derive = { workspace = true }
fixed_bytes = { workspace = true }
hex = { workspace = true }
int_to_bytes = { workspace = true }
itertools = { workspace = true }
kzg = { workspace = true }
log = { workspace = true }
rayon = { workspace = true }
maplit = { workspace = true }
merkle_proof = { workspace = true }
metastruct = "0.1.0"
milhouse = { workspace = true }
parking_lot = { workspace = true }
rand = { workspace = true }
rand_xorshift = "0.3.0"
rayon = { workspace = true }
regex = { workspace = true }
rpds = { workspace = true }
rusqlite = { workspace = true }
safe_arith = { workspace = true }
serde = { workspace = true, features = ["rc"] }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
slog = { workspace = true }
ethereum_ssz = { workspace = true, features = ["arbitrary"] }
ethereum_ssz_derive = { workspace = true }
smallvec = { workspace = true }
ssz_types = { workspace = true, features = ["arbitrary"] }
superstruct = { workspace = true }
swap_or_not_shuffle = { workspace = true, features = ["arbitrary"] }
tempfile = { workspace = true }
test_random_derive = { path = "../../common/test_random_derive" }
tree_hash = { workspace = true }
tree_hash_derive = { workspace = true }
rand_xorshift = "0.3.0"
serde_yaml = { workspace = true }
tempfile = { workspace = true }
derivative = { workspace = true }
rusqlite = { workspace = true }
# The arbitrary dependency is enabled by default since Capella to avoid complexity introduced by
# `AbstractExecPayload`
arbitrary = { workspace = true, features = ["derive"] }
ethereum_serde_utils = { workspace = true }
regex = { workspace = true }
parking_lot = { workspace = true }
itertools = { workspace = true }
superstruct = { workspace = true }
metastruct = "0.1.0"
serde_json = { workspace = true }
smallvec = { workspace = true }
maplit = { workspace = true }
alloy-rlp = { version = "0.3.4", features = ["derive"] }
milhouse = { workspace = true }
rpds = { workspace = true }
fixed_bytes = { workspace = true }

[dev-dependencies]
criterion = { workspace = true }
beacon_chain = { workspace = true }
criterion = { workspace = true }
paste = { workspace = true }
state_processing = { workspace = true }
tokio = { workspace = true }
paste = { workspace = true }

[features]
default = ["sqlite", "legacy-arith"]
Expand Down
35 changes: 31 additions & 4 deletions testing/ef_tests/src/cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,37 @@ pub use ssz_generic::*;
pub use ssz_static::*;
pub use transition::TransitionTest;

#[derive(Debug, PartialEq)]
/// Used for running feature tests for future forks that have not yet been added to `ForkName`.
/// This runs tests in the directory named by the feature instead of the fork name. This has been
/// the pattern used in the `consensus-spec-tests` repository:
/// `consensus-spec-tests/tests/general/[feature_name]/[runner_name].`
/// e.g. consensus-spec-tests/tests/general/peerdas/ssz_static
///
/// The feature tests can be run with one of the following methods:
/// 1. `handler.run_for_feature(feature_name)` for new tests that are not on existing fork, i.e. a
/// new handler. This will be temporary and the test will need to be updated to use
/// `handle.run()` once the feature is incorporated into a fork.
/// 2. `handler.run()` for tests that are already on existing forks, but with new test vectors for
/// the feature. In this case the `handler.is_enabled_for_feature` will need to be implemented
/// to return `true` for the feature in order for the feature test vector to be tested.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum FeatureName {
Eip7594,
}

impl FeatureName {
pub fn list_all() -> Vec<FeatureName> {
vec![FeatureName::Eip7594]
}

/// `ForkName` to use when running the feature tests.
pub fn fork_name(&self) -> ForkName {
match self {
FeatureName::Eip7594 => ForkName::Deneb,
}
}
}

impl Display for FeatureName {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Expand Down Expand Up @@ -107,11 +133,12 @@ pub trait Case: Debug + Sync {
true
}

/// Whether or not this test exists for the given `feature_name`.
/// Whether or not this test exists for the given `feature_name`. This is intended to be used
/// for features that have not been added to a fork yet, and there is usually a separate folder
/// for the feature in the `consensus-spec-tests` repository.
///
/// Returns `true` by default.
/// Returns `false` by default.
fn is_enabled_for_feature(_feature_name: FeatureName) -> bool {
// FIXME(das): waiting for Jimmy's PR
false
}

Expand Down
9 changes: 9 additions & 0 deletions testing/ef_tests/src/cases/get_custody_columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ impl<E: EthSpec> LoadCase for GetCustodyColumns<E> {
}

impl<E: EthSpec> Case for GetCustodyColumns<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let spec = E::default_spec();
let node_id = U256::from_str_radix(&self.node_id, 10)
Expand All @@ -33,6 +41,7 @@ impl<E: EthSpec> Case for GetCustodyColumns<E> {
)
.expect("should compute custody columns")
.collect::<Vec<_>>();

let expected = &self.result;
if computed == *expected {
Ok(())
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_blob_to_kzg_commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ impl<E: EthSpec> Case for KZGBlobToKZGCommitment<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let kzg = get_kzg();
let commitment = parse_blob::<E>(&self.input.blob).and_then(|blob| {
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_compute_blob_kzg_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ impl<E: EthSpec> Case for KZGComputeBlobKZGProof<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let parse_input = |input: &KZGComputeBlobKZGProofInput| -> Result<_, Error> {
let blob = parse_blob::<E>(&input.blob)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ impl<E: EthSpec> LoadCase for KZGComputeCellsAndKZGProofs<E> {
}

impl<E: EthSpec> Case for KZGComputeCellsAndKZGProofs<E> {
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name == ForkName::Deneb
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_compute_kzg_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ impl<E: EthSpec> Case for KZGComputeKZGProof<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let parse_input = |input: &KZGComputeKZGProofInput| -> Result<_, Error> {
let blob = parse_blob::<E>(&input.blob)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ impl<E: EthSpec> LoadCase for KZGRecoverCellsAndKZGProofs<E> {
}

impl<E: EthSpec> Case for KZGRecoverCellsAndKZGProofs<E> {
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name == ForkName::Deneb
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ impl<E: EthSpec> Case for KZGVerifyBlobKZGProof<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let parse_input = |input: &KZGVerifyBlobKZGProofInput| -> Result<(Blob<E>, KzgCommitment, KzgProof), Error> {
let blob = parse_blob::<E>(&input.blob)?;
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ impl<E: EthSpec> Case for KZGVerifyBlobKZGProofBatch<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let parse_input = |input: &KZGVerifyBlobKZGProofBatchInput| -> Result<_, Error> {
let blobs = input
Expand Down
8 changes: 6 additions & 2 deletions testing/ef_tests/src/cases/kzg_verify_cell_kzg_proof_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ impl<E: EthSpec> LoadCase for KZGVerifyCellKZGProofBatch<E> {
}

impl<E: EthSpec> Case for KZGVerifyCellKZGProofBatch<E> {
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name == ForkName::Deneb
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
Expand Down
4 changes: 0 additions & 4 deletions testing/ef_tests/src/cases/kzg_verify_kzg_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ impl<E: EthSpec> Case for KZGVerifyKZGProof<E> {
fork_name == ForkName::Deneb
}

fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name != FeatureName::Eip7594
}

fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
let parse_input = |input: &KZGVerifyKZGProofInput| -> Result<_, Error> {
let commitment = parse_commitment(&input.commitment)?;
Expand Down
Loading

0 comments on commit 1205d83

Please sign in to comment.