From a60d3602b04ada3fce19e9b2a716305699a103b4 Mon Sep 17 00:00:00 2001 From: incrypto32 Date: Fri, 6 Mar 2026 15:12:58 +0400 Subject: [PATCH] core: Restart store on revert errors to clear poisoned writer The runner FSM refactor mapped Action::Restart from handle_revert to RestartReason::DataSourceExpired, skipping store.restart(). Fix by using RestartReason::StoreError for revert errors and remove the unused DataSourceExpired variant. --- core/src/subgraph/runner/mod.rs | 2 +- core/src/subgraph/runner/state.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/subgraph/runner/mod.rs b/core/src/subgraph/runner/mod.rs index a925c652e6c..88238a7fadb 100644 --- a/core/src/subgraph/runner/mod.rs +++ b/core/src/subgraph/runner/mod.rs @@ -619,7 +619,7 @@ where match action { Action::Continue => Ok(RunnerState::AwaitingBlock { block_stream }), Action::Restart => Ok(RunnerState::Restarting { - reason: RestartReason::DataSourceExpired, + reason: RestartReason::StoreError, }), Action::Stop => Ok(RunnerState::Stopped { reason: StopReason::Canceled, diff --git a/core/src/subgraph/runner/state.rs b/core/src/subgraph/runner/state.rs index ad1761c8e47..01ad9648341 100644 --- a/core/src/subgraph/runner/state.rs +++ b/core/src/subgraph/runner/state.rs @@ -74,8 +74,6 @@ pub enum RunnerState { pub enum RestartReason { /// New dynamic data source was created that requires filter updates. DynamicDataSourceCreated, - /// A data source reached its end block. - DataSourceExpired, /// Store error occurred and store needs to be restarted. StoreError, /// Possible reorg detected, need to restart to detect it.