Skip to content

Commit

Permalink
state_witness: require that new_transactions are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Dec 16, 2024
1 parent 86133ea commit 5239f5f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chain/chain/src/stateless_validation/chunk_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,13 @@ pub fn pre_validate_chunk_state_witness(
RelaxedChunkValidation,
current_protocol_version
) {
if !state_witness.new_transactions.is_empty() {
return Err(Error::InvalidChunkStateWitness(format!(
"Witness new_transactions must be empty",
)));
}
let mut check = chain.transaction_validity_check(last_chunk_block.header().clone());
state_witness
.transactions
.iter()
.map(|t| check(t))
.collect::<Vec<_>>()
state_witness.transactions.iter().map(|t| check(t)).collect::<Vec<_>>()
} else {
let new_transactions = &state_witness.new_transactions;
let (new_tx_root_from_state_witness, _) = merklize(&new_transactions);
Expand Down

0 comments on commit 5239f5f

Please sign in to comment.