@@ -169,6 +169,8 @@ impl L1Provider {
169169 if let Err ( previously_consumed_at) =
170170 self . tx_manager . consume_tx ( tx_hash, consumed_at, self . clock . unix_now ( ) )
171171 {
172+ // TODO(guyn): need to check if this is really a critical bug, or if we can
173+ // log and ignore.
172174 panic ! (
173175 "Double consumption of {tx_hash} at {consumed_at}, previously \
174176 consumed at {previously_consumed_at}."
@@ -228,12 +230,10 @@ impl L1Provider {
228230 ) ;
229231 Ok ( txs)
230232 }
231- ProviderState :: Pending => {
232- panic ! (
233- "get_txs called while in pending state. Panicking in order to restart the \
234- provider and bootstrap again."
235- ) ;
236- }
233+ ProviderState :: Pending => Err ( L1ProviderError :: UnexpectedProviderState {
234+ expected : ProviderState :: Propose ,
235+ found : self . state ,
236+ } ) ,
237237 ProviderState :: Bootstrap => Err ( L1ProviderError :: OutOfSessionGetTransactions ) ,
238238 ProviderState :: Validate => Err ( L1ProviderError :: GetTransactionConsensusBug ) ,
239239 ProviderState :: Uninitialized => Err ( L1ProviderError :: Uninitialized ) ,
@@ -259,12 +259,10 @@ impl L1Provider {
259259 Ok ( self . tx_manager . validate_tx ( tx_hash, self . clock . unix_now ( ) ) )
260260 }
261261 ProviderState :: Propose => Err ( L1ProviderError :: ValidateTransactionConsensusBug ) ,
262- ProviderState :: Pending => {
263- panic ! (
264- "validate called while in pending state. Panicking in order to restart the \
265- provider and bootstrap again."
266- ) ;
267- }
262+ ProviderState :: Pending => Err ( L1ProviderError :: UnexpectedProviderState {
263+ expected : ProviderState :: Validate ,
264+ found : self . state ,
265+ } ) ,
268266 ProviderState :: Bootstrap => Err ( L1ProviderError :: OutOfSessionValidate ) ,
269267 ProviderState :: Uninitialized => Err ( L1ProviderError :: Uninitialized ) ,
270268 }
0 commit comments