Repository: near/nearcore
Pull request #13185: remove code where RelaxedChunkValidation is not true
Author: login: akhi3030
Created: 2025-03-21T20:07:50Z | Merged: 2025-03-25T15:08:40Z

This PR removes code where the `RelaxedChunkValidation` protocol feature is not true.

It ends up removing a lot of related cruft that is then also not needed.

I wanted to follow the style of https://github.com/near/nearcore/pull/13179 i.e. removing all the protocol features at a specific protocol version however that made this PR really big.  If we want to follow that style, then maybe we should do it over multiple PRs or at least get reviews on these changes before introducing those.


Diff:
diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs
index b7cac1bbd69..04a904cee34 100644
--- a/chain/chain/src/chain.rs
+++ b/chain/chain/src/chain.rs
@@ -36,9 +36,7 @@ pub use crate::update_shard::{
     apply_new_chunk, apply_old_chunk,
 };
 use crate::update_shard::{ShardUpdateReason, ShardUpdateResult, process_shard_update};
-use crate::validate::{
-    validate_challenge, validate_chunk_with_chunk_extra, validate_transactions_order,
-};
+use crate::validate::{validate_challenge, validate_chunk_with_chunk_extra};
 use crate::{
     BlockStatus, ChainGenesis, Doomslug, Provenance, byzantine_assert,
     create_light_client_block_view,
@@ -2774,21 +2772,8 @@ impl Chain {
         &self,
         prev_block_header: &BlockHeader,
         chunk: &ShardChunk,
-    ) -> Result<Vec<bool>, Error> {
-        let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(prev_block_header.hash())?;
-        let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?;
-        let relaxed_chunk_validation =
-            ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version);
-
-        if !relaxed_chunk_validation {
-            if !validate_transactions_order(chunk.transactions()) {
-                return Err(Error::InvalidChunkTransactionsOrder(
-                    MaybeEncodedShardChunk::Decoded(chunk.clone()).into(),
-                ));
-            }
-        }
-
-        self.chain_store().compute_transaction_validity(protocol_version, prev_block_header, chunk)
+    ) -> Vec<bool> {
+        self.chain_store().compute_transaction_validity(prev_block_header, chunk)
     }
 
     pub fn transaction_validity_check<'a>(
@@ -3446,7 +3431,7 @@ impl Chain {
                 }
             })?;
 
-            let tx_valid_list = self.validate_chunk_transactions(prev_block.header(), &chunk)?;
+            let tx_valid_list = self.validate_chunk_transactions(prev_block.header(), &chunk);
 
             // we can't use hash from the current block here yet because the incoming receipts
             // for this block is not stored yet
