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

Add burst mode for congestion control #20631

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add burst mode for congestion control #20631

wants to merge 4 commits into from

Conversation

aschran
Copy link
Contributor

@aschran aschran commented Dec 13, 2024

Description

Burst mode allows budget to be exceeded up to the configured burst limit.

Test plan

added/updated unit tests


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@aschran aschran requested a review from halfprice December 13, 2024 23:15
@aschran aschran requested a review from mystenmark as a code owner December 13, 2024 23:15
Copy link

vercel bot commented Dec 13, 2024

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 11:43pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 11:43pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 11:43pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 11:43pm

@aschran aschran temporarily deployed to sui-typescript-aws-kms-test-env December 13, 2024 23:15 — with GitHub Actions Inactive
let absolute_limit = self
.max_accumulated_txn_cost_per_object_in_commit
.saturating_add(self.max_txn_cost_overage_per_object_in_commit);
if start_cost <= burst_limit && end_cost <= absolute_limit {
Copy link
Contributor

Choose a reason for hiding this comment

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

is the check on line 166 superfluous now? it seems like the only time the end cost is relevant is when checking the absolute limit.

This also fits with what we discussed, where we split the constants into the debt ceiling and the payback rate. The per commit constant doesn't seem to be needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right, removed the superfluous check

/// If >0, congestion control will allow transactions in total cost equaling the
/// configured amount to exceed the configured maximum accumulated cost per object.
/// As above, up to one transaction per object exceeding the burst limit will be allowed.
allowed_txn_cost_overage_burst_per_object_in_commit: Option<u64>,
Copy link
Contributor

Choose a reason for hiding this comment

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

when we discussed this last, we seemed to have settled on the mental model that the two params could be thought of as "the rate at which scheduling debt is paid down" and "the debt ceiling"

i think this model is much clearer, because i'm having trouble understanding your comments above even though I at least think I understand the system.

Copy link
Contributor Author

@aschran aschran Dec 20, 2024

Choose a reason for hiding this comment

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

it's slightly complicated by the requirement to maintain prior behavior when the new param is not set

  1. max_accumulated_txn_cost_per_object_in_commit
  • is always the rate at which debt is paid down
  • also the absolute limit, if it's the only thing set
  1. max_txn_cost_overage_per_object_in_commit
    if set with 1,
  • soft debt ceiling is 1
  • absolute limit is 1+2
    (this is how it is currently configured to work, with 2 == u64 max)
  1. allowed_txn_cost_overage_burst_per_object_in_commit
    if set with 1 and 2 (must be <= 2 per assert)
  • soft debt ceiling is 1+3
  • absolute limit is still 1+2

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.

2 participants