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

[checkpoint] Log the size of checkpoint fragment message #4641

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion crates/sui-core/src/consensus_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,15 @@ impl CheckpointConsensusAdapter {
let other = fragment.other.auth_signature.authority;
let transaction = ConsensusTransaction::new_checkpoint_message(fragment);
let tracking_id = transaction.get_tracking_id();
let serialized = bincode::serialize(&transaction).expect("Serialize consensus transaction cannot fail");
debug!(
?tracking_id,
?cp_seq,
size=?serialized.len(),
"Checkpoint fragment consensus message created. Proposer: {}, Other: {}",
proposer,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be put into fields too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I mean that you could move proposer and the Other field up before the text so they are key=value pairs as well.... instead of using Proposer: {} Other: {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh they are different though. With {} it will trigger the Display implementation. While putting in the fields would be equivalent to {:?} which is not desired in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not true that fields is equivalent to {:?}. That is true only if you put ?var or key =? var... if you do just var or key=var then it uses Display or Value. However if it is Value then one has to implement Value for our types which is a bit of a pain I guess.

other,
);
let serialized = bincode::serialize(&transaction).expect("Serialize consensus transaction cannot fail");
self.buffer.push_front((serialized, sequence_number));
},

Expand Down