Files
evm/plugin
zeekay 727493f6e7 plugin/evm: harden admin_exportChain with idempotency + sentinel (Task #118)
Previous ExportChain returned (bool, error) and would re-export from
scratch every call, leaving partial files with no marker on Ctrl-C.

Now returns *ExportChainResult with first/last block hashes and a Status
field ("ok" | "noop" | "interrupted"). Behavior:

  * Atomic JSON sentinel at <file>.sentinel (tmp+rename) updated every
    1024 blocks and on terminal states.
  * Idempotency: if file exists with a "done" sentinel matching
    {first, last, firstHash, lastHash}, returns Status=noop without
    re-exporting. Safe to call from a cron CronJob.
  * Interrupt: ctx.Done() at every block boundary writes a sentinel
    with Status=interrupted + HighestExported so the caller can resume.
  * Block iterator still streams (no whole-chain buffering); gzip path
    unchanged.

Symmetric with admin_importChain which returns *ImportChainResult, and
with the cmd/rlp-export CLI shipping alongside.

Server-side test coverage: writeSentinel atomicity, readSentinel
absent + corrupt fall-through, JSON shape pinning for both the
sentinel and ExportChainResult, exportProgressInterval stability.
2026-06-05 15:30:41 -07:00
..
2026-05-20 16:24:51 -07:00
2026-05-20 16:24:51 -07:00