Merge branch 'deneb-free-blobs' into merge-unstable-deneb-june-6th
This commit is contained in:
commit
382b5abbee
8
.github/workflows/test-suite.yml
vendored
8
.github/workflows/test-suite.yml
vendored
@ -118,8 +118,8 @@ jobs:
|
|||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run operation_pool tests for all known forks
|
- name: Run operation_pool tests for all known forks
|
||||||
run: make test-op-pool
|
run: make test-op-pool
|
||||||
network-minimal-tests:
|
network-tests:
|
||||||
name: network-minimal-tests
|
name: network-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: cargo-fmt
|
needs: cargo-fmt
|
||||||
steps:
|
steps:
|
||||||
@ -130,8 +130,8 @@ jobs:
|
|||||||
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
|
uses: arduino/setup-protoc@e52d9eb8f7b63115df1ac544a1376fdbf5a39612
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run network tests for all known forks using the minimal spec
|
- name: Run network tests for all known forks
|
||||||
run: make test-network-minimal
|
run: make test-network
|
||||||
slasher-tests:
|
slasher-tests:
|
||||||
name: slasher-tests
|
name: slasher-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -13,6 +13,7 @@ genesis.ssz
|
|||||||
|
|
||||||
# IntelliJ
|
# IntelliJ
|
||||||
/*.iml
|
/*.iml
|
||||||
|
.idea
|
||||||
|
|
||||||
# VSCode
|
# VSCode
|
||||||
/.vscode
|
/.vscode
|
||||||
.idea
|
|
||||||
|
11
Makefile
11
Makefile
@ -106,12 +106,12 @@ build-release-tarballs:
|
|||||||
# Runs the full workspace tests in **release**, without downloading any additional
|
# Runs the full workspace tests in **release**, without downloading any additional
|
||||||
# test vectors.
|
# test vectors.
|
||||||
test-release:
|
test-release:
|
||||||
cargo test --workspace --release --exclude ef_tests --exclude beacon_chain --exclude slasher
|
cargo test --workspace --release --exclude ef_tests --exclude beacon_chain --exclude slasher --exclude network
|
||||||
|
|
||||||
# Runs the full workspace tests in **debug**, without downloading any additional test
|
# Runs the full workspace tests in **debug**, without downloading any additional test
|
||||||
# vectors.
|
# vectors.
|
||||||
test-debug:
|
test-debug:
|
||||||
cargo test --workspace --exclude ef_tests --exclude beacon_chain
|
cargo test --workspace --exclude ef_tests --exclude beacon_chain --exclude network
|
||||||
|
|
||||||
# Runs cargo-fmt (linter).
|
# Runs cargo-fmt (linter).
|
||||||
cargo-fmt:
|
cargo-fmt:
|
||||||
@ -143,11 +143,12 @@ test-op-pool-%:
|
|||||||
--features 'beacon_chain/fork_from_env'\
|
--features 'beacon_chain/fork_from_env'\
|
||||||
-p operation_pool
|
-p operation_pool
|
||||||
|
|
||||||
test-network-minimal: $(patsubst %,test-network-minimal-%,$(FORKS))
|
# Run the tests in the `network` crate for all known forks.
|
||||||
|
test-network: $(patsubst %,test-network-%,$(FORKS))
|
||||||
|
|
||||||
test-network-minimal-%:
|
test-network-%:
|
||||||
env FORK_NAME=$* cargo test --release \
|
env FORK_NAME=$* cargo test --release \
|
||||||
--features 'fork_from_env,spec-minimal'\
|
--features 'fork_from_env' \
|
||||||
-p network
|
-p network
|
||||||
|
|
||||||
# Run the tests in the `slasher` crate for all supported database backends.
|
# Run the tests in the `slasher` crate for all supported database backends.
|
||||||
|
@ -13,7 +13,6 @@ node_test_rig = { path = "../testing/node_test_rig" }
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
write_ssz_files = ["beacon_chain/write_ssz_files"] # Writes debugging .ssz files to /tmp during block processing.
|
write_ssz_files = ["beacon_chain/write_ssz_files"] # Writes debugging .ssz files to /tmp during block processing.
|
||||||
spec-minimal = ["beacon_chain/spec-minimal"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
eth2_config = { path = "../common/eth2_config" }
|
eth2_config = { path = "../common/eth2_config" }
|
||||||
|
@ -10,7 +10,6 @@ default = ["participation_metrics"]
|
|||||||
write_ssz_files = [] # Writes debugging .ssz files to /tmp during block processing.
|
write_ssz_files = [] # Writes debugging .ssz files to /tmp during block processing.
|
||||||
participation_metrics = [] # Exposes validator participation metrics to Prometheus.
|
participation_metrics = [] # Exposes validator participation metrics to Prometheus.
|
||||||
fork_from_env = [] # Initialise the harness chain spec from the FORK_NAME env variable
|
fork_from_env = [] # Initialise the harness chain spec from the FORK_NAME env variable
|
||||||
spec-minimal = ["kzg/minimal-spec"]
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
|
@ -849,7 +849,6 @@ impl ssz::Decode for OverflowKey {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use crate::{
|
use crate::{
|
||||||
blob_verification::{
|
blob_verification::{
|
||||||
validate_blob_sidecar_for_gossip, verify_kzg_for_blob, GossipVerifiedBlob,
|
validate_blob_sidecar_for_gossip, verify_kzg_for_blob, GossipVerifiedBlob,
|
||||||
@ -859,31 +858,20 @@ mod test {
|
|||||||
eth1_finalization_cache::Eth1FinalizationData,
|
eth1_finalization_cache::Eth1FinalizationData,
|
||||||
test_utils::{BaseHarnessType, BeaconChainHarness, DiskHarnessType},
|
test_utils::{BaseHarnessType, BeaconChainHarness, DiskHarnessType},
|
||||||
};
|
};
|
||||||
#[cfg(feature = "spec-minimal")]
|
use execution_layer::test_utils::DEFAULT_TERMINAL_BLOCK;
|
||||||
use fork_choice::PayloadVerificationStatus;
|
use fork_choice::PayloadVerificationStatus;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use logging::test_logger;
|
use logging::test_logger;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use slog::{info, Logger};
|
use slog::{info, Logger};
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use state_processing::ConsensusContext;
|
use state_processing::ConsensusContext;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use std::collections::{BTreeMap, HashMap, VecDeque};
|
use std::collections::{BTreeMap, HashMap, VecDeque};
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use std::ops::AddAssign;
|
use std::ops::AddAssign;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use store::{HotColdDB, ItemStore, LevelDB, StoreConfig};
|
use store::{HotColdDB, ItemStore, LevelDB, StoreConfig};
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use tempfile::{tempdir, TempDir};
|
use tempfile::{tempdir, TempDir};
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use types::beacon_state::ssz_tagged_beacon_state;
|
use types::beacon_state::ssz_tagged_beacon_state;
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
use types::{ChainSpec, ExecPayload, MinimalEthSpec};
|
use types::{ChainSpec, ExecPayload, MinimalEthSpec};
|
||||||
|
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
const LOW_VALIDATOR_COUNT: usize = 32;
|
const LOW_VALIDATOR_COUNT: usize = 32;
|
||||||
|
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
fn get_store_with_spec<E: EthSpec>(
|
fn get_store_with_spec<E: EthSpec>(
|
||||||
db_path: &TempDir,
|
db_path: &TempDir,
|
||||||
spec: ChainSpec,
|
spec: ChainSpec,
|
||||||
@ -906,7 +894,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get a beacon chain harness advanced to just before deneb fork
|
// get a beacon chain harness advanced to just before deneb fork
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn get_deneb_chain<E: EthSpec>(
|
async fn get_deneb_chain<E: EthSpec>(
|
||||||
log: Logger,
|
log: Logger,
|
||||||
db_path: &TempDir,
|
db_path: &TempDir,
|
||||||
@ -994,7 +981,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn ssz_tagged_beacon_state_encode_decode_equality() {
|
async fn ssz_tagged_beacon_state_encode_decode_equality() {
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
let altair_fork_epoch = Epoch::new(1);
|
let altair_fork_epoch = Epoch::new(1);
|
||||||
@ -1011,6 +997,13 @@ mod test {
|
|||||||
spec.bellatrix_fork_epoch = Some(bellatrix_fork_epoch);
|
spec.bellatrix_fork_epoch = Some(bellatrix_fork_epoch);
|
||||||
spec.capella_fork_epoch = Some(capella_fork_epoch);
|
spec.capella_fork_epoch = Some(capella_fork_epoch);
|
||||||
spec.deneb_fork_epoch = Some(deneb_fork_epoch);
|
spec.deneb_fork_epoch = Some(deneb_fork_epoch);
|
||||||
|
let genesis_block = execution_layer::test_utils::generate_genesis_block(
|
||||||
|
spec.terminal_total_difficulty,
|
||||||
|
DEFAULT_TERMINAL_BLOCK,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
spec.terminal_block_hash = genesis_block.block_hash;
|
||||||
|
spec.terminal_block_hash_activation_epoch = bellatrix_fork_epoch;
|
||||||
|
|
||||||
let harness = BeaconChainHarness::builder(E::default())
|
let harness = BeaconChainHarness::builder(E::default())
|
||||||
.spec(spec)
|
.spec(spec)
|
||||||
@ -1069,7 +1062,6 @@ mod test {
|
|||||||
assert_eq!(state, decoded, "Encoded and decoded states should be equal");
|
assert_eq!(state, decoded, "Encoded and decoded states should be equal");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn availability_pending_block<E, Hot, Cold>(
|
async fn availability_pending_block<E, Hot, Cold>(
|
||||||
harness: &BeaconChainHarness<BaseHarnessType<E, Hot, Cold>>,
|
harness: &BeaconChainHarness<BaseHarnessType<E, Hot, Cold>>,
|
||||||
log: Logger,
|
log: Logger,
|
||||||
@ -1166,7 +1158,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn overflow_cache_test_insert_components() {
|
async fn overflow_cache_test_insert_components() {
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
type T = DiskHarnessType<E>;
|
type T = DiskHarnessType<E>;
|
||||||
@ -1287,7 +1278,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn overflow_cache_test_overflow() {
|
async fn overflow_cache_test_overflow() {
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
type T = DiskHarnessType<E>;
|
type T = DiskHarnessType<E>;
|
||||||
@ -1447,7 +1437,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn overflow_cache_test_maintenance() {
|
async fn overflow_cache_test_maintenance() {
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
type T = DiskHarnessType<E>;
|
type T = DiskHarnessType<E>;
|
||||||
@ -1599,7 +1588,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "spec-minimal")]
|
|
||||||
async fn overflow_cache_test_persist_recover() {
|
async fn overflow_cache_test_persist_recover() {
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
type T = DiskHarnessType<E>;
|
type T = DiskHarnessType<E>;
|
||||||
|
@ -25,8 +25,8 @@ use warp::{http::StatusCode, Filter, Rejection};
|
|||||||
|
|
||||||
use crate::EngineCapabilities;
|
use crate::EngineCapabilities;
|
||||||
pub use execution_block_generator::{
|
pub use execution_block_generator::{
|
||||||
generate_genesis_header, generate_pow_block, generate_random_blobs, Block,
|
generate_genesis_block, generate_genesis_header, generate_pow_block, generate_random_blobs,
|
||||||
ExecutionBlockGenerator,
|
Block, ExecutionBlockGenerator,
|
||||||
};
|
};
|
||||||
pub use hook::Hook;
|
pub use hook::Hook;
|
||||||
pub use mock_builder::{Context as MockBuilderContext, MockBuilder, Operation, TestingBuilder};
|
pub use mock_builder::{Context as MockBuilderContext, MockBuilder, Operation, TestingBuilder};
|
||||||
|
@ -51,5 +51,4 @@ parking_lot = "0.12.0"
|
|||||||
environment = { path = "../../lighthouse/environment" }
|
environment = { path = "../../lighthouse/environment" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
spec-minimal = ["beacon_chain/spec-minimal"]
|
|
||||||
fork_from_env = ["beacon_chain/fork_from_env"]
|
fork_from_env = ["beacon_chain/fork_from_env"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#![cfg(feature = "spec-minimal")]
|
|
||||||
use crate::network_beacon_processor::NetworkBeaconProcessor;
|
use crate::network_beacon_processor::NetworkBeaconProcessor;
|
||||||
|
|
||||||
use crate::service::RequestId;
|
use crate::service::RequestId;
|
||||||
use crate::sync::manager::RequestId as SyncId;
|
use crate::sync::manager::RequestId as SyncId;
|
||||||
use crate::NetworkMessage;
|
use crate::NetworkMessage;
|
||||||
@ -44,7 +44,7 @@ impl TestRig {
|
|||||||
let log = build_log(slog::Level::Debug, enable_log);
|
let log = build_log(slog::Level::Debug, enable_log);
|
||||||
|
|
||||||
// Initialise a new beacon chain
|
// Initialise a new beacon chain
|
||||||
let harness = BeaconChainHarness::<EphemeralHarnessType<E>>::builder(E::default())
|
let harness = BeaconChainHarness::<EphemeralHarnessType<E>>::builder(E)
|
||||||
.default_spec()
|
.default_spec()
|
||||||
.logger(log.clone())
|
.logger(log.clone())
|
||||||
.deterministic_keypairs(1)
|
.deterministic_keypairs(1)
|
||||||
@ -114,7 +114,7 @@ impl TestRig {
|
|||||||
};
|
};
|
||||||
let (bundle, transactions) = execution_layer::test_utils::generate_random_blobs::<E>(
|
let (bundle, transactions) = execution_layer::test_utils::generate_random_blobs::<E>(
|
||||||
num_blobs,
|
num_blobs,
|
||||||
&self.harness.chain.kzg.as_ref().unwrap(),
|
self.harness.chain.kzg.as_ref().unwrap(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
@ -145,8 +145,8 @@ impl TestRig {
|
|||||||
block_parent_root: block.parent_root(),
|
block_parent_root: block.parent_root(),
|
||||||
proposer_index: block.message().proposer_index(),
|
proposer_index: block.message().proposer_index(),
|
||||||
blob: blob.clone(),
|
blob: blob.clone(),
|
||||||
kzg_commitment: kzg_commitment.clone(),
|
kzg_commitment,
|
||||||
kzg_proof: kzg_proof.clone(),
|
kzg_proof,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1390,7 +1390,7 @@ mod deneb_only {
|
|||||||
|
|
||||||
fn blobs_response_was_valid(mut self) -> Self {
|
fn blobs_response_was_valid(mut self) -> Self {
|
||||||
self.rig.expect_empty_network();
|
self.rig.expect_empty_network();
|
||||||
if self.blobs.len() > 0 {
|
if !self.blobs.is_empty() {
|
||||||
self.rig.expect_block_process(ResponseType::Blob);
|
self.rig.expect_block_process(ResponseType::Blob);
|
||||||
}
|
}
|
||||||
self
|
self
|
||||||
|
@ -17,7 +17,7 @@ modern = ["bls/supranational-force-adx"]
|
|||||||
# Uses the slower Milagro BLS library, which is written in native Rust.
|
# Uses the slower Milagro BLS library, which is written in native Rust.
|
||||||
milagro = ["bls/milagro"]
|
milagro = ["bls/milagro"]
|
||||||
# Support minimal spec (used for testing only).
|
# Support minimal spec (used for testing only).
|
||||||
spec-minimal = ["beacon_node/spec-minimal"]
|
spec-minimal = []
|
||||||
# Support Gnosis spec and Gnosis Beacon Chain.
|
# Support Gnosis spec and Gnosis Beacon Chain.
|
||||||
gnosis = []
|
gnosis = []
|
||||||
# Support slasher MDBX backend.
|
# Support slasher MDBX backend.
|
||||||
|
Loading…
Reference in New Issue
Block a user