diff --git a/chain/chain/src/chain_update.rs b/chain/chain/src/chain_update.rs
index f75a5151463..2e663f69056 100644
--- a/chain/chain/src/chain_update.rs
+++ b/chain/chain/src/chain_update.rs
@@ -539,11 +539,9 @@ impl<'a> ChainUpdate<'a> {
         let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?;
         let transactions = chunk.transactions();
         let transaction_validity = if let Some(prev_block_header) = prev_block_header {
-            self.chain_store_update.chain_store().compute_transaction_validity(
-                protocol_version,
-                &prev_block_header,
-                &chunk,
-            )?
+            self.chain_store_update
+                .chain_store()
+                .compute_transaction_validity(&prev_block_header, &chunk)
         } else {
             vec![true; transactions.len()]
         };
diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs
index e8e60b5f83a..1ae661fcc60 100644
--- a/chain/chain/src/runtime/mod.rs
+++ b/chain/chain/src/runtime/mod.rs
@@ -655,11 +655,7 @@ impl RuntimeAdapter for NightshadeRuntime {
         let transactions_gas_limit =
             chunk_tx_gas_limit(protocol_version, runtime_config, &prev_block, shard_id, gas_limit);
 
-        let mut result = PreparedTransactions {
-            transactions: Vec::new(),
-            limited_by: None,
-            storage_proof: None,
-        };
+        let mut result = PreparedTransactions { transactions: Vec::new(), limited_by: None };
         let mut num_checked_transactions = 0;
 
         // To avoid limiting the throughput of the network, we want to include enough receipts to
@@ -677,7 +673,6 @@ impl RuntimeAdapter for NightshadeRuntime {
         let size_limit: u64 = calculate_transactions_size_limit(
             protocol_version,
             &runtime_config,
-            chunk.last_chunk_transactions_size,
             transactions_gas_limit,
         );
         // for metrics only
@@ -825,7 +820,6 @@ impl RuntimeAdapter for NightshadeRuntime {
         metrics::CONGESTION_PREPARE_TX_GAS_LIMIT
             .with_label_values(&[&shard_label])
             .set(i64::try_from(transactions_gas_limit).unwrap_or(i64::MAX));
-        result.storage_proof = state_update.trie.recorded_storage().map(|s| s.nodes);
         Ok(result)
     }
 
@@ -1336,20 +1330,15 @@ fn chunk_tx_gas_limit(
 fn calculate_transactions_size_limit(
     protocol_version: ProtocolVersion,
     runtime_config: &RuntimeConfig,
-    mut last_chunk_transactions_size: usize,
     transactions_gas_limit: Gas,
 ) -> u64 {
     // Checking feature WitnessTransactionLimits
     if ProtocolFeature::StatelessValidation.enabled(protocol_version) {
-        if ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version) {
-            last_chunk_transactions_size = 0;
-        }
         // Sum of transactions in the previous and current chunks should not exceed the limit.
         // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both.
         runtime_config
             .witness_config
             .combined_transactions_size_limit
-            .saturating_sub(last_chunk_transactions_size)
             .try_into()
             .expect("Can't convert usize to u64!")
     } else {
diff --git a/chain/chain/src/runtime/tests.rs b/chain/chain/src/runtime/tests.rs
index e93ba23ace8..ef80da8a2bb 100644
--- a/chain/chain/src/runtime/tests.rs
+++ b/chain/chain/src/runtime/tests.rs
@@ -8,9 +8,7 @@ use near_chain_configs::test_utils::{TESTING_INIT_BALANCE, TESTING_INIT_STAKE};
 use near_epoch_manager::EpochManager;
 use near_epoch_manager::shard_assignment::shard_id_to_uid;
 use near_epoch_manager::shard_tracker::ShardTracker;
-use near_pool::{
-    InsertTransactionResult, PoolIteratorWrapper, TransactionGroupIteratorWrapper, TransactionPool,
-};
+use near_pool::{InsertTransactionResult, PoolIteratorWrapper, TransactionPool};
 use near_primitives::action::FunctionCallAction;
 use near_primitives::apply::ApplyChunkReason;
 use near_primitives::bandwidth_scheduler::BlockBandwidthRequests;
@@ -1645,7 +1643,6 @@ fn prepare_transactions(
         PrepareTransactionsChunkContext {
             shard_id,
             gas_limit: env.runtime.genesis_config.gas_limit,
-            last_chunk_transactions_size: 0,
         },
         PrepareTransactionsBlockContext {
             next_gas_price: env.runtime.genesis_config.min_gas_price,
@@ -1664,50 +1661,6 @@ fn prepare_transactions(
     )
 }
 
-/// Check that transactions validation works the same when using recorded storage proof instead of db.
-#[test]
-fn test_prepare_transactions_storage_proof() {
-    let (env, chain, mut transaction_pool) = get_test_env_with_chain_and_pool();
-    let transactions_count = transaction_pool.len();
-
-    let storage_config = RuntimeStorageConfig {
-        state_root: env.state_roots[0],
-        use_flat_storage: true,
-        source: StorageDataSource::Db,
-        state_patch: Default::default(),
-    };
-
-    let proposed_transactions = prepare_transactions(
-        &env,
-        &chain,
-        &mut PoolIteratorWrapper::new(&mut transaction_pool),
-        storage_config,
-    )
-    .unwrap();
-
-    assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
-
-    let validator_storage_config = RuntimeStorageConfig {
-        state_root: env.state_roots[0],
-        use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
-        state_patch: Default::default(),
-    };
-
-    let validated_transactions = prepare_transactions(
-        &env,
-        &chain,
-        &mut TransactionGroupIteratorWrapper::new(proposed_transactions.transactions.clone()),
-        validator_storage_config,
-    )
-    .unwrap();
-
-    assert_eq!(validated_transactions.transactions, proposed_transactions.transactions);
-}
-
 /// Check that transactions validation fails if provided empty storage proof.
 #[test]
 fn test_prepare_transactions_empty_storage_proof() {
@@ -1730,7 +1683,6 @@ fn test_prepare_transactions_empty_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
diff --git a/chain/chain/src/stateless_validation/chunk_validation.rs b/chain/chain/src/stateless_validation/chunk_validation.rs
index ee827f20ac0..aea2819bd59 100644
--- a/chain/chain/src/stateless_validation/chunk_validation.rs
+++ b/chain/chain/src/stateless_validation/chunk_validation.rs
@@ -30,11 +30,10 @@ use near_primitives::sharding::{ChunkHash, ReceiptProof, ShardChunkHeader};
 use near_primitives::stateless_validation::state_witness::{
     ChunkStateWitness, EncodedChunkStateWitness,
 };
-use near_primitives::transaction::{SignedTransaction, ValidatedTransaction};
+use near_primitives::transaction::ValidatedTransaction;
 use near_primitives::types::chunk_extra::ChunkExtra;
 use near_primitives::types::{AccountId, ProtocolVersion, ShardId, ShardIndex};
 use near_primitives::utils::compression::CompressedData;
-use near_primitives::version::ProtocolFeature;
 use near_store::flat::BlockInfo;
 use near_store::trie::ops::resharding::RetainMode;
 use near_store::{PartialStorage, Trie};
@@ -94,16 +93,13 @@ pub fn validate_prepared_transactions(
     chunk_header: &ShardChunkHeader,
     storage_config: RuntimeStorageConfig,
     validated_txs: impl IntoIterator<Item = ValidatedTransaction>,
-    last_chunk_transactions: &[SignedTransaction],
 ) -> Result<PreparedTransactions, Error> {
     let parent_block = chain.chain_store().get_block(chunk_header.prev_block_hash())?;
-    let last_chunk_transactions_size = borsh::to_vec(last_chunk_transactions)?.len();
     runtime_adapter.prepare_transactions(
         storage_config,
         crate::types::PrepareTransactionsChunkContext {
             shard_id: chunk_header.shard_id(),
             gas_limit: chunk_header.gas_limit(),
-            last_chunk_transactions_size,
         },
         (&parent_block).into(),
         &mut TransactionGroupIteratorWrapper::new(validated_txs),
@@ -328,7 +324,6 @@ pub fn pre_validate_chunk_state_witness(
     state_witness: &ChunkStateWitness,
     chain: &Chain,
     epoch_manager: &dyn EpochManagerAdapter,
-    runtime_adapter: &dyn RuntimeAdapter,
 ) -> Result<PreValidationOutput, Error> {
     let store = chain.chain_store();
 
@@ -374,79 +369,16 @@ pub fn pre_validate_chunk_state_witness(
         )));
     }
 
-    let current_protocol_version =
-        epoch_manager.get_epoch_protocol_version(&state_witness.epoch_id)?;
-    let transaction_validity_check_results =
-        if ProtocolFeature::RelaxedChunkValidation.enabled(current_protocol_version) {
-            if !state_witness.new_transactions.is_empty() {
-                return Err(Error::InvalidChunkStateWitness(format!(
-                    "Witness new_transactions must be empty",
-                )));
-            }
-            if last_chunk_block.header().is_genesis() {
-                vec![true; state_witness.transactions.len()]
-            } else {
-                let prev_block_header =
-                    store.get_block_header(last_chunk_block.header().prev_hash())?;
-                let check = chain.transaction_validity_check(prev_block_header);
-                state_witness.transactions.iter().map(|t| check(t)).collect::<Vec<_>>()
-            }
-        } else {
-            let (new_tx_root_from_state_witness, _) = merklize(&state_witness.new_transactions);
-            let chunk_tx_root = state_witness.chunk_header.tx_root();
-            if new_tx_root_from_state_witness != chunk_tx_root {
-                return Err(Error::InvalidChunkStateWitness(format!(
-                    "Witness new transactions root {:?} does not match chunk {:?}",
-                    new_tx_root_from_state_witness, chunk_tx_root
-                )));
-            }
-            // Verify that all proposed transactions are valid.
-            if !state_witness.new_transactions.is_empty() {
-                let transactions_validation_storage_config = RuntimeStorageConfig {
-                    state_root: state_witness.chunk_header.prev_state_root(),
-                    use_flat_storage: true,
-                    source: StorageDataSource::Recorded(PartialStorage {
-                        nodes: state_witness.new_transactions_validation_state.clone(),
-                    }),
-                    state_patch: Default::default(),
-                };
-                let config = runtime_adapter.get_runtime_config(protocol_version);
-                let validated_txs =
-                    ValidatedTransaction::new_list(&config, state_witness.new_transactions.clone())
-                        .map_err(|(err, signed_tx)| {
-                            Error::InvalidChunkStateWitness(format!(
-                                "Validating signed tx ({:?}) failed with {:?}",
-                                signed_tx, err
-                            ))
-                        })?;
-                match validate_prepared_transactions(
-                    chain,
-                    runtime_adapter,
-                    &state_witness.chunk_header,
-                    transactions_validation_storage_config,
-                    validated_txs,
-                    &state_witness.transactions,
-                ) {
-                    Ok(result) => {
-                        if result.transactions.len() != state_witness.new_transactions.len() {
-                            return Err(Error::InvalidChunkStateWitness(format!(
-                                "New transactions validation failed. \
-                         {} transactions out of {} proposed transactions were valid.",
-                                result.transactions.len(),
-                                state_witness.new_transactions.len(),
-                            )));
-                        }
-                    }
-                    Err(error) => {
-                        return Err(Error::InvalidChunkStateWitness(format!(
-                            "New transactions validation failed: {}",
-                            error,
-                        )));
-                    }
-                };
-            }
+    let transaction_validity_check_results = {
+        if last_chunk_block.header().is_genesis() {
             vec![true; state_witness.transactions.len()]
-        };
+        } else {
+            let prev_block_header =
+                store.get_block_header(last_chunk_block.header().prev_hash())?;
+            let check = chain.transaction_validity_check(prev_block_header);
+            state_witness.transactions.iter().map(|t| check(t)).collect::<Vec<_>>()
+        }
+    };
 
     let main_transition_params = if last_chunk_block.header().is_genesis() {
         let epoch_id = last_chunk_block.header().epoch_id();
@@ -821,7 +753,6 @@ impl Chain {
         &self,
         witness: ChunkStateWitness,
         epoch_manager: &dyn EpochManagerAdapter,
-        runtime_adapter: &dyn RuntimeAdapter,
         processing_done_tracker: Option<ProcessingDoneTracker>,
     ) -> Result<(), Error> {
         let shard_id = witness.chunk_header.shard_id();
@@ -852,7 +783,7 @@ impl Chain {
         };
         let pre_validation_start = Instant::now();
         let pre_validation_result =
-            pre_validate_chunk_state_witness(&witness, &self, epoch_manager, runtime_adapter)?;
+            pre_validate_chunk_state_witness(&witness, &self, epoch_manager)?;
         tracing::debug!(
             parent: &parent_span,
             ?shard_id,
diff --git a/chain/chain/src/stateless_validation/metrics.rs b/chain/chain/src/stateless_validation/metrics.rs
index 8a6b53a91d7..9f19d1adbf1 100644
--- a/chain/chain/src/stateless_validation/metrics.rs
+++ b/chain/chain/src/stateless_validation/metrics.rs
@@ -131,28 +131,6 @@ pub(crate) static CHUNK_STATE_WITNESS_MAIN_STATE_TRANSITION_SIZE: LazyLock<Histo
             .unwrap()
     });
 
-pub(crate) static CHUNK_STATE_WITNESS_NEW_TRANSACTIONS_SIZE: LazyLock<HistogramVec> =
-    LazyLock::new(|| {
-        try_create_histogram_vec(
-            "near_chunk_state_witness_new_transactions_size",
-            "Size of ChunkStateWitness::new_transactions (new proposed transactions)",
-            &["shard_id"],
-            Some(buckets_for_witness_field_size()),
-        )
-        .unwrap()
-    });
-
-pub(crate) static CHUNK_STATE_WITNESS_NEW_TRANSACTIONS_STATE_SIZE: LazyLock<HistogramVec> =
-    LazyLock::new(|| {
-        try_create_histogram_vec(
-            "near_chunk_state_witness_new_transactions_state_size",
-            "Size of ChunkStateWitness::new_transactions_validation_state (storage proof to validate new proposed transactions)",
-            &["shard_id"],
-            Some(buckets_for_witness_field_size()),
-        )
-            .unwrap()
-    });
-
 pub(crate) static CHUNK_STATE_WITNESS_SOURCE_RECEIPT_PROOFS_SIZE: LazyLock<HistogramVec> =
     LazyLock::new(|| {
         try_create_histogram_vec(
@@ -189,12 +167,6 @@ fn record_witness_size_metrics_fallible(
     CHUNK_STATE_WITNESS_MAIN_STATE_TRANSITION_SIZE
         .with_label_values(&[shard_id.as_str()])
         .observe(borsh::to_vec(&witness.main_state_transition)?.len() as f64);
-    CHUNK_STATE_WITNESS_NEW_TRANSACTIONS_SIZE
-        .with_label_values(&[&shard_id.as_str()])
-        .observe(borsh::to_vec(&witness.new_transactions)?.len() as f64);
-    CHUNK_STATE_WITNESS_NEW_TRANSACTIONS_STATE_SIZE
-        .with_label_values(&[&shard_id.as_str()])
-        .observe(borsh::to_vec(&witness.new_transactions_validation_state)?.len() as f64);
     CHUNK_STATE_WITNESS_SOURCE_RECEIPT_PROOFS_SIZE
         .with_label_values(&[&shard_id.as_str()])
         .observe(borsh::to_vec(&witness.source_receipt_proofs)?.len() as f64);
diff --git a/chain/chain/src/store/mod.rs b/chain/chain/src/store/mod.rs
index e330b4c3e90..4798e19b903 100644
--- a/chain/chain/src/store/mod.rs
+++ b/chain/chain/src/store/mod.rs
@@ -498,32 +498,20 @@ impl ChainStore {
 
     pub fn compute_transaction_validity(
         &self,
-        protocol_version: ProtocolVersion,
         prev_block_header: &BlockHeader,
         chunk: &ShardChunk,
-    ) -> Result<Vec<bool>, Error> {
-        let relaxed_chunk_validation =
-            ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version);
-        let mut valid_txs = Vec::with_capacity(chunk.transactions().len());
-        if relaxed_chunk_validation {
-            for transaction in chunk.transactions() {
-                let is_valid = self.check_transaction_validity_period(
-                    prev_block_header,
-                    transaction.transaction.block_hash(),
-                );
-                valid_txs.push(is_valid.is_ok());
-            }
-        } else {
-            for transaction in chunk.transactions() {
+    ) -> Vec<bool> {
+        chunk
+            .transactions()
+            .into_iter()
+            .map(|signed_tx| {
                 self.check_transaction_validity_period(
                     prev_block_header,
-                    transaction.transaction.block_hash(),
+                    signed_tx.transaction.block_hash(),
                 )
-                .map_err(|_| Error::from(Error::InvalidTransactions))?;
-                valid_txs.push(true);
-            }
-        }
-        Ok(valid_txs)
+                .is_ok()
+            })
+            .collect()
     }
 }
 
diff --git a/chain/chain/src/test_utils/kv_runtime.rs b/chain/chain/src/test_utils/kv_runtime.rs
index d66e5c0b76e..4e59b0e4f47 100644
--- a/chain/chain/src/test_utils/kv_runtime.rs
+++ b/chain/chain/src/test_utils/kv_runtime.rs
@@ -1035,8 +1035,7 @@ impl RuntimeAdapter for KeyValueRuntime {
         while let Some(iter) = transaction_groups.next() {
             res.push(iter.next().unwrap());
         }
-        let storage_proof = Some(Default::default());
-        Ok(PreparedTransactions { transactions: res, limited_by: None, storage_proof })
+        Ok(PreparedTransactions { transactions: res, limited_by: None })
     }
 
     fn apply_chunk(
diff --git a/chain/chain/src/types.rs b/chain/chain/src/types.rs
index 3f1cf90156e..81d232ec73b 100644
--- a/chain/chain/src/types.rs
+++ b/chain/chain/src/types.rs
@@ -24,7 +24,6 @@ use near_primitives::receipt::{PromiseYieldTimeout, Receipt};
 use near_primitives::sandbox::state_patch::SandboxStatePatch;
 use near_primitives::shard_layout::ShardLayout;
 use near_primitives::shard_layout::ShardUId;
-use near_primitives::state::PartialState;
 use near_primitives::state_part::PartId;
 use near_primitives::stateless_validation::contract_distribution::ContractUpdates;
 use near_primitives::transaction::ValidatedTransaction;
@@ -334,8 +333,6 @@ pub struct PreparedTransactions {
     pub transactions: Vec<ValidatedTransaction>,
     /// Describes which limit was hit when preparing the transactions.
     pub limited_by: Option<PrepareTransactionsLimit>,
-    /// May contain partial state that was used to verify transactions when preparing.
-    pub storage_proof: Option<PartialState>,
 }
 
 /// Chunk producer prepares transactions from the transaction pool
@@ -371,9 +368,6 @@ impl From<&Block> for PrepareTransactionsBlockContext {
 pub struct PrepareTransactionsChunkContext {
     pub shard_id: ShardId,
     pub gas_limit: Gas,
-    /// Size of transactions added in the last existing chunk.
-    /// Used to calculate the allowed size of transactions in a newly produced chunk.
-    pub last_chunk_transactions_size: usize,
 }
 
 /// Bridge between the chain and the runtime.
diff --git a/chain/client/src/chunk_producer.rs b/chain/client/src/chunk_producer.rs
index c5481a0bdb6..552827f345d 100644
--- a/chain/client/src/chunk_producer.rs
+++ b/chain/client/src/chunk_producer.rs
@@ -16,14 +16,12 @@ use near_primitives::epoch_info::RngSeed;
 use near_primitives::hash::CryptoHash;
 use near_primitives::merkle::{MerklePath, merklize};
 use near_primitives::receipt::Receipt;
-use near_primitives::sharding::{EncodedShardChunk, ShardChunk, ShardChunkHeader};
-use near_primitives::state::PartialState;
+use near_primitives::sharding::{EncodedShardChunk, ShardChunkHeader};
 use near_primitives::stateless_validation::ChunkProductionKey;
 use near_primitives::transaction::SignedTransaction;
 use near_primitives::types::chunk_extra::ChunkExtra;
 use near_primitives::types::{BlockHeight, EpochId, ShardId};
 use near_primitives::validator_signer::ValidatorSigner;
-use near_primitives::version::ProtocolFeature;
 use near_store::ShardUId;
 use near_store::adapter::chain_store::ChainStoreAdapter;
 use reed_solomon_erasure::galois_8::ReedSolomon;
@@ -49,7 +47,6 @@ pub struct ProduceChunkResult {
     pub chunk: EncodedShardChunk,
     pub encoded_chunk_parts_paths: Vec<MerklePath>,
     pub receipts: Vec<Receipt>,
-    pub transactions_storage_proof: Option<PartialState>,
 }
 
 /// Handles chunk production.
@@ -175,9 +172,6 @@ impl ChunkProducer {
             let validated_tx =
                 near_primitives::transaction::ValidatedTransaction::new_for_test(signed_tx);
             txs.transactions.push(validated_tx);
-            if txs.storage_proof.is_none() {
-                txs.storage_proof = Some(Default::default());
-            }
         }
         txs
     }
@@ -248,40 +242,21 @@ impl ChunkProducer {
             .get_chunk_extra(&prev_block_hash, &shard_uid)
             .map_err(|err| Error::ChunkProducer(format!("No chunk extra available: {}", err)))?;
 
-        let (_, prev_shard_id, prev_shard_index) =
-            self.epoch_manager.get_prev_shard_id_from_prev_hash(prev_block.hash(), shard_id)?;
-        let last_chunk_header =
-            prev_block.chunks().get(prev_shard_index).cloned().ok_or_else(|| {
-                Error::ChunkProducer(format!(
-                    "No last chunk in prev_block_hash {:?}, prev_shard_id: {}",
-                    prev_block_hash, prev_shard_id
-                ))
-            })?;
-        let last_chunk = self.chain.get_chunk(&last_chunk_header.chunk_hash())?;
         let prepared_transactions = {
             #[cfg(feature = "test_features")]
             match self.adv_produce_chunks {
-                Some(AdvProduceChunksMode::ProduceWithoutTx) => PreparedTransactions {
-                    transactions: Vec::new(),
-                    limited_by: None,
-                    storage_proof: None,
-                },
+                Some(AdvProduceChunksMode::ProduceWithoutTx) => {
+                    PreparedTransactions { transactions: Vec::new(), limited_by: None }
+                }
                 _ => self.prepare_transactions(
                     shard_uid,
                     prev_block,
-                    &last_chunk,
                     chunk_extra.as_ref(),
                     chain_validate,
                 )?,
             }
             #[cfg(not(feature = "test_features"))]
-            self.prepare_transactions(
-                shard_uid,
-                prev_block,
-                &last_chunk,
-                chunk_extra.as_ref(),
-                chain_validate,
-            )?
+            self.prepare_transactions(shard_uid, prev_block, chunk_extra.as_ref(), chain_validate)?
         };
 
         #[cfg(feature = "test_features")]
@@ -375,7 +350,6 @@ impl ChunkProducer {
             chunk: encoded_chunk,
             encoded_chunk_parts_paths: merkle_paths,
             receipts: outgoing_receipts,
-            transactions_storage_proof: prepared_transactions.storage_proof,
         }))
     }
 
@@ -384,7 +358,6 @@ impl ChunkProducer {
         &mut self,
         shard_uid: ShardUId,
         prev_block: &Block,
-        last_chunk: &ShardChunk,
         chunk_extra: &ChunkExtra,
         chain_validate: &dyn Fn(&SignedTransaction) -> bool,
     ) -> Result<PreparedTransactions, Error> {
@@ -398,32 +371,16 @@ impl ChunkProducer {
                 source: near_chain::types::StorageDataSource::Db,
                 state_patch: Default::default(),
             };
-            let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(&prev_block.hash())?;
-            let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?;
-            let last_chunk_transactions_size =
-                if ProtocolFeature::StatelessValidation.enabled(protocol_version) {
-                    borsh::to_vec(last_chunk.transactions())
-                        .map_err(|e| {
-                            Error::ChunkProducer(format!("Failed to serialize transactions: {e}"))
-                        })?
-                        .len()
-                } else {
-                    0
-                };
             self.runtime_adapter.prepare_transactions(
                 storage_config,
-                PrepareTransactionsChunkContext {
-                    shard_id,
-                    gas_limit: chunk_extra.gas_limit(),
-                    last_chunk_transactions_size,
-                },
+                PrepareTransactionsChunkContext { shard_id, gas_limit: chunk_extra.gas_limit() },
                 prev_block.into(),
                 &mut iter,
                 chain_validate,
                 self.chunk_transactions_time_limit.get(),
             )?
         } else {
-            PreparedTransactions { transactions: Vec::new(), limited_by: None, storage_proof: None }
+            PreparedTransactions { transactions: Vec::new(), limited_by: None }
         };
         // Reintroduce valid transactions back to the pool. They will be removed when the chunk is
         // included into the block.
diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs
index 717e5b5e6e0..3a09d33d0f0 100644
--- a/chain/client/src/client.rs
+++ b/chain/client/src/client.rs
@@ -1796,7 +1796,6 @@ impl Client {
                         block.header(),
                         &last_header,
                         &shard_chunk,
-                        result.transactions_storage_proof,
                         &Some(signer.clone()),
                     ) {
                         tracing::error!(target: "client", ?err, "Failed to send chunk state witness to chunk validators");
diff --git a/chain/client/src/stateless_validation/chunk_validator/mod.rs b/chain/client/src/stateless_validation/chunk_validator/mod.rs
index 1eaf10caf39..1570565f2d2 100644
--- a/chain/client/src/stateless_validation/chunk_validator/mod.rs
+++ b/chain/client/src/stateless_validation/chunk_validator/mod.rs
@@ -91,7 +91,6 @@ impl ChunkValidator {
             &state_witness,
             chain,
             self.epoch_manager.as_ref(),
-            self.runtime_adapter.as_ref(),
         )?;
 
         let chunk_header = state_witness.chunk_header.clone();
diff --git a/chain/client/src/stateless_validation/shadow_validate.rs b/chain/client/src/stateless_validation/shadow_validate.rs
index 37792318e7a..7c2ec23a6d8 100644
--- a/chain/client/src/stateless_validation/shadow_validate.rs
+++ b/chain/client/src/stateless_validation/shadow_validate.rs
@@ -1,12 +1,9 @@
 use crate::Client;
 use crate::stateless_validation::state_witness_producer::CreateWitnessResult;
 use near_chain::get_chunk_clone_from_header;
-use near_chain::stateless_validation::chunk_validation::validate_prepared_transactions;
-use near_chain::types::{RuntimeStorageConfig, StorageDataSource};
 use near_chain::{Block, BlockHeader};
 use near_chain_primitives::Error;
 use near_primitives::sharding::{ShardChunk, ShardChunkHeader};
-use near_primitives::transaction::ValidatedTransaction;
 
 impl Client {
     // Temporary feature to make node produce state witness for every chunk in every processed block
@@ -51,50 +48,12 @@ impl Client {
         prev_chunk_header: &ShardChunkHeader,
         chunk: &ShardChunk,
     ) -> Result<(), Error> {
-        let chunk_header = chunk.cloned_header();
-        let last_chunk = self.chain.get_chunk(&prev_chunk_header.chunk_hash())?;
-        let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(prev_block_header.hash())?;
-        let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?;
-        let config = self.runtime_adapter.get_runtime_config(protocol_version);
-
-        let transactions_validation_storage_config = RuntimeStorageConfig {
-            state_root: chunk_header.prev_state_root(),
-            use_flat_storage: true,
-            source: StorageDataSource::Db,
-            state_patch: Default::default(),
-        };
-
-        let validated_txs =
-            ValidatedTransaction::new_list(&config, chunk.transactions().into_iter().cloned())
-                .map_err(|(err, signed_tx)| {
-                    Error::Other(format!(
-                        "Validating signed tx ({:?}) failed with {:?}",
-                        signed_tx, err,
-                    ))
-                })?;
-
-        // We call `validate_prepared_transactions()` here because we need storage proof for transactions validation.
-        // Normally it is provided by chunk producer, but for shadow validation we need to generate it ourselves.
-        let Ok(prepared_txs) = validate_prepared_transactions(
-            &self.chain,
-            self.runtime_adapter.as_ref(),
-            &chunk_header,
-            transactions_validation_storage_config,
-            validated_txs,
-            last_chunk.transactions(),
-        ) else {
-            return Err(Error::Other(
-                "Could not produce storage proof for new transactions".to_owned(),
-            ));
-        };
-
         let CreateWitnessResult { state_witness, .. } = self.create_state_witness(
             // Setting arbitrary chunk producer is OK for shadow validation
             "alice.near".parse().unwrap(),
             prev_block_header,
             prev_chunk_header,
             chunk,
-            prepared_txs.storage_proof,
         )?;
         if self.config.save_latest_witnesses {
             self.chain.chain_store.save_latest_chunk_state_witness(&state_witness)?;
@@ -102,7 +61,6 @@ impl Client {
         self.chain.shadow_validate_state_witness(
             state_witness,
             self.epoch_manager.as_ref(),
-            self.runtime_adapter.as_ref(),
             None,
         )?;
         Ok(())
diff --git a/chain/client/src/stateless_validation/state_witness_producer.rs b/chain/client/src/stateless_validation/state_witness_producer.rs
index f8e0da31eef..48f946a67f4 100644
--- a/chain/client/src/stateless_validation/state_witness_producer.rs
+++ b/chain/client/src/stateless_validation/state_witness_producer.rs
@@ -11,7 +11,6 @@ use near_o11y::log_assert_fail;
 use near_primitives::hash::{CryptoHash, hash};
 use near_primitives::receipt::Receipt;
 use near_primitives::sharding::{ChunkHash, ReceiptProof, ShardChunk, ShardChunkHeader};
-use near_primitives::state::PartialState;
 use near_primitives::stateless_validation::contract_distribution::ContractUpdates;
 use near_primitives::stateless_validation::state_witness::{
     ChunkStateTransition, ChunkStateWitness,
@@ -58,7 +57,6 @@ impl Client {
         prev_block_header: &BlockHeader,
         prev_chunk_header: &ShardChunkHeader,
         chunk: &ShardChunk,
-        transactions_storage_proof: Option<PartialState>,
         validator_signer: &Option<Arc<ValidatorSigner>>,
     ) -> Result<(), Error> {
         let protocol_version = self.epoch_manager.get_epoch_protocol_version(epoch_id)?;
@@ -78,7 +76,6 @@ impl Client {
                 prev_block_header,
                 prev_chunk_header,
                 chunk,
-                transactions_storage_proof,
             )?;
 
         if self.config.save_latest_witnesses {
@@ -121,12 +118,10 @@ impl Client {
         prev_block_header: &BlockHeader,
         prev_chunk_header: &ShardChunkHeader,
         chunk: &ShardChunk,
-        transactions_storage_proof: Option<PartialState>,
     ) -> Result<CreateWitnessResult, Error> {
         let chunk_header = chunk.cloned_header();
         let epoch_id =
             self.epoch_manager.get_epoch_id_from_prev_block(chunk_header.prev_block_hash())?;
-        let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?;
         let prev_chunk = self.chain.get_chunk(&prev_chunk_header.chunk_hash())?;
         let StateTransitionData {
             main_transition,
@@ -136,25 +131,6 @@ impl Client {
             contract_updates,
         } = self.collect_state_transition_data(&chunk_header, prev_chunk_header)?;
 
-        let (new_transactions, new_transactions_validation_state) =
-            if ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version) {
-                (Vec::new(), PartialState::default())
-            } else {
-                let new_transactions = chunk.transactions().to_vec();
-                let new_transactions_validation_state = if new_transactions.is_empty() {
-                    PartialState::default()
-                } else {
-                    // With stateless validation chunk producer uses recording reads when validating
-                    // transactions. The storage proof must be available here.
-                    transactions_storage_proof.ok_or_else(|| {
-                        let message = "Missing storage proof for transactions validation";
-                        log_assert_fail!("{message}");
-                        Error::Other(message.to_owned())
-                    })?
-                };
-                (new_transactions, new_transactions_validation_state)
-            };
-
         let source_receipt_proofs =
             self.collect_source_receipt_proofs(prev_block_header, prev_chunk_header)?;
 
@@ -170,8 +146,6 @@ impl Client {
             applied_receipts_hash,
             prev_chunk.transactions().to_vec(),
             implicit_transitions,
-            new_transactions,
-            new_transactions_validation_state,
         );
         Ok(CreateWitnessResult { state_witness, contract_updates, main_transition_shard_id })
     }
diff --git a/chain/client/src/test_utils.rs b/chain/client/src/test_utils.rs
index 0e227660372..7f503cad53f 100644
--- a/chain/client/src/test_utils.rs
+++ b/chain/client/src/test_utils.rs
@@ -107,7 +107,6 @@ impl Client {
             chunk: encoded_chunk,
             encoded_chunk_parts_paths: merkle_paths,
             receipts,
-            transactions_storage_proof,
         } = create_chunk_on_height_for_shard(self, height, shard_id);
         let signer = self.validator_signer.get();
         let shard_chunk = self
@@ -130,7 +129,6 @@ impl Client {
             prev_block.header(),
             &prev_chunk_header,
             &shard_chunk,
-            transactions_storage_proof,
             &signer,
         )
         .unwrap();
@@ -183,24 +181,20 @@ pub fn create_chunk(
     let last_block = client.chain.get_block_by_height(client.chain.head().unwrap().height).unwrap();
     let next_height = last_block.header().height() + 1;
     let signer = client.validator_signer.get().unwrap();
-    let ProduceChunkResult {
-        mut chunk,
-        encoded_chunk_parts_paths: mut merkle_paths,
-        receipts,
-        transactions_storage_proof,
-    } = client
-        .chunk_producer
-        .produce_chunk(
-            &last_block,
-            last_block.header().epoch_id(),
-            last_block.chunks()[0].clone(),
-            next_height,
-            ShardId::new(0),
-            &signer,
-            &client.chain.transaction_validity_check(last_block.header().clone()),
-        )
-        .unwrap()
-        .unwrap();
+    let ProduceChunkResult { mut chunk, encoded_chunk_parts_paths: mut merkle_paths, receipts } =
+        client
+            .chunk_producer
+            .produce_chunk(
+                &last_block,
+                last_block.header().epoch_id(),
+                last_block.chunks()[0].clone(),
+                next_height,
+                ShardId::new(0),
+                &signer,
+                &client.chain.transaction_validity_check(last_block.header().clone()),
+            )
+            .unwrap()
+            .unwrap();
     let should_replace = replace_transactions.is_some() || replace_tx_root.is_some();
     let transactions = replace_transactions.unwrap_or_else(Vec::new);
     let tx_root = match replace_tx_root {
@@ -283,15 +277,7 @@ pub fn create_chunk(
         None,
         None,
     );
-    (
-        ProduceChunkResult {
-            chunk,
-            encoded_chunk_parts_paths: merkle_paths,
-            receipts,
-            transactions_storage_proof,
-        },
-        block,
-    )
+    (ProduceChunkResult { chunk, encoded_chunk_parts_paths: merkle_paths, receipts }, block)
 }
 
 /// Keep running catchup until there is no more catchup work that can be done
diff --git a/core/primitives-core/src/version.rs b/core/primitives-core/src/version.rs
index 51813831bb7..bf7c32cd62b 100644
--- a/core/primitives-core/src/version.rs
+++ b/core/primitives-core/src/version.rs
@@ -205,7 +205,12 @@ pub enum ProtocolFeature {
     ///
     /// Chunks no longer become entirely invalid in case invalid transactions are included in the
     /// chunk. Instead the transactions are discarded during their conversion to receipts.
-    RelaxedChunkValidation,
+    ///
+    /// support for code that does not do relaxed chunk validation has now been removed.
+    #[deprecated(
+        note = "Was used for protocol versions without relaxed chunk validation which is not supported anymore."
+    )]
+    _DeprecatedRelaxedChunkValidation,
     /// This enables us to remove the expensive check_balance call from the runtime.
     RemoveCheckBalance,
     /// Exclude existing contract code in deploy-contract and delete-account actions from the chunk state witness.
@@ -219,6 +224,11 @@ pub enum ProtocolFeature {
 }
 
 impl ProtocolFeature {
+    // The constructor must initialize all fields of the struct but some fields
+    // are deprecated.  So unfortunately, we need this attribute here.  A better
+    // fix is being discussed on
+    // https://github.com/rust-lang/rust/issues/102777.
+    #[allow(deprecated)]
     pub const fn protocol_version(self) -> ProtocolVersion {
         match self {
             // Stable features
@@ -287,7 +297,7 @@ impl ProtocolFeature {
             ProtocolFeature::FixStakingThreshold
             | ProtocolFeature::RejectBlocksWithOutdatedProtocolVersions
             | ProtocolFeature::FixChunkProducerStakingThreshold
-            | ProtocolFeature::RelaxedChunkValidation
+            | ProtocolFeature::_DeprecatedRelaxedChunkValidation
             | ProtocolFeature::RemoveCheckBalance
             // BandwidthScheduler and CurrentEpochStateSync must be enabled
             // before ReshardingV3! When releasing this feature please make sure
@@ -319,7 +329,7 @@ impl ProtocolFeature {
 pub const PROD_GENESIS_PROTOCOL_VERSION: ProtocolVersion = 29;
 
 /// Minimum supported protocol version for the current binary
-pub const MIN_SUPPORTED_PROTOCOL_VERSION: ProtocolVersion = 48;
+pub const MIN_SUPPORTED_PROTOCOL_VERSION: ProtocolVersion = 75;
 
 /// Current protocol version used on the mainnet with all stable features.
 const STABLE_PROTOCOL_VERSION: ProtocolVersion = 77;
diff --git a/core/primitives/src/stateless_validation/state_witness.rs b/core/primitives/src/stateless_validation/state_witness.rs
index eefe9bedc2a..968e21e6f44 100644
--- a/core/primitives/src/stateless_validation/state_witness.rs
+++ b/core/primitives/src/stateless_validation/state_witness.rs
@@ -146,18 +146,25 @@ pub struct ChunkStateWitness {
     /// After these are applied as well, we should arrive at the pre-state-root
     /// of the chunk that this witness is for.
     pub implicit_transitions: Vec<ChunkStateTransition>,
-    /// Finally, we need to be able to verify that the new transitions proposed
-    /// by the chunk (that this witness is for) are valid. For that, we need
-    /// the transactions as well as another partial storage (based on the
-    /// pre-state-root of this chunk) in order to verify that the sender
-    /// accounts have appropriate balances, access keys, nonces, etc.
-    pub new_transactions: Vec<SignedTransaction>,
-    pub new_transactions_validation_state: PartialState,
+    #[deprecated(
+        note = "Was used for protocol versions without relaxed chunk validation which is not supported anymore."
+    )]
+    pub _deprecated_new_transactions: Vec<SignedTransaction>,
+    /// The following two field is deprecated and should not be use anymore
+    #[deprecated(
+        note = "Was used for protocol versions without relaxed chunk validation which is not supported anymore."
+    )]
+    pub _deprecated_new_transactions_validation_state: PartialState,
     // TODO(stateless_validation): Deprecate this field in the next version of the state witness.
     signature_differentiator: SignatureDifferentiator,
 }
 
 impl ChunkStateWitness {
+    // The constructor must initialize all fields of the struct but some fields
+    // are deprecated.  So unfortunately, we need this attribute here.  A better
+    // fix is being discussed on
+    // https://github.com/rust-lang/rust/issues/102777.
+    #[allow(deprecated)]
     pub fn new(
         chunk_producer: AccountId,
         epoch_id: EpochId,
@@ -167,8 +174,6 @@ impl ChunkStateWitness {
         applied_receipts_hash: CryptoHash,
         transactions: Vec<SignedTransaction>,
         implicit_transitions: Vec<ChunkStateTransition>,
-        new_transactions: Vec<SignedTransaction>,
-        new_transactions_validation_state: PartialState,
     ) -> Self {
         Self {
             chunk_producer,
@@ -179,9 +184,9 @@ impl ChunkStateWitness {
             applied_receipts_hash,
             transactions,
             implicit_transitions,
-            new_transactions,
-            new_transactions_validation_state,
-            signature_differentiator: "ChunkStateWitness".to_owned(),
+            signature_differentiator: "ChunkStateWitness".to_string(),
+            _deprecated_new_transactions: vec![],
+            _deprecated_new_transactions_validation_state: PartialState::default(),
         }
     }
 
@@ -204,8 +209,6 @@ impl ChunkStateWitness {
             Default::default(),
             Default::default(),
             Default::default(),
-            Default::default(),
-            Default::default(),
         )
     }
 }
diff --git a/integration-tests/src/tests/client/invalid_txs.rs b/integration-tests/src/tests/client/invalid_txs.rs
index 3ad3fdc433b..81878ccce60 100644
--- a/integration-tests/src/tests/client/invalid_txs.rs
+++ b/integration-tests/src/tests/client/invalid_txs.rs
@@ -87,15 +87,8 @@ fn test_invalid_transactions_no_panic() {
                 assert!(matches!(res, ProcessTxResponse::ValidTx))
             }
 
-            let (
-                ProduceChunkResult {
-                    chunk,
-                    encoded_chunk_parts_paths,
-                    receipts,
-                    transactions_storage_proof,
-                },
-                _,
-            ) = create_chunk_with_transactions(client, transactions);
+            let (ProduceChunkResult { chunk, encoded_chunk_parts_paths, receipts }, _) =
+                create_chunk_with_transactions(client, transactions);
 
             let shard_chunk = client
                 .persist_and_distribute_encoded_chunk(
@@ -121,7 +114,6 @@ fn test_invalid_transactions_no_panic() {
                     prev_block.header(),
                     &prev_chunk_header,
                     &shard_chunk,
-                    transactions_storage_proof,
                     &client.validator_signer.get(),
                 )
                 .unwrap();
@@ -215,15 +207,8 @@ fn test_invalid_transactions_dont_invalidate_chunk() {
     let chunk_producer = env.get_chunk_producer_at_offset(&tip, 1, ShardId::new(0));
     let block_producer = env.get_block_producer_at_offset(&tip, 1);
     let client = env.client(&chunk_producer);
-    let (
-        ProduceChunkResult {
-            chunk,
-            encoded_chunk_parts_paths,
-            receipts,
-            transactions_storage_proof,
-        },
-        _,
-    ) = create_chunk_with_transactions(client, chunk_transactions);
+    let (ProduceChunkResult { chunk, encoded_chunk_parts_paths, receipts }, _) =
+        create_chunk_with_transactions(client, chunk_transactions);
 
     let shard_chunk = client
         .persist_and_distribute_encoded_chunk(
@@ -247,7 +232,6 @@ fn test_invalid_transactions_dont_invalidate_chunk() {
             prev_block.header(),
             &prev_chunk_header,
             &shard_chunk,
-            transactions_storage_proof,
             &client.validator_signer.get(),
         )
         .unwrap();
diff --git a/integration-tests/src/tests/features/adversarial_behaviors.rs b/integration-tests/src/tests/features/adversarial_behaviors.rs
index f7873558a56..b5909032a6b 100644
--- a/integration-tests/src/tests/features/adversarial_behaviors.rs
+++ b/integration-tests/src/tests/features/adversarial_behaviors.rs
@@ -369,17 +369,3 @@ fn slow_test_banning_chunk_producer_when_seeing_invalid_chunk() {
     test.env.clients[7].chunk_producer.produce_invalid_chunks = true;
     test_banning_chunk_producer_when_seeing_invalid_chunk_base(test);
 }
-
-#[test]
-#[cfg(feature = "test_features")]
-fn test_banning_chunk_producer_when_seeing_invalid_tx_in_chunk() {
-    let relaxed_chunk_validation =
-        ProtocolFeature::RelaxedChunkValidation.enabled(PROTOCOL_VERSION);
-    if !relaxed_chunk_validation {
-        init_test_logger();
-        let mut test = AdversarialBehaviorTestData::new();
-        test.env.clients[7].chunk_producer.produce_invalid_tx_in_chunks = true;
-        test_banning_chunk_producer_when_seeing_invalid_chunk_base(test);
-    }
-    // Otherwise the chunks aren't considered invalid and there will be no banning.
-}
diff --git a/runtime/runtime/src/lib.rs b/runtime/runtime/src/lib.rs
index 3b23a155a7a..4d409488a23 100644
--- a/runtime/runtime/src/lib.rs
+++ b/runtime/runtime/src/lib.rs
@@ -1576,28 +1576,6 @@ impl Runtime {
         state_update.commit(StateChangeCause::Migration);
     }
 
-    /// Helper function that checks `RelaxedChunkValidation`. If it is enabled, we log a debug
-    /// message and return `Ok(())` to skip the transaction. Otherwise, we return `Err(e.into())`.
-    fn handle_invalid_transaction<E: std::fmt::Debug + Clone + Into<RuntimeError>>(
-        e: E,
-        tx_hash: &CryptoHash,
-        protocol_version: ProtocolVersion,
-        reason: &str,
-    ) -> Result<(), RuntimeError> {
-        if ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version) {
-            tracing::debug!(
-                target: "runtime",
-                "invalid transaction ignored ({}) => tx_hash: {}, error: {:?}",
-                reason,
-                tx_hash,
-                e
-            );
-            Ok(())
-        } else {
-            Err(e.into())
-        }
-    }
-
     /// Processes a collection of transactions.
     ///
     /// Fills the `processing_state` with local receipts generated during processing of the
@@ -1633,12 +1611,12 @@ impl Runtime {
                     ) {
                         Ok(outcome) => outcome,
                         Err(err) => {
-                            Self::handle_invalid_transaction(
-                                err,
-                                &tx_hash,
-                                processing_state.protocol_version,
-                                "process_transaction error",
-                            )?;
+                            tracing::debug!(
+                                target: "runtime",
+                                ?tx_hash,
+                                ?err,
+                                "invalid transaction ignored (process_transaction error)",
+                            );
                             continue;
                         }
                     };
@@ -1662,12 +1640,12 @@ impl Runtime {
                     processing_state.outcomes.push(outcome_with_id);
                 }
                 Err(err) => {
-                    Self::handle_invalid_transaction(
-                        err,
-                        &tx_hash,
-                        processing_state.protocol_version,
-                        "parallel validation error",
-                    )?;
+                    tracing::debug!(
+                        target: "runtime",
+                        ?tx_hash,
+                        ?err,
+                        "invalid transaction ignored (parallel validation error)",
+                    );
                 }
             }
         }
diff --git a/tools/protocol-schema-check/res/protocol_schema.toml b/tools/protocol-schema-check/res/protocol_schema.toml
index a32938db362..7957e2ccd36 100644
--- a/tools/protocol-schema-check/res/protocol_schema.toml
+++ b/tools/protocol-schema-check/res/protocol_schema.toml
@@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 1590606989
 ChunkStateWitnessAck = 177881908
 ChunkStats = 4176245277
 CodeBytes = 2940589161
diff --git a/tools/state-viewer/src/apply_chain_range.rs b/tools/state-viewer/src/apply_chain_range.rs
index b0c5ba85776..3b476f034fb 100644
--- a/tools/state-viewer/src/apply_chain_range.rs
+++ b/tools/state-viewer/src/apply_chain_range.rs
@@ -155,8 +155,7 @@ fn apply_block_from_range(
         let transactions = chunk.transactions();
         let valid_txs = chain_store_update
             .chain_store()
-            .compute_transaction_validity(protocol_version, prev_block.header(), &chunk)
-            .expect("valid transaction calculation");
+            .compute_transaction_validity(prev_block.header(), &chunk);
         let shard_layout =
             epoch_manager.get_shard_layout_from_prev_block(block.header().prev_hash()).unwrap();
         let receipt_proof_response = get_incoming_receipts_for_shard(
diff --git a/tools/state-viewer/src/apply_chunk.rs b/tools/state-viewer/src/apply_chunk.rs
index 1e9e831ec5a..2ac6f96738e 100644
--- a/tools/state-viewer/src/apply_chunk.rs
+++ b/tools/state-viewer/src/apply_chunk.rs
@@ -180,14 +180,7 @@ pub fn apply_chunk(
         shard_id,
     )?;
 
-    let new_epoch_id =
-        epoch_manager.get_epoch_id_from_prev_block(prev_block_hash).context("new epoch id")?;
-    let protocol_version = epoch_manager
-        .get_epoch_protocol_version(&new_epoch_id)
-        .context("epoch protocol version")?;
-    let valid_txs = chain_store
-        .compute_transaction_validity(protocol_version, prev_block.header(), &chunk)
-        .context("compute transaction validity")?;
+    let valid_txs = chain_store.compute_transaction_validity(prev_block.header(), &chunk);
 
     Ok((
         runtime.apply_chunk(
diff --git a/tools/state-viewer/src/commands.rs b/tools/state-viewer/src/commands.rs
index df1734548ba..35a3ef0fad2 100644
--- a/tools/state-viewer/src/commands.rs
+++ b/tools/state-viewer/src/commands.rs
@@ -107,13 +107,7 @@ pub(crate) fn apply_block(
         .unwrap();
 
         let transactions = chunk.transactions();
-        let valid_txs = chain_store
-            .compute_transaction_validity(
-                block.header().latest_protocol_version(),
-                prev_block.header(),
-                &chunk,
-            )
-            .unwrap();
+        let valid_txs = chain_store.compute_transaction_validity(prev_block.header(), &chunk);
         runtime
             .apply_chunk(
                 storage.create_runtime_storage(*chunk_inner.prev_state_root()),
diff --git a/tools/state-viewer/src/latest_witnesses.rs b/tools/state-viewer/src/latest_witnesses.rs
index 09cefe9a69a..44ce7158228 100644
--- a/tools/state-viewer/src/latest_witnesses.rs
+++ b/tools/state-viewer/src/latest_witnesses.rs
@@ -133,7 +133,7 @@ impl ValidateWitnessCmd {
             Clock::real(),
             epoch_manager.clone(),
             shard_tracker,
-            runtime_adapter.clone(),
+            runtime_adapter,
             &chain_genesis,
             DoomslugThresholdMode::TwoThirds,
             false,
@@ -145,7 +145,6 @@ impl ValidateWitnessCmd {
             .shadow_validate_state_witness(
                 witness,
                 epoch_manager.as_ref(),
-                runtime_adapter.as_ref(),
                 Some(processing_done_tracker),
             )
             .unwrap();


Reviews:
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T19:18:35Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-23T06:49:55Z
user: login: nagisa
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T09:30:49Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T11:28:53Z
user: login: wacban
body: generally looks good but please answer the question about storage proofs

Will you be removing the ProtocolFeature::RelaxedChunkValidation as well? 
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T14:09:40Z
user: login: wacban
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T14:15:40Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T15:28:13Z
user: login: pugachAG
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T15:36:57Z
user: login: shreyan-gupta
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:15:27Z
user: login: shreyan-gupta
body: Could we please mark `RelaxedChunkValidation` as `_DeprecatedRelaxedChunkValidation`? Also change `MIN_SUPPORTED_PROTOCOL_VERSION` to 75?
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:18:11Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:42:45Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:43:05Z
user: login: shreyan-gupta
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T20:30:53Z
user: login: akhi3030
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T14:45:31Z

Review comments:
diff_hunk: @@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 655135716
path: tools/protocol-schema-check/res/protocol_schema.toml
user: login: akhi3030
body: I changed the names of some fields in the `ChunkStateWitness`, hence I had to regenerate the schema.
created_at: 2025-03-22T19:18:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: akhi3030
body: This is obviously not the correct change.  I just added it here to make things compile.  This test is currently failing.  I am not sure how to fix the issue though.  I need to somehow need to do `trie.recorded_storage().map(|s| s.nodes)` from the call to `prepare_transactions` above but I am not sure how exactly to accomplish that.  Any help is much appreciated.
created_at: 2025-03-23T06:49:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 655135716
path: tools/protocol-schema-check/res/protocol_schema.toml
user: login: nagisa
body: Doesn't that mean a change in protocol anyway? On one hand Borsh doesn't encode field names so supposedly that should have no effect (in which case the tool should be adjusted IMO,) on the other hand I'm not familiar with borsh derives enough to be super confident that it really has no effect.

Regardless, rustc has `#[deprecated = "reason"]` that can be put on top of pretty much anything you can think of.
created_at: 2025-03-24T09:23:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: nagisa
body: Why was `storage_proof` field removed from the `PreparedTransactions` in the first place?
created_at: 2025-03-24T09:30:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: akhi3030
body: @nagisa and @wacban: based on my analysis, the field was only used to set the `transactions_storage_proof` argument to `create_state_witness` [here](https://github.com/near/nearcore/pull/13185/files#diff-5fe9869228ee4876b7d1cdcdcf40ffd3e4582c03cd70bb0345a7ce81246084feL124).  So AFAICT, there is no consumer of this field in production code.
created_at: 2025-03-24T11:28:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -498,32 +498,20 @@ impl ChainStore {
 
     pub fn compute_transaction_validity(
         &self,
-        protocol_version: ProtocolVersion,
         prev_block_header: &BlockHeader,
         chunk: &ShardChunk,
-    ) -> Result<Vec<bool>, Error> {
-        let relaxed_chunk_validation =
-            ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version);
-        let mut valid_txs = Vec::with_capacity(chunk.transactions().len());
-        if relaxed_chunk_validation {
-            for transaction in chunk.transactions() {
-                let is_valid = self.check_transaction_validity_period(
-                    prev_block_header,
-                    transaction.transaction.block_hash(),
-                );
-                valid_txs.push(is_valid.is_ok());
-            }
-        } else {
-            for transaction in chunk.transactions() {
+    ) -> Vec<bool> {
+        chunk
+            .transactions()
+            .into_iter()
path: chain/chain/src/store/mod.rs
user: login: wacban
body: personally I'm more of a for loop guy but I guess it's personal preference
created_at: 2025-03-24T14:02:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -146,13 +146,10 @@ pub struct ChunkStateWitness {
     /// After these are applied as well, we should arrive at the pre-state-root
     /// of the chunk that this witness is for.
     pub implicit_transitions: Vec<ChunkStateTransition>,
-    /// Finally, we need to be able to verify that the new transitions proposed
-    /// by the chunk (that this witness is for) are valid. For that, we need
-    /// the transactions as well as another partial storage (based on the
-    /// pre-state-root of this chunk) in order to verify that the sender
-    /// accounts have appropriate balances, access keys, nonces, etc.
-    pub new_transactions: Vec<SignedTransaction>,
-    pub new_transactions_validation_state: PartialState,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions: Vec<SignedTransaction>,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions_validation_state: PartialState,
path: core/primitives/src/stateless_validation/state_witness.rs
user: login: wacban
body: Sanity check - does that change serialization of this struct? Is that a protocol upgrade / networking protocol upgrade? 
created_at: 2025-03-24T14:06:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1661,12 +1639,12 @@ impl Runtime {
                     ) {
                         Ok(outcome) => outcome,
                         Err(err) => {
-                            Self::handle_invalid_transaction(
-                                err,
-                                &tx_hash,
-                                processing_state.protocol_version,
-                                "process_transaction error",
-                            )?;
+                            tracing::debug!(
+                                target: "runtime",
+                                "invalid transaction ignored (process_transaction error) => tx_hash: {}, error: {:?}",
+                                tx_hash,
+                                err
+                            );
path: runtime/runtime/src/lib.rs
user: login: wacban
body: nit: use structured logging by moving the tx_hash and error to fields
```
tracing::debug!(target:"runtime", ?tx_hash, ?err, "invalid ...);
```
created_at: 2025-03-24T14:07:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1661,12 +1639,12 @@ impl Runtime {
                     ) {
                         Ok(outcome) => outcome,
                         Err(err) => {
-                            Self::handle_invalid_transaction(
-                                err,
-                                &tx_hash,
-                                processing_state.protocol_version,
-                                "process_transaction error",
-                            )?;
+                            tracing::debug!(
+                                target: "runtime",
+                                "invalid transaction ignored (process_transaction error) => tx_hash: {}, error: {:?}",
+                                tx_hash,
+                                err
+                            );
path: runtime/runtime/src/lib.rs
user: login: wacban
body: actually not related to your PR so feel free to leave as is but would be nice
created_at: 2025-03-24T14:07:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: wacban
body: Ah, was the proof only used to validate new transactions? Just for completeness, why is it that the old transaction not require the same? Is that because the old transaction validation happens in the main transition and is captured in the storage proof there? This would make sense assuming the transaction validation happens from within apply where it would be recorded and automatically verified by chunk validators. 
created_at: 2025-03-24T14:14:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: wacban
body: In that case however I don't see why the empty storage breaks the test though. 
created_at: 2025-03-24T14:15:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -498,32 +498,20 @@ impl ChainStore {
 
     pub fn compute_transaction_validity(
         &self,
-        protocol_version: ProtocolVersion,
         prev_block_header: &BlockHeader,
         chunk: &ShardChunk,
-    ) -> Result<Vec<bool>, Error> {
-        let relaxed_chunk_validation =
-            ProtocolFeature::RelaxedChunkValidation.enabled(protocol_version);
-        let mut valid_txs = Vec::with_capacity(chunk.transactions().len());
-        if relaxed_chunk_validation {
-            for transaction in chunk.transactions() {
-                let is_valid = self.check_transaction_validity_period(
-                    prev_block_header,
-                    transaction.transaction.block_hash(),
-                );
-                valid_txs.push(is_valid.is_ok());
-            }
-        } else {
-            for transaction in chunk.transactions() {
+    ) -> Vec<bool> {
+        chunk
+            .transactions()
+            .into_iter()
path: chain/chain/src/store/mod.rs
user: login: akhi3030
body: I know what you mean.  I like this approach mainly because there are fewer mutable variables and less "cruft" i.e. declaring empty Vec, pushing to it, etc. etc.
created_at: 2025-03-24T15:20:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -146,13 +146,10 @@ pub struct ChunkStateWitness {
     /// After these are applied as well, we should arrive at the pre-state-root
     /// of the chunk that this witness is for.
     pub implicit_transitions: Vec<ChunkStateTransition>,
-    /// Finally, we need to be able to verify that the new transitions proposed
-    /// by the chunk (that this witness is for) are valid. For that, we need
-    /// the transactions as well as another partial storage (based on the
-    /// pre-state-root of this chunk) in order to verify that the sender
-    /// accounts have appropriate balances, access keys, nonces, etc.
-    pub new_transactions: Vec<SignedTransaction>,
-    pub new_transactions_validation_state: PartialState,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions: Vec<SignedTransaction>,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions_validation_state: PartialState,
path: core/primitives/src/stateless_validation/state_witness.rs
user: login: akhi3030
body: AFAIU borsh, it should not be a protocol or networking upgrade.  @pugachAG [recommended](https://github.com/near/nearcore/pull/13107#discussion_r1994291781) that I do this in my previous attempt to do this PR.  So I am assuming this is safe.
created_at: 2025-03-24T15:24:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 655135716
path: tools/protocol-schema-check/res/protocol_schema.toml
user: login: akhi3030
body: @pugachAG and @Longarithm: do you know how to handle this issue please?  Does this change imply that there is a change in the protocol?  
created_at: 2025-03-24T15:27:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 655135716
path: tools/protocol-schema-check/res/protocol_schema.toml
user: login: pugachAG
body: renaming field in borsh-serialised struct is not a protocol change
created_at: 2025-03-24T15:36:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -146,13 +146,10 @@ pub struct ChunkStateWitness {
     /// After these are applied as well, we should arrive at the pre-state-root
     /// of the chunk that this witness is for.
     pub implicit_transitions: Vec<ChunkStateTransition>,
-    /// Finally, we need to be able to verify that the new transitions proposed
-    /// by the chunk (that this witness is for) are valid. For that, we need
-    /// the transactions as well as another partial storage (based on the
-    /// pre-state-root of this chunk) in order to verify that the sender
-    /// accounts have appropriate balances, access keys, nonces, etc.
-    pub new_transactions: Vec<SignedTransaction>,
-    pub new_transactions_validation_state: PartialState,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions: Vec<SignedTransaction>,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions_validation_state: PartialState,
path: core/primitives/src/stateless_validation/state_witness.rs
user: login: shreyan-gupta
body: Does it make sense to prefix underscore?
created_at: 2025-03-24T16:15:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -73,7 +73,7 @@ ChunkProductionKey = 2508733236
 ChunkProofs = 4130187750
 ChunkState = 1435093277
 ChunkStateTransition = 307448170
-ChunkStateWitness = 94504878
+ChunkStateWitness = 655135716
path: tools/protocol-schema-check/res/protocol_schema.toml
user: login: akhi3030
body: Added the deprecated attribute.
created_at: 2025-03-24T17:42:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -146,13 +146,10 @@ pub struct ChunkStateWitness {
     /// After these are applied as well, we should arrive at the pre-state-root
     /// of the chunk that this witness is for.
     pub implicit_transitions: Vec<ChunkStateTransition>,
-    /// Finally, we need to be able to verify that the new transitions proposed
-    /// by the chunk (that this witness is for) are valid. For that, we need
-    /// the transactions as well as another partial storage (based on the
-    /// pre-state-root of this chunk) in order to verify that the sender
-    /// accounts have appropriate balances, access keys, nonces, etc.
-    pub new_transactions: Vec<SignedTransaction>,
-    pub new_transactions_validation_state: PartialState,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions: Vec<SignedTransaction>,
+    /// The following two field is deprecated and should not be use anymore
+    pub deprecated_new_transactions_validation_state: PartialState,
path: core/primitives/src/stateless_validation/state_witness.rs
user: login: akhi3030
body: added the `_`.
created_at: 2025-03-24T17:43:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1686,14 +1685,11 @@ fn test_prepare_transactions_storage_proof() {
     .unwrap();
 
     assert_eq!(proposed_transactions.transactions.len(), transactions_count);
-    assert!(proposed_transactions.storage_proof.is_some());
 
     let validator_storage_config = RuntimeStorageConfig {
         state_root: env.state_roots[0],
         use_flat_storage: true,
-        source: StorageDataSource::Recorded(PartialStorage {
-            nodes: proposed_transactions.storage_proof.unwrap(),
-        }),
+        source: StorageDataSource::Recorded(PartialStorage::default()),
path: chain/chain/src/runtime/tests.rs
user: login: akhi3030
body: for posterity, we decided that the test is now obsolete and removed it.
created_at: 2025-03-25T14:45:31Z
author_association: CONTRIBUTOR

PR comments:
user: login: codecov[bot]
created_at: 2025-03-22T18:15:14Z
body: ## [Codecov](https://app.codecov.io/gh/near/nearcore/pull/13185?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) Report
Attention: Patch coverage is `90.38462%` with `5 lines` in your changes missing coverage. Please review.
> Project coverage is 69.92%. Comparing base [(`761c1a0`)](https://app.codecov.io/gh/near/nearcore/commit/761c1a0a60e79a80be888983ae90100fb9138ca7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) to head [(`cd0c52e`)](https://app.codecov.io/gh/near/nearcore/commit/cd0c52e8d4e3a3b0d9166079fa63fc8c778ee55e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near).
> Report is 2 commits behind head on master.

| [Files with missing lines](https://app.codecov.io/gh/near/nearcore/pull/13185?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | Patch % | Lines |
|---|---|---|
| [...chain/src/stateless\_validation/chunk\_validation.rs](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&filepath=chain%2Fchain%2Fsrc%2Fstateless_validation%2Fchunk_validation.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#diff-Y2hhaW4vY2hhaW4vc3JjL3N0YXRlbGVzc192YWxpZGF0aW9uL2NodW5rX3ZhbGlkYXRpb24ucnM=) | 71.42% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) |
| [runtime/runtime/src/lib.rs](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&filepath=runtime%2Fruntime%2Fsrc%2Flib.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#diff-cnVudGltZS9ydW50aW1lL3NyYy9saWIucnM=) | 50.00% | [2 Missing :warning: ](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) |
| [tools/state-viewer/src/latest\_witnesses.rs](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&filepath=tools%2Fstate-viewer%2Fsrc%2Flatest_witnesses.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#diff-dG9vbHMvc3RhdGUtdmlld2VyL3NyYy9sYXRlc3Rfd2l0bmVzc2VzLnJz) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/near/nearcore/pull/13185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master   #13185      +/-   ##
==========================================
- Coverage   69.95%   69.92%   -0.04%     
==========================================
  Files         871      871              
  Lines      176101   175811     -290     
  Branches   176101   175811     -290     
==========================================
- Hits       123197   122938     -259     
+ Misses      47756    47754       -2     
+ Partials     5148     5119      -29     
```

| [Flag](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | Coverage Δ | |
|---|---|---|
| [backward-compatibility](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.36% <0.00%> (+<0.01%)` | :arrow_up: |
| [db-migration](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.36% <0.00%> (+<0.01%)` | :arrow_up: |
| [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.44% <0.00%> (+<0.01%)` | :arrow_up: |
| [linux](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.76% <90.38%> (-0.03%)` | :arrow_down: |
| [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.46% <90.38%> (-0.04%)` | :arrow_down: |
| [pytests](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.75% <0.00%> (+<0.01%)` | :arrow_up: |
| [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.56% <0.00%> (+<0.01%)` | :arrow_up: |
| [unittests](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.76% <90.38%> (-0.04%)` | :arrow_down: |
| [upgradability](https://app.codecov.io/gh/near/nearcore/pull/13185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.36% <0.00%> (+<0.01%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/near/nearcore/pull/13185?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE
user: login: wacban
created_at: 2025-03-24T10:29:45Z
body: I was just about to catch up on the relaxed validation and it's getting removed already ;) 
author_association: CONTRIBUTOR
user: login: akhi3030
created_at: 2025-03-24T11:30:15Z
body: > I was just about to catch up on the relaxed validation and it's getting removed already ;)

To be clear, we are getting rid of code where we do not do relaxed validation so still makes sense to catch up on it =).
author_association: CONTRIBUTOR
user: login: wacban
created_at: 2025-03-24T14:11:40Z
body: > To be clear, we are getting rid of code where we do not do relaxed validation so still makes sense to catch up on it =).

Well please consider that a failed attempt at humour on my side ;) I blame the Monday blues! 
author_association: CONTRIBUTOR
user: login: akhi3030
created_at: 2025-03-24T17:46:26Z
body: > Could we please mark `RelaxedChunkValidation` as `_DeprecatedRelaxedChunkValidation`? Also change `MIN_SUPPORTED_PROTOCOL_VERSION` to 75?

done 
author_association: CONTRIBUTOR