Skip to content

Commit

Permalink
Rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfind committed Sep 26, 2022
1 parent 288eafa commit 9654a7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,15 @@ impl AuthorityState {
}
}

/// Execute a certificate that's know to have already finalized (i.e. executed by a quorum of
/// validators). For such certificate, we don't have to wait for consensus to set shared object
/// Execute a certificate that's known to have correct effects.
/// For such certificate, we don't have to wait for consensus to set shared object
/// locks because we already know the shared object versions based on the effects.
/// This function can be called either by a fullnode after seeing a quorum of signed effects,
/// or by a validator after seeing the certificate included by a certified checkpoint.
/// TODO: down the road, we may want to execute a shared object tx on a validator when f+1
/// validators have executed it.
#[instrument(level = "trace", skip_all)]
pub async fn handle_finalized_certificate(
pub async fn handle_certificate_with_effects(
&self,
certificate: CertifiedTransaction,
// Signed effects is signed by only one validator, it is not a
Expand All @@ -531,7 +533,7 @@ impl AuthorityState {
) -> SuiResult {
let _metrics_guard = start_timer(self.metrics.handle_node_sync_certificate_latency.clone());
let digest = *certificate.digest();
debug!(?digest, "handle_finalized_certificate");
debug!(?digest, "handle_certificate_with_effects");
fp_ensure!(
signed_effects.effects.transaction_digest == digest,
SuiError::ErrorWhileProcessingConfirmationTransaction {
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-core/src/node_sync/node_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ where

match self
.state
.handle_finalized_certificate(cert.clone(), effects.clone())
.handle_certificate_with_effects(cert.clone(), effects.clone())
.await
{
Ok(_) => Ok(SyncStatus::CertExecuted),
Expand Down Expand Up @@ -601,7 +601,7 @@ where
.await?;

self.state
.handle_finalized_certificate(cert, effects.clone())
.handle_certificate_with_effects(cert, effects.clone())
.await?;

Ok(SyncStatus::CertExecuted)
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-core/src/unit_tests/authority_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ async fn test_consensus_message_processed() {
handle_cert(&authority2, &certificate).await
} else {
authority2
.handle_finalized_certificate(certificate.clone(), effects1.clone())
.handle_certificate_with_effects(certificate.clone(), effects1.clone())
.await
.unwrap();
authority2
Expand Down

0 comments on commit 9654a7d

Please sign in to comment.