Skip to content

Commit 8f7210b

Browse files
authored
Do not report execution times for cancelled transactions (#22080)
1 parent 23008dd commit 8f7210b

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

crates/sui-core/src/authority.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ impl AuthorityState {
12951295

12961296
epoch_store.record_local_execution_time(
12971297
certificate.data().transaction_data(),
1298+
&effects,
12981299
timings,
12991300
execution_start_time.elapsed(),
13001301
);

crates/sui-core/src/authority/authority_per_epoch_store.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use sui_types::crypto::{
4949
};
5050
use sui_types::digests::{ChainIdentifier, TransactionEffectsDigest};
5151
use sui_types::dynamic_field::get_dynamic_field_from_store;
52-
use sui_types::effects::TransactionEffects;
52+
use sui_types::effects::{TransactionEffects, TransactionEffectsAPI};
5353
use sui_types::error::{SuiError, SuiResult};
5454
use sui_types::executable_transaction::{
5555
TrustedExecutableTransaction, VerifiedExecutableTransaction,
@@ -1230,6 +1230,7 @@ impl AuthorityPerEpochStore {
12301230
pub fn record_local_execution_time(
12311231
&self,
12321232
tx: &TransactionData,
1233+
effects: &TransactionEffects,
12331234
timings: Vec<ExecutionTiming>,
12341235
total_duration: Duration,
12351236
) {
@@ -1238,6 +1239,10 @@ impl AuthorityPerEpochStore {
12381239
return;
12391240
};
12401241

1242+
if effects.status().is_cancelled() {
1243+
return;
1244+
}
1245+
12411246
// Only record timings for PTBs with shared inputs.
12421247
let TransactionKind::ProgrammableTransaction(ptb) = tx.kind() else {
12431248
return;

crates/sui-types/src/execution_status.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ impl ExecutionStatus {
416416
None
417417
}
418418
}
419+
420+
pub fn is_cancelled(&self) -> bool {
421+
matches!(
422+
self,
423+
ExecutionStatus::Failure {
424+
error: ExecutionFailureStatus::ExecutionCancelledDueToSharedObjectCongestion { .. },
425+
..
426+
}
427+
)
428+
}
419429
}
420430

421431
pub type CommandIndex = usize;

0 commit comments

Comments
 (0)