1616use super :: * ;
1717
1818use snarkvm_ledger_committee:: { MAX_DELEGATORS , MIN_DELEGATOR_STAKE , MIN_VALIDATOR_SELF_STAKE } ;
19- use snarkvm_utilities:: { cfg_sort_by_cached_key, defer} ;
19+ use snarkvm_utilities:: { cfg_sort_by_cached_key, defer, dev_eprintln } ;
2020
2121impl < N : Network , C : ConsensusStorage < N > > VM < N , C > {
2222 /// Speculates on the given list of transactions in the VM.
@@ -407,6 +407,8 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
407407 true => match process_rejected_deployment( fee, * deployment. clone( ) ) {
408408 Ok ( result) => result,
409409 Err ( error) => {
410+ // Note: On failure, skip this transaction, and continue speculation.
411+ dev_eprintln!( "Failed to finalize the fee in a rejected deploy - {error}" ) ;
410412 // Store the aborted transaction.
411413 aborted. push( ( transaction. clone( ) , error. to_string( ) ) ) ;
412414 // Continue to the next transaction.
@@ -428,6 +430,8 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
428430 match process_rejected_deployment( fee, * deployment. clone( ) ) {
429431 Ok ( result) => result,
430432 Err ( error) => {
433+ // Note: On failure, skip this transaction, and continue speculation.
434+ dev_eprintln!( "Failed to finalize the fee in a rejected deploy - {error}" ) ;
431435 // Store the aborted transaction.
432436 aborted. push( ( transaction. clone( ) , error. to_string( ) ) ) ;
433437 // Continue to the next transaction.
@@ -469,6 +473,10 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
469473 . map_err( |e| e. to_string( ) )
470474 }
471475 Err ( error) => {
476+ // Note: On failure, skip this transaction, and continue speculation.
477+ dev_eprintln!(
478+ "Failed to finalize the fee in a rejected execute - {error}"
479+ ) ;
472480 // Store the aborted transaction.
473481 aborted. push( ( transaction. clone( ) , error. to_string( ) ) ) ;
474482 // Continue to the next transaction.
@@ -529,6 +537,7 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
529537 // If the transaction failed, abort the entire batch.
530538 Err ( error) => {
531539 error!( "Critical bug in speculate: {error}\n \n {transaction}" ) ;
540+ dev_eprintln!( "Critical bug in speculate: {error}\n \n {transaction}" ) ;
532541 // Note: This will abort the entire atomic batch.
533542 return Err ( format!( "Failed to speculate on transaction - {error}" ) ) ;
534543 }
@@ -818,6 +827,7 @@ impl<N: Network, C: ConsensusStorage<N>> VM<N, C> {
818827 // If the transaction failed to finalize, abort and continue to the next transaction.
819828 Err ( error) => {
820829 error!( "Critical bug in finalize: {error}\n \n {transaction}" ) ;
830+ dev_eprintln!( "Critical bug in finalize: {error}\n \n {transaction}" ) ;
821831 // Note: This will abort the entire atomic batch.
822832 return Err ( format!( "Failed to finalize on transaction - {error}" ) ) ;
823833 }
0 commit comments