-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[NCC-EVJ] Use Committee
stakes when determining the timestamp of a Subdag
#2223
Conversation
#[cfg(not(feature = "serial"))] | ||
timestamps_and_stake.par_sort_unstable_by_key(|(timestamp, _)| *timestamp); | ||
#[cfg(feature = "serial")] | ||
timestamps_and_stake.sort_unstable_by_key(|(timestamp, _)| *timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make another one of these macros, more in line with existing code (I only know it from the algorithms crate)
timestamps[timestamps.len() / 2] | ||
// Retrieve the timestamps and stakes of the certificates. | ||
let timestamps_and_stakes = self | ||
.values() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the median of leader_certificate's parents or all certificates? It makes no sense to use the weighted median of all certificates.
Signed-off-by: Howard Wu <[email protected]>
Committee
stakes when determining the timestamp of a Subdag
Committee
stakes when determining the timestamp of a Subdag
Motivation
This PR updates the
Subdag::timestamp
function from a simple median timestamp to a weighed median timestamp that uses the committee member stakes as the weights.Because quorum is determined by stake and not the number of validators, we must also use stake to determine the timestamp.
Audit Finding: [NCC EVJ] Timestamp Calculation Does Not Provide Byzantine Fault Tolerance