Skip to content

Commit b45b386

Browse files
authored
Merge pull request #3149 from ProvableHQ/better_add_next_block_error_reporting
Report mismatching finalized transactions on failure to add block
2 parents 698852c + 7864a0f commit b45b386

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

synthesizer/src/vm/finalize.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
154154
bail!("The ratifications after speculation do not match the ratifications in the block");
155155
}
156156
// Ensure the transactions after speculation match.
157-
if transactions != &confirmed_transactions.into_iter().collect() {
158-
bail!("The transactions after speculation do not match the transactions in the block");
157+
let confirmed_transactions = confirmed_transactions.into_iter().collect();
158+
if transactions != &confirmed_transactions {
159+
let confirmed_transaction_ids = confirmed_transactions.transaction_ids().collect::<Vec<_>>();
160+
bail!(
161+
"The transactions after speculation do not match the transactions in the block. IDs: {confirmed_transaction_ids:?} - Transactions:{transactions:?}"
162+
);
159163
}
160164
// Ensure there are no aborted transaction IDs from this speculation.
161165
// Note: There should be no aborted transactions, because we are checking a block,

0 commit comments

Comments
 (0)