mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 04:44:28 +00:00
Merge branch 'unstable' into gloas-fix-proposer-pref-gossip-verification
This commit is contained in:
@@ -1587,7 +1587,7 @@ pub async fn block_seen_on_gossip_without_blobs_or_columns() {
|
||||
let state = tester.harness.get_current_state();
|
||||
let fork_name = state.fork_name(&tester.harness.spec).unwrap();
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
if !fork_name.deneb_enabled() || fork_name.gloas_enabled() {
|
||||
if !fork_name.fulu_enabled() || fork_name.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1647,7 +1647,7 @@ pub async fn block_seen_on_gossip_without_blobs_or_columns() {
|
||||
/// This test checks that an HTTP POST request with the block & blobs/columns succeeds with a 200 response
|
||||
/// even if the block has already been seen on gossip without all blobs/columns.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
pub async fn block_seen_on_gossip_with_some_blobs_or_columns() {
|
||||
pub async fn block_seen_on_gossip_with_columns() {
|
||||
let validation_level: Option<BroadcastValidation> = Some(BroadcastValidation::Gossip);
|
||||
|
||||
// Validator count needs to be at least 32 or proposer boost gets set to 0 when computing
|
||||
@@ -1658,7 +1658,7 @@ pub async fn block_seen_on_gossip_with_some_blobs_or_columns() {
|
||||
let state = tester.harness.get_current_state();
|
||||
let fork_name = state.fork_name(&tester.harness.spec).unwrap();
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
if !fork_name.deneb_enabled() || fork_name.gloas_enabled() {
|
||||
if !fork_name.fulu_enabled() || fork_name.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1690,9 +1690,6 @@ pub async fn block_seen_on_gossip_with_some_blobs_or_columns() {
|
||||
blobs.0.len()
|
||||
);
|
||||
|
||||
let partial_kzg_proofs = [*blobs.0.first().unwrap()];
|
||||
let partial_blobs = [blobs.1.first().unwrap().clone()];
|
||||
|
||||
// Simulate the block being seen on gossip.
|
||||
block
|
||||
.clone()
|
||||
@@ -1702,12 +1699,7 @@ pub async fn block_seen_on_gossip_with_some_blobs_or_columns() {
|
||||
// Simulate some of the blobs being seen on gossip.
|
||||
tester
|
||||
.harness
|
||||
.process_gossip_blobs_or_columns(
|
||||
&block,
|
||||
partial_blobs.iter(),
|
||||
partial_kzg_proofs.iter(),
|
||||
Some(get_custody_columns(&tester, block.slot())),
|
||||
)
|
||||
.process_gossip_columns(&block, Some(get_custody_columns(&tester, block.slot())))
|
||||
.await;
|
||||
|
||||
// It should not yet be added to fork choice because all blobs have not been seen.
|
||||
@@ -1740,7 +1732,7 @@ pub async fn block_seen_on_gossip_with_some_blobs_or_columns() {
|
||||
/// This test checks that an HTTP POST request with the block & blobs/columns succeeds with a 200 response
|
||||
/// even if the blobs/columns have already been seen on gossip.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
pub async fn blobs_or_columns_seen_on_gossip_without_block() {
|
||||
pub async fn columns_seen_on_gossip_without_block() {
|
||||
let spec = test_spec::<E>();
|
||||
let validation_level: Option<BroadcastValidation> = Some(BroadcastValidation::Gossip);
|
||||
|
||||
@@ -1752,7 +1744,7 @@ pub async fn blobs_or_columns_seen_on_gossip_without_block() {
|
||||
let state = tester.harness.get_current_state();
|
||||
let fork_name = state.fork_name(&tester.harness.spec).unwrap();
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
if !fork_name.deneb_enabled() || fork_name.gloas_enabled() {
|
||||
if !fork_name.fulu_enabled() || fork_name.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1778,12 +1770,7 @@ pub async fn blobs_or_columns_seen_on_gossip_without_block() {
|
||||
// Simulate the blobs being seen on gossip.
|
||||
tester
|
||||
.harness
|
||||
.process_gossip_blobs_or_columns(
|
||||
&block,
|
||||
blobs.iter(),
|
||||
kzg_proofs.iter(),
|
||||
Some(get_custody_columns(&tester, block.slot())),
|
||||
)
|
||||
.process_gossip_columns(&block, Some(get_custody_columns(&tester, block.slot())))
|
||||
.await;
|
||||
|
||||
// It should not yet be added to fork choice because the block has not been seen.
|
||||
@@ -1816,7 +1803,7 @@ pub async fn blobs_or_columns_seen_on_gossip_without_block() {
|
||||
/// This test checks that an HTTP POST request with the block succeeds with a 200 response
|
||||
/// if just the blobs have already been seen on gossip.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn blobs_or_columns_seen_on_gossip_without_block_and_no_http_blobs_or_columns() {
|
||||
async fn columns_seen_on_gossip_without_block_and_no_http_columns() {
|
||||
let validation_level: Option<BroadcastValidation> = Some(BroadcastValidation::Gossip);
|
||||
|
||||
// Validator count needs to be at least 32 or proposer boost gets set to 0 when computing
|
||||
@@ -1827,7 +1814,7 @@ async fn blobs_or_columns_seen_on_gossip_without_block_and_no_http_blobs_or_colu
|
||||
let state = tester.harness.get_current_state();
|
||||
let fork_name = state.fork_name(&tester.harness.spec).unwrap();
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
if !fork_name.deneb_enabled() || fork_name.gloas_enabled() {
|
||||
if !fork_name.fulu_enabled() || fork_name.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1848,18 +1835,13 @@ async fn blobs_or_columns_seen_on_gossip_without_block_and_no_http_blobs_or_colu
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let ((block, blobs), _) = tester.harness.make_block(state_a, slot_b).await;
|
||||
let (kzg_proofs, blobs) = blobs.expect("should have some blobs");
|
||||
let (_, blobs) = blobs.expect("should have some blobs");
|
||||
assert!(!blobs.is_empty());
|
||||
|
||||
// Simulate the blobs being seen on gossip.
|
||||
tester
|
||||
.harness
|
||||
.process_gossip_blobs_or_columns(
|
||||
&block,
|
||||
blobs.iter(),
|
||||
kzg_proofs.iter(),
|
||||
Some(get_custody_columns(&tester, block.slot())),
|
||||
)
|
||||
.process_gossip_columns(&block, Some(get_custody_columns(&tester, block.slot())))
|
||||
.await;
|
||||
|
||||
// It should not yet be added to fork choice because the block has not been seen.
|
||||
@@ -1893,7 +1875,7 @@ async fn blobs_or_columns_seen_on_gossip_without_block_and_no_http_blobs_or_colu
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn slashable_blobs_or_columns_seen_on_gossip_cause_failure() {
|
||||
async fn slashable_columns_seen_on_gossip_cause_failure() {
|
||||
let validation_level: Option<BroadcastValidation> =
|
||||
Some(BroadcastValidation::ConsensusAndEquivocation);
|
||||
|
||||
@@ -1905,7 +1887,7 @@ async fn slashable_blobs_or_columns_seen_on_gossip_cause_failure() {
|
||||
let state = tester.harness.get_current_state();
|
||||
let fork_name = state.fork_name(&tester.harness.spec).unwrap();
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
if !fork_name.deneb_enabled() || fork_name.gloas_enabled() {
|
||||
if !fork_name.fulu_enabled() || fork_name.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1926,19 +1908,13 @@ async fn slashable_blobs_or_columns_seen_on_gossip_cause_failure() {
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let ((block_a, blobs_a), _) = tester.harness.make_block(state_a.clone(), slot_b).await;
|
||||
let ((block_b, blobs_b), _) = tester.harness.make_block(state_a, slot_b).await;
|
||||
let ((block_b, _), _) = tester.harness.make_block(state_a, slot_b).await;
|
||||
let (kzg_proofs_a, blobs_a) = blobs_a.expect("should have some blobs");
|
||||
let (kzg_proofs_b, blobs_b) = blobs_b.expect("should have some blobs");
|
||||
|
||||
// Simulate the blobs of block B being seen on gossip.
|
||||
tester
|
||||
.harness
|
||||
.process_gossip_blobs_or_columns(
|
||||
&block_b,
|
||||
blobs_b.iter(),
|
||||
kzg_proofs_b.iter(),
|
||||
Some(get_custody_columns(&tester, block_b.slot())),
|
||||
)
|
||||
.process_gossip_columns(&block_b, Some(get_custody_columns(&tester, block_b.slot())))
|
||||
.await;
|
||||
|
||||
// It should not yet be added to fork choice because block B has not been seen.
|
||||
@@ -1984,7 +1960,7 @@ pub async fn duplicate_block_status_code() {
|
||||
// Gloas blocks don't carry blobs (execution data comes via envelopes).
|
||||
let spec = test_spec::<E>();
|
||||
let genesis_fork = spec.fork_name_at_slot::<E>(Slot::new(0));
|
||||
if !genesis_fork.deneb_enabled() || genesis_fork.gloas_enabled() {
|
||||
if !genesis_fork.fulu_enabled() || genesis_fork.gloas_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
use beacon_chain::custody_context::NodeCustodyType;
|
||||
use beacon_chain::{
|
||||
ChainConfig,
|
||||
chain_config::{DisallowedReOrgOffsets, ReOrgThreshold},
|
||||
chain_config::DisallowedReOrgOffsets,
|
||||
test_utils::{
|
||||
AttestationStrategy, BlockStrategy, LightClientStrategy, SyncCommitteeStrategy, test_spec,
|
||||
},
|
||||
@@ -23,7 +23,7 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use types::{
|
||||
Address, Epoch, EthSpec, ExecPayload, ExecutionBlockHash, ForkName, Hash256, MainnetEthSpec,
|
||||
MinimalEthSpec, ProposerPreparationData, Slot, Uint256,
|
||||
MinimalEthSpec, ProposerPreparationData, Slot,
|
||||
};
|
||||
|
||||
type E = MainnetEthSpec;
|
||||
@@ -181,8 +181,6 @@ pub struct ReOrgTest {
|
||||
parent_distance: u64,
|
||||
/// Number of slots between head block and block proposal slot.
|
||||
head_distance: u64,
|
||||
re_org_threshold: u64,
|
||||
max_epochs_since_finalization: u64,
|
||||
percent_parent_votes: usize,
|
||||
percent_empty_votes: usize,
|
||||
percent_head_votes: usize,
|
||||
@@ -201,8 +199,6 @@ impl Default for ReOrgTest {
|
||||
head_slot: Slot::new(E::slots_per_epoch() - 2),
|
||||
parent_distance: 1,
|
||||
head_distance: 1,
|
||||
re_org_threshold: 20,
|
||||
max_epochs_since_finalization: 2,
|
||||
percent_parent_votes: 100,
|
||||
percent_empty_votes: 100,
|
||||
percent_head_votes: 0,
|
||||
@@ -388,8 +384,6 @@ pub async fn proposer_boost_re_org_test(
|
||||
head_slot,
|
||||
parent_distance,
|
||||
head_distance,
|
||||
re_org_threshold,
|
||||
max_epochs_since_finalization,
|
||||
percent_parent_votes,
|
||||
percent_empty_votes,
|
||||
percent_head_votes,
|
||||
@@ -403,8 +397,7 @@ pub async fn proposer_boost_re_org_test(
|
||||
|
||||
// TODO(EIP-7732): extend test for Gloas — `get_validator_blocks_v3` is missing the
|
||||
// `Eth-Execution-Payload-Blinded` header for Gloas block production responses.
|
||||
let mut spec = ForkName::Fulu.make_genesis_spec(E::default_spec());
|
||||
spec.terminal_total_difficulty = Uint256::from(1);
|
||||
let spec = ForkName::Fulu.make_genesis_spec(E::default_spec());
|
||||
|
||||
// Ensure there are enough validators to have `attesters_per_slot`.
|
||||
let attesters_per_slot = 10;
|
||||
@@ -427,14 +420,9 @@ pub async fn proposer_boost_re_org_test(
|
||||
validator_count,
|
||||
None,
|
||||
Some(Box::new(move |builder| {
|
||||
builder
|
||||
.proposer_re_org_head_threshold(Some(ReOrgThreshold(re_org_threshold)))
|
||||
.proposer_re_org_max_epochs_since_finalization(Epoch::new(
|
||||
max_epochs_since_finalization,
|
||||
))
|
||||
.proposer_re_org_disallowed_offsets(
|
||||
DisallowedReOrgOffsets::new::<E>(disallowed_offsets).unwrap(),
|
||||
)
|
||||
builder.proposer_re_org_disallowed_offsets(
|
||||
DisallowedReOrgOffsets::new::<E>(disallowed_offsets).unwrap(),
|
||||
)
|
||||
})),
|
||||
Default::default(),
|
||||
false,
|
||||
|
||||
@@ -9167,11 +9167,17 @@ async fn builder_works_post_deneb() {
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn get_blob_sidecars() {
|
||||
let mut config = ApiTesterConfig::default();
|
||||
let mut config = ApiTesterConfig {
|
||||
retain_historic_states: false,
|
||||
spec: E::default_spec(),
|
||||
node_custody_type: NodeCustodyType::Supernode,
|
||||
};
|
||||
config.spec.altair_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.bellatrix_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.capella_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.deneb_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.electra_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.fulu_fork_epoch = Some(Epoch::new(0));
|
||||
|
||||
ApiTester::new_from_config(config)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user