Skip to content

Commit

Permalink
Temporary work around for crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark committed Dec 18, 2024
1 parent 5d4350d commit 7eba17b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/sui-core/src/execution_cache/cache_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::sync::Arc;
use std::{cmp::Ordering, hash::DefaultHasher};

use moka::sync::Cache as MokaCache;
use mysten_common::debug_fatal;
use parking_lot::Mutex;
use sui_types::base_types::SequenceNumber;

Expand Down Expand Up @@ -291,10 +292,13 @@ where
let mut entry = entry.value().lock();
check_ticket()?;

// Ticket expiry makes this assert impossible.
// TODO: relax to debug_assert?
assert!(!entry.is_newer_than(&value), "entry is newer than value");
*entry = value;
if entry.is_newer_than(&value) {
// TODO: Ticket expiry should this assert impossible. While trying to root cause
// the bug we can simply ignore the insert.
debug_fatal!("entry is newer than value: {:?} > {:?}", entry, value);
} else {
*entry = value;
}
}

Ok(())
Expand Down

0 comments on commit 7eba17b

Please sign in to comment.