Skip to content

Commit 90c792d

Browse files
authored
Removed unsed DB and made source mandatory (#708)
## 📝 Summary Removed flashbots DB from backtest sources. Mempool source is not default and and now the source is mandaroty ## ✅ I have completed the following steps: * [X] Run `make lint` * [X] Run `make test` * [ ] Added tests (if applicable)
1 parent ffa5156 commit 90c792d

File tree

6 files changed

+14
-484
lines changed

6 files changed

+14
-484
lines changed

crates/rbuilder/src/backtest/fetch/backtest_fetch.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,24 @@ struct FetchCommand {
5353

5454
pub async fn run_backtest_fetch<
5555
ConfigType: LiveBuilderConfig + Clone,
56-
BundleSourceFactoryFut: Future<Output = eyre::Result<Option<Box<dyn DataSource>>>>,
57-
BundleSourceFactoryType: FnOnce(ConfigType) -> BundleSourceFactoryFut,
56+
OrderSourceFactoryFut: Future<Output = eyre::Result<Box<dyn DataSource>>>,
57+
OrderSourceFactoryType: FnOnce(ConfigType) -> OrderSourceFactoryFut,
5858
>(
59-
bundle_source_factory: BundleSourceFactoryType,
59+
order_source_factory: OrderSourceFactoryType,
6060
) -> eyre::Result<()> {
6161
let cli = Cli::parse();
6262
let config: ConfigType = load_config_toml_and_env(cli.config)?;
6363
config.base_config().setup_tracing_subscriber()?;
6464

6565
match cli.command {
6666
Commands::Fetch(cli) => {
67-
// create paths for backtest_fetch_mempool_data_dir (i.e "~/.rbuilder/mempool-data" and ".../transactions")
68-
let backtest_fetch_mempool_data_dir =
69-
config.base_config().backtest_fetch_mempool_data_dir()?;
70-
7167
let provider = config.base_config().eth_rpc_provider()?;
7268
let mut fetcher = HistoricalDataFetcher::new(
7369
provider,
7470
config.base_config().backtest_fetch_eth_rpc_parallel,
75-
)
76-
.with_default_datasource(backtest_fetch_mempool_data_dir)?;
71+
);
7772

78-
if let Some(bundle_source) = bundle_source_factory(config.clone()).await? {
79-
fetcher = fetcher.with_datasource(bundle_source);
80-
}
73+
fetcher = fetcher.with_datasource(order_source_factory(config.clone()).await?);
8174

8275
let blocks_to_fetch: Box<dyn Iterator<Item = u64>> = if cli.range {
8376
let from_block = cli.blocks.first().copied().unwrap_or(0);

0 commit comments

Comments
 (0)