Skip to content

Commit

Permalink
dev: clean tracing (kkrt-labs#1312)
Browse files Browse the repository at this point in the history
clean tracing
  • Loading branch information
greged93 authored Jul 24, 2024
1 parent 3c71f05 commit 963dea9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
environment:
- KAKAROT_RPC_URL=0.0.0.0:3030
- STARKNET_NETWORK=http://starknet:6060
- RUST_LOG="kakarot_rpc=info"
- RUST_LOG=kakarot_rpc=info
- MONGO_CONNECTION_STRING=mongodb://mongo:mongo@mongo:27017
- MONGO_DATABASE_NAME=kakarot-local
# These values are unique to Sepolia Testnet
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
environment:
- KAKAROT_RPC_URL=0.0.0.0:3030
- STARKNET_NETWORK=http://starknet:6060
- RUST_LOG="kakarot_rpc=info"
- RUST_LOG=kakarot_rpc=info
- MONGO_CONNECTION_STRING=mongodb://mongo:mongo@mongo:27017
- MONGO_DATABASE_NAME=kakarot-local
# These values are unique to Sepolia Testnet
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ services:
environment:
- KAKAROT_RPC_URL=0.0.0.0:3030
- STARKNET_NETWORK=http://starknet:5050
- RUST_LOG="kakarot_rpc=info"
- RUST_LOG=kakarot_rpc=info
- MONGO_CONNECTION_STRING=mongodb://mongo:mongo@mongo:27017
- MONGO_DATABASE_NAME=kakarot-local
- MAX_FELTS_IN_CALLDATA=30000
Expand Down
5 changes: 1 addition & 4 deletions src/retry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ where

/// Processes all current pending transactions by retrying them
/// and pruning them if necessary.
#[instrument(skip_all)]
async fn process_pending_transactions(&self) -> Result<()> {
let pending_transactions = self.pending_transactions().await?;
tracing::info!(count = pending_transactions.len());
for transaction in pending_transactions {
if self.should_retry(&transaction).await? {
self.retry_transaction(transaction).await?;
Expand Down Expand Up @@ -149,8 +147,7 @@ where
/// not been executed and the number of retries is less than the maximum number of retries.
async fn should_retry(&self, transaction: &StoredPendingTransaction) -> Result<bool> {
let max_retries_reached = transaction.retries + 1 >= get_transaction_max_retries();
let span = tracing::span!(tracing::Level::INFO, "db::transaction");
let transaction_executed = self.database.transaction(&transaction.hash).instrument(span).await?.is_some();
let transaction_executed = self.database.transaction(&transaction.hash).await?.is_some();
Ok(!max_retries_reached && !transaction_executed)
}
}
Expand Down

0 comments on commit 963dea9

Please sign in to comment.