Skip to content

Commit

Permalink
Fixes for overload protection (#20248)
Browse files Browse the repository at this point in the history
- Only check overload queues for mutable shared inputs
- Increase max tx queue age to 500ms

## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## 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): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
mystenmark authored Nov 13, 2024
1 parent 297913c commit 6ea6bc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/sui-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ pub struct AuthorityOverloadConfig {
}

fn default_max_txn_age_in_queue() -> Duration {
Duration::from_millis(200)
Duration::from_millis(500)
}

fn default_overload_monitor_interval() -> Duration {
Expand Down
10 changes: 7 additions & 3 deletions crates/sui-core/src/transaction_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,9 @@ impl TransactionManager {
for (object_id, queue_len, txn_age) in self.objects_queue_len_and_age(
tx_data
.transaction_data()
.input_objects()?
.shared_input_objects()
.into_iter()
.map(|r| r.object_id())
.filter_map(|r| r.mutable.then_some(r.id))
.collect(),
) {
// When this occurs, most likely transactions piled up on a shared object.
Expand All @@ -867,7 +867,11 @@ impl TransactionManager {
if let Some(age) = txn_age {
// Check that we don't have a txn that has been waiting for a long time in the queue.
if age >= overload_config.max_txn_age_in_queue {
info!("Overload detected on object {:?} with oldest transaction pending for {} secs", object_id, age.as_secs());
info!(
"Overload detected on object {:?} with oldest transaction pending for {}ms",
object_id,
age.as_millis()
);
fp_bail!(SuiError::TooOldTransactionPendingOnObject {
object_id,
txn_age_sec: age.as_secs(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -320,7 +320,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -492,7 +492,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -664,7 +664,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -836,7 +836,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -1008,7 +1008,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down Expand Up @@ -1180,7 +1180,7 @@ validator_configs:
authority-overload-config:
max-txn-age-in-queue:
secs: 0
nanos: 200000000
nanos: 500000000
overload-monitor-interval:
secs: 10
nanos: 0
Expand Down

0 comments on commit 6ea6bc9

Please sign in to comment.