Skip to content
Open
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
10 changes: 2 additions & 8 deletions crates/apollo_l1_provider/src/l1_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,10 @@ impl L1Provider {
);
Ok(txs)
}
ProviderState::Pending => Err(L1ProviderError::UnexpectedProviderState {
_ => Err(L1ProviderError::UnexpectedProviderState {
expected: ProviderState::Propose,
found: self.state,
}),
ProviderState::Bootstrap => Err(L1ProviderError::OutOfSessionGetTransactions),
ProviderState::Validate => Err(L1ProviderError::GetTransactionConsensusBug),
ProviderState::Uninitialized => Err(L1ProviderError::Uninitialized),
}
}

Expand All @@ -258,13 +255,10 @@ impl L1Provider {
ProviderState::Validate => {
Ok(self.tx_manager.validate_tx(tx_hash, self.clock.unix_now()))
}
ProviderState::Propose => Err(L1ProviderError::ValidateTransactionConsensusBug),
ProviderState::Pending => Err(L1ProviderError::UnexpectedProviderState {
_ => Err(L1ProviderError::UnexpectedProviderState {
expected: ProviderState::Validate,
found: self.state,
}),
ProviderState::Bootstrap => Err(L1ProviderError::OutOfSessionValidate),
ProviderState::Uninitialized => Err(L1ProviderError::Uninitialized),
}
}

Expand Down
10 changes: 0 additions & 10 deletions crates/apollo_l1_provider_types/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ use crate::ProviderState;

#[derive(Clone, Debug, Error, PartialEq, Eq, Serialize, Deserialize)]
pub enum L1ProviderError {
#[error("`get_txs` while in `Validate` state")]
GetTransactionConsensusBug,
// This is likely due to a crash, restart block proposal.
#[error("`get_txs` called when provider is not in proposer state")]
OutOfSessionGetTransactions,
// This is likely due to a crash, restart block proposal.
#[error("`validate` called when provider is not in proposer state")]
OutOfSessionValidate,
// This error indicates that the provider is uninitialized.
// It likely occurs if the provider restarted while the scraper remained active.
// In that case, the scraper's restart logic will automatically reinitialize the provider.
Expand All @@ -28,8 +20,6 @@ pub enum L1ProviderError {
UnexpectedProviderState { expected: ProviderState, found: ProviderState },
#[error("Cannot transition from {from} to {to}")]
UnexpectedProviderStateTransition { from: String, to: String },
#[error("`validate` called while in `Propose` state")]
ValidateTransactionConsensusBug,
}

impl L1ProviderError {
Expand Down
Loading