Skip to content

Conversation

@hanish520
Copy link
Contributor

No description provided.

@hanish520 hanish520 requested a review from meling February 17, 2025 09:52
Copy link
Member

@meling meling left a comment

Choose a reason for hiding this comment

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

Minor changes suggested @hanish520

@meling meling requested a review from AlanRostem May 20, 2025 11:44
@meling
Copy link
Member

meling commented May 20, 2025

@AlanRostem Could you take a look at this and provide some guidance on possible issues related to migration to the new package structure PR, or other suggested improvements.

Copy link
Collaborator

@AlanRostem AlanRostem left a comment

Choose a reason for hiding this comment

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

Please see my review comments... Merging package-restructuring into this branch is necessary to apply the changes I requested.

cmd: cmd,
view: view,
proposer: proposer,
ts: time.Now(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

What I understand is that Block is sent over the wire. So, if a remote replica created this block, won't the latency be incorrect since the nodes don't have perfectly synchronized time?

Copy link
Member

Choose a reason for hiding this comment

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

The Block is sent on the wire like this:

message Block {
  bytes Parent = 1;
  QuorumCert QC = 2;
  uint64 View = 3;
  bytes Command = 4;
  uint32 Proposer = 5;
}

So this ts field is not sent over the wire; I believe it is a local-only timestamp.

@hanish520 Please confirm my understanding. I also suggest to rename the field to timestamp

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. So the timestamp is recorded here:

ts: time.Now(),

but NewBlock is used to convert from proto to the Block:

return hotstuff.NewBlock(

As I understand, it measures "local commit latency". I.e., it measures the latency between block arrival and commit if the replica is an acceptor. For leader, this latency measurement is very tiny, no? @hanish520 is this the intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This metrics is used to measure the commit latency at the leader when used in the network simulation mode. This metrics may not make sense in the normal mode.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you mean with network simulation mode? Is this done with hotstuff run locally?

Otherwise I understand, and I would suggest a different way to do this: put timestamps in propose and commit events instead of the block. Then in the ConsensusLatency, you can filter blocks that were committed/proposed by other replicas than yourself. This way it could work regardless of the mode.

I can come up with some code for this soon

@meling
Copy link
Member

meling commented May 20, 2025

@AlanRostem My idea was to merge this into master and then merge master into package-restructuring. Do you see any issues with that?

@AlanRostem
Copy link
Collaborator

@AlanRostem My idea was to merge this into master and then merge master into package-restructuring. Do you see any issues with that?

Ah, I misunderstood. Yes this is doable as long as we address the changes I requested upon merging master into package-restructuring.

Though, I am still wondering about the block timestamps I mentioned in my other comment...

@AlanRostem AlanRostem dismissed their stale review May 21, 2025 07:05

Dismissing my review since I will address them myself when merging into package-restructuring

@hanish520 hanish520 requested a review from meling May 23, 2025 08:26
@meling meling merged commit a08bd86 into master May 25, 2025
4 checks passed
@meling meling deleted the consensusLatency branch May 25, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants