Skip to content

Commit

Permalink
Suppress lock errors from concurrent tx processing (MystenLabs#2378)
Browse files Browse the repository at this point in the history
* In case of lock error, check if the tx effects already exist

* Revert temp fix from 2091
  • Loading branch information
mystenmark authored Jun 2, 2022
1 parent 6c825d9 commit dd0acf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 10 additions & 1 deletion crates/sui-core/src/authority/authority_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,17 @@ impl<
// 2. Not all validators lock, just 2f+1, so transaction should proceed regardless
// (But the lock should exist which means previous transactions finished)
// 3. Equivocation possible (different TX) but as long as 2f+1 approves current TX its fine
// 4. Locks may have existed when we started processing this tx, but could have since
// been deleted by a concurrent tx that finished first. In that case, check if the tx effects exist.
if USE_LOCKS {
self.lock_service.locks_exist(owned_inputs.clone()).await?;
if let Err(e) = self.lock_service.locks_exist(owned_inputs.clone()).await {
if self.effects_exists(&transaction_digest)? {
debug!(digest = ?transaction_digest, "locks were deleted due to concurrent processing of tx");
return Ok(());
} else {
return Err(e);
}
}
}

if let Some(next_seq) = seq_opt {
Expand Down
9 changes: 1 addition & 8 deletions crates/sui-core/src/authority_active/gossip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,7 @@ where
if !self.state.database.effects_exists(&digest)? {
// Download the certificate
let response = self.client.handle_transaction_info_request(TransactionInfoRequest::from(digest)).await?;
if let Err(err) = self.process_response(response).await {
// Check again whether the failure is due to a concurrent execution.
// TODO: a concurrent execution should not really have returned an
// error but it seems it does? Check correctness?
if !self.state.database.effects_exists(&digest)?{
return Err(err);
}
}
self.process_response(response).await?;
}
}
};
Expand Down

0 comments on commit dd0acf1

Please sign in to comment.