@@ -1050,7 +1050,7 @@ impl AuthorityStore {
10501050 // TODO: replace with optimistic db_transactions (i.e. set lock to tx if none)
10511051 let _mutexes = self . acquire_locks ( owned_input_objects) . await ;
10521052
1053- trace ! ( ?owned_input_objects, "acquire_locks " ) ;
1053+ trace ! ( ?owned_input_objects, "acquire_transaction_locks " ) ;
10541054 let mut locks_to_write = Vec :: new ( ) ;
10551055
10561056 let live_object_markers = self
@@ -1070,11 +1070,12 @@ impl AuthorityStore {
10701070 owned_input_objects
10711071 ) {
10721072 if live_marker. is_none ( ) {
1073- let latest_lock = self . get_latest_live_version_for_object_id ( obj_ref. 0 ) ?;
1073+ // object at that version does not exist
1074+ let latest_live_version = self . get_latest_live_version_for_object_id ( obj_ref. 0 ) ?;
10741075 fp_bail ! (
10751076 UserInputError :: ObjectVersionUnavailableForConsumption {
10761077 provided_obj_ref: * obj_ref,
1077- current_version: latest_lock . 1
1078+ current_version: latest_live_version . 1
10781079 }
10791080 . into( )
10801081 ) ;
@@ -1121,6 +1122,7 @@ impl AuthorityStore {
11211122 . get ( & obj_ref) ?
11221123 . is_none ( )
11231124 {
1125+ // object at that version does not exist
11241126 return Ok ( ObjectLockStatus :: LockedAtDifferentVersion {
11251127 locked_ref : self . get_latest_live_version_for_object_id ( obj_ref. 0 ) ?,
11261128 } ) ;
@@ -1172,17 +1174,18 @@ impl AuthorityStore {
11721174 /// Returns UserInputError::ObjectVersionUnavailableForConsumption if at
11731175 /// least one object lock is not initialized at the given version.
11741176 pub fn check_owned_objects_are_live ( & self , objects : & [ ObjectRef ] ) -> IotaResult {
1175- let locks = self
1177+ let live_markers = self
11761178 . perpetual_tables
11771179 . live_owned_object_markers
11781180 . multi_get ( objects) ?;
1179- for ( lock, obj_ref) in locks. into_iter ( ) . zip ( objects) {
1180- if lock. is_none ( ) {
1181- let latest_lock = self . get_latest_live_version_for_object_id ( obj_ref. 0 ) ?;
1181+ for ( live_marker, obj_ref) in live_markers. into_iter ( ) . zip ( objects) {
1182+ if live_marker. is_none ( ) {
1183+ // object at that version does not exist
1184+ let latest_live_version = self . get_latest_live_version_for_object_id ( obj_ref. 0 ) ?;
11821185 fp_bail ! (
11831186 UserInputError :: ObjectVersionUnavailableForConsumption {
11841187 provided_obj_ref: * obj_ref,
1185- current_version: latest_lock . 1
1188+ current_version: latest_live_version . 1
11861189 }
11871190 . into( )
11881191 ) ;
@@ -1209,7 +1212,7 @@ impl AuthorityStore {
12091212 write_batch : & mut DBBatch ,
12101213 objects : & [ ObjectRef ] ,
12111214 ) -> IotaResult {
1212- trace ! ( ?objects, "initialize_locks " ) ;
1215+ trace ! ( ?objects, "initialize_live_object_markers " ) ;
12131216
12141217 write_batch. insert_batch (
12151218 live_object_marker_table,
@@ -1224,7 +1227,7 @@ impl AuthorityStore {
12241227 write_batch : & mut DBBatch ,
12251228 objects : & [ ObjectRef ] ,
12261229 ) -> IotaResult {
1227- trace ! ( ?objects, "delete_locks " ) ;
1230+ trace ! ( ?objects, "delete_live_object_markers " ) ;
12281231 write_batch. delete_batch (
12291232 & self . perpetual_tables . live_owned_object_markers ,
12301233 objects. iter ( ) ,
@@ -1233,7 +1236,7 @@ impl AuthorityStore {
12331236 }
12341237
12351238 #[ cfg( test) ]
1236- pub ( crate ) fn reset_locks_for_test (
1239+ pub ( crate ) fn reset_locks_and_live_markers_for_test (
12371240 & self ,
12381241 transactions : & [ TransactionDigest ] ,
12391242 objects : & [ ObjectRef ] ,
@@ -1346,10 +1349,10 @@ impl AuthorityStore {
13461349
13471350 let old_locks: Vec < _ > = old_locks. flatten ( ) . collect ( ) ;
13481351
1349- // Re-create old locks .
1352+ // Re-create old live markers .
13501353 self . initialize_live_object_markers_impl ( & mut write_batch, & old_locks) ?;
13511354
1352- // Delete new locks
1355+ // Delete new live markers
13531356 write_batch. delete_batch (
13541357 & self . perpetual_tables . live_owned_object_markers ,
13551358 new_locks. flatten ( ) ,
0 commit comments