Skip to content

Commit

Permalink
fix(node): address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Nov 4, 2024
1 parent 06c9698 commit 6be993b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/iota-core/src/authority/authority_per_epoch_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pub struct AuthorityEpochTables {
DBMap<TransactionDigest, TrustedEnvelope<SenderSignedData, AuthoritySignInfo>>,

/// Map from ObjectRef to transaction locking that object
#[default_options_override_fn = "owned_object_transaction_locks_table_default_config"]
#[default_options_override_fn = "owned_object_locked_transactions_table_default_config"]
owned_object_locked_transactions: DBMap<ObjectRef, LockDetailsWrapper>,

/// Signatures over transaction effects that we have signed and returned to
Expand Down Expand Up @@ -607,7 +607,7 @@ fn signed_transactions_table_default_config() -> DBOptions {
.optimize_for_large_values_no_scan(1 << 10)
}

fn owned_object_transaction_locks_table_default_config() -> DBOptions {
fn owned_object_locked_transactions_table_default_config() -> DBOptions {
DBOptions {
options: default_db_options()
.optimize_for_write_throughput()
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-core/src/authority/authority_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ impl AuthorityStore {
locks.into_iter(),
owned_input_objects
) {
let Some(_live_marker) = live_marker else {
if live_marker.is_none() {
let latest_lock = self.get_latest_live_version_for_object_id(obj_ref.0)?;
fp_bail!(
UserInputError::ObjectVersionUnavailableForConsumption {
Expand Down Expand Up @@ -1905,6 +1905,6 @@ pub type IotaLockResult = IotaResult<ObjectLockStatus>;
#[derive(Debug, PartialEq, Eq)]
pub enum ObjectLockStatus {
Initialized,
LockedToTx { locked_by_tx: LockDetails },
LockedToTx { locked_by_tx: LockDetails }, // no need to use wrapper, not stored or serialized
LockedAtDifferentVersion { locked_ref: ObjectRef },
}
5 changes: 2 additions & 3 deletions crates/iota-core/src/authority/authority_store_tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ pub struct AuthorityPerpetualTables {
pub(crate) indirect_move_objects: DBMap<ObjectContentDigest, StoreMoveObjectWrapper>,

/// Object references of currently active objects that can be mutated.
#[default_options_override_fn = "owned_object_transaction_locks_table_default_config"]
#[rename = "owned_object_transaction_locks"]
#[default_options_override_fn = "live_owned_object_markers_table_default_config"]
pub(crate) live_owned_object_markers: DBMap<ObjectRef, ()>,

/// This is a map between the transaction digest and the corresponding
Expand Down Expand Up @@ -608,7 +607,7 @@ impl Iterator for LiveSetIter<'_> {
}

// These functions are used to initialize the DB tables
fn owned_object_transaction_locks_table_default_config() -> DBOptions {
fn live_owned_object_markers_table_default_config() -> DBOptions {
DBOptions {
options: default_db_options()
.optimize_for_write_throughput()
Expand Down

0 comments on commit 6be993b

Please sign in to comment.