Skip to content

Commit 4055509

Browse files
committed
Buffer bundles that exceed processing time and make the allowed processing time longer (#609)
1 parent 2696209 commit 4055509

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

core/src/banking_stage/unprocessed_transaction_storage.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use {
2121
itertools::Itertools,
2222
min_max_heap::MinMaxHeap,
2323
solana_accounts_db::transaction_error_metrics::TransactionErrorMetrics,
24-
solana_bundle::BundleExecutionError,
24+
solana_bundle::{bundle_execution::LoadAndExecuteBundleError, BundleExecutionError},
2525
solana_measure::measure,
2626
solana_runtime::bank::Bank,
2727
solana_sdk::{
@@ -1249,18 +1249,32 @@ impl BundleStorage {
12491249
rebuffered_bundles.push(deserialized_bundle);
12501250
is_slot_over = true;
12511251
}
1252+
Err(BundleExecutionError::ExceedsCostModel) => {
1253+
// cost model buffered bundles contain most recent bundles at the front of the queue
1254+
debug!(
1255+
"bundle={} exceeds cost model, rebuffering",
1256+
sanitized_bundle.bundle_id
1257+
);
1258+
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
1259+
}
1260+
Err(BundleExecutionError::TransactionFailure(
1261+
LoadAndExecuteBundleError::ProcessingTimeExceeded(_),
1262+
)) => {
1263+
// these are treated the same as exceeds cost model and are rebuferred to be completed
1264+
// at the beginning of the next slot
1265+
debug!(
1266+
"bundle={} processing time exceeded, rebuffering",
1267+
sanitized_bundle.bundle_id
1268+
);
1269+
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
1270+
}
12521271
Err(BundleExecutionError::TransactionFailure(e)) => {
12531272
debug!(
12541273
"bundle={} execution error: {:?}",
12551274
sanitized_bundle.bundle_id, e
12561275
);
12571276
// do nothing
12581277
}
1259-
Err(BundleExecutionError::ExceedsCostModel) => {
1260-
// cost model buffered bundles contain most recent bundles at the front of the queue
1261-
debug!("bundle={} exceeds cost model", sanitized_bundle.bundle_id);
1262-
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
1263-
}
12641278
Err(BundleExecutionError::TipError(e)) => {
12651279
debug!("bundle={} tip error: {}", sanitized_bundle.bundle_id, e);
12661280
// Tip errors are _typically_ due to misconfiguration (except for poh record error, bank processing error, exceeds cost model)

core/src/bundle_stage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ mod bundle_reserved_space_manager;
4545
pub(crate) mod bundle_stage_leader_metrics;
4646
mod committer;
4747

48-
const MAX_BUNDLE_RETRY_DURATION: Duration = Duration::from_millis(10);
48+
const MAX_BUNDLE_RETRY_DURATION: Duration = Duration::from_millis(40);
4949
const SLOT_BOUNDARY_CHECK_PERIOD: Duration = Duration::from_millis(10);
5050

5151
// Stats emitted periodically

0 commit comments

Comments
 (0)