Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderIntakeConsumer fixes for less warninig. #281

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/rbuilder/src/building/builders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use reth::{
revm::cached::CachedReads,
};
use reth_db::Database;
use reth_errors::ProviderError;
use reth_provider::{DatabaseProviderFactory, StateProviderFactory};
use std::{fmt::Debug, marker::PhantomData, sync::Arc};
use tokio::sync::{broadcast, broadcast::error::TryRecvError};
Expand Down Expand Up @@ -144,7 +145,9 @@ where
if !self.order_consumer.consume_next_commands()? {
return Ok(false);
}
self.update_onchain_nonces()?;
if !self.update_onchain_nonces()? {
return Ok(false);
}

self.order_consumer
.apply_new_commands(&mut self.block_orders);
Expand All @@ -161,7 +164,11 @@ where
SimulatedOrderCommand::Simulation(sim_order) => Some(sim_order),
SimulatedOrderCommand::Cancellation(_) => None,
});
let nonce_db_ref = self.nonce_cache.get_ref()?;
let nonce_db_ref = match self.nonce_cache.get_ref() {
Ok(nonce_db_ref) => nonce_db_ref,
Err(ProviderError::BlockHashNotFound(_)) => return Ok(false), // This can happen on reorgs since the block is removed
Err(err) => return Err(err.into()),
};
let mut nonces = Vec::new();
for new_order in new_orders {
for nonce in new_order.order.nonces() {
Expand Down
Loading