Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion crates/apollo_l1_provider/src/l1_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ impl L1Provider {
);
});
}
Event::TransactionCanceled(event_data) => {
// TODO(guyn): delete the transaction from the provider.
info!(
"Cancellation finalized with data: {event_data:?}. THIS DOES NOT DELETE \
THE TRANSACTION FROM THE PROVIDER YET."
);
}
Event::TransactionConsumed { tx_hash, timestamp: consumed_at } => {
if let Err(previously_consumed_at) =
self.tx_manager.consume_tx(tx_hash, consumed_at, self.clock.unix_now())
Expand All @@ -241,7 +248,6 @@ impl L1Provider {
);
}
}
_ => return Err(L1ProviderError::unsupported_l1_event(event)),
}
}
Ok(())
Expand Down
7 changes: 0 additions & 7 deletions crates/apollo_l1_provider/src/l1_scraper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,6 @@ fn handle_client_error<B: BaseLayerContract + Send + Sync>(
L1ProviderClientError::L1ProviderError(L1ProviderError::Uninitialized) => {
Err(L1ScraperError::NeedsRestart)
}
L1ProviderClientError::L1ProviderError(L1ProviderError::UnsupportedL1Event(event)) => {
panic!(
"Scraper-->Provider consistency error: the event {event} is not supported by the \
provider, but has been scraped and sent to it nonetheless. Check the list of \
tracked events in the scraper and compare to the provider's."
)
}
error => panic!("Unexpected error: {error}"),
}
}
8 changes: 0 additions & 8 deletions crates/apollo_l1_provider_types/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use serde::{Deserialize, Serialize};
use starknet_api::block::BlockNumber;
use thiserror::Error;

use crate::Event;

#[derive(Clone, Debug, Error, PartialEq, Eq, Serialize, Deserialize)]
pub enum L1ProviderError {
#[error("`get_txs` while in `Validate` state")]
Expand All @@ -26,8 +24,6 @@ pub enum L1ProviderError {
UnexpectedHeight { expected_height: BlockNumber, got: BlockNumber },
#[error("Cannot transition from {from} to {to}")]
UnexpectedProviderStateTransition { from: String, to: String },
#[error("L1 event not supported: {0}")]
UnsupportedL1Event(String),
#[error("`validate` called while in `Propose` state")]
ValidateTransactionConsensusBug,
}
Expand All @@ -36,10 +32,6 @@ impl L1ProviderError {
pub fn unexpected_transition(from: impl ToString, to: impl ToString) -> Self {
Self::UnexpectedProviderStateTransition { from: from.to_string(), to: to.to_string() }
}

pub fn unsupported_l1_event(event: Event) -> Self {
Self::UnsupportedL1Event(event.to_string())
}
}

#[derive(Clone, Debug, Error)]
Expand Down