From 6731a7c9b1f4047853fc76275d808750479c1bf6 Mon Sep 17 00:00:00 2001 From: naps62 Date: Tue, 11 Aug 2026 09:57:46 +0000 Subject: [PATCH] fix: preserve historical anvil state across suspends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suspend/resume kept blocks and logs but dropped historical state, so eth_call at any pre-restart block failed with BlockOutOfRangeError — breaking indexers that replay chain history (bit the bullish staging indexer today). Verified locally: with the flag, a killed-and-resumed anvil answers eth_getBalance at pre-restart blocks; without it, the same query fails. Co-Authored-By: Claude Fable 5 --- server/lib/ethui/services/anvil.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/lib/ethui/services/anvil.ex b/server/lib/ethui/services/anvil.ex index f32bdee..62568a6 100644 --- a/server/lib/ethui/services/anvil.ex +++ b/server/lib/ethui/services/anvil.ex @@ -326,6 +326,10 @@ defmodule Ethui.Services.Anvil do to_string(port), "--state", "#{dir}/state.json", + # Without this, every suspend/resume cycle silently drops pre-restart state: + # blocks and logs survive, but eth_call at any older block fails with + # BlockOutOfRangeError, which breaks indexers replaying chain history. + "--preserve-historical-states", "--host", "0.0.0.0", "--chain-id",