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
4 changes: 2 additions & 2 deletions crates/audit/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ impl BundleEvent {
block_hash,
..
} => {
format!("{}-{}", bundle_id, block_hash)
format!("{bundle_id}-{block_hash}")
}
BundleEvent::FlashblockIncluded {
bundle_id,
block_number,
flashblock_index,
..
} => {
format!("{}-{}-{}", bundle_id, block_number, flashblock_index)
format!("{bundle_id}-{block_number}-{flashblock_index}")
}
_ => {
format!("{}-{}", self.bundle_id(), Uuid::new_v4())
Expand Down
17 changes: 9 additions & 8 deletions crates/datastore/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,19 +446,20 @@ impl BundleDatastore for PostgresDatastore {
match (row.latest_block_number, row.latest_block_hash) {
(Some(block_number), Some(hash_str)) => {
let hash = B256::from_hex(&hash_str)
.map_err(|e| anyhow::anyhow!("Failed to parse latest block hash: {}", e))?;
.map_err(|e| anyhow::anyhow!("Failed to parse latest block hash: {e}"))?;
(block_number as u64, hash)
}
_ => return Ok(None),
};

let latest_finalized_block_hash = if let Some(hash_str) = row.latest_finalized_block_hash {
Some(B256::from_hex(&hash_str).map_err(|e| {
anyhow::anyhow!("Failed to parse latest finalized block hash: {}", e)
})?)
} else {
None
};
let latest_finalized_block_hash =
if let Some(hash_str) = row.latest_finalized_block_hash {
Some(B256::from_hex(&hash_str).map_err(|e| {
anyhow::anyhow!("Failed to parse latest finalized block hash: {e}")
})?)
} else {
None
};

Ok(Some(BlockInfo {
latest_block_number,
Expand Down
2 changes: 0 additions & 2 deletions crates/ingress-rpc/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ where
.await?;
validate_tx(account, &transaction, &data, &mut l1_block_info).await?;

// TODO: parallelize DB and mempool setup

let expiry_timestamp = SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion crates/maintenance/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl<S: BundleDatastore, P: Provider<Optimism>, K: BundleEventPublisher> Mainten
)))
.full()
.await?
.ok_or_else(|| anyhow::anyhow!("Failed to get block {}", block_num))?;
.ok_or_else(|| anyhow::anyhow!("Failed to get block {block_num}"))?;

self.on_new_block(block).await?;
}
Expand Down