Skip to content

Commit

Permalink
[Congestion] reduce per-object transaction queue length limit from 10…
Browse files Browse the repository at this point in the history
…00 to 200 (MystenLabs#12860)

## Description 

When transactions are congested on the same shared object, the cheapest
transaction types (e.g. incrementing a shared counter) support 50 ~ 100
transaction/sec per-object from testing. We need to reduce the
transaction queue length limit to a more reasonable value, to avoid
delaying checkpoint building and epoch change too much when an object is
congested.

It is still possible to cause congestion on an object with more
expensive transactions locking the object for > 0.1s. In future, a limit
will be added for the max queueing time, e.g. do not sign new
transactions touch a shared object when there is a transaction waiting
for the object for >= 2s.

## Test Plan 

CI

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
mwtian authored Jul 6, 2023
1 parent 33e1e14 commit deccd8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/sui-core/src/authority_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub(crate) const MAX_TM_QUEUE_LENGTH: usize = 100_000;

// Reject a transaction if the number of pending transactions depending on the object
// is above the threshold.
pub(crate) const MAX_PER_OBJECT_QUEUE_LENGTH: usize = 1000;
pub(crate) const MAX_PER_OBJECT_QUEUE_LENGTH: usize = 200;

#[cfg(test)]
#[path = "unit_tests/server_tests.rs"]
Expand Down

0 comments on commit deccd8f

Please sign in to comment.