Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sui-core] Better consensus adaptor logs #3663

Merged
merged 3 commits into from
Aug 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
As per review use tap
  • Loading branch information
George Danezis committed Aug 1, 2022
commit 56bf20c24f5105b2742b77bc1d6dd6b430bca480
15 changes: 6 additions & 9 deletions crates/sui-core/src/consensus_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use sui_types::{
error::{SuiError, SuiResult},
messages::ConsensusTransaction,
};
use tap::prelude::*;
use tokio::{
sync::{
mpsc::{Receiver, Sender},
Expand Down Expand Up @@ -167,19 +168,15 @@ impl ConsensusAdapter {

// Check if this authority submits the transaction to consensus.
if Self::should_submit(certificate) {
let res = self
self
.consensus_client
.clone()
.submit_transaction(TransactionProto { transaction: bytes })
.await
.map_err(|e| SuiError::ConsensusConnectionBroken(format!("{:?}", e)));

// Record an internal error
if let Err(e) = &res {
error!("Submit transaction failed with: {:?}", e);
}

res?;
.map_err(|e| SuiError::ConsensusConnectionBroken(format!("{:?}", e)))
.tap_err(|r| {
error!("Submit transaction failed with: {:?}", r);
})?;
}

// Wait for the consensus to sequence the certificate and assign locks to shared objects.
Expand Down