From a8f4cf28b33efa6409905af1e07162f5b051dba5 Mon Sep 17 00:00:00 2001 From: Povilas Liubauskas Date: Fri, 22 Mar 2024 13:04:27 +0200 Subject: [PATCH] Fixes for passing tests: - Update `consensus-spec-tests` test vector submodule to v1.4.0 and implement fixes in fork choice. - Remove several unnecessary fork choice extra tests. - Slashing protection tests: Test block proposals and attestations against `should_succeed_complete` from test vectors, since we have a complete slashing protection DB, not a minimal one. --- Cargo.lock | 1 - builder_api/src/api.rs | 2 +- consensus-spec-tests | 2 +- fork_choice_control/Cargo.toml | 1 - fork_choice_control/src/extra_tests.rs | 316 +----------------- fork_choice_control/src/specialized.rs | 1 + fork_choice_control/src/storage_back_sync.rs | 2 +- fork_choice_store/src/store.rs | 28 +- grandine-snapshot-tests | 2 +- http_api/src/context.rs | 4 + .../attestation_packer.rs | 5 +- slashing_protection/src/lib.rs | 68 +--- 12 files changed, 37 insertions(+), 395 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 004ab292..a81587c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2618,7 +2618,6 @@ dependencies = [ "reqwest", "serde", "serde-aux", - "serde_json", "serde_utils", "spec_test_utils", "ssz", diff --git a/builder_api/src/api.rs b/builder_api/src/api.rs index 1ff1bc30..c6ae5356 100644 --- a/builder_api/src/api.rs +++ b/builder_api/src/api.rs @@ -283,6 +283,7 @@ fn validate_phase(computed: Phase, in_response: Phase) -> Result<()> { } #[cfg(test)] +#[cfg(feature = "eth2-cache")] mod tests { use eth2_cache_utils::mainnet; use reqwest::{Client, Url}; @@ -320,7 +321,6 @@ mod tests { 43, [42, 21, 0] => Err(BuilderApiError::RollingEpochMissingBlocks { missing_blocks: 30 }); "more missing blocks than allowed in first gap alone" )] - #[cfg(feature = "eth2-cache")] fn circuit_breaker_conditions( slot: Slot, nonempty_slots: impl IntoIterator, diff --git a/consensus-spec-tests b/consensus-spec-tests index a8e3d532..5df4cd33 160000 --- a/consensus-spec-tests +++ b/consensus-spec-tests @@ -1 +1 @@ -Subproject commit a8e3d53243d86e95fe745aa32e4766485ac29a4c +Subproject commit 5df4cd333fb3736279d0cd93ded2e691c8ebcf12 diff --git a/fork_choice_control/Cargo.toml b/fork_choice_control/Cargo.toml index 55b9ef96..9818bb74 100644 --- a/fork_choice_control/Cargo.toml +++ b/fork_choice_control/Cargo.toml @@ -51,7 +51,6 @@ eth2_cache_utils = { workspace = true } factory = { workspace = true } fs-err = { workspace = true } serde-aux = { workspace = true } -serde_json = { workspace = true } spec_test_utils = { workspace = true } tap = { workspace = true } test-generator = { workspace = true } diff --git a/fork_choice_control/src/extra_tests.rs b/fork_choice_control/src/extra_tests.rs index 14af65a4..807fb5ac 100644 --- a/fork_choice_control/src/extra_tests.rs +++ b/fork_choice_control/src/extra_tests.rs @@ -12,27 +12,29 @@ #![allow(clippy::too_many_lines)] use core::ops::Not as _; -use std::{path::PathBuf, sync::Arc}; +#[cfg(feature = "eth2-cache")] +use std::sync::Arc; -use anyhow::Result; -use eth2_cache_utils::{mainnet, medalla, withdrawal_devnet_3}; +#[cfg(feature = "eth2-cache")] +use eth2_cache_utils::medalla; +#[cfg(feature = "eth2-cache")] use eth2_libp2p::GossipId; -use execution_engine::PayloadStatusV1; use fork_choice_store::PayloadStatus; use helper_functions::misc; +#[cfg(feature = "eth2-cache")] use std_ext::ArcExt as _; +#[cfg(feature = "eth2-cache")] +use types::{config::Config, preset::Medalla}; use types::{ - combined::SignedBeaconBlock, - config::Config, phase0::{consts::GENESIS_SLOT, primitives::H256}, - preset::{Medalla, Minimal}, + preset::Minimal, traits::SignedBeaconBlock as _, }; -use crate::{ - helpers::{is_at_start_of_epoch, start_of_epoch, Context, Status}, - specialized::TestController, -}; +use crate::helpers::{is_at_start_of_epoch, start_of_epoch, Context, Status}; + +#[cfg(feature = "eth2-cache")] +use crate::specialized::TestController; // This test was added to reproduce the bug described in // . @@ -87,180 +89,6 @@ fn processes_blocks_from_medalla_in_their_slots() { } } -// The blocks were not actually invalid. -// We had missed the change to the type of `WithdrawalV1.amount` in `execution-apis`. -#[test] -#[cfg(feature = "eth2-cache")] -fn handles_invalid_blocks_from_withdrawal_devnet_3() -> Result<()> { - let config = Arc::new(Config::withdrawal_devnet_3()); - - let genesis_block = withdrawal_devnet_3::GENESIS_BEACON_BLOCK - .force() - .clone_arc(); - - let genesis_state = withdrawal_devnet_3::GENESIS_BEACON_STATE - .force() - .clone_arc(); - - let last_slot = 672; - let last_valid_slot = 643; - let justified_slot = 640; - let blocks = withdrawal_devnet_3::beacon_blocks(1..=last_slot, 6); - - let index_of_slot = |slot| { - blocks - .binary_search_by_key(&slot, |block| block.message().slot()) - .unwrap_or_else(|_| panic!("withdrawal-devnet-3 should have a block at slot {slot}")) - }; - - let last_valid_index = index_of_slot(last_valid_slot); - let justified_index = index_of_slot(justified_slot); - let last_valid_block = &blocks[last_valid_index]; - let justified_block = &blocks[justified_index]; - let (valid_blocks, invalid_blocks) = blocks.split_at(last_valid_index + 1); - let (invalid_blocks, poison_blocks) = invalid_blocks.split_at(invalid_blocks.len() - 1); - - let (controller, _mutator_handle) = TestController::quiet(config, genesis_block, genesis_state); - - let mut json_directory = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - assert!(json_directory.pop()); - json_directory.push("eth2-cache/withdrawals_devnet_3/json"); - - let add_block = |block: &Arc>| -> Result<()> { - let block_root = block.message().hash_tree_root(); - let path = json_directory.join(format!("payload_response_block_root_{block_root:?}.json")); - let bytes = fs_err::read(path)?; - let payload_status = serde_json::from_slice::(bytes.as_slice())?; - - let execution_block_hash = block - .execution_block_hash() - .expect("every block from withdrawal-devnet-3 should be post-Bellatrix"); - - controller.on_slot(block.message().slot()); - controller.on_gossip_block(block.clone_arc(), GossipId::default()); - controller.on_notified_new_payload(execution_block_hash, payload_status); - controller.wait_for_tasks(); - - Ok(()) - }; - - let assert_head = |block: &Arc>| { - let head = controller.head().value; - - assert_eq!(head.slot(), block.message().slot()); - assert_eq!(head.block_root, block.message().hash_tree_root()); - }; - - for block in valid_blocks { - add_block(block)?; - assert_head(block); - } - - assert_head(last_valid_block); - - for block in invalid_blocks { - add_block(block)?; - assert_head(last_valid_block); - } - - for block in poison_blocks { - add_block(block)?; - assert_head(justified_block); - } - - Ok(()) -} - -// This test was added to verify the comment about anchors above `Store::is_block_viable`. -// We weren't sure how long the store would remain without viable forks after the changes to -// viability checking in `consensus-specs` version 1.3.0-rc.4. -// The test revealed a bug in `Store::apply_tick` that was making the mutator panic. -// `Store::head` was being called while the `Store` was in an inconsistent state. -// That made `assert!(no_viable_segments)` fail, though the end result may have been unaffected. -#[test] -#[cfg(feature = "eth2-cache")] -fn handles_blocks_after_non_genesis_anchor_in_their_slots() { - let config = Arc::new(Config::mainnet()); - let anchor_state = mainnet::ALTAIR_BEACON_STATE.force().clone_arc(); - let anchor_block = mainnet::ALTAIR_BEACON_BLOCK.force().clone_arc(); - - let (viable_block, non_viable_blocks) = mainnet::ALTAIR_BEACON_BLOCKS_FROM_32_SLOTS - .force() - .split_last() - .expect("range should contain at least one block"); - - let (controller, _mutator_handle) = - TestController::quiet(config, anchor_block.clone_arc(), anchor_state); - - let add_block = |block: &Arc>| { - controller.on_slot(block.message().slot()); - controller.on_gossip_block(block.clone_arc(), GossipId::default()); - controller.wait_for_tasks(); - }; - - let assert_head = |block: &Arc>| { - let head = controller.head().value; - - assert_eq!(head.slot(), block.message().slot()); - assert_eq!(head.block_root, block.message().hash_tree_root()); - }; - - for block in non_viable_blocks { - add_block(block); - assert_head(&anchor_block); - } - - add_block(viable_block); - assert_head(viable_block); -} - -#[test] -#[cfg(feature = "eth2-cache")] -fn handles_blocks_after_non_genesis_anchor_in_a_future_slot() { - let config = Arc::new(Config::mainnet()); - let anchor_state = mainnet::ALTAIR_BEACON_STATE.force().clone_arc(); - let anchor_block = mainnet::ALTAIR_BEACON_BLOCK.force().clone_arc(); - let supermajority_block_index = 22; - - let (non_viable_blocks, viable_blocks) = mainnet::ALTAIR_BEACON_BLOCKS_FROM_32_SLOTS - .force() - .split_at(supermajority_block_index); - - let last_slot = viable_blocks - .last() - .expect("range should contain at least one block") - .message() - .slot(); - - let (controller, _mutator_handle) = - TestController::quiet(config, anchor_block.clone_arc(), anchor_state); - - let add_block = |block: &Arc>| { - controller.on_requested_block(block.clone_arc(), None); - controller.wait_for_tasks(); - }; - - let assert_head = |block: &Arc>| { - let head = controller.head().value; - - assert_eq!(head.slot(), block.message().slot()); - assert_eq!(head.block_root, block.message().hash_tree_root()); - }; - - controller.on_slot(last_slot); - controller.wait_for_tasks(); - - for block in non_viable_blocks { - add_block(block); - assert_head(&anchor_block); - } - - for block in viable_blocks { - add_block(block); - assert_head(block); - } -} - // Based on the only fork choice test we had in the repository from 2019. #[test] fn handles_happy_path_with_3_blocks_and_height_difference_of_1() { @@ -510,124 +338,6 @@ fn best_child_is_updated_when_it_falls_behind_the_2nd_best_one() { }); } -// ```text -// 0 -// / \ -// 1 | block in epoch 1, justified between epochs 2 and 3 by blocks 2 and 3 -// | | -// 2 | block at the start of epoch 2, with attestations justifying block 1 in epoch 1 -// | | -// | 4 block in epoch 2, justified between epochs 2 and 3 by blocks 5 and 6 -// | | -// | 5 block at the end of epoch 2, with attestations justifying block 4 in epoch 2 -// | | -// 3 | block at the start of epoch 3, causing attestations added by block 2 to be processed -// | -// 6 block at the start of epoch 3, causing attestations added by block 5 to be processed -// ``` -// -// There used to be separate tests for this happening early and late in an epoch. -// The checkpoint would only be updated in the first `SAFE_SLOTS_TO_UPDATE_JUSTIFIED` slots. -// The condition was removed from the Fork Choice specification in version 1.3.0-rc.4. -#[test] -fn justified_checkpoint_always_switches_to_later_one() { - let mut context = Context::minimal(); - - let (_, state_0) = context.genesis(); - let (block_1, state_1) = context.empty_block(&state_0, start_of_epoch(1), H256::default()); - let (block_2, state_2) = context.block_justifying_previous_epoch(&state_1, 2, H256::default()); - let (block_3, _) = context.empty_block(&state_2, start_of_epoch(3), H256::default()); - let (block_4, state_4) = context.empty_block(&state_0, start_of_epoch(2), H256::default()); - let (block_5, state_5) = context.block_justifying_current_epoch(&state_4, 2, H256::default()); - let (block_6, _) = context.empty_block(&state_5, start_of_epoch(3), H256::default()); - - context.on_slot(start_of_epoch(3)); - - context.on_acceptable_block(&block_1); - - context.assert_status(Status { - head: &block_1, - attesting_validators: Some(0), - store_justified_epoch: 0, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 1, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 1, - unfinalized_block_count_total: 1, - }); - - context.on_acceptable_block(&block_2); - - context.assert_status(Status { - head: &block_2, - attesting_validators: Some(0), - store_justified_epoch: 1, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 1, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 2, - unfinalized_block_count_total: 2, - }); - - context.on_acceptable_block(&block_3); - - context.assert_status(Status { - head: &block_3, - attesting_validators: Some(0), - store_justified_epoch: 1, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 1, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 3, - unfinalized_block_count_total: 3, - }); - - context.on_acceptable_block(&block_4); - - context.assert_status(Status { - head: &block_3, - attesting_validators: Some(0), - store_justified_epoch: 1, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 2, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 3, - unfinalized_block_count_total: 4, - }); - - context.on_acceptable_block(&block_5); - - context.assert_status(Status { - head: &block_5, - attesting_validators: Some(0), - store_justified_epoch: 2, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 2, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 2, - unfinalized_block_count_total: 5, - }); - - context.on_acceptable_block(&block_6); - - context.assert_status(Status { - head: &block_6, - attesting_validators: Some(0), - store_justified_epoch: 2, - store_finalized_epoch: 0, - fork_count_viable: 1, - fork_count_total: 2, - finalized_block_count: 1, - unfinalized_block_count_in_fork: 3, - unfinalized_block_count_total: 6, - }); -} - // ```text // 0 // / \ diff --git a/fork_choice_control/src/specialized.rs b/fork_choice_control/src/specialized.rs index f9e045b6..8d5df83c 100644 --- a/fork_choice_control/src/specialized.rs +++ b/fork_choice_control/src/specialized.rs @@ -173,6 +173,7 @@ impl BenchController

{ #[cfg(test)] impl TestController

{ + #[cfg(feature = "eth2-cache")] pub(crate) fn quiet( chain_config: Arc, anchor_block: Arc>, diff --git a/fork_choice_control/src/storage_back_sync.rs b/fork_choice_control/src/storage_back_sync.rs index dd6e2a02..f337e98c 100644 --- a/fork_choice_control/src/storage_back_sync.rs +++ b/fork_choice_control/src/storage_back_sync.rs @@ -105,6 +105,7 @@ impl Storage

{ } #[cfg(test)] +#[cfg(feature = "eth2-cache")] mod tests { use core::num::NonZeroU64; @@ -116,7 +117,6 @@ mod tests { use super::*; #[test] - #[cfg(feature = "eth2-cache")] fn test_archive_back_sync_states() -> Result<()> { let genesis_state = mainnet::GENESIS_BEACON_STATE.force().clone_arc(); let blocks = mainnet::BEACON_BLOCKS_UP_TO_SLOT_128.force(); diff --git a/fork_choice_store/src/store.rs b/fork_choice_store/src/store.rs index 2e61790f..e0a09b59 100644 --- a/fork_choice_store/src/store.rs +++ b/fork_choice_store/src/store.rs @@ -709,24 +709,11 @@ impl Store

{ fn is_block_viable(&self, unfinalized_block: &UnfinalizedBlock

) -> bool { let voting_source = self.voting_source(unfinalized_block); - // > The voting source should be at the same height as the store's justified checkpoint - let mut correct_justified = self.justified_epoch() == GENESIS_EPOCH - || voting_source.epoch == self.justified_checkpoint.epoch; - - // > If the previous epoch is justified, the block should be pulled-up. - // > In this case, check that unrealized justification is higher than the store and that - // > the voting source is not more than two epochs ago - if !correct_justified && self.is_previous_epoch_justified() { - let unrealized_justification_higher = unfinalized_block - .chain_link - .unrealized_justified_checkpoint - .epoch - >= self.justified_checkpoint.epoch; - - let voting_source_recent = voting_source.epoch + 2 >= self.current_epoch(); - - correct_justified = unrealized_justification_higher && voting_source_recent; - } + // > The voting source should be at the same height as the store's justified checkpoint or + // > not more than two epochs ago + let correct_justified = self.justified_epoch() == GENESIS_EPOCH + || voting_source.epoch == self.justified_checkpoint.epoch + || voting_source.epoch + 2 >= self.current_epoch(); // `correct_finalized` should always be true because our implementation prunes orphans as // soon as possible. We check it anyway to be safe. @@ -772,11 +759,6 @@ impl Store

{ } } - /// [`is_previous_epoch_justified`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/fork-choice.md#is_previous_epoch_justified) - fn is_previous_epoch_justified(&self) -> bool { - self.justified_epoch() + 1 == self.current_epoch() - } - fn should_wait_for_justified_state(&self, checkpoint: Checkpoint) -> bool { // The comparison with `self.anchor_epoch()` is needed for two reasons: // - All checkpoints in a genesis state have their `root` set to 0x00…00. In contrast, the diff --git a/grandine-snapshot-tests b/grandine-snapshot-tests index 5e02cd19..903d20bd 160000 --- a/grandine-snapshot-tests +++ b/grandine-snapshot-tests @@ -1 +1 @@ -Subproject commit 5e02cd19303574f65a13513da8ecd9ae0a8ce849 +Subproject commit 903d20bd29669043abb52f9c9012cbe87551e2a4 diff --git a/http_api/src/context.rs b/http_api/src/context.rs index 2f041f72..339de5bf 100644 --- a/http_api/src/context.rs +++ b/http_api/src/context.rs @@ -10,6 +10,7 @@ use deposit_tree::DepositTree; use enum_iterator::Sequence as _; use eth1::{Eth1Chain, Eth1Config}; use eth1_api::{Eth1Api, Eth1ExecutionEngine, ExecutionService}; +#[cfg(feature = "eth2-cache")] use eth2_cache_utils::mainnet; use features::Feature; use fork_choice_control::{ @@ -410,6 +411,7 @@ impl Context { } } + #[cfg(feature = "eth2-cache")] pub fn mainnet_genesis_128_slots() -> Self { let genesis_provider = predefined_chains::mainnet(); @@ -425,6 +427,7 @@ impl Context { } } + #[cfg(feature = "eth2-cache")] pub fn mainnet_epoch_96214_128_slots() -> Self { let extra_blocks = mainnet::ALTAIR_BEACON_BLOCKS_FROM_128_SLOTS .force() @@ -442,6 +445,7 @@ impl Context { } } + #[cfg(feature = "eth2-cache")] pub fn mainnet_epoch_244816_128_slots() -> Self { let extra_blocks = mainnet::CAPELLA_BEACON_BLOCKS_FROM_244816_SLOTS .force() diff --git a/operation_pools/src/attestation_agg_pool/attestation_packer.rs b/operation_pools/src/attestation_agg_pool/attestation_packer.rs index e6c83bc4..50bddc28 100644 --- a/operation_pools/src/attestation_agg_pool/attestation_packer.rs +++ b/operation_pools/src/attestation_agg_pool/attestation_packer.rs @@ -782,6 +782,7 @@ fn translate_participation<'attestations, P: Preset>( } #[cfg(test)] +#[cfg(feature = "eth2-cache")] mod tests { use std::collections::hash_map::{Entry as HashMapEntry, HashMap}; @@ -797,7 +798,6 @@ mod tests { HashMap::MaxValidatorsPerCommittee>>; #[test] - #[cfg(feature = "eth2-cache")] fn test_goerli_aggregate_attestation_packing() -> Result<()> { let config = Arc::new(Config::goerli()); let slot = 547_813; @@ -837,7 +837,6 @@ mod tests { } #[test] - #[cfg(feature = "eth2-cache")] fn test_goerli_aggregate_attestation_packing_dynamically() -> Result<()> { let config = Arc::new(Config::goerli()); let slot = 547_813; @@ -876,7 +875,6 @@ mod tests { } #[test] - #[cfg(feature = "eth2-cache")] fn test_holesky_aggregate_attestation_packing() -> Result<()> { let config = Arc::new(Config::holesky()); let slot = 50_015; @@ -916,7 +914,6 @@ mod tests { } #[test] - #[cfg(feature = "eth2-cache")] fn test_holesky_dynamic_aggregate_attestation_packing() -> Result<()> { let config = Arc::new(Config::holesky()); let slot = 50_015; diff --git a/slashing_protection/src/lib.rs b/slashing_protection/src/lib.rs index 4067db0e..1fe9fb7a 100644 --- a/slashing_protection/src/lib.rs +++ b/slashing_protection/src/lib.rs @@ -245,17 +245,6 @@ impl SlashingProtector { report.validators.succeeded.push(interchange_record.pubkey); - // delete older existing entries to avoid "gap" issues - let min_slot = interchange_record - .signed_blocks - .iter() - .map(|block| block.slot) - .min(); - - if let Some(min_slot) = min_slot { - Self::delete_older_proposals(&transaction, validator_id, min_slot)?; - } - for signed_block in interchange_record.signed_blocks { let proposal = BlockProposal { slot: signed_block.slot, @@ -274,22 +263,6 @@ impl SlashingProtector { } } - // delete older existing entries to avoid "gap" issues - let min_epochs = interchange_record - .signed_attestations - .iter() - .map(|attestation| (attestation.source_epoch, attestation.target_epoch)) - .min(); - - if let Some((source_epoch, target_epoch)) = min_epochs { - Self::delete_older_attestations( - &transaction, - validator_id, - source_epoch, - target_epoch, - )?; - } - for signed_attestation in interchange_record.signed_attestations { let attestation = AttestationProposal { source_epoch: signed_attestation.source_epoch, @@ -482,19 +455,6 @@ impl SlashingProtector { Ok(()) } - fn delete_older_proposals( - transaction: &Transaction, - validator_id: ValidatorId, - slot: Slot, - ) -> Result<()> { - transaction.execute( - "DELETE FROM block_proposals WHERE validator_id = ?1 AND slot < ?2", - (validator_id, slot), - )?; - - Ok(()) - } - fn store_proposal( transaction: &Transaction, validator_id: ValidatorId, @@ -545,20 +505,6 @@ impl SlashingProtector { .map_err(Into::into) } - fn delete_older_attestations( - transaction: &Transaction, - validator_id: ValidatorId, - source_epoch: Epoch, - target_epoch: Epoch, - ) -> Result<()> { - transaction.execute( - "DELETE FROM attestation_proposals WHERE validator_id = ?1 AND source_epoch < ?2 AND target_epoch < ?3", - (validator_id, source_epoch, target_epoch), - )?; - - Ok(()) - } - pub fn validate_and_store_proposal( &mut self, proposal: BlockProposal, @@ -1040,11 +986,13 @@ mod tests { #[derive(Deserialize)] #[serde(deny_unknown_fields)] struct TestBlock { - should_succeed: bool, #[serde(with = "serde_utils::string_or_native")] slot: Slot, signing_root: H256, pubkey: PublicKeyBytes, + #[allow(dead_code)] + should_succeed: bool, + should_succeed_complete: bool, } #[derive(Deserialize)] @@ -1056,7 +1004,9 @@ mod tests { target_epoch: Epoch, signing_root: H256, pubkey: PublicKeyBytes, + #[allow(dead_code)] should_succeed: bool, + should_succeed_complete: bool, } fn build_own_attestation(source: Epoch, target: Epoch) -> OwnAttestation

{ @@ -1362,12 +1312,12 @@ mod tests { )?; assert_ne!( - test_block.should_succeed, + test_block.should_succeed_complete, validation_outcome.is_slashing_violation(), ); // Test that valid block proposals are persisted in DB - if test_block.should_succeed { + if test_block.should_succeed_complete { let count: usize = slashing_protector.transaction()?.query_row( "SELECT count(*) FROM block_proposals \ WHERE slot = ?1 \ @@ -1394,12 +1344,12 @@ mod tests { for (test_attestation, outcome) in step.attestations.iter().zip(outcomes) { assert_ne!( - test_attestation.should_succeed, + test_attestation.should_succeed_complete, outcome?.is_slashing_violation(), ); // Test that valid attestation proposals are persisted in DB - if test_attestation.should_succeed { + if test_attestation.should_succeed_complete { let count: usize = slashing_protector.transaction()?.query_row( "SELECT count(*) FROM attestation_proposals \ WHERE source_epoch = ?1 \