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

[Narwhal] Add a min_header_delay parameter #7970

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

mwtian
Copy link
Member

@mwtian mwtian commented Feb 1, 2023

Currently we are trying to use the header batches threshold to determine the speed of generating headers, which depends on the rate of batch creations, which in turn depends on the write rate. Instead, adding a new min_header_delay parameter, which allows proposing headers before reaching batch threshold, would make the header propose latency more predictable especially under lower TPS.

For now, the min_header_delay is set to 1.8s, only slightly below max_header_delay, to separate behavior change from this PR. We will run experiments on different values. One possibility as @arun-koshy proposed is to set min_header_delay to 1s and max_header_delay to 5s.

Also, ensure leader only needs to wait for parent stakes and nothing else.

@vercel
Copy link

vercel bot commented Feb 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated
explorer ⬜️ Ignored (Inspect) Feb 1, 2023 at 11:01PM (UTC)
explorer-storybook ⬜️ Ignored (Inspect) Feb 1, 2023 at 11:01PM (UTC)
frenemies ⬜️ Ignored (Inspect) Feb 1, 2023 at 11:01PM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Feb 1, 2023 at 11:01PM (UTC)

Copy link
Contributor

@asonnino asonnino left a comment

Choose a reason for hiding this comment

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

Nice!

NetworkModel::PartiallySynchronous
if self.committee.leader(self.round + 1) == self.name =>
{
Duration::ZERO
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool :)

Copy link
Contributor

@arun-koshy arun-koshy left a comment

Choose a reason for hiding this comment

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

Awesome! Just curious what are the effects to dag performance if we hit the min timeout eventually and add empty headers?

// Nothing to do.
// Check whether any timer expired.
() = &mut max_delay_timer, if !max_delay_timed_out => {
// Continue to next ieration of the loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ieration/iteration (same in the below comment)

Copy link
Contributor

@akichidis akichidis left a comment

Choose a reason for hiding this comment

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

Great addition! 👍

NetworkModel::PartiallySynchronous
if self.committee.leader(self.round + 1) == self.name =>
{
Duration::ZERO
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

with = "duration_format",
default = "Parameters::default_min_header_delay"
)]
pub min_header_delay: Duration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also update the README file under the benchmark folder to include the newly introduced parameter?

@mwtian
Copy link
Member Author

mwtian commented Feb 1, 2023

Awesome! Just curious what are the effects to dag performance if we hit the min timeout eventually and add empty headers?

If this happens, the network must have very low load. Generating headers at 1/s ~ 2/s should be ok. And the benefit would be lower latencies.

@arun-koshy
Copy link
Contributor

If this happens, the network must have very low load. Generating headers at 1/s ~ 2/s should be ok. And the benefit would be lower latencies.

Spoke with Mingwei offline about this, but in the case we do under tune this parameter it is possible we will generate empty headers. Just something to monitor for the future

@mwtian mwtian enabled auto-merge (squash) February 1, 2023 22:05
This allows proposing headers before reaching batch threshold.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
@mwtian mwtian merged commit 3c4bee7 into MystenLabs:main Feb 1, 2023
arun-koshy pushed a commit that referenced this pull request Feb 1, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
williampsmith pushed a commit that referenced this pull request Feb 3, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
SplittyDev pushed a commit to eqlabs/bullshark-bft that referenced this pull request Feb 3, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
arun-koshy pushed a commit that referenced this pull request Feb 4, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
arun-koshy pushed a commit that referenced this pull request Feb 5, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
SplittyDev pushed a commit to eqlabs/bullshark-bft that referenced this pull request Apr 3, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
SplittyDev pushed a commit to eqlabs/bullshark-bft that referenced this pull request Apr 17, 2023
Currently we are trying to use the header batches threshold to determine
the speed of generating headers, which depends on the rate of batch
creations, which in turn depends on the write rate. Instead, adding a
new `min_header_delay` parameter, which allows proposing headers before
reaching batch threshold, would make the header propose latency more
predictable especially under lower TPS.

For now, the `min_header_delay` is set to 1.8s, only slightly below
`max_header_delay`, to separate behavior change from this PR. We will
run experiments on different values. One possibility as @arun-koshy
proposed is to set `min_header_delay` to 1s and `max_header_delay` to
5s.

Also, ensure leader only needs to wait for parent stakes and nothing
else.
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.

5 participants