Skip to content

Commit

Permalink
Buffer bundles that exceed processing time and make the allowed proce…
Browse files Browse the repository at this point in the history
…ssing time longer (#610)
  • Loading branch information
buffalu committed Apr 27, 2024
1 parent 8c7f5d7 commit bfefd77
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
26 changes: 20 additions & 6 deletions core/src/banking_stage/unprocessed_transaction_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use {
itertools::Itertools,
min_max_heap::MinMaxHeap,
solana_accounts_db::transaction_error_metrics::TransactionErrorMetrics,
solana_bundle::BundleExecutionError,
solana_bundle::{bundle_execution::LoadAndExecuteBundleError, BundleExecutionError},
solana_measure::{measure, measure_us},
solana_runtime::bank::Bank,
solana_sdk::{
Expand Down Expand Up @@ -1271,18 +1271,32 @@ impl BundleStorage {
rebuffered_bundles.push(deserialized_bundle);
is_slot_over = true;
}
Err(BundleExecutionError::ExceedsCostModel) => {
// cost model buffered bundles contain most recent bundles at the front of the queue
debug!(
"bundle={} exceeds cost model, rebuffering",
sanitized_bundle.bundle_id
);
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
}
Err(BundleExecutionError::TransactionFailure(
LoadAndExecuteBundleError::ProcessingTimeExceeded(_),
)) => {
// these are treated the same as exceeds cost model and are rebuferred to be completed
// at the beginning of the next slot
debug!(
"bundle={} processing time exceeded, rebuffering",
sanitized_bundle.bundle_id
);
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
}
Err(BundleExecutionError::TransactionFailure(e)) => {
debug!(
"bundle={} execution error: {:?}",
sanitized_bundle.bundle_id, e
);
// do nothing
}
Err(BundleExecutionError::ExceedsCostModel) => {
// cost model buffered bundles contain most recent bundles at the front of the queue
debug!("bundle={} exceeds cost model", sanitized_bundle.bundle_id);
self.push_back_cost_model_buffered_bundles(vec![deserialized_bundle]);
}
Err(BundleExecutionError::TipError(e)) => {
debug!("bundle={} tip error: {}", sanitized_bundle.bundle_id, e);
// Tip errors are _typically_ due to misconfiguration (except for poh record error, bank processing error, exceeds cost model)
Expand Down
2 changes: 1 addition & 1 deletion core/src/bundle_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod bundle_reserved_space_manager;
pub(crate) mod bundle_stage_leader_metrics;
mod committer;

const MAX_BUNDLE_RETRY_DURATION: Duration = Duration::from_millis(10);
const MAX_BUNDLE_RETRY_DURATION: Duration = Duration::from_millis(40);
const SLOT_BOUNDARY_CHECK_PERIOD: Duration = Duration::from_millis(10);

// Stats emitted periodically
Expand Down
4 changes: 0 additions & 4 deletions core/src/bundle_stage/bundle_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ mod tests {
bank.clone(),
Some((4, 4)),
bank.ticks_per_slot(),
&Pubkey::default(),
blockstore,
&leader_schedule_cache,
&poh_config,
Expand Down Expand Up @@ -1042,9 +1041,6 @@ mod tests {
} = create_test_fixture(1_000_000);
let recorder = poh_recorder.read().unwrap().new_recorder();

let status = poh_recorder.read().unwrap().reached_leader_slot();
info!("status: {:?}", status);

let (replay_vote_sender, _replay_vote_receiver) = unbounded();
let committer = Committer::new(
None,
Expand Down

0 comments on commit bfefd77

Please sign in to comment.