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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Pathfinder panics with "Block number Z is not in the range X..=Y" after starting up from an old Sepolia testnet database snapshot.
- Pathfinder returns internal errors for some `starknet_getTransactionStatus` / `starknet_getTransactionReceipt` queries for transactions in the pre-confirmed block.
- L2 sync stalls for a while after logging an "L2 sync process terminated with: Fetch signature for BlockNumber(XXX) from sequencer" error.

## [0.20.3] - 2025-09-09

Expand Down
25 changes: 21 additions & 4 deletions crates/pathfinder/src/state/sync/l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,28 @@ where
// There is a race condition here: if the query for the signature was made
// _before_ the block was published -- but by the time we
// actually queried for the block it was there. In this case
// we just retry the signature download.
// we just retry the signature download until we get it.
let t_signature = std::time::Instant::now();
let signature = sequencer.signature(next.into()).await.with_context(|| {
format!("Fetch signature for block {next:?} from sequencer")
})?;
let signature = loop {
match sequencer.signature(next.into()).await {
Ok(s) => {
break s;
}
Err(SequencerError::StarknetError(err))
if err.code
== starknet_gateway_types::error::KnownStarknetErrorCode::BlockNotFound
.into() =>
{
// Wait a bit and retry
tokio::time::sleep(Duration::from_millis(500)).await;
continue;
}
Err(err) => {
return Err(err)
.context(format!("Fetch signature for block {next:?} from sequencer"))
}
}
};
(signature, t_signature.elapsed())
}
Err(err) => {
Expand Down