mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 13:24:44 +00:00
Remove merge transition code (#8761)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -85,14 +85,18 @@ pub async fn gossip_invalid() {
|
||||
/* mandated by Beacon API spec */
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
// The error depends on whether blobs exist (which affects validation order):
|
||||
// - Pre-Deneb (no blobs): block validation runs first -> NotFinalizedDescendant
|
||||
// - Deneb/Electra (blobs): blob validation runs first -> ParentUnknown
|
||||
// - Fulu+ (columns): block validation runs first -> NotFinalizedDescendant
|
||||
let pre_finalized_block_root = Hash256::zero();
|
||||
let expected_error_msg = if tester.harness.spec.is_fulu_scheduled() {
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
// Since Deneb, the invalidity of the blobs will be detected prior to the invalidity of the
|
||||
// block.
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
|
||||
@@ -283,13 +287,13 @@ pub async fn consensus_invalid() {
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
let pre_finalized_block_root = Hash256::zero();
|
||||
let expected_error_msg = if tester.harness.spec.is_fulu_scheduled() {
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
// Since Deneb, the invalidity of the blobs will be detected prior to the invalidity of the
|
||||
// block.
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
|
||||
@@ -520,13 +524,13 @@ pub async fn equivocation_invalid() {
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
let pre_finalized_block_root = Hash256::zero();
|
||||
let expected_error_msg = if tester.harness.spec.is_fulu_scheduled() {
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
// Since Deneb, the invalidity of the blobs will be detected prior to the invalidity of the
|
||||
// block.
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
|
||||
@@ -845,16 +849,17 @@ pub async fn blinded_gossip_invalid() {
|
||||
assert!(response.is_err());
|
||||
|
||||
let error_response: eth2::Error = response.err().unwrap();
|
||||
/* mandated by Beacon API spec */
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
let pre_finalized_block_root = Hash256::zero();
|
||||
let expected_error_msg = if tester.harness.spec.is_fulu_scheduled() {
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
// Since Deneb, the invalidity of the blobs will be detected prior to the invalidity of the
|
||||
// block.
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
|
||||
@@ -1070,10 +1075,16 @@ pub async fn blinded_consensus_invalid() {
|
||||
);
|
||||
} else {
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
assert_server_message_error(
|
||||
error_response,
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}"),
|
||||
);
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
assert_server_message_error(error_response, expected_error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1253,10 +1264,16 @@ pub async fn blinded_equivocation_invalid() {
|
||||
);
|
||||
} else {
|
||||
assert_eq!(error_response.status(), Some(StatusCode::BAD_REQUEST));
|
||||
assert_server_message_error(
|
||||
error_response,
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}"),
|
||||
);
|
||||
let expected_error_msg = if tester.harness.spec.deneb_fork_epoch.is_none()
|
||||
|| tester.harness.spec.is_fulu_scheduled()
|
||||
{
|
||||
format!(
|
||||
"BAD_REQUEST: NotFinalizedDescendant {{ block_parent_root: {pre_finalized_block_root:?} }}"
|
||||
)
|
||||
} else {
|
||||
format!("BAD_REQUEST: ParentUnknown {{ parent_root: {pre_finalized_block_root:?} }}")
|
||||
};
|
||||
assert_server_message_error(error_response, expected_error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1957,6 +1974,13 @@ pub async fn duplicate_block_status_code() {
|
||||
let validator_count = 64;
|
||||
let num_initial: u64 = 31;
|
||||
let duplicate_block_status_code = StatusCode::IM_A_TEAPOT;
|
||||
|
||||
// Check if deneb is enabled, which is required for blobs.
|
||||
let spec = test_spec::<E>();
|
||||
if !spec.fork_name_at_slot::<E>(Slot::new(0)).deneb_enabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
let tester = InteractiveTester::<E>::new_with_initializer_and_mutator(
|
||||
None,
|
||||
validator_count,
|
||||
|
||||
Reference in New Issue
Block a user