Skip to content

Commit

Permalink
fix: return 500 status code to Stacks node when event ingestion fails (
Browse files Browse the repository at this point in the history
…#648)

This PR makes sure we return a `500` status code error to the Stacks
node when chainhook failed to ingest an event correctly, so it can retry
indefinitely until it succeeds.

This prevents block gaps from occurring in the chainhook index.

Fixes #646
  • Loading branch information
rafaelcr authored Oct 8, 2024
1 parent 8c68352 commit 63c753c
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 199 deletions.
2 changes: 1 addition & 1 deletion components/chainhook-sdk/src/indexer/stacks/blocks_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl StacksBlockPool {
ctx.try_log(|logger| {
slog::error!(logger, "unable to retrieve previous stacks fork")
});
return Ok(None);
return Err("unable to retrieve previous stacks fork".to_string());
}
};

Expand Down
Loading

0 comments on commit 63c753c

Please sign in to comment.