From f64afabe1c5d1cef08882e3a971fcd1afe829a8e Mon Sep 17 00:00:00 2001 From: drcpu Date: Thu, 19 Dec 2024 19:35:46 +0000 Subject: [PATCH] feat(tests): improve test coverage of create_tally function under different protocol versions --- validations/src/tests/mod.rs | 470 +++++++++++++++++++++------------ validations/src/validations.rs | 12 +- 2 files changed, 310 insertions(+), 172 deletions(-) diff --git a/validations/src/tests/mod.rs b/validations/src/tests/mod.rs index 86f8bc67b..89b7eff48 100644 --- a/validations/src/tests/mod.rs +++ b/validations/src/tests/mod.rs @@ -5178,6 +5178,7 @@ fn tally_dr_not_tally_stage() { &HashSet::::new(), None, Some(epoch), + ProtocolVersion::default(), ); assert_eq!( x.unwrap_err().downcast::().unwrap(), @@ -5195,6 +5196,7 @@ fn tally_dr_not_tally_stage() { &HashSet::::new(), None, Some(epoch), + ProtocolVersion::default(), ); assert_eq!( x.unwrap_err().downcast::().unwrap(), @@ -5213,6 +5215,7 @@ fn tally_dr_not_tally_stage() { &HashSet::::new(), None, Some(epoch), + ProtocolVersion::default(), ); assert_eq!( x.unwrap_err().downcast::().unwrap(), @@ -5231,6 +5234,7 @@ fn tally_dr_not_tally_stage() { &HashSet::::new(), None, Some(epoch), + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -5310,6 +5314,7 @@ fn tally_invalid_consensus() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ); assert_eq!( x.unwrap_err().downcast::().unwrap(), @@ -5384,6 +5389,7 @@ fn tally_valid_1_reveal_5_commits() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -5578,6 +5584,7 @@ fn tally_valid_1_reveal_5_commits_invalid_value() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -5653,6 +5660,7 @@ fn tally_valid_1_reveal_5_commits_with_absurd_timelock() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -5735,6 +5743,7 @@ fn tally_valid() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -5799,6 +5808,7 @@ fn tally_too_many_outputs() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -5847,6 +5857,7 @@ fn tally_too_less_outputs() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -5928,6 +5939,7 @@ fn tally_invalid_change() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -5985,6 +5997,7 @@ fn tally_double_reward() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -6039,6 +6052,7 @@ fn tally_reveal_not_found() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -6094,6 +6108,7 @@ fn tally_invalid_reward() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -6152,6 +6167,7 @@ fn tally_valid_2_reveals() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -6221,6 +6237,7 @@ fn tally_valid_3_reveals_dr_liar() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -6290,6 +6307,7 @@ fn tally_valid_3_reveals_dr_liar_invalid() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); @@ -6379,6 +6397,7 @@ fn tally_valid_5_reveals_1_liar_1_error() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -6444,6 +6463,7 @@ fn tally_valid_3_reveals_1_error() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -6509,6 +6529,7 @@ fn tally_valid_3_reveals_1_error_invalid_reward() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -6580,6 +6601,7 @@ fn tally_valid_3_reveals_mark_all_as_error() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -6654,6 +6676,7 @@ fn tally_dishonest_reward() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); @@ -6720,33 +6743,39 @@ fn create_tally_validation_dr_liar() { let report = evaluate_tally_postcondition_clause(report, min_consensus, 3); // Create a TallyTransaction using the create_tally function - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![rewarded[0], rewarded[1], dr_pkh], - [rewarded[0], rewarded[1], dr_pkh] - .iter() - .cloned() - .collect::>(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![rewarded[0], rewarded[1], dr_pkh], + [rewarded[0], rewarded[1], dr_pkh] + .iter() + .cloned() + .collect::>(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + assert_eq!(tally_transaction.out_of_consensus, vec![dr_pkh]); + assert_eq!(tally_transaction.error_committers, vec![]); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -6819,45 +6848,59 @@ fn create_tally_validation_5_reveals_1_liar_1_error() { let report = evaluate_tally_postcondition_clause(report, min_consensus, 5); // Create a TallyTransaction using the create_tally function - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![ - rewarded[0], - rewarded[1], - rewarded[2], - slashed[0], - error_witnesses[0], - ], - [ - rewarded[0], - rewarded[1], - rewarded[2], - slashed[0], - error_witnesses[0], - ] - .iter() - .cloned() - .collect::>(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![ + rewarded[0], + rewarded[1], + rewarded[2], + slashed[0], + error_witnesses[0], + ], + [ + rewarded[0], + rewarded[1], + rewarded[2], + slashed[0], + error_witnesses[0], + ] + .iter() + .cloned() + .collect::>(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + assert_eq!( + tally_transaction + .out_of_consensus + .iter() + .cloned() + .sorted() + .collect::>(), + vec![error_witnesses[0], slashed[0]] + ); + assert_eq!(tally_transaction.error_committers, vec![error_witnesses[0]]); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -6909,33 +6952,55 @@ fn create_tally_validation_4_commits_2_reveals() { let report = evaluate_tally_postcondition_clause(report, min_consensus, 4); // Create a TallyTransaction using the create_tally function - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![rewarded[0], rewarded[1]], - [rewarded[0], rewarded[1], slashed[0], slashed[1]] - .iter() - .cloned() - .collect::>(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![rewarded[0], rewarded[1]], + [rewarded[0], rewarded[1], slashed[0], slashed[1]] + .iter() + .cloned() + .collect::>(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + assert_eq!( + tally_transaction + .out_of_consensus + .iter() + .cloned() + .sorted() + .collect::>(), + vec![slashed[0], slashed[1], rewarded[1], rewarded[0]] + ); + assert_eq!( + tally_transaction + .error_committers + .iter() + .cloned() + .sorted() + .collect::>(), + vec![rewarded[1], rewarded[0]] + ); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -6969,6 +7034,7 @@ fn tally_valid_zero_commits() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -6997,29 +7063,37 @@ fn create_tally_validation_zero_commits() { let script = RADTally::default(); let report = construct_report_from_clause_result(clause_result, &script, 0, &active_wips); let report = evaluate_tally_postcondition_clause(report, min_consensus, 0); - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![], - HashSet::::default(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![], + HashSet::::default(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); + + assert_eq!(tally_transaction.out_of_consensus, vec![]); + assert_eq!(tally_transaction.error_committers, vec![]); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -7063,6 +7137,7 @@ fn tally_invalid_zero_commits() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -7146,6 +7221,7 @@ fn tally_valid_zero_reveals() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7177,34 +7253,50 @@ fn create_tally_validation_zero_reveals() { let report = evaluate_tally_postcondition_clause(report, min_consensus, 5); let mut committers = rewarded; - committers.extend(slashed); + committers.extend(slashed.clone()); committers.extend(error_witnesses); - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![], - committers - .iter() - .cloned() - .collect::>(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![], + committers + .iter() + .cloned() + .collect::>(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); + + assert_eq!( + tally_transaction + .out_of_consensus + .iter() + .cloned() + .sorted() + .collect::>(), + slashed.iter().cloned().sorted().collect::>() + ); + assert_eq!(tally_transaction.error_committers, vec![]); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -7234,34 +7326,49 @@ fn create_tally_validation_zero_reveals_zero_collateral() { let report = evaluate_tally_postcondition_clause(report, min_consensus, 5); let mut committers = rewarded; - committers.extend(slashed); + committers.extend(slashed.iter()); committers.extend(error_witnesses); - let tally_transaction = create_tally( - dr_pointer, - &dr_output, - dr_pkh, - &report, - vec![], - committers - .iter() - .cloned() - .collect::>(), - ONE_WIT, - tally_bytes_on_encode_error(), - &active_wips, - ProtocolVersion::V1_7, - ); - let x = validate_tally_transaction( - &tally_transaction, - &mut dr_pool, - &CONSENSUS_CONSTANTS_FOR_TALLY, - &active_wips, - &HashSet::::new(), - None, - None, - ) - .map(|_| ()); - x.unwrap(); + for protocol in ProtocolVersion::iter() { + let tally_transaction = create_tally( + dr_pointer, + &dr_output, + dr_pkh, + &report, + vec![], + committers + .iter() + .cloned() + .collect::>(), + ONE_WIT, + tally_bytes_on_encode_error(), + &active_wips, + protocol, + ); + + assert_eq!( + tally_transaction + .out_of_consensus + .iter() + .cloned() + .sorted() + .collect::>(), + slashed.iter().cloned().sorted().collect::>() + ); + assert_eq!(tally_transaction.error_committers, vec![]); + + let x = validate_tally_transaction( + &tally_transaction, + &mut dr_pool, + &CONSENSUS_CONSTANTS_FOR_TALLY, + &active_wips, + &HashSet::::new(), + None, + None, + protocol, + ) + .map(|_| ()); + x.unwrap(); + } } #[test] @@ -7496,6 +7603,7 @@ fn tally_valid_4_reveals_all_liars() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7556,6 +7664,7 @@ fn tally_valid_4_reveals_all_liars_attacker_pkh() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); // The attacker_pkh has not participated in the commit/reveal process, so the error is "CommitNotFound" @@ -7620,6 +7729,7 @@ fn tally_valid_4_reveals_2_liars_2_true() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7683,6 +7793,7 @@ fn tally_valid_4_reveals_2_errors_2_true() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7743,6 +7854,7 @@ fn tally_valid_4_reveals_1_liar_2_true() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7808,6 +7920,7 @@ fn tally_valid_4_reveals_invalid_script_arg() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7873,6 +7986,7 @@ fn tally_valid_3_reveals_1_no_reveal_invalid_script_arg() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7929,6 +8043,7 @@ fn tally_valid_4_reveals_majority_of_errors() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -7995,6 +8110,7 @@ fn tally_valid_3_reveals_1_no_reveal_majority_of_errors() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8054,6 +8170,7 @@ fn tally_valid_2_reveals_2_no_reveals_majority_of_errors_insufficient_consensus( &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8119,6 +8236,7 @@ fn tally_valid_4_reveals_majority_of_errors_insufficient_consensus() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8183,6 +8301,7 @@ fn tally_valid_3_reveals_1_no_reveal_majority_of_errors_insufficient_consensus() &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8252,6 +8371,7 @@ fn tally_valid_rng() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8309,6 +8429,7 @@ fn tally_valid_rng_wrong_bytes_len() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8388,6 +8509,7 @@ fn tally_valid_rng_one_error() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8474,6 +8596,7 @@ fn tally_valid_rng_all_errors() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8547,6 +8670,7 @@ fn tally_valid_rng_one_invalid_type() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8605,6 +8729,7 @@ fn tally_valid_rng_all_invalid_type() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8668,6 +8793,7 @@ fn tally_unserializable_value() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8732,6 +8858,7 @@ fn tally_unhandled_intercept_with_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8743,6 +8870,7 @@ fn tally_unhandled_intercept_with_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -8768,6 +8896,7 @@ fn tally_unhandled_intercept_with_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -8785,6 +8914,7 @@ fn tally_unhandled_intercept_with_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8867,6 +8997,7 @@ fn tally_unhandled_intercept_mode_tie_has_no_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8878,6 +9009,7 @@ fn tally_unhandled_intercept_mode_tie_has_no_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -8903,6 +9035,7 @@ fn tally_unhandled_intercept_mode_tie_has_no_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -8920,6 +9053,7 @@ fn tally_unhandled_intercept_mode_tie_has_no_message() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); @@ -8971,6 +9105,7 @@ fn tally_error_encode_reveal_wip() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); assert_eq!( @@ -8993,6 +9128,7 @@ fn tally_error_encode_reveal_wip() { &HashSet::::new(), None, None, + ProtocolVersion::default(), ) .map(|_| ()); x.unwrap(); diff --git a/validations/src/validations.rs b/validations/src/validations.rs index cd3da747d..11dfa28bb 100644 --- a/validations/src/validations.rs +++ b/validations/src/validations.rs @@ -967,7 +967,7 @@ fn create_expected_tally_transaction( collateral_minimum: u64, active_wips: &ActiveWips, too_many_witnesses: bool, - epoch: Option, + protocol_version: ProtocolVersion, ) -> Result<(TallyTransaction, DataRequestState), failure::Error> { // Get DataRequestState let dr_pointer = ta_tx.dr_pointer; @@ -1010,7 +1010,7 @@ fn create_expected_tally_transaction( collateral_minimum, tally_bytes_on_encode_error(), active_wips, - get_protocol_version(epoch), + protocol_version, ); Ok((ta_tx, dr_state.clone())) @@ -1038,6 +1038,7 @@ pub fn calculate_liars_and_errors_count_from_tally(tally_tx: &TallyTransaction) } /// Function to validate a tally transaction +#[allow(clippy::too_many_arguments)] pub fn validate_tally_transaction<'a>( ta_tx: &'a TallyTransaction, dr_pool: &mut DataRequestPool, @@ -1046,6 +1047,7 @@ pub fn validate_tally_transaction<'a>( data_requests_with_too_many_witnesses: &HashSet, validator_count: Option, epoch: Option, + protocol_version: ProtocolVersion, ) -> Result<(Vec<&'a ValueTransferOutput>, u64), failure::Error> { let validator_count = validator_count.unwrap_or(witnet_data_structures::DEFAULT_VALIDATOR_COUNT_FOR_TESTS); @@ -1088,7 +1090,7 @@ pub fn validate_tally_transaction<'a>( consensus_constants.collateral_minimum, active_wips, too_many_witnesses, - epoch, + protocol_version, )?; let sorted_out_of_consensus = ta_tx.out_of_consensus.iter().cloned().sorted().collect(); @@ -1312,8 +1314,7 @@ pub fn validate_tally_transaction<'a>( // In case of no commits, collateral does not affect 0 }; - // TODO: should we somehow validate that the total data request reward is correctly refunded + added to the staked balance? - if get_protocol_version(epoch) < ProtocolVersion::V2_0 { + if protocol_version < ProtocolVersion::V2_0 { let expected_dr_value = dr_state.data_request.checked_total_value()?; let found_dr_value = dr_state.info.commits.len() as u64 * dr_state.data_request.commit_and_reveal_fee @@ -2209,6 +2210,7 @@ pub fn validate_block_transactions( &data_requests_with_too_many_witnesses, Some(stakes.validator_count()), Some(epoch), + get_protocol_version(Some(epoch)), ) { Ok((outputs, fee)) => { reset_data_request_stage(&data_requests_to_reset, transaction.dr_pointer, dr_pool);