Skip to content

Commit

Permalink
remove start block entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Nov 19, 2024
1 parent 8fe18bb commit a7eed90
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion bin/torii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ async fn main() -> anyhow::Result<()> {
processors,
EngineConfig {
max_concurrent_tasks: args.indexing.max_concurrent_tasks,
start_block: 0,
blocks_chunk_size: args.indexing.blocks_chunk_size,
events_chunk_size: args.indexing.events_chunk_size,
polling_interval: Duration::from_millis(args.indexing.polling_interval),
Expand Down
10 changes: 0 additions & 10 deletions crates/torii/core/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ bitflags! {
#[derive(Debug)]
pub struct EngineConfig {
pub polling_interval: Duration,
pub start_block: u64,
pub blocks_chunk_size: u64,
pub events_chunk_size: u64,
pub max_concurrent_tasks: usize,
Expand All @@ -155,7 +154,6 @@ impl Default for EngineConfig {
fn default() -> Self {
Self {
polling_interval: Duration::from_millis(500),
start_block: 0,
blocks_chunk_size: 10240,
events_chunk_size: 1024,
max_concurrent_tasks: 100,
Expand Down Expand Up @@ -244,14 +242,6 @@ impl<P: Provider + Send + Sync + std::fmt::Debug + 'static> Engine<P> {
}

pub async fn start(&mut self) -> Result<()> {
// use the start block provided by user if head is 0
let (head, _, _) = self.db.head(self.world.address).await?;
if head == 0 {
self.db.set_head(self.config.start_block, 0, 0, self.world.address).await?;
} else if self.config.start_block != 0 {
warn!(target: LOG_TARGET, "Start block ignored, stored head exists and will be used instead.");
}

let mut backoff_delay = Duration::from_secs(1);
let max_backoff_delay = Duration::from_secs(60);

Expand Down

0 comments on commit a7eed90

Please sign in to comment.