Skip to content

Commit

Permalink
UseCaseAwareShuffler (#13738)
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse authored Jul 16, 2024
1 parent 3754419 commit d98b854
Show file tree
Hide file tree
Showing 14 changed files with 1,157 additions and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ claims = { workspace = true }
mockall = { workspace = true }
move-core-types = { workspace = true }
proptest = { workspace = true }
proptest-derive = { workspace = true }
tempfile = { workspace = true }

[features]
Expand Down
17 changes: 17 additions & 0 deletions consensus/src/transaction_shuffler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::sync::Arc;

mod deprecated_fairness;
mod sender_aware;
mod use_case_aware;

/// Interface to shuffle transactions
pub trait TransactionShuffler: Send + Sync {
Expand Down Expand Up @@ -61,5 +62,21 @@ pub fn create_transaction_shuffler(
entry_fun_conflict_window_size: entry_fun_conflict_window_size as usize,
})
},
UseCaseAware {
sender_spread_factor,
platform_use_case_spread_factor,
user_use_case_spread_factor,
} => {
let config = use_case_aware::Config {
sender_spread_factor,
platform_use_case_spread_factor,
user_use_case_spread_factor,
};
info!(
config = ?config,
"Using use case aware transaction shuffling."
);
Arc::new(use_case_aware::UseCaseAwareShuffler { config })
},
}
}
Loading

0 comments on commit d98b854

Please sign in to comment.